/* Estilos para a interface pública dos opcionais */

.wvo-optionals-container {
    margin: 20px 0;
    padding: 20px;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    background: #fafafa;
}

.wvo-optionals-title {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #28a745;
    padding-bottom: 8px;
}

.wvo-optionals-list {
    margin-bottom: 20px;
}

.wvo-optional-item {
    margin-bottom: 8px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 6px;
    border-left: 4px solid #28a745;
}

.wvo-optional-item:last-child {
    margin-bottom: 0;
}

.wvo-optional-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wvo-optional-icon {
    color: #28a745;
    font-weight: bold;
    font-size: 14px;
}

.wvo-optional-name {
    font-size: 14px;
    color: #333;
    line-height: 1.4;
}



/* Loading state */
.wvo-optionals-container.loading {
    opacity: 0.7;
    pointer-events: none;
}

.wvo-optionals-container.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 #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsividade */
@media (max-width: 768px) {
    .wvo-optionals-container {
        margin: 15px 0;
        padding: 15px;
    }

    .wvo-optionals-title {
        font-size: 16px;
    }

    .wvo-optional-label {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .wvo-optional-checkbox {
        margin: 0 8px 0 0;
    }

    .wvo-optional-price {
        margin-left: 0;
        align-self: flex-end;
    }

    .wvo-price-summary {
        padding: 12px;
    }

    .wvo-price-summary > div {
        font-size: 14px;
    }

    .wvo-total-price .value {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .wvo-optionals-container {
        margin: 10px 0;
        padding: 12px;
    }

    .wvo-optional-item {
        padding: 10px;
    }

    .wvo-optional-name {
        font-size: 13px;
    }

    .wvo-optional-price {
        font-size: 13px;
    }
}

/* Melhorias de acessibilidade */
.wvo-optional-checkbox:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.wvo-optional-label:focus-within {
    background-color: #f8f9fa;
}

/* Estilo para produtos sem opcionais */
.wvo-no-optionals {
    text-align: center;
    padding: 20px;
    color: #666;
    font-style: italic;
}

/* Customização para temas específicos */
.woocommerce .wvo-optionals-container {
    clear: both;
}

.woocommerce .wvo-optionals-container .wvo-optional-checkbox {
    margin-right: 12px;
}

/* Integração com botão de compra */
.single-product .cart .wvo-optionals-container {
    margin-bottom: 20px;
}

/* Estilo para mensagens de erro */
.wvo-error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 10px 15px;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin: 10px 0;
}

/* Estilo para mensagens de sucesso */
.wvo-success-message {
    background: #d4edda;
    color: #155724;
    padding: 10px 15px;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    margin: 10px 0;
}


/* Estilos para diferentes variações do shortcode */

/* Estilo compacto */
.wvo-style-compact .wvo-optionals-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.wvo-style-compact .wvo-optional-item {
    margin-bottom: 0;
    padding: 6px 10px;
    border-radius: 15px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-left: 2px solid #28a745;
}

.wvo-style-compact .wvo-optional-info {
    gap: 4px;
}

.wvo-style-compact .wvo-optional-name {
    font-size: 13px;
}

/* Estilo em grid */
.wvo-style-grid .wvo-optionals-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.wvo-style-grid .wvo-optional-item {
    margin-bottom: 0;
}

/* Estilo minimalista */
.wvo-style-minimal .wvo-optionals-container {
    background: transparent;
    border: none;
    padding: 0;
}

.wvo-style-minimal .wvo-optionals-title {
    border-bottom: 1px solid #ddd;
    margin-bottom: 10px;
    font-size: 16px;
}

.wvo-style-minimal .wvo-optional-item {
    background: transparent;
    border: none;
    border-left: 3px solid #28a745;
    padding: 5px 0 5px 10px;
    margin-bottom: 5px;
}

/* Estilo para contador */
.wvo-optionals-count {
    display: inline-block;
    background: #28a745;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

/* Responsividade para shortcodes */
@media (max-width: 768px) {
    .wvo-style-compact .wvo-optionals-list {
        flex-direction: column;
    }
    
    .wvo-style-grid .wvo-optionals-list {
        grid-template-columns: 1fr;
    }
}
