:root {
    --sy-navy: #0a192f;
    --sy-light-navy: #112240;
    --sy-lighter-navy: #233554;
    --sy-slate: #8892b0;
    --sy-gold: #ffd700;
    --sy-bronze: #cd7f32;
    --sy-white: #e6f1ff;
    --sy-cyan: #64ffda;
}

/* =========================================
   SINGLE PRODUCT PAGE - CUSTOM THEME (LIGHT/MONTSERRAT)
   Escopo: body.solaryum-custom-theme (adicionado via PHP)
   ========================================= */

body.solaryum-custom-theme {
    background-color: #EFEFEF !important;
    /* color: #333333; - Moved to .product */
    /* Font removed from body to avoid affecting Modal/Simulator */
}

/* Container Principal do Produto */
body.solaryum-custom-theme .product {
    background-color: #ffffff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.05);
    margin-top: 30px;
    margin-bottom: 30px;
    border: 1px solid #e0e0e0;
    font-family: 'Montserrat', sans-serif !important; /* Added here */
    color: #333333; /* Moved here */
}

/* Layout Responsivo (Grid/Flex) */
@media (min-width: 768px) {
    body.solaryum-custom-theme .product {
        display: flex;
        flex-wrap: wrap;
        gap: 40px;
    }
    body.solaryum-custom-theme .product .woocommerce-product-gallery {
        flex: 1;
        min-width: 300px;
    }
    body.solaryum-custom-theme .product .summary {
        flex: 1;
        min-width: 300px;
    }
    body.solaryum-custom-theme .product .woocommerce-tabs {
        width: 100%;
        margin-top: 40px;
    }
    body.solaryum-custom-theme .product .related.products {
        width: 100%;
        margin-top: 40px;
    }
}

/* Tipografia e Cores Principais - SCOPED TO PRODUCT ONLY */
body.solaryum-custom-theme .product h1,
body.solaryum-custom-theme .product h2,
body.solaryum-custom-theme .product h3,
body.solaryum-custom-theme .product_title {
    color: var(--sy-navy) !important;
    font-family: 'Montserrat', sans-serif !important;
    font-weight: 700;
}

body.solaryum-custom-theme .product_title {
    font-size: 2em;
    line-height: 1.2;
    margin-bottom: 15px;
    letter-spacing: -0.5px;
}

/* Preço */
body.solaryum-custom-theme .product .price {
    color: var(--sy-light-navy) !important;
    font-family: 'Montserrat', sans-serif !important;
    font-weight: 600;
    font-size: 1.8em;
    display: block;
    margin-bottom: 25px;
}
body.solaryum-custom-theme .product .price ins {
    text-decoration: none;
    color: var(--sy-navy);
}

/* Descrição Curta */
body.solaryum-custom-theme .woocommerce-product-details__short-description {
    color: #555555 !important;
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--sy-gold);
    margin-bottom: 30px;
    font-family: 'Montserrat', sans-serif !important;
    line-height: 1.6;
    font-size: 0.95em;
}

/* Inputs do Produto (Quantidade, Variações) - NÃO afeta o modal */
body.solaryum-custom-theme .product form.cart .quantity input,
body.solaryum-custom-theme .product form.variations_form select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    height: 40px;
    font-family: 'Montserrat', sans-serif;
}

/* Abas */
body.solaryum-custom-theme .woocommerce-tabs ul.tabs {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 0 10px 0 !important;
}
body.solaryum-custom-theme .woocommerce-tabs ul.tabs li {
    background: #f0f0f0 !important;
    border: none !important;
    border-radius: 50px !important;
    margin-right: 10px !important;
    padding: 5px 15px !important;
}
body.solaryum-custom-theme .woocommerce-tabs ul.tabs li.active {
    background: var(--sy-navy) !important;
    color: #fff !important;
}
body.solaryum-custom-theme .woocommerce-tabs ul.tabs li a {
    color: #666 !important;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 15px !important;
}
body.solaryum-custom-theme .woocommerce-tabs ul.tabs li.active a {
    color: #ffffff !important;
}
body.solaryum-custom-theme .woocommerce-Tabs-panel {
    background: #ffffff !important;
    color: #444 !important;
    border: 1px solid #eee;
    padding: 30px !important;
    border-radius: 12px;
    line-height: 1.7;
    font-family: 'Montserrat', sans-serif !important;
}

/* Conteúdo da Descrição (Abas) */
body.solaryum-custom-theme .woocommerce-Tabs-panel h2,
body.solaryum-custom-theme .woocommerce-Tabs-panel h3 {
    margin-top: 20px;
    margin-bottom: 15px;
    font-size: 1.5em;
    color: var(--sy-navy) !important;
}
body.solaryum-custom-theme .woocommerce-Tabs-panel p {
    margin-bottom: 15px;
    color: #555;
    font-size: 1em;
}
body.solaryum-custom-theme .woocommerce-Tabs-panel ul {
    margin-left: 20px;
    margin-bottom: 20px;
}
body.solaryum-custom-theme .woocommerce-Tabs-panel ul li {
    margin-bottom: 8px;
    color: #555;
}


/* Hide SKU globally */
.sku_wrapper, .product_meta .sku_wrapper {
    display: none !important;
}

/* =========================================
   RELATED PRODUCTS STYLING (Restored Design)
   ========================================= */

/* 1. Cards (Caixas) */
.related.products ul.products {
    display: flex;
    flex-wrap: nowrap; /* Force single line */
    justify-content: space-between; /* Distribute space */
    gap: 5px; /* Minimal gap */
    overflow: hidden; /* No scrollbars */
    padding-bottom: 0;
}

/* Remove scrollbar styling */

.related.products ul.products li.product {
    border: none !important;
    border-radius: 10px !important; /* Smaller radius */
    box-shadow: 0 3px 10px rgba(0,0,0,0.05) !important; /* Lighter shadow */
    background-color: #ffffff !important;
    padding: 8px !important; /* Minimal padding */
    transition: transform 0.3s ease;
    margin-bottom: 0;
    flex: 1; /* Grow/shrink to fit container */
    width: auto !important; /* Let flex handle width */
    min-width: 0; /* Allow shrinking below content size if needed to prevent overflow */
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.related.products ul.products li.product:hover {
    transform: translateY(-5px);
}

/* Media Queries Removed for Horizontal Slider */
/*
@media (max-width: 1024px) {
    .related.products ul.products li.product {
        width: calc(33.333% - 20px) !important;
    }
}

@media (max-width: 768px) {
    .related.products ul.products li.product {
        width: calc(50% - 15px) !important;
    }
}

@media (max-width: 480px) {
    .related.products ul.products li.product {
        width: 100% !important;
    }
}
*/
/* Fix image styling inside related products */
.related.products ul.products li.product a img {
    width: 100%;
    height: auto;
    object-fit: contain;
    margin-bottom: 8px; /* Reduced from 15px */
    border-radius: 12px;
}

/* 2. Títulos */
.related.products ul.products li.product .woocommerce-loop-product__title {
    color: #cba135 !important; /* Golden/Mustard */
    font-size: 0.75em !important; /* Very small */
    text-transform: uppercase !important;
    font-weight: 700 !important;
    font-family: 'Montserrat', sans-serif !important;
    margin-bottom: 2px !important; /* Minimal margin */
    line-height: 1.1 !important; /* Very tight line height */
}

/* 3. Botão "Ver Opções" */
.related.products ul.products li.product .button,
.related.products ul.products li.product .add_to_cart_button {
    background-color: #cba135 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 50px !important; /* Pill shape */
    padding: 5px 12px !important; /* Minimal button padding */
    font-size: 0.7em !important; /* Tiny font */
    text-transform: uppercase !important;
    font-weight: 600 !important;
    display: inline-block !important;
    width: auto !important;
    margin: 3px auto 0 auto !important; /* Minimal margin */
    text-align: center !important;
}

.related.products ul.products li.product .button:hover,
.related.products ul.products li.product .add_to_cart_button:hover {
    background-color: #b38f2e !important; /* Slightly darker gold for hover */
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(203, 161, 53, 0.3);
}

/* 4. Preço */
.related.products ul.products li.product .price {
    color: var(--sy-navy) !important; /* Navy blue */
    font-weight: 700 !important;
    font-size: 0.9em !important; /* Smaller price */
    font-family: 'Montserrat', sans-serif !important;
    margin-bottom: 2px !important; /* Minimal margin */
    display: block !important;
}

.related.products ul.products li.product .price ins {
    text-decoration: none;
    font-weight: 700;
}

/* =========================================
   BOTÕES DE AÇÃO (Comprar e Simular)
   ========================================= */
.solaryum-custom-buttons {
    margin-top: 30px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 30px;
    align-items: center;
}

.solaryum-btn-buy, .solaryum-btn-finance {
    padding: 15px 25px;
    border-radius: 6px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    text-align: center;
    flex: 1;
    min-width: 200px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: none;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Montserrat', sans-serif !important;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

/* Botão Comprar */
.solaryum-btn-buy {
    background-color: var(--sy-navy); 
    color: #ffffff;
    font-size: 1.1em;
    box-shadow: 0 4px 10px rgba(10, 25, 47, 0.3);
    border: 2px solid var(--sy-navy);
}
.solaryum-btn-buy:hover {
    background-color: var(--sy-light-navy);
    border-color: var(--sy-light-navy);
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(10, 25, 47, 0.4);
}

/* Botão Simular Financiamento */
.solaryum-btn-finance {
    background-color: transparent;
    border: 2px solid var(--sy-navy);
    color: var(--sy-navy);
    font-size: 0.85em;
    padding: 17px 25px;
}
.solaryum-btn-finance:hover {
    background-color: var(--sy-navy);
    color: #ffffff;
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(10, 25, 47, 0.1);
}
.solaryum-btn-finance:disabled,
.solaryum-btn-finance[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #f5f5f5;
    border-color: #cccccc;
    color: #999999;
    transform: none;
    box-shadow: none;
}

/* =========================================
   MODAL DE SIMULAÇÃO
   ========================================= */
.solaryum-modal {
    display: none; 
    position: fixed; 
    z-index: 999999; /* Z-index altíssimo */
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(0,0,0,0.7); 
    backdrop-filter: blur(5px);
}

.solaryum-modal-content {
    background-color: transparent; /* Transparente para deixar o simulador brilhar */
    margin: 2% auto; 
    padding: 0;
    border: none;
    width: 95%; 
    max-width: 650px; /* Um pouco mais largo que o simulador padrão (600px) */
    position: relative;
    animation: solaryumModalFadeIn 0.3s;
}

@keyframes solaryumModalFadeIn {
    from {opacity: 0; transform: translateY(-20px);}
    to {opacity: 1; transform: translateY(0);}
}

.solaryum-close-modal {
    color: #fff;
    float: right;
    font-size: 32px;
    font-weight: bold;
    position: absolute;
    right: 0;
    top: -40px; /* Fora do modal para não sobrepor */
    cursor: pointer;
    z-index: 1000000;
    transition: color 0.2s;
    text-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

.solaryum-close-modal:hover {
    color: var(--sy-gold);
}

.solaryum-modal-body {
    padding: 0;
}

/* =========================================
   INTEGRAÇÃO VISUAL COM SIMULADOR COMPLETO
   Garante que o simulador fique bonito dentro do modal
   e corrige possíveis conflitos
   ========================================= */

/* Remove margens externas do simulador para encaixar no modal */
#solaryum-finance-modal .sc-simulador {
    margin: 0 auto !important;
    max-width: 100% !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5) !important;
}

/* Força a fonte Montserrat no simulador para consistência - REMOVIDO PARA PRESERVAR DESIGN ORIGINAL */
/*
#solaryum-finance-modal .sc-simulador,
#solaryum-finance-modal .sc-simulador h2,
#solaryum-finance-modal .sc-simulador input,
#solaryum-finance-modal .sc-simulador button {
    font-family: 'Montserrat', sans-serif !important;
}
*/

/* Garante que o input readonly (valor) tenha contraste - REMOVIDO SE NÃO FOR NECESSÁRIO */
/*
#solaryum-finance-modal .sc-simulador input[readonly] {
    color: #FFD54F !important; 
    opacity: 1 !important;
}
*/

/* Ajuste mobile para o modal */
@media (max-width: 600px) {
    .solaryum-modal-content {
        width: 100%;
        margin: 0;
        height: 100%;
        border-radius: 0;
    }
    #solaryum-finance-modal .sc-simulador {
        border-radius: 0 !important;
        min-height: 100vh;
        margin: 0 !important;
    }
    .solaryum-close-modal {
        top: 10px;
        right: 15px;
        color: #fff;
        z-index: 1000001;
    }
}
