/*
Theme Name: O Sucesso em Casa
Theme URI: https://osucessoemcasa.com.br/
Author: O Sucesso em Casa
Author URI: https://osucessoemcasa.com.br/
Description: Tema personalizado para a loja O Sucesso em Casa - Produtos selecionados da Amazon, Mercado Livre e Shopee com links diretos para compra.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: o-sucesso-em-casa
Tags: e-commerce, affiliate, marketplace
*/

/* Nossos estilos CSS */

body {
    background-color: #f5f5f5;
    font-family: 'Segoe UI', Arial, sans-serif;
    line-height: 1.6;
}

.site-header {
    background-color: #ffffff;
    padding: 20px;
    border-bottom: 2px solid #dddddd;
}

.site-title a {
    text-decoration: none;
    color: #333333;
    font-size: 28px;
    font-weight: bold;
}

.site-footer {
    background-color: #333333;
    color: #ffffff;
    padding: 20px;
    text-align: center;
    margin-top: 30px;
}

/* Hero Section (Banner principal) */
.hero-bg {
    background: linear-gradient(135deg, #FF6B00 0%, #EE4D2D 50%, #FFE033 100%);
    background-size: cover;
    background-position: center center;
    padding-top: 6rem;
    padding-bottom: 6rem;
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.product-card:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fadeIn {
    animation: fadeIn 0.5s ease-in-out;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #FF6B00;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Resetar estilos antigos */
.site-header, .site-footer {
    background: none;
    padding: 0;
    border: none;
    color: inherit;
    margin: 0;
}

.site-title a {
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
}

/* Imagem de Produto Quadrada */
.woocommerce ul.products li.product .woocommerce-loop-product__link img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    object-position: center;
}

/* --- LAYOUT DE CATEGORIAS LADO A LADO --- */

#categoriesContainer {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 2rem;
}

.categoria-section {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 0;
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

.categoria-section:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
}

.categoria-section > div:last-child {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.categoria-section .product-card {
    min-height: 280px;
    display: flex;
    flex-direction: column;
}

.categoria-section .product-card > div:last-child {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* Botao ver mais */
.ver-mais-btn {
    white-space: nowrap;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.ver-mais-btn:hover {
    transform: translateX(3px);
}

/* Botao Comprar com estilo marketplace */
.btn-comprar {
    background: linear-gradient(135deg, #FF6B00 0%, #EE4D2D 100%);
    transition: all 0.3s ease;
}

.btn-comprar:hover {
    background: linear-gradient(135deg, #EE4D2D 0%, #FF6B00 100%);
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(238, 77, 45, 0.4);
}

/* Badge de plataforma */
.platform-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: bold;
    text-transform: uppercase;
}

.platform-amazon {
    background: #FF9900;
    color: #232F3E;
}

.platform-mercadolivre {
    background: #FFE600;
    color: #2D3277;
}

.platform-shopee {
    background: #EE4D2D;
    color: white;
}

/* --- RESPONSIVIDADE --- */

@media (min-width: 1400px) {
    #categoriesContainer {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) and (max-width: 1399px) {
    #categoriesContainer {
        grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
        gap: 1.5rem;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    #categoriesContainer {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .categoria-section {
        min-height: 350px;
    }
}

@media (max-width: 767px) {
    #categoriesContainer {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .categoria-section {
        min-height: auto;
    }

    .categoria-section .flex.justify-between {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1rem;
    }

    .categoria-section .ver-mais-btn {
        width: 100%;
        justify-content: center;
    }

    .categoria-section .product-card {
        min-height: auto;
    }
}

@media (min-width: 1200px) {
    #categoriesContainer {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ================================================
   LIGHTBOX - Visualizacao de Imagens Grande
   ================================================ */

#imageLightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    box-sizing: border-box;
}

#imageLightbox.hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

#imageLightbox .lightbox-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 95vw;
    max-height: 95vh;
}

#lightboxImage {
    max-width: 90vw;
    max-height: 80vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    cursor: zoom-out;
    background: #fff;
}

#lightboxCaption {
    color: #ffffff;
    background: rgba(0, 0, 0, 0.7);
    padding: 12px 24px;
    border-radius: 25px;
    text-align: center;
    margin-top: 20px;
    font-size: 18px;
    font-weight: 500;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    max-width: 80vw;
}

#closeLightboxBtn {
    position: fixed;
    top: 30px;
    right: 30px;
    background: rgba(255, 255, 255, 0.95);
    color: #333333;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 28px;
    font-weight: bold;
    line-height: 50px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
    z-index: 100000;
}

#closeLightboxBtn:hover {
    background: #EE4D2D;
    color: #ffffff;
    transform: scale(1.1) rotate(90deg);
}

@media (max-width: 768px) {
    #imageLightbox {
        padding: 10px;
    }

    #lightboxImage {
        max-width: 95vw;
        max-height: 70vh;
    }

    #lightboxCaption {
        font-size: 14px;
        padding: 10px 16px;
        margin-top: 15px;
        max-width: 95vw;
    }

    #closeLightboxBtn {
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
        font-size: 22px;
        line-height: 40px;
    }
}

@keyframes lightboxFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes lightboxZoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

#imageLightbox:not(.hidden) {
    animation: lightboxFadeIn 0.3s ease;
}

#imageLightbox:not(.hidden) #lightboxImage {
    animation: lightboxZoomIn 0.3s ease;
}

body.lightbox-open {
    overflow: hidden !important;
}

/* Filtro de Categorias */
.category-btn {
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.category-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.category-btn.active {
    border-color: rgba(255,255,255,0.3);
    box-shadow: 0 4px 15px rgba(255, 107, 0, 0.4);
}

#categorySearch {
    transition: all 0.3s ease;
}

#categorySearch:focus {
    box-shadow: 0 4px 15px rgba(255, 107, 0, 0.2);
}
