/* =====================================================================
   GUAN — vitrine pública (página inicial)
   ===================================================================== */

:root {
    --paper: #f4f6f8;
    --surface: #ffffff;
    --ink: #26313d;
    --ink-soft: #3f4c59;
    --muted: #788493;
    --line: #dfe4ea;
    --accent: #526b86;
    --accent-dark: #3f566d;
    --gold: #b49a62;
    --green: #4f7a63;
    --soft: #edf1f5;
    --shadow-sm: 0 1px 2px rgba(38, 49, 61, .05);
    --shadow: 0 10px 30px rgba(38, 49, 61, .08);
    --radius: 12px;
    --max: 1360px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 14px/1.5 Arial, Helvetica, sans-serif;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; margin: 0; }

a { color: inherit; text-decoration: none; }

img { display: block; max-width: 100%; }

button, input, select { font: inherit; }

/* ------------------------------ Header ------------------------------ */

.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.header-inner {
    max-width: var(--max);
    margin: 0 auto;
    padding: 16px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand { display: inline-flex; align-items: center; gap: 12px; }

.brand-mark {
    width: 42px; height: 42px;
    display: grid; place-items: center;
    background: var(--ink); color: #fff;
    font-family: Georgia, serif; font-size: 22px;
    border-radius: 10px; letter-spacing: .04em;
}

.brand-text strong { display: block; font-family: Georgia, serif; font-size: 20px; letter-spacing: .22em; line-height: 1; }
.brand-text small { display: block; font-size: 9px; letter-spacing: .22em; text-transform: uppercase; color: var(--gold); margin-top: 4px; }

.header-actions { display: flex; align-items: center; gap: 16px; }
.header-note { font-size: 11px; letter-spacing: .06em; color: var(--muted); }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: 1px solid var(--line); background: var(--surface); color: var(--ink);
    border-radius: 8px; padding: 9px 16px; font-size: 12.5px; cursor: pointer;
    transition: background .18s, border-color .18s, transform .12s, box-shadow .18s;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn.whatsapp { background: #1f8f5f; border-color: #1f8f5f; color: #fff; }
.btn.whatsapp:hover { background: #177a50; border-color: #177a50; color: #fff; box-shadow: 0 6px 16px rgba(31, 143, 95, .25); }
.btn.whatsapp svg { width: 16px; height: 16px; fill: currentColor; }
.btn.full { width: 100%; }
.btn.ghost { background: transparent; }

/* ------------------------------ Hero ------------------------------ */

.hero {
    max-width: var(--max);
    margin: 0 auto;
    padding: 30px 28px 26px;
    border-top: 1px solid var(--line);
    background:
        radial-gradient(1200px 220px at 12% -40%, rgba(180, 154, 98, .13), transparent 70%),
        var(--surface);
}

.hero h1 {
    font-size: clamp(17px, 2.8vw, 32px);
    letter-spacing: .03em;
    line-height: 1.2;
}

.hero p {
    margin: 10px 0 0;
    max-width: 620px;
    color: var(--muted);
    font-size: 14px;
}

.fx-chip {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%;
    margin: 0;
    padding: 7px 10px;
    border: 1px solid #e8ddc6;
    background: #faf7ef;
    border-radius: 8px;
    font-size: 11px;
    line-height: 1.35;
    text-align: center;
    color: #7a6533;
}
.fx-chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.fx-chip.stale { border-color: #efd9d5; background: #fbf2f1; color: #8c443f; }
.fx-chip.stale .dot { background: #a4554f; }

/* ------------------------------ Busca ------------------------------ */

.search-bar {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(6px);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
}

.search-inner {
    max-width: var(--max);
    margin: 0 auto;
    padding: 12px 28px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-icon { width: 18px; height: 18px; fill: var(--muted); flex: 0 0 auto; }

.search-inner input {
    flex: 1;
    border: 0;
    background: transparent;
    padding: 8px 0;
    font-size: 15px;
    color: var(--ink);
    outline: none;
    min-width: 0;
}
.search-inner input::placeholder { color: #9aa5b1; }

.search-clear {
    border: 0; background: var(--soft); color: var(--muted);
    width: 26px; height: 26px; border-radius: 50%;
    cursor: pointer; font-size: 15px; line-height: 1;
}
.search-clear:hover { background: #e2e8ee; color: var(--ink); }

/* ------------------------------ Layout ------------------------------ */

.layout {
    max-width: var(--max);
    margin: 0 auto;
    padding: 24px 28px 60px;
    display: grid;
    grid-template-columns: 258px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

/* ------------------------------ Filtros ------------------------------ */

.filters-column {
    position: sticky;
    top: 72px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.filters {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 18px;
}

.filters-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.filters-head h2 { font-size: 17px; letter-spacing: .06em; }
.filters-head-actions { display: flex; align-items: center; gap: 12px; }

.drawer-close {
    display: none;
    align-items: center; justify-content: center;
    width: 34px; height: 34px; padding: 0;
    border: 1px solid var(--line); border-radius: 50%;
    background: var(--surface); color: var(--ink);
    font-size: 20px; line-height: 1; cursor: pointer;
}

.drawer-foot { display: none; }

.filters-backdrop { display: none; }

body.no-scroll { overflow: hidden; }

.filter-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 17px; height: 17px; padding: 0 4px; margin-left: 4px;
    border-radius: 99px; background: var(--gold); color: #fff;
    font-size: 9.5px; font-weight: bold; line-height: 1;
}

.link {
    border: 0; background: none; color: var(--muted);
    font-size: 11px; text-decoration: underline; cursor: pointer; padding: 0;
}
.link:hover { color: var(--accent); }

.filter-group { padding: 14px 0; border-top: 1px solid var(--line); }
.filter-group h3 {
    font-family: Arial, sans-serif;
    font-size: 9.5px; font-weight: bold; letter-spacing: .16em; text-transform: uppercase;
    color: var(--muted); margin-bottom: 9px;
}

.category-list { display: flex; flex-direction: column; gap: 2px; }

.category-btn {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    border: 0; background: transparent; text-align: left;
    padding: 8px 10px; border-radius: 7px; cursor: pointer;
    font-size: 12.5px; color: var(--ink-soft);
    border-left: 3px solid transparent;
}
.category-btn:hover { background: var(--soft); }
.category-btn.active { background: #f3f6f9; border-left-color: var(--gold); color: var(--ink); font-weight: bold; }
.category-btn .count { font-size: 10.5px; color: var(--muted); font-weight: normal; }

.brand-list { display: flex; flex-direction: column; gap: 6px; max-height: 210px; overflow-y: auto; padding-right: 4px; }
.brand-item { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-soft); cursor: pointer; }
.brand-item input { accent-color: var(--accent); width: 14px; height: 14px; }
.brand-item .count { margin-left: auto; font-size: 10.5px; color: var(--muted); }

#price-range {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
    padding: 8px 9px;
    font-size: 12.5px;
    color: var(--ink);
}

.filters-foot { border-top: 1px solid var(--line); padding-top: 14px; }
.filters-foot p { margin: 0 0 8px; font-size: 11.5px; color: var(--muted); }

.skeleton-line {
    height: 28px; border-radius: 6px; margin-bottom: 6px;
    background: linear-gradient(90deg, #eef2f5 25%, #f7f9fb 50%, #eef2f5 75%);
    background-size: 200% 100%;
    animation: shimmer 1.2s infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ------------------------------ Catálogo ------------------------------ */

.catalog { min-width: 0; }

.catalog-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 14px; flex-wrap: wrap; margin-bottom: 16px;
}

.result-count { font-size: 12px; color: var(--muted); }
.result-count strong { color: var(--ink); }

.toolbar-right { display: flex; align-items: center; gap: 8px; }
.sort-label { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
#sort {
    border: 1px solid var(--line); border-radius: 7px; background: #fff;
    padding: 7px 9px; font-size: 12px; color: var(--ink);
}
.filters-toggle { display: none; }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
    gap: 18px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #cfd8e2; }

.card-media {
    position: relative;
    aspect-ratio: 4 / 3;
    background: linear-gradient(135deg, #eef2f6, #e4e9ef);
    overflow: hidden;
}
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card:hover .card-media img { transform: scale(1.04); }

.card-media .placeholder {
    position: absolute; inset: 0;
    display: grid; place-items: center;
    font-family: Georgia, serif; font-size: 34px; color: #a9b5c1;
    letter-spacing: .1em;
}

.card-category {
    position: absolute; left: 10px; top: 10px;
    background: rgba(38, 49, 61, .82);
    color: #fff; font-size: 9px; letter-spacing: .12em; text-transform: uppercase;
    padding: 3px 8px; border-radius: 99px;
    backdrop-filter: blur(2px);
}

.card-body { padding: 14px 15px 15px; display: flex; flex-direction: column; gap: 5px; flex: 1; }

.card-brand { font-size: 9.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); font-weight: bold; }

.card-title { font-size: 14.5px; font-weight: bold; line-height: 1.3; }

.card-desc { font-size: 11.5px; color: var(--muted); line-height: 1.4; min-height: 16px; }

.card-prices { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }

.price-cny { font-family: Georgia, serif; font-size: 20px; letter-spacing: .01em; }
.price-cny small { font-family: Arial, sans-serif; font-size: 9px; letter-spacing: .1em; color: var(--muted); display: block; text-transform: uppercase; margin-top: 2px; }
.price-brl { margin-top: 6px; font-size: 12.5px; color: var(--ink-soft); }
.price-brl span { color: var(--muted); font-size: 11px; }
.price-brl.unavailable { color: var(--muted); font-size: 11px; }

.card .btn { margin-top: 12px; }

/* ------------------------------ Estados ------------------------------ */

.loading, .empty {
    grid-column: 1 / -1;
    padding: 60px 20px;
    text-align: center;
    color: var(--muted);
}
.loading .spinner {
    width: 24px; height: 24px; margin: 0 auto 12px;
    border: 2px solid var(--line); border-top-color: var(--accent);
    border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty strong { display: block; font-family: Georgia, serif; font-size: 20px; color: var(--ink); margin-bottom: 6px; font-weight: 500; }

/* ------------------------------ Footer ------------------------------ */

.site-footer {
    border-top: 1px solid var(--line);
    background: var(--surface);
    padding: 22px 28px;
    display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    font-size: 11.5px; color: var(--muted);
}
.site-footer strong { color: var(--ink); letter-spacing: .14em; }
.site-footer a { color: var(--accent); }
.site-footer .dot { margin: 0 6px; color: #c3ccd6; }

/* ------------------------------ Responsivo ------------------------------ */

@media (max-width: 1020px) {
    .layout { grid-template-columns: 220px minmax(0, 1fr); gap: 18px; }
    .grid { grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); }
}

/* ------------------------------ Smartphones e tablets ------------------------------ */

@media (max-width: 860px) {
    .header-note { display: none; }
    .header-inner, .hero, .search-inner, .layout { padding-left: 16px; padding-right: 16px; }
    .header-inner { padding-top: 12px; padding-bottom: 12px; }
    .hero { padding-top: 20px; padding-bottom: 18px; }
    .hero p { font-size: 12.5px; max-width: 100%; }

    .layout { grid-template-columns: 1fr; gap: 14px; padding-top: 16px; }
    .filters-column { position: static; }
    .filters-toggle { display: inline-flex; }

    /* Filtros viram uma gaveta de tela cheia */
    .filters {
        position: fixed; inset: 0; z-index: 70;
        display: none; margin: 0; border: 0; border-radius: 0;
        padding: 16px 18px calc(96px + env(safe-area-inset-bottom));
        overflow-y: auto; box-shadow: none; background: var(--surface);
    }
    .filters.open { display: block; }
    .filters-head { position: sticky; top: -16px; background: var(--surface); padding: 10px 0 12px; z-index: 2; }
    .drawer-close { display: inline-flex; }

    .drawer-foot {
        display: block;
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
        padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
        background: #fff; border-top: 1px solid var(--line);
    }

    .filters-backdrop {
        display: block; position: fixed; inset: 0; z-index: 65;
        background: rgba(24, 34, 44, .45);
    }
    .filters-backdrop[hidden] { display: none; }
    body.no-scroll { overflow: hidden; }

    .catalog-toolbar { flex-direction: column; align-items: stretch; gap: 8px; }
    .toolbar-right { width: 100%; }
    .toolbar-right .filters-toggle { flex: 0 0 auto; }
    .sort-label { display: none; }
    #sort { flex: 1; }

    /* Alvos de toque maiores nos filtros */
    .filters-head h2 { font-size: 19px; }
    .link { font-size: 12px; padding: 4px 0; }
    .category-btn { padding: 11px 10px; font-size: 13px; }
    .brand-item { min-height: 34px; font-size: 13px; }
    .brand-item input { width: 17px; height: 17px; }
    #price-range { padding: 11px 10px; font-size: 14px; }

    .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .site-footer { padding: 18px 16px; flex-direction: column; gap: 6px; }
}

@media (max-width: 560px) {
    .brand-mark { width: 36px; height: 36px; font-size: 18px; }
    .brand-text strong { font-size: 17px; letter-spacing: .18em; }
    .brand-text small { font-size: 8px; }
    .btn.whatsapp { padding: 8px 11px; font-size: 12px; }
    .search-inner input { font-size: 16px; }
    .hero h1 { font-size: 24px; }

    /* Cartão horizontal: foto à esquerda, conteúdo à direita */
    .grid { grid-template-columns: 1fr; }
    .card { flex-direction: row; }
    .card-media { flex: 0 0 42%; width: 42%; aspect-ratio: auto; min-height: 150px; }
    .card-body { padding: 12px 13px; gap: 3px; }
    .card-title { font-size: 14px; }
    .card-desc {
        font-size: 11px;
        display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    }
    .price-cny { font-size: 17px; }
    .price-brl { font-size: 11.5px; }
    .card .btn { padding: 8px 10px; font-size: 11.5px; margin-top: 6px; min-height: 40px; }
    .card-category { font-size: 8px; left: 8px; top: 8px; padding: 2px 6px; }
    .result-count { font-size: 11.5px; }
    .site-footer { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}
