:root {
    --primary: #c63735;
    --dark-bg: #1a1a1a;
    --footer-bg: #111111;
    --text-main: #333;
    --text-muted: #666;
    --white: #ffffff;
    --transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }

body { background: #fafafa; color: var(--text-main); overflow-x: hidden; }

/* Animações Base */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
.content-fade-in { animation: fadeInUp 1s ease-out; }

/* =========================================
   HEADER MODERNO E MENU LATERAL
   ========================================= */
.main-header {
    background: var(--white);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
}
.header-container { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; padding: 0 20px; }
.burger-menu { cursor: pointer; display: flex; flex-direction: column; gap: 5px; }
.burger-menu span { width: 25px; height: 3px; background: var(--dark-bg); transition: var(--transition); border-radius: 2px; }
.logo h2 { font-weight: 800; letter-spacing: -1px; margin: 0; }
.logo span { color: var(--primary); }
.header-actions { display: flex; align-items: center; gap: 20px; }

/* Botões do Header */
.login-trigger { background: none; border: 1px solid #ddd; padding: 8px 15px; border-radius: 20px; cursor: pointer; transition: 0.3s; font-weight: bold; }
.login-trigger:hover { border-color: var(--primary); color: var(--primary); }
.logout-btn { background: #eee; border: none; padding: 6px 12px; border-radius: 4px; font-size: 0.8rem; cursor: pointer; margin-left: 10px; }
.logout-btn:hover { background: #ff4444; color: white; }
.cart-trigger { cursor: pointer; position: relative; font-size: 1.2rem; }
#cart-count { position: absolute; top: -10px; right: -10px; background: var(--primary); color: white; border-radius: 50%; padding: 2px 6px; font-size: 0.7rem; font-weight: bold; }

/* Estilos do Logótipo (Forçado) */
.logo-img { height: 45px !important; width: auto !important; object-fit: contain !important; transition: transform 0.3s ease; }
.logo:hover .logo-img { transform: scale(1.05); }

/* Menu Lateral (Overlay) */
.side-menu {
    position: fixed; top: 0; left: -100%; width: 320px; height: 100vh;
    background: var(--dark-bg); z-index: 1000; transition: var(--transition);
    padding: 60px 40px; box-shadow: 5px 0 15px rgba(0,0,0,0.5);
}
.side-menu.active { left: 0; }
.close-btn { position: absolute; top: 20px; right: 20px; font-size: 35px; color: white; background: none; border: none; cursor: pointer; }
.logo-menu { font-size: 1.5rem; font-weight: bold; color: white; margin-bottom: 40px; }
.logo-menu span { color: var(--primary); }
.menu-content ul { list-style: none; }
.menu-content ul li { margin-bottom: 20px; }
.menu-content ul li a { color: #ccc; text-decoration: none; font-size: 1.1rem; transition: 0.3s; display: block; }
.menu-content ul li a:hover { color: var(--primary); padding-left: 10px; }

/* =========================================
   HERO SECTION
   ========================================= */
.hero-modern {
    background-image: url('img/fundojolda.png');
    height: 65vh; 
    min-height: 100px; 
    background-position: center; 
    background-size: cover;
    background-repeat: center;
    display: flex;
    align-items: center; 
}
.hero-overlay { background: linear-gradient(to right, rgba(0,0,0,0.85), rgba(0,0,0,0.2)); height: 100%; width: 100%; display: flex; align-items: center; padding: 0 10%; }
.hero-text { color: white; max-width: 600px; }
.hero-text h1 { font-size: 3rem; margin: 15px 0; line-height: 1.2; }
.hero-text p { font-size: 1.1rem; color: #ddd; margin-bottom: 20px; }
.badge { background: var(--primary); padding: 5px 12px; font-size: 0.8rem; border-radius: 4px; font-weight: bold; text-transform: uppercase; }
.btn-primary { display: inline-block; background: var(--primary); color: white; padding: 15px 30px; text-decoration: none; border-radius: 4px; font-weight: bold; transition: 0.3s; cursor: pointer; text-align: center; }
.btn-primary:hover { filter: brightness(1.1); transform: translateY(-2px); }

/* =========================================
   CARROSSEL DE MARCAS
   ========================================= */
.brands-slider {
    background: #ffffff;
    padding: 40px 0;
    overflow: hidden; 
    position: relative;
    width: 100%;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    display: block;
}
.slider-track { display: flex; flex-direction: row !important; flex-wrap: nowrap !important; width: max-content; }
.slide-group { display: flex; flex-direction: row !important; flex-wrap: nowrap !important; flex-shrink: 0; align-items: center; animation: scrollBrands 25s linear infinite; }
.brands-slider:hover .slide-group { animation-play-state: paused; }
.slide { display: flex; justify-content: center; align-items: center; width: 200px; padding: 0 15px; opacity: 0.6; transition: opacity 0.3s ease; }
.slide:hover { opacity: 1; }
.slide h3 { margin: 0; font-size: 1.5rem; color: #333; font-weight: bold; }
@keyframes scrollBrands { 0% { transform: translateX(0); } 100% { transform: translateX(-100%); } }

/* =========================================
   CARROSSEL DE PROMOÇÕES (HORIZONTAL FORÇADO)
   ========================================= */
.promo-carousel {
    display: flex !important; 
    flex-direction: row !important; 
    flex-wrap: nowrap !important; 
    overflow-x: auto !important;
    gap: 20px;
    padding-bottom: 25px; 
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch; 
}
.promo-carousel::-webkit-scrollbar { height: 8px; }
.promo-carousel::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 10px; }
.promo-carousel::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 10px; }
.promo-carousel .card { min-width: 260px !important; max-width: 260px !important; flex: 0 0 auto !important; scroll-snap-align: start; margin-bottom: 5px; }

/* Setas Flutuantes do Carrossel */
.promo-arrow {
    position: absolute;
    top: 40%;
    transform: translateY(-50%);
    width: 45px;
    height: 45px;
    background: white;
    color: var(--dark-bg);
    border: 1px solid #eee;
    border-radius: 50%;
    cursor: pointer;
    z-index: 20;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    font-size: 1.2rem;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.promo-arrow:hover { background: var(--primary); color: white; border-color: var(--primary); }
.arrow-left { left: -20px; }
.arrow-right { right: -20px; }

/* =========================================
   GRELHA DE PRODUTOS NORMAIS
   ========================================= */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px 60px 20px; }
.section-title { margin-bottom: 40px; border-left: 4px solid var(--primary); padding-left: 15px; }
.section-title h2 { font-size: 2rem; color: var(--dark-bg); }

.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 30px; }
.card { background: white; border: 1px solid #eee; padding: 20px; border-radius: 8px; transition: var(--transition); position: relative; cursor: pointer; }
.card:hover { box-shadow: 0 15px 30px rgba(0,0,0,0.1); border-color: transparent; transform: translateY(-5px); }
.card img { width: 100%; height: 180px; object-fit: contain; margin-bottom: 15px; transition: 0.3s; }
.card:hover img { transform: scale(1.05); }
.card h4 { font-size: 1.1rem; color: var(--dark-bg); margin-bottom: 10px; height: 45px; overflow: hidden; }
.price-row { display: flex; justify-content: space-between; align-items: center; margin-top: 15px; border-top: 1px solid #eee; padding-top: 15px; }
.price { font-weight: bold; font-size: 1.3rem; color: var(--dark-bg); }
.add-btn { background: #f4f4f4; border: none; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; color: var(--dark-bg); transition: 0.3s; font-size: 1rem; }
.card:hover .add-btn { background: var(--primary); color: white; }

/* =========================================
   ESTILOS DE MODAIS (JANELAS) E CARRINHO
   ========================================= */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.7); display: flex; align-items: flex-start; justify-content: center; z-index: 2000; padding: 20px; overflow-y: auto; }
.hidden { display: none !important; }
.modal-card { background: white; width: 100%; max-width: 500px; border-radius: 12px; padding: 30px; position: relative; animation: fadeInUp 0.3s; margin: auto; }
.close-modal { position: absolute; top: 15px; right: 20px; font-size: 1.8rem; background: rgba(255,255,255,0.9); width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: none; cursor: pointer; color: #333; z-index: 50; box-shadow: 0 2px 10px rgba(0,0,0,0.1); transition: 0.3s; }
.close-modal:hover { color: red; transform: scale(1.1); }

/* Modal Auth (Login) */
.auth-card { max-width: 400px !important; text-align: center; }
.auth-card input { width: 100%; padding: 12px 15px; margin: 10px 0; border: 1px solid #ddd; border-radius: 4px; font-size: 1rem; outline: none; }
.auth-card input:focus { border-color: var(--primary); }
#auth-switch { margin-top: 20px; font-size: 0.9rem; cursor: pointer; color: var(--text-muted); transition: 0.3s; }
#auth-switch:hover { color: var(--primary); text-decoration: underline; }

/* Modal Detalhe de Produto */
.product-detail { max-width: 800px !important; padding: 40px; max-height: 90vh; overflow-y: auto; }
.detail-container { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.detail-container img { width: 100%; max-height: 350px; object-fit: contain; background: #f9f9f9; border-radius: 8px; padding: 20px; }
.detail-info h2 { font-size: 2rem; margin-bottom: 5px; color: var(--dark-bg); }
.detail-info .ref { color: #888; font-size: 0.85rem; margin-bottom: 15px; font-weight: bold; }
.detail-info .desc { line-height: 1.6; color: #555; margin-bottom: 25px; }
.detail-info .price-big { font-size: 2.5rem; font-weight: 800; color: var(--dark-bg); margin-bottom: 20px; }

/* Modal Carrinho */
.modal-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #eee; padding-bottom: 15px; margin-bottom: 15px; }
.cart-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid #f4f4f4; }
.remove-btn { background: #ffebee; border: none; color: #f44336; width: 25px; height: 25px; border-radius: 50%; cursor: pointer; font-weight: bold; margin-left: 10px; }
.whatsapp-btn { background: #25D366; color: white; border: none; width: 100%; padding: 15px; border-radius: 8px; font-weight: bold; font-size: 1.1rem; cursor: pointer; transition: 0.3s; }
.whatsapp-btn:hover { background: #1ebc5a; }

/* =========================================
   CATÁLOGOS PDF
   ========================================= */
.catalogos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 30px; margin-bottom: 50px; }
.cat-card { background: white; border: 1px solid #eee; border-radius: 8px; overflow: hidden; transition: var(--transition); text-align: center; cursor: pointer; text-decoration: none; display: block; }
.cat-card:hover { transform: translateY(-5px); box-shadow: 0 15px 30px rgba(0,0,0,0.1); border-color: transparent; }
.cat-card img { width: 100%; height: 250px; object-fit: cover; border-bottom: 3px solid var(--primary); }
.cat-info { padding: 20px; }
.cat-info h4 { font-size: 1.1rem; color: var(--dark-bg); margin-bottom: 5px; }
.cat-info p { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 15px; height: 35px; overflow: hidden;}
.cat-btn { background: #f4f4f4; color: var(--dark-bg); padding: 8px 15px; border-radius: 4px; font-weight: bold; font-size: 0.9rem; transition: 0.3s; display: inline-block; }
.cat-card:hover .cat-btn { background: var(--primary); color: white; }

/* =========================================
   NOTIFICAÇÕES FLUTUANTES E WHATSAPP
   ========================================= */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 10000; display: flex; flex-direction: column; gap: 15px; }
.toast { min-width: 250px; max-width: 350px; background: #fff; color: #333; padding: 15px 20px; border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.15); display: flex; align-items: center; gap: 15px; font-weight: 500; font-size: 0.95rem; transform: translateX(120%); opacity: 0; transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55); }
.toast.show { transform: translateX(0); opacity: 1; }
.toast.success { border-left: 5px solid #2ecc71; }
.toast.error { border-left: 5px solid #e74c3c; }
.toast.info { border-left: 5px solid var(--primary); }
.toast i { font-size: 1.3rem; }
.toast.success i { color: #2ecc71; }
.toast.error i { color: #e74c3c; }
.toast.info i { color: var(--primary); }

.whatsapp-float { position: fixed; width: 60px; height: 60px; bottom: 25px; right: 25px; background-color: #25d366; color: #FFF; border-radius: 50px; text-align: center; font-size: 35px; box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.2); z-index: 9000; transition: all 0.3s ease; display: flex; align-items: center; justify-content: center; text-decoration: none; }
.whatsapp-float:hover { background-color: #1ebe57; transform: scale(1.1); color: white; }

/* =========================================
   FOOTER (RODAPÉ)
   ========================================= */
.jofafe-footer { background: var(--footer-bg); color: #999; padding: 70px 0 20px 0; }
.footer-top { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 40px; padding: 0 20px 50px 20px; }
.footer-col h4 { color: white; margin-bottom: 20px; text-transform: uppercase; font-size: 0.95rem; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul li a { color: #999; text-decoration: none; transition: 0.3s; }
.footer-col ul li a:hover { color: var(--primary); padding-left: 5px; }
.social-links { display: flex; gap: 10px; margin-top: 15px; }
.social-links a { width: 35px; height: 35px; background: #222; display: flex; align-items: center; justify-content: center; border-radius: 50%; color: white; text-decoration: none; transition: 0.3s; }
.social-links a:hover { background: var(--primary); }
.newsletter-box { display: flex; margin-top: 15px; }
.newsletter-box input { background: #222; border: none; padding: 12px; color: white; width: 100%; outline: none; }
.newsletter-box button { background: var(--primary); border: none; padding: 12px 15px; color: white; cursor: pointer; }
.footer-bottom { border-top: 1px solid #222; text-align: center; padding-top: 20px; font-size: 0.85rem; }

/* =========================================
   RESPONSIVIDADE (TELEMÓVEIS)
   ========================================= */
@media (max-width: 768px) {
    .hero-text h1 { font-size: 2.2rem; }
    /* ... os outros códigos de telemóvel que já tinhas ... */

    /* Telemóvel - Whatsapp Flutuante */
    .whatsapp-float { width: 50px; height: 50px; bottom: 80px; right: 15px; font-size: 28px; }

    /* =========================================
       GRELHA DE PRODUTOS LADO A LADO NO TELEMÓVEL
       ========================================= */
    .products-grid { 
        grid-template-columns: repeat(2, 1fr) !important; 
        gap: 10px; 
    }
    .products-grid .card { padding: 10px; }
    .products-grid .card img { height: 120px; margin-bottom: 10px; }
    .products-grid .card h4 { font-size: 0.85rem; height: 35px; }
    .products-grid .price { font-size: 1rem; }
    .products-grid .add-btn { width: 32px; height: 32px; font-size: 0.85rem; }
}