/**
 * Business/Private Toggle Styles
 */

.et_pb_social_media_follow {
    display:flex;
    justify-content: flex-end;
    align-items: center;
}

.business-private-toggle {
    margin: 0;
    padding: 10px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid rgba(31, 41, 55, 0.20);
    transition: all 0.3s ease;
}

/* Simulation mode styling */
.business-private-toggle[data-simulation="true"] {
    background: #fff3cd;
    border-color: #ffeaa7;
}

.business-private-toggle[data-simulation="true"] .toggle-description {
    color: #856404;
}

.business-private-toggle[data-simulation="true"] .toggle-description::after {
    content: " (Preview Mode)";
    font-weight: 600;
}

.toggle-container {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: center;
    /* margin-bottom: 8px; */
}

.toggle-label-text {
    font-family: Outfit, sans-serif;
    font-size: 16px;
    font-weight: 400;
    color: #666;
    transition: color 0.3s ease;
}

.toggle-label-text.active {
    color: #000;
    font-weight: 600;
}

/* Toggle Switch Styles */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #000;
}

.toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 1px #000;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

.toggle-description {
    color: #666;
    font-size: 14px;
    font-family: Roboto, sans-serif;
    text-align: center;
}

.business-private-toggle.loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.business-private-toggle.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Price display enhancements */
.woocommerce .price del {
    color: #999;
    text-decoration: line-through;
    margin-right: 8px;
}

.woocommerce .price ins {
    text-decoration: none;
    font-weight: 600;
}

.woocommerce .price small {
    color: #666;
    font-size: 0.85em;
    font-weight: normal;
    margin-left: 4px;
    opacity: 0.8;
    font-style: italic;
}

/* Ensure VAT indication appears only once per price line */
.woocommerce .price del small,
.woocommerce .price ins small {
    display: none;
}

/* Show VAT indication only on the final price */
.woocommerce .price > small:last-child {
    display: inline;
}

/* Responsive design */
@media (max-width: 768px) {
    .toggle-container {
        flex-direction: column;
        gap: 12px;
    }
    
    .toggle-switch {
        order: 2;
    }
    
    .toggle-label-text.particulier {
        order: 1;
    }
    
    .toggle-label-text.zakelijk {
        order: 3;
    }
    
    .business-private-toggle {
        /* margin: 16px 0; */
        padding: 12px;
    }
    
    .toggle-label-text {
        font-size: 14px;
    }
    
    .toggle-switch {
        width: 40px;
        height: 22px;
    }
    
    .toggle-slider:before {
        height: 18px;
        width: 18px;
        left: 2px;
        bottom: 2px;
    }
    
    .toggle-switch input:checked + .toggle-slider:before {
        transform: translateX(18px);
    }
}

/* Integration with existing WooCommerce styles */
.woocommerce .business-private-toggle {
    margin-bottom: 0px!important;
}

.woocommerce-page .business-private-toggle {
    margin-top: 0;
}

/* Product page specific styling */
.single-product .business-private-toggle {
    margin: 0px;
}

/* Shop page specific styling */
.woocommerce-shop .business-private-toggle {
    margin-bottom: 32px;
}

/* Category page specific styling */
.woocommerce-page.tax-product_cat .business-private-toggle {
    margin-bottom: 32px;
}

/* Hover effects for better UX */
.toggle-switch:hover .toggle-slider {
    background-color: #bbb;
}

.toggle-switch input:checked:hover + .toggle-slider {
    background-color: #333;
}

.toggle-label-text {
    cursor: pointer;
    user-select: none;
}

.toggle-label-text:hover {
    color: #333;
}

@media (prefers-reduced-motion: reduce) {
    .business-private-toggle.loading::after {
        animation: none;
    }
    .business-private-toggle,
    .toggle-label-text,
    .toggle-slider,
    .toggle-slider:before {
        transition: none;
    }
}
