/* ============================================================
   MISS MAGNOLIA — Storefront Design System
   Shared styles for all front-end pages
   ============================================================ */

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: hidden; }

:root {
    --primary: #c5a059;
    --text: #1a1a1a;
    --text-light: #666;
    --bg: #ffffff;
    --bg-alt: #f7f7f5;
    --surface: #fff;
    --border: #e8e8e8;
    --max-w: 1360px;
    --pad: clamp(16px, 4vw, 50px);
}

[data-theme="dark"] {
    --text: #e8e8e8;
    --text-light: #999;
    --bg: #121212;
    --bg-alt: #1a1a1a;
    --surface: #1e1e1e;
    --border: #333;
}

body {
    font-family: 'Montserrat', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
main { flex: 1 0 auto; }
a { text-decoration: none; color: inherit; transition: all 0.3s; }
button { cursor: pointer; font-family: inherit; background: none; border: none; }
img { display: block; max-width: 100%; }
input, select, textarea { font-family: inherit; }

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--pad); }

/* ===== TOPBAR ===== */
.topbar {
    background: var(--text);
    color: #fff;
    text-align: center;
    padding: 9px 16px;
    font-size: 0.7rem;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    font-weight: 500;
}
.topbar span { color: var(--primary); }

/* ===== HEADER ===== */
header {
    background: var(--bg);
    position: sticky;
    top: 0;
    z-index: 999;
    border-bottom: 1px solid var(--border);
    transition: box-shadow 0.3s;
}
header.shadow { box-shadow: 0 4px 20px rgba(0,0,0,.06); }

nav.main-nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    height: 90px;
}

.nav-left { display: flex; align-items: center; gap: 32px; }
.hamburger { display: none; font-size: 1.3rem; color: var(--text); }

.nav-links { display: flex; gap: 28px; list-style: none; }
.nav-links > li { position: relative; }
.nav-links > li > a {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1.8px;
    font-weight: 500;
    padding: 33px 0;
    display: block;
}
.nav-links > li > a:hover { color: var(--primary); }

.dropdown {
    position: absolute;
    top: 100%;
    left: -16px;
    background: var(--bg);
    min-width: 190px;
    border: 1px solid var(--border);
    border-top: 2px solid var(--primary);
    padding: 12px 0;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.25s;
    z-index: 1000;
}
.nav-links > li:hover .dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown li a { display: block; padding: 9px 20px; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-light); }
.dropdown li a:hover { color: var(--primary); background: var(--bg-alt); }

.nav-logo-wrap { text-align: center; }
.nav-logo {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.2rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 5px;
    color: var(--text);
    white-space: nowrap;
}
.nav-logo:hover { color: var(--primary); }

.nav-right { display: flex; justify-content: flex-end; align-items: center; gap: 22px; }
.nav-icon { font-size: 1.1rem; color: var(--text); position: relative; }
.nav-icon:hover { color: var(--primary); }
.theme-toggle { font-size: 1rem; }

.cart-badge {
    position: absolute;
    top: -6px;
    right: -8px;
    background: var(--primary);
    color: #fff;
    font-size: 0.62rem;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
}

/* ===== MOBILE DRAWER ===== */
.mobile-drawer {
    position: fixed;
    top: 0;
    left: -100%;
    width: min(320px, 85vw);
    height: 100vh;
    background: var(--bg);
    z-index: 2000;
    padding: 30px 24px;
    overflow-y: auto;
    transition: left 0.35s cubic-bezier(.4,0,.2,1);
    border-right: 1px solid var(--border);
}
.mobile-drawer.open { left: 0; }
.drawer-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 1999; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.drawer-overlay.open { opacity: 1; pointer-events: auto; }
.drawer-logo { font-family: 'Cormorant Garamond', serif; font-size: 1.6rem; text-transform: uppercase; letter-spacing: 3px; color: var(--text); margin-bottom: 30px; }
.drawer-close { position: absolute; top: 20px; right: 20px; font-size: 1.3rem; color: var(--text-light); }
.drawer-link { display: block; padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1.5px; font-weight: 500; color: var(--text); }
.drawer-link:hover { color: var(--primary); }

/* ===== PRODUCT CARD (shared) ===== */
.product-card { text-align: center; }
.product-img-wrapper { position: relative; height: 380px; overflow: hidden; background: var(--bg-alt); margin-bottom: 20px; border-radius: 12px; }
.product-img { width: 100%; height: 100%; object-fit: cover; transition: opacity 0.5s; }
.product-img-hover { position: absolute; inset: 0; object-fit: cover; opacity: 0; transition: opacity 0.5s; transform: scale(1.03); }
.product-card:hover .product-img-hover { opacity: 1; }
.product-card:hover .product-img-main { opacity: 0; }

.product-action-group {
    position: absolute;
    bottom: -100px;
    left: 0;
    right: 0;
    padding: 10px 12px;
    background: rgba(255,255,255,.97);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: bottom 0.35s;
}
.product-card:hover .product-action-group { bottom: 0; }

.btn-card {
    display: block; width: 100%; padding: 10px;
    font-size: 0.68rem; text-transform: uppercase; letter-spacing: 1.5px;
    font-weight: 600; border: 1px solid transparent; transition: all 0.25s;
    font-family: inherit; cursor: pointer;
}
.btn-card-outline { border-color: var(--border); color: var(--text-light); background: none; }
.btn-card-outline:hover { border-color: var(--text); color: var(--text); }
.btn-card-primary { background: var(--text); color: #fff; }
.btn-card-primary:hover { background: var(--primary); }
.btn-card-whatsapp { background: #25d366; color: #fff; }
.btn-card-whatsapp:hover { background: #1db954; }

.product-category { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 2px; color: #999; display: block; margin-bottom: 6px; }
.product-title { font-family: 'Cormorant Garamond', serif; font-size: 1.1rem; letter-spacing: 0.5px; font-weight: 500; margin-bottom: 8px; }
.product-title a { color: var(--text); }
.product-title a:hover { color: var(--primary); }
.product-price-old { font-size: 0.78rem; color: #aaa; text-decoration: line-through; }
.product-price { font-size: 1.05rem; color: var(--text); font-weight: 600; }
.product-installments { font-size: 0.72rem; color: var(--text-light); margin-top: 2px; }
.product-promo-badge {
    position: absolute; top: 12px; left: 12px;
    background: var(--primary); color: #fff;
    font-size: 0.62rem; padding: 4px 10px; font-weight: 700; text-transform: uppercase;
    z-index: 2;
}

/* ===== FOOTER ===== */
/* ===== PRÉ-FOOTER (FAIXA DE CONFIANÇA) ===== */
.footer-trust { background: var(--bg-alt); padding: 50px 0; border-bottom: 1px solid var(--border); }
.footer-trust-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.footer-trust-item { display: flex; align-items: center; gap: 16px; }
.footer-trust-icon { width: 50px; height: 50px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,.04); flex-shrink: 0; }
.footer-trust-item strong { display: block; font-size: 0.82rem; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.footer-trust-item span { font-size: 0.75rem; color: var(--text-light); }
@media (max-width: 768px) { .footer-trust-grid { grid-template-columns: 1fr; gap: 20px; } }

footer { background: #111; color: #fff; padding: 75px 0 0; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 40px; margin-bottom: 50px; }
.footer-logo { font-family: 'Cormorant Garamond', serif; font-size: 1.9rem; text-transform: uppercase; letter-spacing: 4px; color: var(--primary); margin-bottom: 18px; display: block; }
.footer-about { color: #888; font-size: 0.82rem; line-height: 1.8; margin-bottom: 20px; }
.footer-social { display: flex; gap: 14px; }
.footer-social a { width: 36px; height: 36px; background: #222; color: #888; display: flex; align-items: center; justify-content: center; border-radius: 50%; font-size: 0.9rem; transition: all 0.3s; }
.footer-social a:hover { background: var(--primary); color: #fff; }
.footer-col-title { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 2px; color: var(--primary); font-weight: 600; margin-bottom: 20px; }
.footer-col-links { list-style: none; }
.footer-col-links li { margin-bottom: 10px; }
.footer-col-links a { color: #888; font-size: 0.82rem; transition: color 0.3s; }
.footer-col-links a:hover { color: #fff; }
.newsletter-form { display: flex; margin-top: 14px; }
.newsletter-form input { flex: 1; background: #1e1e1e; border: 1px solid #333; color: #fff; padding: 11px 14px; font-family: inherit; font-size: 0.82rem; outline: none; }
.newsletter-form input::placeholder { color: #666; }
.newsletter-form input:focus { border-color: var(--primary); }
.newsletter-form button { background: var(--primary); color: #111; padding: 0 16px; font-weight: 700; font-size: 0.85rem; transition: opacity 0.3s; }
.newsletter-form button:hover { opacity: 0.85; }
.footer-bottom { border-top: 1px solid #222; padding: 20px var(--pad); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.5rem; color: #555; font-size: 0.72rem; letter-spacing: 0.5px; }
.footer-bottom span { color: #444; }
.footer-bottom-links { display: flex; align-items: center; gap: 0.5rem; }
.footer-bottom-links a { color: #666; transition: color 0.2s; text-decoration: none; }
.footer-bottom-links a:hover { color: var(--primary); }
.footer-bottom-links .sep { color: #333; font-size: 0.6rem; }

/* ===== WHATSAPP FLOAT ===== */
.wpp-float {
    position: fixed; bottom: 32px; right: 32px;
    width: 56px; height: 56px;
    background: #25d366; color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 20px rgba(37,211,102,.4);
    z-index: 500;
    transition: transform 0.3s;
}
.wpp-float:hover { transform: scale(1.1); color: #fff; }

/* ===== TOAST ===== */
.toast-cart {
    position: fixed; bottom: 100px; right: 32px;
    background: var(--text); color: #fff;
    padding: 12px 20px; border-radius: 6px;
    font-size: 0.8rem; font-weight: 500;
    z-index: 600; opacity: 0; transform: translateY(10px);
    transition: all 0.35s; pointer-events: none;
}
.toast-cart.show { opacity: 1; transform: translateY(0); }

/* ===== SWIPER OVERRIDES ===== */
.swiper-pagination-bullet { background: rgba(255,255,255,.6); opacity: 1; width: 8px; height: 8px; }
.swiper-pagination-bullet-active { background: #fff; transform: scale(1.4); }
.swiper-button-prev, .swiper-button-next { color: rgba(255,255,255,.7); opacity: 0; transition: opacity 0.3s; }
.hero-slider-wrap:hover .swiper-button-prev,
.hero-slider-wrap:hover .swiper-button-next { opacity: 1; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .nav-links { display: none; }
    .hamburger { display: flex; }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .products-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
    .product-img-wrapper { height: 280px; border-radius: 10px; }
}
@media (max-width: 600px) {
    .products-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
    .product-img-wrapper { height: 250px; border-radius: 8px; }
    .product-action-group { display: none; }
    .footer-grid { grid-template-columns: 1fr; }
    nav.main-nav { grid-template-columns: 1fr auto 1fr; }
    .nav-right { gap: 10px; }
    .nav-logo-wrap { display:flex;justify-content:center; }
    .nav-logo-wrap img { max-height: 32px; }
    .nav-logo { font-size: 1.3rem; letter-spacing: 3px; }
    .hamburger { margin-right: 0; }
    .nav-right { gap: 14px; }
}

/* ===== SEARCH TOGGLE ===== */
.header-search {
    position: relative;
    display: flex;
    align-items: center;
}
.search-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
}
.search-toggle-btn:hover {
    color: var(--primary);
}
.search-expand {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 320px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0,0,0,.12);
    z-index: 2000;
    display: none;
    overflow: hidden;
    animation: acFadeIn 0.2s ease;
}
.search-expand.open {
    display: block;
}
.search-expand form {
    display: flex;
    align-items: center;
    padding: 8px;
    gap: 6px;
    border-bottom: 1px solid var(--border);
}
.search-expand form input {
    flex: 1;
    border: none;
    background: var(--bg-alt);
    padding: 10px 12px;
    font-size: 0.85rem;
    color: var(--text);
    outline: none;
    border-radius: 6px;
    font-family: inherit;
}
.search-expand form input::placeholder {
    color: var(--text-light);
}
.search-expand form button {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--text);
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s;
    flex-shrink: 0;
}
.search-expand form button:hover {
    background: var(--primary);
}

@media (max-width: 600px) {
    .search-expand {
        position: fixed;
        top: 80px;
        left: 10px;
        right: 10px;
        width: auto;
    }
}

/* ===== AUTOCOMPLETE DROPDOWN ===== */
.ac-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: none;
    z-index: 2000;
    display: none;
    animation: acFadeIn 0.15s ease;
}
.ac-dropdown.open { display: block; }
@keyframes acFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.ac-item {
    display: block;
    padding: 10px 14px;
    text-decoration: none;
    color: var(--text);
    font-size: 0.85rem;
    transition: background 0.15s;
    border-bottom: 1px solid var(--border);
}
.ac-item:last-child { border-bottom: none; }
.ac-item:hover { background: var(--bg-alt); }
.ac-item-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.95rem;
    font-weight: 500;
}
.ac-empty {
    padding: 16px;
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-light);
}
.ac-footer {
    display: block;
    padding: 10px 14px;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary);
    border-top: 1px solid var(--border);
    background: var(--bg-alt);
    text-decoration: none;
}
.ac-footer:hover { background: var(--border); }

/* ===== THEME TOGGLE ===== */
.theme-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--bg);
    color: var(--text);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 4px;
}
.theme-toggle-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
