/* =============================================
   FICHEIRO: catalogo.css (Versão Mobile-First, Poppins)
   DESCRIÇÃO: Contém todos os estilos modernos para o catálogo.
   ============================================= */

/* =============================================
   1. VARIÁVEIS, RESET E ANIMAÇÕES
   ============================================= */
:root {
    --cor-primaria: #0C2340; 
    --cor-fundo: #FFFFFF; 
    --cor-texto: #333333;
    --cor-cards: #FFFFFF;
    
    --cor-dourado: #D4AF37; 
    --cor-whatsapp: #25D366;
    --borda-suave: #eeeeee; 
    --vermelho-alerta: #d9534f;
    --texto-secundario: #6c757d;
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

html { 
    font-size: 14px;
    scroll-behavior: smooth; 
}

body { 
    font-family: 'Poppins', sans-serif; 
    background-color: var(--cor-fundo); 
    color: var(--cor-texto);
    padding-top: 55px; /* Compensa a altura do header fixo */
}

.container { 
    max-width: 1140px; 
    margin: 0 auto; 
    padding: 0 15px; 
}

.fade-in {
    animation: fadeInAnimation 0.5s ease-out forwards;
}
@keyframes fadeInAnimation { 
    from { opacity: 0; transform: translateY(20px); } 
    to { opacity: 1; transform: translateY(0); } 
}

/* =============================================
   2. LOADER, VIEWS E ELEMENTOS GLOBAIS
   ============================================= */
.spinner-overlay { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background-color: var(--cor-fundo); 
    z-index: 9999; 
    display: flex; 
    flex-direction: column;
    justify-content: center; 
    align-items: center; 
    transition: opacity 0.3s ease-in-out;
}
.loader-content {
    text-align: center;
}
.loader-text {
    color: var(--texto-secundario);
    font-size: 1rem;
    margin-bottom: 20px;
}
.progress-bar-container {
    width: 150px;
    height: 4px;
    background-color: var(--borda-suave);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto;
}
.progress-bar {
    width: 100%;
    height: 100%;
    background-color: var(--cor-primaria);
    animation: loading-progress 1.5s infinite;
}
@keyframes loading-progress {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.page-view { 
    display: none; 
    padding-bottom: 20px;
}
.page-view.active { 
    display: block; 
    animation: fadeInAnimation 0.4s ease-out;
}

/* =============================================
   3. NOVA BARRA DE ENTREGA, CABEÇALHO E SIDEBAR
   ============================================= */
.delivery-marquee {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--cor-primaria);
    color: var(--cor-fundo);
    z-index: 101;
    white-space: nowrap;
    overflow: hidden;
    padding: 5px 0;
    font-size: 0.8rem;
    font-weight: 600;
}
.delivery-marquee--content {
    display: inline-block;
    animation: marquee-scroll 20s linear infinite;
}
.delivery-marquee--content span {
    display: inline-block;
    padding: 0 2rem;
}
@keyframes marquee-scroll {
    from { transform: translateX(0%); }
    to { transform: translateX(-50%); }
}

.store-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 0 15px;
    position: fixed; 
    top: 0; 
    left: 0;
    width: 100%;
    background-color: var(--cor-fundo); 
    z-index: 100; 
    border-bottom: 1px solid var(--borda-suave); 
    height: 55px;
}
body.delivery-active .store-header {
    top: 29px;
}
body.delivery-active {
    padding-top: 84px;
}

.header-btn { 
    background: none; 
    border: none; 
    font-size: 1.6rem;
    cursor: pointer; 
    color: var(--cor-texto); 
    display: flex;
    align-items: center;
    justify-content: center;
}
#cart-button { 
    position: relative; 
}
#cart-count { 
    position: absolute; 
    top: -4px; 
    right: -6px; 
    width: 20px;
    height: 20px;
    font-size: 0.8rem; 
    font-weight: 700; 
    display: none;
    justify-content: center; 
    align-items: center; 
    border: 2px solid var(--cor-fundo); 
    border-radius: 50%;
    background-color: var(--vermelho-alerta); 
    color: white;
}
#cart-count.visible { 
    display: flex; 
}
.cover-image-container { 
    height: 140px;
    background-color: var(--cor-primaria); 
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative; 
}
.store-logo { 
    width: 105px;
    height: 105px;
    object-fit: cover; 
    border-radius: 50%; 
    border: 4px solid var(--cor-fundo); 
    box-shadow: 0 4px 8px rgba(0,0,0,0.15); 
    position: absolute; 
    bottom: -52.5px;
    left: 50%; 
    transform: translateX(-50%); 
}
.sidebar { 
    position: fixed; 
    top: 0; 
    left: -300px; 
    width: 280px; 
    height: 100%; 
    background-color: var(--cor-fundo); 
    z-index: 1200; 
    transition: left 0.3s ease-in-out; 
    box-shadow: 3px 0 10px rgba(0,0,0,0.1); 
    display: flex; 
    flex-direction: column; 
}
.sidebar.open { 
    left: 0; 
}
.sidebar-header { 
    padding: 15px; 
    border-bottom: 1px solid var(--borda-suave); 
    display: flex; 
    justify-content: space-between; 
    align-items: center;
}
.sidebar-header h2 { 
    color: var(--cor-primaria); 
    font-size: 1.2rem; 
}
.sidebar-menu { 
    flex-grow: 1; 
    overflow-y: auto; 
}
.sidebar-menu h3 { 
    padding: 18px 18px 9px; 
    font-size: 1rem; 
    color: var(--texto-secundario); 
    text-transform: uppercase; 
    font-weight: 700;
}
.sidebar-menu ul { 
    list-style: none; 
    padding: 0; 
}
.sidebar-menu a { 
    display: flex; 
    align-items: center; 
    padding: 14px 18px; 
    color: var(--cor-texto); 
    text-decoration: none; 
    font-weight: 600; 
}
.sidebar-menu a:hover { 
    background-color: var(--borda-suave); 
}
.sidebar-menu iconify-icon { 
    font-size: 1.5rem; 
    margin-right: 15px; 
    width: 28px; 
    text-align: center; 
}
.sidebar-menu .promotion-option {
    color: var(--dourado);
}
.sidebar-footer { 
    padding: 18px; 
    border-top: 1px solid var(--borda-suave); 
    display: flex; 
    justify-content: center; 
    gap: 18px; 
}
.sidebar-footer a {
    color: var(--cor-texto);
    font-size: 2.1rem;
    display: flex;
    align-items: center;
}
.sidebar-footer a[href*="wa.me"] { 
    color: var(--cor-whatsapp); 
}

/* =============================================
   4. CONTEÚDO PRINCIPAL E CARDS DE PRODUTOS
   ============================================= */
.welcome-text { 
    text-align: center; 
    padding: 75px 15px 25px;
}
.welcome-text h1 { 
    color: var(--cor-primaria); 
    font-size: 1.8rem;
    font-weight: 800; 
}
.welcome-text p { 
    margin-top: 5px; 
    color: var(--texto-secundario); 
    max-width: 600px; 
    margin-left: auto; 
    margin-right: auto; 
}

.filter-bar { 
    display: flex; 
    gap: 10px; 
    padding: 0 15px; 
    margin-bottom: 25px; 
    align-items: center; 
}
#filter-btn { 
    flex-shrink: 0; 
    height: 42px; 
    width: 42px; 
    border-radius: 8px; 
    border: 1px solid var(--borda-suave); 
    background-color: var(--cor-cards); 
    font-size: 1.5rem; 
    color: var(--cor-texto); 
    cursor: pointer; 
}
.search-wrapper { 
    position: relative; 
    flex-grow: 1; 
}
.search-wrapper iconify-icon { 
    position: absolute; 
    left: 15px; 
    top: 50%; 
    transform: translateY(-50%); 
    color: var(--texto-secundario); 
}
#search-input { 
    width: 100%; 
    height: 42px; 
    border-radius: 8px; 
    border: 1px solid var(--borda-suave); 
    padding-left: 40px; 
    font-size: 1rem;
    font-family: 'Poppins', sans-serif; 
    background-color: var(--cor-cards); 
    color: var(--cor-texto); 
}
#search-input:focus { 
    outline: none; 
    border-color: var(--cor-primaria); 
}

.section-title { 
    font-size: 1.6rem; 
    font-weight: 800; 
    color: var(--cor-primaria); 
    margin-bottom: 18px; 
    padding: 0 15px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}
.section-title a { 
    font-size: 1rem; 
    font-weight: 600; 
    color: var(--cor-texto); 
    text-decoration: none; 
}

.horizontal-scroll-wrapper { 
    display: flex; 
    overflow-x: auto; 
    gap: 15px; 
    padding: 10px 15px; 
    scroll-snap-type: x mandatory; 
    scrollbar-width: none; 
    -ms-overflow-style: none; 
}
.horizontal-scroll-wrapper::-webkit-scrollbar { 
    display: none; 
}

.products-grid { 
    display: grid; 
    grid-template-columns: repeat(2, 1fr); 
    gap: 15px; 
    padding: 0 15px; 
}
.product-card { 
    background: var(--cor-cards); 
    border: 1px solid var(--borda-suave); 
    border-radius: 8px; 
    overflow: hidden; 
    display: flex; 
    flex-direction: column; 
}
.product-card-horizontal { 
    flex: 0 0 150px; 
    scroll-snap-align: start; 
}
.product-card-image-wrapper { 
    position: relative; 
    cursor: pointer; 
}
.product-card img { 
    width: 100%; 
    height: 160px;
    object-fit: cover; 
    display: block; 
    transition: filter 0.3s ease;
}
.product-info { 
    padding: 12px; 
    text-align: center; 
    flex-grow: 1; 
    display: flex; 
    flex-direction: column; 
    justify-content: space-between; 
}
.product-info h3 { 
    font-size: 0.95rem;
    font-weight: 600; 
    margin-bottom: 5px; 
}
.product-price { 
    font-weight: 700;
    color: var(--cor-primaria); 
}
.original-price { 
    display: block; 
    text-decoration: line-through; 
    color: var(--vermelho-alerta); 
    font-size: 0.9em; 
}
.promotion-badge { 
    position: absolute; 
    top: 8px; 
    left: 8px; 
    width: 40px; 
    height: 40px; 
    font-size: 0.85rem; 
    background-color: var(--dourado); 
    color: var(--cor-primaria); 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-weight: 800; 
    z-index: 10; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.25); 
    transform: rotate(-15deg); 
}
.no-products-message { 
    grid-column: 1 / -1; 
    text-align: center; 
    padding: 40px; 
    color: var(--texto-secundario); 
}
.product-actions {
    margin-top: 10px;
}
.interest-btn {
    background-color: var(--cor-primaria);
    color: var(--cor-fundo);
    border: none;
    border-radius: 6px;
    width: 100%;
    padding: 10px;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: none;
    display: inline-block;
}
.product-stock-status {
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 8px;
    color: var(--texto-secundario);
}
.product-stock-status.stock-out {
    color: var(--vermelho-alerta);
}
.product-card.out-of-stock .product-card-image-wrapper img {
    filter: blur(4px) grayscale(60%);
}
.out-of-stock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--vermelho-alerta);
    font-size: 1.5rem;
    font-weight: 800;
    text-transform: uppercase;
    pointer-events: none;
}
.product-card.out-of-stock .interest-btn {
    background-color: #ccc;
    cursor: not-allowed;
    opacity: 0.7;
    pointer-events: none;
}

/* =============================================
   5. PÁGINA DE DETALHES DO PRODUTO (PDP)
   ============================================= */
.pdp-container { 
    padding: 20px; 
}
.pdp-media-viewer { 
    width: 100%; 
    background-color: #000; 
    border-radius: 10px; 
    overflow: hidden; 
    margin-bottom: 15px; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
}
.pdp-main-media { 
    width: 100%; 
    max-width: 100%; 
    max-height: 55vh; 
    object-fit: contain; 
    display: block; 
}
.pdp-media-viewer .plyr { 
    max-height: 55vh; 
}
.pdp-thumbnails { 
    display: flex; 
    gap: 10px; 
    overflow-x: auto; 
    padding-bottom: 10px; 
}
.pdp-thumbnail { 
    width: 55px; 
    height: 55px; 
    object-fit: cover; 
    border-radius: 6px; 
    cursor: pointer; 
    border: 2px solid transparent; 
    opacity: 0.7; 
}
.pdp-thumbnail.active { 
    border-color: var(--cor-primaria); 
    opacity: 1; 
}
.pdp-thumbnail-wrapper { 
    position: relative; 
}
.pdp-thumbnail-wrapper .play-icon { 
    font-size: 1.4rem; 
    position: absolute; 
    top: 50%; 
    left: 50%; 
    transform: translate(-50%, -50%); 
    color: white; 
    background: rgba(0,0,0,0.5); 
    border-radius: 50%; 
    pointer-events: none; 
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
}
.pdp-details-container {
    margin-top: 15px;
}
.pdp-details-container h1 { 
    font-size: 1.8rem;
    color: var(--cor-primaria); 
    font-weight: 800;
}
.pdp-price-box {
    margin-top: 12px;
    padding: 12px;
    background-color: var(--cor-cards);
    border: 1px solid var(--borda-suave);
    border-radius: 8px;
    text-align: center;
}
.pdp-price-box .price { 
    font-size: 2rem;
    font-weight: 800; 
    color: var(--cor-primaria); 
}
.pdp-price-box .original-price {
    font-size: 1.3rem;
}
.pdp-description-box {
    margin: 15px 0;
    padding: 15px;
    border: 1px solid var(--borda-suave);
    background-color: var(--cor-cards);
    border-radius: 8px;
}
.pdp-description-box h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.2rem;
    color: var(--texto-secundario);
    margin-bottom: 10px;
}
.pdp-description-box p { 
    line-height: 1.6; 
    font-size: 1rem;
}
.pdp-separator {
    border: none;
    height: 1px;
    background-color: var(--borda-suave);
    margin: 20px 0;
}
.pdp-actions { 
    display: flex; 
    flex-direction: column; 
    gap: 12px; 
    margin-top: 20px;
}
.pdp-btn { 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 10px; 
    width: 100%; 
    padding: 14px;
    border-radius: 8px; 
    font-size: 1.1rem;
    font-weight: 700; 
    text-decoration: none; 
    border: none; 
    cursor: pointer; 
    transition: background-color 0.2s, color 0.2s;
}
.add-to-cart-btn { 
    background-color: var(--cor-primaria); 
    color: var(--cor-fundo); 
}
.order-now-btn {
    border: 2px solid var(--cor-primaria);
    background-color: transparent;
    color: var(--cor-primaria);
}
.order-now-btn:hover {
    background-color: var(--cor-primaria);
    color: var(--cor-fundo);
}
.related-products-section {
    margin-top: 40px;
}

/* =============================================
   6. CHECKOUT, MODAIS E FOOTER
   ============================================= */
.checkout-container { 
    padding: 20px; 
}
.page-title { 
    font-size: 1.8rem; 
    color: var(--cor-primaria); 
    margin-bottom: 20px; 
    text-align: center; 
    font-weight: 800;
}
.checkout-summary, .checkout-form { 
    background-color: var(--cor-cards); 
    border: 1px solid var(--borda-suave); 
    border-radius: 8px; 
    padding: 20px; 
    margin-bottom: 20px; 
}
.checkout-summary h3 { 
    margin-bottom: 15px; 
    font-size: 1.2rem; 
}
.summary-item { 
    display: flex; 
    justify-content: space-between; 
    margin-bottom: 10px; 
    font-size: 1rem; 
}
.summary-total { 
    font-weight: 800; 
    margin-top: 15px; 
    border-top: 1px solid var(--borda-suave); 
    padding-top: 10px; 
}
.form-group { 
    margin-bottom: 15px; 
}
.form-group label { 
    display: block; 
    font-weight: 600; 
    margin-bottom: 5px; 
    font-size: 1rem; 
}
.form-group input, .form-group textarea { 
    width: 100%; 
    padding: 12px; 
    border: 1px solid var(--borda-suave); 
    border-radius: 6px; 
    font-size: 1rem; 
    background-color: var(--cor-fundo); 
    color: var(--cor-texto);
    font-family: 'Poppins', sans-serif; 
}
.payment-methods { 
    margin-top: 20px; 
}
.payment-option { 
    display: block; 
    position: relative; 
    padding-left: 32px; 
    margin-bottom: 12px; 
    cursor: pointer; 
    font-size: 1rem; 
    user-select: none; 
}
.payment-option input { position: absolute; opacity: 0; cursor: pointer; }
.checkmark { position: absolute; top: 0; left: 0; height: 22px; width: 22px; background-color: #eee; border-radius: 50%; }
.payment-option input:checked ~ .checkmark { background-color: var(--cor-primaria); }
.checkmark:after { content: ""; position: absolute; display: none; }
.payment-option input:checked ~ .checkmark:after { display: block; }
.payment-option .checkmark:after { top: 7px; left: 7px; width: 8px; height: 8px; border-radius: 50%; background: white; }
.finalize-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 14px; border-radius: 8px; font-size: 1.1rem; font-weight: 700; text-decoration: none; border: none; cursor: pointer; background-color: var(--cor-whatsapp); color: white; margin-top: 20px; }
.empty-cart-message { text-align: center; padding: 40px; }

.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1100; opacity: 0; pointer-events: none; transition: opacity 0.3s ease; }
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.cart-modal, .options-modal, .filter-modal { position: fixed; bottom: 0; left: 0; width: 100%; max-height: 85vh; background-color: var(--cor-fundo); border-top-left-radius: 20px; border-top-right-radius: 20px; z-index: 1101; transform: translateY(100%); transition: transform 0.4s ease-in-out; }
.cart-modal.open, .options-modal.open, .filter-modal.open { transform: translateY(0); }

.modal-header { padding: 15px 20px 10px; text-align: center; flex-shrink: 0; }
.modal-header h2 { font-size: 1.5rem; color: var(--cor-primaria); }
.modal-body { padding: 0 20px 20px; overflow-y: auto; }
.filter-modal .modal-body ul { list-style: none; padding: 10px 0; }
.filter-modal .modal-body a { display: block; padding: 14px; border-radius: 8px; margin-bottom: 10px; background-color: var(--cor-cards); text-decoration: none; color: var(--cor-texto); font-weight: 600; }
.cart-item { display: flex; align-items: center; gap: 15px; margin-bottom: 15px; }
.cart-item img { width: 55px; height: 55px; object-fit: cover; border-radius: 6px; }
.cart-item-info { flex-grow: 1; }
.cart-item-info h4 { font-size: 1rem; font-weight: 600; }
.cart-item-controls { display: flex; align-items: center; gap: 10px; }
.cart-item-controls button { background: var(--borda-suave); border: none; border-radius: 50%; width: 26px; height: 26px; font-weight: bold; cursor: pointer; }
.cart-total { text-align: right; font-size: 1.2rem; font-weight: 800; margin-top: 20px; padding-top: 15px; border-top: 1px solid var(--borda-suave); }
.modal-footer { padding: 15px 20px; border-top: 1px solid var(--borda-suave); display: flex; flex-direction: column; gap: 10px; }
.modal-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 14px; border-radius: 8px; font-size: 1.1rem; font-weight: 700; text-decoration: none; border: none; cursor: pointer; }
.continue-shopping-btn { background: var(--borda-suave); color: var(--texto-primario); }
.go-to-checkout-btn { background-color: var(--cor-primaria); color: var(--cor-fundo); }

.notification-modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1500; display: none; justify-content: center; align-items: center; padding: 20px; opacity: 0; transition: opacity 0.3s ease; }
.notification-modal-overlay.visible { display: flex; opacity: 1; }
.notification-modal { background-color: var(--cor-fundo); color: var(--cor-texto); border-radius: 12px; box-shadow: 0 5px 20px rgba(0,0,0,0.2); padding: 25px; width: 100%; max-width: 320px; text-align: center; }
.notification-modal.fade-in { animation: fadeInAnimation 0.3s ease-out forwards; }
.notification-icon { font-size: 2.8rem; margin-bottom: 12px; }
.notification-title { font-size: 1.4rem; margin-bottom: 8px; }
.notification-message { font-size: 1rem; margin-bottom: 20px; }
.notification-close-btn { border: none; border-radius: 8px; padding: 10px 25px; font-size: 1rem; font-weight: 700; cursor: pointer; }

.whatsapp-fab { position: fixed; bottom: 20px; right: 20px; width: 55px; height: 55px; border-radius: 50%; display: none; justify-content: center; align-items: center; box-shadow: 0 4px 10px rgba(0,0,0,0.2); z-index: 999; text-decoration: none; background-color: var(--cor-whatsapp); color: white; font-size: 1.8rem; }
.whatsapp-fab.visible { display: flex; }
.catalog-footer { background-color: var(--cor-cards); border-top: 1px solid var(--borda-suave); padding: 30px 15px; text-align: center; margin-top: 40px; }
.footer-contacts { margin-top: 15px; margin-bottom: 20px; }
.footer-contacts a { color: var(--cor-texto); text-decoration: none; margin: 0 10px; }
.footer-socials a { color: var(--cor-texto); text-decoration: none; margin: 0 10px; font-size: 1.8rem; }