
:root {
    --primary-color: #003366; 
    --secondary-color: #ffcc00; 
    --bg-color: #f8fafc;
    --text-color: #333;
    --white: #ffffff;
    --border-color: #e2e8f0;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }
body { background-color: var(--bg-color); color: var(--text-color); display: flex; flex-direction: column; min-height: 100vh;}
main { flex: 1; }

.btn { background-color: var(--primary-color); color: var(--white); padding: 10px 15px; border: none; cursor: pointer; border-radius: 4px; font-weight: bold; transition:0.2s;}
.btn:hover { filter: brightness(0.9); }
.btn-outline { background-color: transparent; color: var(--primary-color); border: 1px solid var(--primary-color); padding: 10px 15px; cursor: pointer; border-radius: 4px;}

/* Toasts da Loja */
#loja-toast-container { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.loja-toast { background: #333; color: white; padding: 12px 25px; border-radius: 30px; font-weight: bold; font-size: 14px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); display: flex; align-items: center; gap: 10px; opacity: 0; transform: translateY(20px); transition: all 0.3s ease;}
.loja-toast.show { opacity: 1; transform: translateY(0); }
.loja-toast.success { background: #22c55e; }
.loja-toast.error { background: #ef4444; }

.topbar-micro { background-color: #f1f5f9; color: #475569; border-bottom: 1px solid #e2e8f0; font-weight: 500; }
.topbar-marketing i { color: var(--primary-color); margin-right: 5px; }
.auth-btn-text { background: none; border: none; color: var(--primary-color); font-weight: bold; cursor: pointer; margin-left: 10px; }

.header { background-color: var(--white); padding: 20px 0; border-bottom: 1px solid var(--border-color); }
.header-container { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; padding: 0 20px; }
.logo { font-size: 28px; font-weight: 800; color: var(--primary-color); display:flex; align-items:center; gap:5px;}

.search-bar-modern { display: flex; flex: 1; max-width: 500px; margin: 0 40px; border: 2px solid var(--primary-color); border-radius: 8px; overflow: hidden; }
.search-bar-modern input { flex:1; padding: 12px 15px; border: none; outline: none; }
.search-bar-modern button { padding: 0 20px; background: var(--primary-color); color: white; border: none; cursor: pointer; }

.header-actions { display: flex; gap: 20px; align-items: center; color: var(--primary-color); }
.cart-icon { position: relative; font-size: 24px; cursor: pointer; }
.cart-badge { position: absolute; top: -8px; right: -10px; background-color: var(--secondary-color); color: var(--primary-color); font-size: 12px; font-weight: bold; padding: 2px 6px; border-radius: 50%; }

.main-nav { background-color: var(--primary-color); }
.nav-list { list-style: none; display: flex; margin: 0; padding: 0; }
.nav-list > li > a { display: block; padding: 15px 20px; color: var(--white); text-decoration: none; font-weight: 600; font-size: 14px; text-transform: uppercase; }
.nav-list > li > a:hover { background-color: rgba(255,255,255,0.1); }

.dropdown { position: relative; display: inline-block; background-color: rgba(0,0,0,0.2); }
.dropdown-content { display: none; position: absolute; background-color: white; min-width: 250px; box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.1); z-index: 100; border-radius: 0 0 8px 8px; overflow: hidden; border: 1px solid var(--border-color); }
.dropdown-content a { color: var(--text-color); padding: 12px 20px; text-decoration: none; display: block; font-weight: 500; border-bottom: 1px solid #f1f5f9; }
.dropdown-content a:hover { background-color: #f8fafc; color: var(--primary-color); padding-left: 25px; transition: 0.2s;}
.dropdown:hover .dropdown-content { display: block; }

/* Category Bubbles */
.category-bubbles-container { max-width: 1200px; margin: 30px auto 0; padding: 0 20px; display: flex; justify-content: center; gap: 30px; overflow-x: auto; scroll-behavior: smooth; }
.cat-bubble { display: flex; flex-direction: column; align-items: center; gap: 10px; cursor: pointer; text-decoration: none; color: var(--text-color); transition: 0.2s;}
.cat-bubble:hover { transform: translateY(-5px); color: var(--primary-color); }
.cat-bubble-icon { width: 80px; height: 80px; border-radius: 50%; background: var(--white); border: 2px solid var(--border-color); display: flex; justify-content: center; align-items: center; font-size: 30px; color: var(--primary-color); box-shadow: 0 4px 6px rgba(0,0,0,0.05); }
.cat-bubble:hover .cat-bubble-icon { border-color: var(--primary-color); background: var(--bg-color); }
.cat-bubble span { font-weight: bold; font-size: 14px; text-transform: uppercase; }

.banner-container { width: 100%; max-width: 1200px; margin: 20px auto; overflow: hidden; display: flex; justify-content: center; align-items: center; }
.banner-container img { width: 100%; max-height: 400px; object-fit: cover; border-radius: 8px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); display: none; cursor:pointer;}
.banner-container img.active { display: block; animation: fadeBanner 0.5s ease-in-out; }
@keyframes fadeBanner { from { opacity: 0.5; } to { opacity: 1; } }

/* Modais */
.modal-overlay { position: fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,0.6); display:none; justify-content:center; align-items:center; z-index:2000; overflow-y:auto; padding: 20px; }
.modal-content { background: var(--white); padding: 30px; border-radius: 12px; width: 100%; max-width: 400px; margin: auto; position: relative; }
.modal-header { display:flex; justify-content:space-between; margin-bottom: 20px; border-bottom: 1px solid var(--border-color); padding-bottom: 10px;}
.close-btn { background:none; border:none; font-size:24px; cursor:pointer; color: #94a3b8; }
.close-btn:hover { color: #ef4444; }
.modal-body input { width: 100%; padding: 12px; margin-bottom: 15px; border: 1px solid var(--border-color); border-radius: 6px; }
.modal-body button { width: 100%; margin-bottom: 10px; }

/* MODAL DE PRODUTO GIGANTE */
.produto-detalhe-container { max-width: 1000px; padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.close-modal-flutuante { position: absolute; top: 15px; right: 20px; font-size: 28px; background: white; border: none; border-radius: 50%; width: 40px; height: 40px; cursor: pointer; z-index: 10; box-shadow: 0 2px 5px rgba(0,0,0,0.2); display: flex; justify-content: center; align-items: center; color: #333;}
.produto-detalhe-grid { display: grid; grid-template-columns: 1fr 1fr; }
.prod-modal-img-container { background: #f1f5f9; padding: 40px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.prod-modal-img-main { width: 100%; max-height: 400px; object-fit: contain; border-radius: 8px; margin-bottom: 20px; background: white; padding: 10px; box-shadow: 0 4px 10px rgba(0,0,0,0.05);}
.prod-modal-thumbs { display: flex; gap: 10px; }
.prod-modal-thumbs img { width: 60px; height: 60px; object-fit: cover; border-radius: 6px; border: 2px solid transparent; cursor: pointer; transition: 0.2s;}
.prod-modal-thumbs img:hover, .prod-modal-thumbs img.active { border-color: var(--primary-color); }

.prod-modal-info { padding: 40px; display: flex; flex-direction: column; overflow-y: auto; max-height: 80vh; }
.prod-modal-title { font-size: 28px; color: var(--primary-color); margin-bottom: 10px; }
.prod-modal-price { font-size: 32px; font-weight: 800; color: #1e293b; margin-bottom: 20px; }
.prod-modal-badges { display: flex; gap: 10px; margin-bottom: 20px; }
.badge { padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: bold; text-transform: uppercase; color: white;}
.badge-lancamento { background: #3b82f6; }
.badge-oferta { background: #ef4444; }
.badge-encomenda { background: var(--secondary-color); color: #333; }

.prod-modal-desc { font-size: 15px; color: #475569; line-height: 1.6; margin-bottom: 20px; }
.prod-modal-accordion { border: 1px solid var(--border-color); border-radius: 8px; margin-bottom: 20px; overflow: hidden; }
.accordion-header { background: #f8fafc; padding: 15px; font-weight: bold; color: var(--primary-color); border-bottom: 1px solid var(--border-color); }
.accordion-body { padding: 15px; font-size: 14px; color: #64748b; white-space: pre-line; background: white;}

.prod-modal-variations { margin-bottom: 20px; background: #f8fafc; padding: 20px; border-radius: 8px; border: 1px solid var(--border-color);}
.prod-modal-variations label { font-weight: bold; font-size: 14px; margin-bottom: 5px; display: block; color: var(--primary-color);}
.prod-modal-variations select { width: 100%; padding: 12px; border-radius: 6px; border: 1px solid #cbd5e1; font-size: 15px; outline: none; }
.prod-modal-buy-btn { width: 100%; padding: 18px; font-size: 18px; text-transform: uppercase; letter-spacing: 1px; border-radius: 8px; background: #22c55e;}
.prod-modal-buy-btn:hover { background: #16a34a; }

@media (max-width: 768px) { .produto-detalhe-grid { grid-template-columns: 1fr; } }

/* Cards Vitrine */
.main-store-content { max-width: 1200px; margin: 40px auto; padding: 0 20px; }
.category-section { margin-bottom: 50px; }
.category-section h2 { font-size: 22px; color: var(--primary-color); margin-bottom: 20px; display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 2px solid var(--border-color); padding-bottom: 10px;}
.category-section h2 span { border-bottom: 3px solid var(--secondary-color); padding-bottom: 7px; margin-bottom: -10px; }
.carousel-scroller { display: flex; overflow-x: auto; gap: 20px; padding-bottom: 15px; scroll-snap-type: x mandatory; scroll-behavior: smooth; }
.carousel-scroller::-webkit-scrollbar { height: 8px; }
.carousel-scroller::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 4px;}
.carousel-scroller::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
.product-card { flex: 0 0 260px; scroll-snap-align: start; background: var(--white); border: 1px solid var(--border-color); border-radius: 8px; padding: 15px; display:flex; flex-direction:column; transition: transform 0.2s, box-shadow 0.2s; cursor: pointer; position: relative;}
.product-card:hover { transform: translateY(-5px); box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); }
.product-card img { width: 100%; height: 200px; object-fit: cover; border-radius: 4px; margin-bottom: 15px; }
.product-card h3 { font-size: 15px; margin-bottom: 5px; color: #1e293b; flex: 1;}
.card-badges { position: absolute; top: 25px; left: 25px; display: flex; flex-direction: column; gap: 5px; }

/* Sidebar Carrinho */
.cart-overlay { position: fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,0.5); display:none; z-index:999; }
.cart-sidebar { position: fixed; top:0; right:-400px; width:100%; max-width:400px; height:100%; background:var(--white); z-index:1000; transition: right 0.3s ease; display:flex; flex-direction:column; box-shadow: -5px 0 15px rgba(0,0,0,0.1);}
.cart-sidebar.active { right:0; }
.cart-overlay.active { display:block; }
.cart-header { background: var(--primary-color); color: var(--white); padding: 20px; display:flex; justify-content:space-between; }
.cart-header button { background:none; border:none; color:var(--white); font-size:20px; cursor:pointer;}
.cart-items { flex:1; padding:20px; overflow-y:auto; }
.cart-item { display:flex; justify-content:space-between; margin-bottom: 15px; border-bottom: 1px solid var(--border-color); padding-bottom: 10px;}
.freight-calculator { padding: 15px 20px; border-top: 1px solid var(--border-color); display:flex; gap:10px; background: #f8fafc;}
.freight-calculator input { flex:1; padding:10px; border:1px solid var(--border-color); border-radius: 4px;}
.freight-calculator button { background: #475569; color:white; border:none; padding:10px 15px; cursor:pointer; border-radius: 4px; font-weight: bold;}
.cart-footer { padding: 20px; background: var(--white); border-top: 1px solid var(--border-color); }
.cart-total { display:flex; justify-content:space-between; font-weight:bold; font-size:18px; margin-bottom:15px; color: var(--primary-color); }
.checkout-btn { width: 100%; background: #22c55e; color: white; border: none; padding: 15px; font-weight: bold; cursor: pointer; border-radius:6px; font-size: 16px;}

/* RODAPÉ DINÂMICO */
.main-footer { background-color: var(--primary-color); color: white; margin-top: 50px; padding-top: 40px; }
.footer-container { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 40px; padding: 0 20px 40px; }
.footer-logo { font-size: 24px; font-weight: 800; color: var(--secondary-color); }
.footer-col h3 { font-size: 16px; margin-bottom: 20px; border-bottom: 2px solid rgba(255,255,255,0.1); padding-bottom: 10px; color: var(--white);}
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul li a { color: #cbd5e1; text-decoration: none; font-size: 14px; transition: color 0.2s; }
.footer-col ul li a:hover { color: var(--secondary-color); }
.security-icons { font-size: 16px; align-items: center; }
.security-icons i { font-size: 20px; color: #22c55e; }
.footer-bottom { background-color: rgba(0,0,0,0.3); padding: 20px; text-align: center; font-size: 13px; color: #cbd5e1; }

/* BOTÃO FLUTUANTE WHATSAPP */
.whatsapp-float { position: fixed; bottom: 25px; right: 25px; background-color: #25D366; color: white; border-radius: 50%; width: 60px; height: 60px; display: flex; justify-content: center; align-items: center; font-size: 32px; box-shadow: 0 4px 15px rgba(0,0,0,0.3); z-index: 1000; text-decoration: none; transition: transform 0.2s;}
.whatsapp-float:hover { transform: scale(1.1); color: white; }

/* RESPONSIVIDADE E MENU HAMBURGER (STORE & ADMIN) */
.mobile-menu-toggle { display: none; background: none; border: none; font-size: 24px; color: var(--primary-color); cursor: pointer; margin-right: 15px; }

@media (max-width: 768px) {
    /* STORE: Header e Menu */
    .mobile-menu-toggle { display: block; }
    .header-container { flex-wrap: wrap; }
    .search-bar-modern { min-width: 100%; order: 3; margin: 15px 0 0 0 !important; }
    .nav-list { display: none; flex-direction: column; width: 100%; background: var(--primary-color); }
    .nav-list.active { display: flex; }
    .nav-list > li > a { border-bottom: 1px solid rgba(255,255,255,0.1); padding: 15px !important; }
    .dropdown-content { position: relative; min-width: 100%; box-shadow: none; border-radius: 0; }
    
    /* ADMIN: Sidebar e Layout */
    .dashboard-layout { display: flex; flex-direction: column; }
    .sidebar { position: fixed; left: -250px; z-index: 3000; height: 100vh; transition: left 0.3s ease; box-shadow: 2px 0 10px rgba(0,0,0,0.1); }
    .sidebar.active { left: 0; }
    .admin-mobile-topbar { display: flex !important; }
    .main-content .topbar { display: none; }
    .main-content { margin-left: 0 !important; width: 100% !important; }
    
    /* Grids */
    .admin-layout-grid { grid-template-columns: 1fr !important; }
    .produto-detalhe-grid { grid-template-columns: 1fr !important; }
    
    /* Tabelas Overflow */
    .table-container { overflow-x: auto; }
}
