/**
 * WooCommerce VAT Toggle - Frontend Styles
 *
 * @package WC_VAT_Toggle
 */

/* ==========================================================================
   Toggle Container
   ========================================================================== */

.wvt-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    line-height: 1.4;
}

/* ==========================================================================
   Toggle Switch Style
   ========================================================================== */

.wvt-toggle-switch .wvt-label {
    cursor: pointer;
    color: #666;
    transition: color 0.2s ease;
}

.wvt-toggle-switch .wvt-label.active {
    color: #333;
    font-weight: 600;
}

.wvt-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.wvt-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.wvt-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
}

.wvt-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.wvt-toggle-input:checked + .wvt-slider {
    background-color: #0073aa;
}

.wvt-toggle-input:focus + .wvt-slider {
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.3);
}

.wvt-toggle-input:checked + .wvt-slider:before {
    transform: translateX(24px);
}

/* Rounded slider */
.wvt-slider-round {
    border-radius: 26px;
}

.wvt-slider-round:before {
    border-radius: 50%;
}

/* ==========================================================================
   Buttons Style
   ========================================================================== */

.wvt-toggle-buttons {
    display: inline-flex;
    gap: 0;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #ddd;
}

.wvt-toggle-buttons .wvt-btn {
    padding: 8px 16px;
    border: none;
    background-color: #f5f5f5;
    color: #666;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    outline: none;
}

.wvt-toggle-buttons .wvt-btn:hover {
    background-color: #e5e5e5;
}

.wvt-toggle-buttons .wvt-btn.active {
    background-color: #0073aa;
    color: #fff;
}

.wvt-toggle-buttons .wvt-btn:first-child {
    border-right: 1px solid #ddd;
}

.wvt-toggle-buttons .wvt-btn.active + .wvt-btn,
.wvt-toggle-buttons .wvt-btn:first-child.active {
    border-color: transparent;
}

/* ==========================================================================
   Dropdown Style
   ========================================================================== */

.wvt-toggle-dropdown {
    display: inline-flex;
    align-items: center;
}

.wvt-dropdown-label {
    display: flex;
    align-items: center;
}

.wvt-dropdown-select {
    padding: 8px 32px 8px 12px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 10px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.wvt-dropdown-select:hover {
    border-color: #bbb;
}

.wvt-dropdown-select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

/* ==========================================================================
   Price Wrapper
   ========================================================================== */

.wvt-price-wrapper {
    display: inline;
    transition: opacity 0.15s ease;
}

.wvt-price-wrapper.wvt-updating {
    opacity: 0.5;
}

.wvt-primary-price {
    display: inline;
}

.wvt-secondary-price {
    display: inline;
    margin-left: 5px;
    font-size: 0.85em;
    color: #666;
    opacity: 0.8;
}

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes wvt-fade-in {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wvt-price-wrapper:not(.wvt-updating) .wvt-primary-price {
    animation: wvt-fade-in 0.2s ease;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 480px) {
    .wvt-toggle-switch {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .wvt-toggle-buttons .wvt-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .wvt-switch {
        width: 44px;
        height: 24px;
    }
    
    .wvt-slider:before {
        height: 18px;
        width: 18px;
    }
    
    .wvt-toggle-input:checked + .wvt-slider:before {
        transform: translateX(20px);
    }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

/* Focus states for keyboard navigation */
.wvt-toggle-buttons .wvt-btn:focus {
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.5);
    z-index: 1;
    position: relative;
}

.wvt-switch:focus-within .wvt-slider {
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.3);
}
