/* Estilos para o Plugin Meu Seletor de Produtos */

/* Container principal dos seletores */
.msp-top-sold-selector {
    max-width: 500px;
    margin: 20px auto;
    padding: 20px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.msp-top-sold-selector:hover {
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
}

/* Espaçamento entre os campos */
.msp-top-sold-selector > * {
    margin-bottom: 15px;
}

.msp-top-sold-selector > *:last-child {
    margin-bottom: 0;
}

/* Estilos para os selects */
.msp-select {
    width: 100% !important;
    min-height: 42px;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
    background-color: #fff;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.msp-select:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.msp-select:disabled {
    background-color: #f7f7f7;
    color: #999;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Container dos botões */
.msp-button-container {
    display: flex;
    gap: 12px;
    align-items: stretch;
    flex-wrap: nowrap;
    width: 100%;
}

/* Estilos para os botões */
.msp-add-to-cart {
    flex: 1;
    padding: 14px 20px;
    background: #FFAF04;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(255, 175, 4, 0.3);
    text-transform: none;
    letter-spacing: normal;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
}

.msp-add-to-cart:hover:not(:disabled) {
    background: #e69a03;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 175, 4, 0.4);
}

.msp-add-to-cart:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(255, 175, 4, 0.3);
}

.msp-add-to-cart:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.6;
}

/* Botão Finalizar Compra */
.msp-checkout-button {
    flex: 1;
    padding: 14px 20px;
    background: #CF2E2E;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(207, 46, 46, 0.3);
    text-transform: none;
    letter-spacing: normal;
    text-decoration: none;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
}

.msp-checkout-button:hover:not(:disabled) {
    background: #b52626;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(207, 46, 46, 0.4);
    color: white;
    text-decoration: none;
}

.msp-checkout-button:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(207, 46, 46, 0.3);
}

.msp-checkout-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.6;
}

/* Customização do Select2 */
.select2-container {
    width: 100% !important;
}

.select2-container--default .select2-selection--single {
    height: 42px !important;
    border: 1px solid #ddd !important;
    border-radius: 6px !important;
    padding: 0 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    transition: all 0.3s ease !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 40px !important;
    padding-left: 12px !important;
    font-size: 14px !important;
    color: #000 !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 40px !important;
    right: 8px !important;
}

.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: #0073aa !important;
    box-shadow: 0 6px 20px rgba(0, 115, 170, 0.25) !important;
}

.select2-dropdown {
    border: 2px solid #0073aa !important;
    border-radius: 8px !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2) !important;
}

.select2-container--default .select2-results__option {
    color: #000 !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #0073aa !important;
    color: #fff !important;
}

/* Responsividade */
@media (max-width: 768px) {
    .msp-top-sold-selector {
        margin: 15px 10px;
        padding: 15px;
        border-radius: 6px;
    }
    
    .msp-select {
        min-height: 44px;
        font-size: 16px;
        padding: 10px 12px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
    
    .select2-container--default .select2-selection--single {
        height: 44px !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    }
    
    .select2-container--default .select2-selection--single .select2-selection__rendered {
        line-height: 42px !important;
        font-size: 16px !important;
    }
    
    .select2-container--default .select2-selection--single .select2-selection__arrow {
        height: 42px !important;
    }
    
    .msp-button-container {
        gap: 10px;
        flex-wrap: nowrap;
    }
    
    .msp-add-to-cart,
    .msp-checkout-button {
        padding: 16px 20px;
        font-size: 16px;
        min-height: 52px;
        font-weight: 600;
    }
}

@media (max-width: 480px) {
    .msp-top-sold-selector {
        margin: 10px 5px;
        padding: 12px;
        max-width: none;
    }
    
    .msp-select {
        min-height: 46px;
        font-size: 16px;
        padding: 12px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
    
    .select2-container--default .select2-selection--single {
        height: 46px !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    }
    
    .select2-container--default .select2-selection--single .select2-selection__rendered {
        line-height: 44px !important;
        font-size: 16px !important;
    }
    
    .select2-container--default .select2-selection--single .select2-selection__arrow {
        height: 44px !important;
    }
    
    .msp-button-container {
        gap: 8px;
        flex-direction: column;
    }
    
    .msp-add-to-cart,
    .msp-checkout-button {
        padding: 18px 20px;
        font-size: 16px;
        min-height: 54px;
        font-weight: 600;
        width: 100%;
    }
}

/* Animações suaves */
.msp-select,
.msp-add-to-cart,
.select2-container {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Estados de loading */
.msp-loading {
    position: relative;
    pointer-events: none;
}

.msp-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); }
}

/* Melhorias de acessibilidade */
.msp-select:focus,
.msp-add-to-cart:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Estilo para mensagens de erro/sucesso */
.msp-message {
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-weight: 500;
}

.msp-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.msp-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}