/* ============================================
   VARIATION SLIDE SELECTOR - FRONTEND CSS
   VERSÃO OTIMIZADA
   ============================================ */

/* Container principal */
.vss-variation-selectors {
    margin: 20px 0;
    width: 100%;
}

/* Cada seletor */
.vss-selector-wrapper {
    margin-bottom: 25px;
}

/* Label do seletor */
.vss-selector-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 500;
}

.vss-label-name {
    color: #666;
    text-transform: uppercase;
}

.vss-label-selected {
    color: #000;
    font-weight: 600;
}

/* NOVO: Valor selecionado ao lado */
.vss-selected-value {
    color: #00a650;
    font-weight: 700;
    font-size: 16px;
    margin-left: 5px;
}

.vss-selected-value strong {
    color: #00a650;
}

.vss-clear-btn {
    margin-left: auto;
    background: none;
    border: none;
    color: #666;
    font-size: 12px;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s;
}

.vss-clear-btn:hover {
    color: #333;
}

/* Container do scroll */
.vss-scroll-container {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.vss-options-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 4px 2px;
}

.vss-options-scroll::-webkit-scrollbar {
    display: none;
}

/* Setas de navegação */
.vss-scroll-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #ddd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

.vss-scroll-arrow:hover {
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.vss-arrow-left {
    left: -8px;
}

.vss-arrow-right {
    right: -8px;
}

.vss-scroll-arrow.vss-hidden {
    opacity: 0;
    pointer-events: none;
}

/* Opção base */
.vss-option {
    flex-shrink: 0;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    user-select: none;
}

/* Opção com imagem (cores) */
.vss-option-image {
    width: 70px;
    height: 70px;
    border: 2px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
}

.vss-option-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    pointer-events: none;
}

.vss-option-image:hover {
    border-color: #00a650;
    transform: scale(1.05);
}

.vss-option-image.vss-selected {
    border-color: #00a650;
    border-width: 3px;
}

.vss-option-image.vss-selected::after {
    content: '✓';
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: #00a650;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* Placeholder para cores sem imagem */
.vss-option-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    color: #999;
    background: #f0f0f0;
}

/* Opção de texto (tamanhos) */
.vss-option-text {
    min-width: 50px;
    height: 50px;
    padding: 0 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    background: white;
}

.vss-option-text:hover {
    border-color: #00a650;
    background: #f8fff8;
}

.vss-option-text.vss-selected {
    border-color: #00a650;
    background: #00a650;
    color: white;
}

/* Opções desabilitadas */
.vss-option.vss-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
    position: relative;
}

/* X GRANDE nos tamanhos indisponíveis */
.vss-option-text.vss-disabled::before {
    content: '✕';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 28px;
    font-weight: bold;
    color: #ff0000;
    z-index: 10;
}

/* X nas cores indisponíveis */
.vss-option-image.vss-disabled::before {
    content: '✕';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 32px;
    font-weight: bold;
    color: #ff0000;
    text-shadow: 0 0 3px white;
    z-index: 10;
}

/* Marca adicional de indisponível */
.vss-unavailable-mark {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: #ff0000;
    color: white;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    z-index: 11;
}

/* Esconder seletores padrão do WooCommerce - MANTER FUNCIONAIS */
.variations,
.single_variation_wrap .variations,
table.variations,
.variations_form table.variations {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
    overflow: hidden !important;
    clip: rect(1px, 1px, 1px, 1px) !important;
}

/* Responsividade */
@media (max-width: 768px) {
    .vss-option-image {
        width: 65px;
        height: 65px;
        padding: 3px;
    }
    
    .vss-option-text {
        min-width: 45px;
        height: 45px;
        font-size: 14px;
    }
    
    .vss-scroll-arrow {
        width: 28px;
        height: 28px;
    }
}

@media (max-width: 480px) {
    .vss-option-image {
        width: 60px;
        height: 60px;
        padding: 2px;
    }
    
    .vss-option-text {
        min-width: 42px;
        height: 42px;
    }
}

/* Compatibilidade Porto */
.porto-content .vss-variation-selectors,
.product-summary-wrap .vss-variation-selectors {
    max-width: 100%;
}

/* Estilos para shortcodes */
.vss-add-to-cart-section {
    margin: 20px 0;
}

.vss-add-to-cart-section .single_variation_wrap {
    margin-top: 0;
}

.vss-add-to-cart-section .woocommerce-variation-price {
    margin-bottom: 15px;
}

.vss-add-to-cart-section .woocommerce-variation-availability {
    margin-bottom: 15px;
}

/* Quando usado em Elementor */
.elementor-widget-container .vss-variation-selectors {
    width: 100%;
}

.elementor-widget-container .vss-add-to-cart-section {
    width: 100%;
}

/* ============================================
   BOTÃO COMPRAR AGORA - PULSANTE
   ============================================ */

@keyframes vss-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 166, 80, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 15px rgba(0, 166, 80, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 166, 80, 0);
    }
}

body .single_variation_wrap button.single_add_to_cart_button,
body .vss-add-to-cart-section button.single_add_to_cart_button,
body button.single_add_to_cart_button.single_add_to_cart_button,
.woocommerce button.single_add_to_cart_button,
.woocommerce-page button.single_add_to_cart_button {
    animation: vss-pulse 2s ease-in-out infinite !important;
}

body button.single_add_to_cart_button.disabled,
body button.single_add_to_cart_button:disabled,
body button.single_add_to_cart_button.wc-variation-selection-needed {
    animation: none !important;
    opacity: 0.5 !important;
    cursor: not-allowed !important;
}
