@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --primary: #1e3a8a;
    --primary-dark: #152963;
    --bg: #f8fafc;
    --surface: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --border: #e2e8f0;
    --wa: #16a34a;
    --wa-hover: #15803d;
    --radius: 18px;
    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 12px 30px rgba(15, 23, 42, 0.09);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 74px;
    padding: 10px 0;
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text);
    flex-shrink: 0;
}
.brand img {
    height: 44px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
}
.brand-name {
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
}

.search-wrap {
    flex: 1;
    max-width: 460px;
    position: relative;
}
.search-wrap svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
}
.search-input {
    width: 100%;
    padding: 11px 16px 11px 42px;
    border: 1.5px solid var(--border);
    border-radius: 999px;
    background: #f1f5f9;
    font-family: inherit;
    font-size: 0.92rem;
    color: var(--text);
    transition: all 0.2s ease;
}
.search-input:focus {
    outline: none;
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(30, 58, 138, 0.1);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.btn-wa-top {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--wa);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.88rem;
    padding: 10px 16px;
    border-radius: 999px;
    transition: background 0.2s, transform 0.15s;
}
.btn-wa-top:hover { background: var(--wa-hover); transform: translateY(-1px); }

.btn-admin-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 9px 13px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #fff;
    transition: all 0.2s;
}
.btn-admin-link:hover { color: var(--text); border-color: #cbd5e1; }

/* Hero */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, #0f172a 100%);
    color: #fff;
    padding: 46px 0 42px;
    position: relative;
    overflow: hidden;
}
.hero::after {
    content: "";
    position: absolute;
    width: 480px;
    height: 480px;
    right: -120px;
    top: -180px;
    background: radial-gradient(circle, rgba(255,255,255,0.14) 0%, transparent 70%);
    pointer-events: none;
}
.hero-content {
    position: relative;
    z-index: 2;
    max-width: 720px;
}
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(255,255,255,0.22);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 14px;
}
.hero h1 {
    font-size: clamp(1.7rem, 3.6vw, 2.7rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 10px;
}
.hero p {
    color: rgba(255,255,255,0.85);
    font-size: 0.98rem;
    max-width: 600px;
}

/* Filter Bar with Click-to-Open Dropdown Menu */
.filter-bar {
    position: sticky;
    top: 74px;
    z-index: 35;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
    padding: 12px 0;
}
.filter-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* Dropdown Menu */
.cat-dropdown {
    position: relative;
    width: 320px;
    max-width: 100%;
}
.cat-dropdown-btn {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1.5px solid var(--primary);
    background: var(--primary);
    color: #fff;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.2);
    transition: background 0.18s ease, box-shadow 0.18s ease;
}
.cat-dropdown-btn:hover {
    filter: brightness(1.06);
}
.cat-dropdown-btn-left {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    overflow: hidden;
}
.cat-dropdown-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cat-dropdown-chevron {
    flex-shrink: 0;
    transition: transform 0.22s ease;
}
.cat-dropdown.open .cat-dropdown-chevron {
    transform: rotate(180deg);
}

.cat-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    min-width: 260px;
    max-height: 62vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.16);
    padding: 8px;
    display: none;
    flex-direction: column;
    gap: 4px;
    z-index: 80;
    animation: dropIn 0.18s ease;
}
.cat-dropdown.open .cat-dropdown-menu {
    display: flex;
}
@keyframes dropIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.cat-option {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 13px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: background 0.14s ease, color 0.14s ease;
}
.cat-option:hover {
    background: #f1f5f9;
    color: var(--primary);
}
.cat-option-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.cat-option-check {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0;
    color: var(--primary);
}
.cat-option-count {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    background: #f1f5f9;
    color: var(--muted);
    flex-shrink: 0;
}
.cat-option.active {
    background: #eff6ff;
    color: var(--primary);
    font-weight: 700;
}
.cat-option.active .cat-option-check {
    opacity: 1;
}
.cat-option.active .cat-option-count {
    background: var(--primary);
    color: #fff;
}

.sort-select {
    flex-shrink: 0;
    height: 44px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1.5px solid var(--border);
    background: #fff;
    font-family: inherit;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.15s;
}
.sort-select:focus {
    outline: none;
    border-color: var(--primary);
}

/* Catalog Grid */
.catalog-section {
    padding: 24px 0 64px;
}
.catalog-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 500;
}
.active-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #e0e7ff;
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
}
.active-filter-chip:hover { opacity: 0.88; }

.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px;
}

.product-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
    box-shadow: var(--shadow-sm);
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: #cbd5e1;
}

.card-media {
    position: relative;
    aspect-ratio: 1 / 1;
    background: radial-gradient(circle at center, #ffffff 45%, #f1f5f9 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    cursor: pointer;
    overflow: hidden;
}
.card-media img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}
.product-card:hover .card-media img {
    transform: scale(1.06);
}
.card-cat-tag {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(6px);
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
}

.card-body {
    padding: 16px 18px 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
    line-height: 1.3;
    cursor: pointer;
}
.card-desc {
    font-size: 0.84rem;
    color: var(--muted);
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}
.card-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
}
.price-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}
.price-label {
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.price-value {
    font-size: 1.32rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.02em;
}

.btn-wa-card {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 11px 14px;
    background: var(--wa);
    color: #fff;
    text-decoration: none;
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}
.btn-wa-card:hover {
    background: var(--wa-hover);
    transform: translateY(-1px);
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 64px 20px;
    background: #fff;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    color: var(--muted);
}

/* Modal Produto */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.58);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 130;
    padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal-card {
    background: #fff;
    border-radius: 22px;
    max-width: 780px;
    width: 100%;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr 1fr;
    box-shadow: 0 25px 60px rgba(15, 23, 42, 0.25);
    position: relative;
    animation: modalIn 0.2s ease;
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}
.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}
.modal-media {
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
}
.modal-media img {
    max-width: 100%;
    max-height: 360px;
    object-fit: contain;
}
.modal-info {
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
}
.modal-cat {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}
.modal-info h2 {
    font-size: 1.45rem;
    font-weight: 800;
    margin-bottom: 12px;
    line-height: 1.25;
}
.modal-info p {
    color: var(--muted);
    font-size: 0.94rem;
    margin-bottom: 20px;
    flex: 1;
}
.modal-price {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 16px;
}
.qty-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}
.qty-row label { font-size: 0.88rem; font-weight: 600; color: var(--muted); }
.qty-input {
    width: 82px;
    padding: 8px 12px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    text-align: center;
}

/* Footer */
.site-footer {
    background: #0f172a;
    color: #cbd5e1;
    padding: 52px 0 28px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 36px;
    padding-bottom: 36px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.footer-brand img {
    height: 44px;
    margin-bottom: 14px;
    filter: brightness(0) invert(1);
}
.footer-brand h3 {
    color: #fff;
    font-size: 1.15rem;
    margin-bottom: 8px;
}
.footer-col h4 {
    color: #fff;
    font-size: 0.95rem;
    margin-bottom: 12px;
}
.footer-col p, .footer-col a {
    color: #94a3b8;
    font-size: 0.88rem;
    text-decoration: none;
    display: block;
    margin-bottom: 6px;
}
.footer-col a:hover { color: #fff; }
.footer-bottom {
    padding-top: 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.82rem;
    color: #64748b;
}

/* Responsive */
@media (max-width: 1100px) {
    .product-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 820px) {
    .container { padding: 0 14px; }
    .site-header {
        position: relative;
        top: auto;
    }
    .header-inner {
        flex-wrap: wrap;
        gap: 10px;
        min-height: auto;
        padding: 12px 0;
    }
    .brand img { height: 36px; }
    .search-wrap {
        order: 3;
        max-width: 100%;
        width: 100%;
    }
    .btn-wa-top { padding: 9px 11px; }
    .btn-wa-top span { display: none; }
    .hero { padding: 28px 0 26px; }

    .filter-bar {
        top: 0;
        padding: 10px 0;
    }
    .filter-row {
        display: grid;
        grid-template-columns: 1.4fr 1fr;
        gap: 10px;
    }
    .cat-dropdown {
        width: 100%;
    }
    .cat-dropdown-btn {
        height: 42px;
        padding: 0 12px;
        font-size: 0.85rem;
    }
    .cat-dropdown-menu {
        min-width: 100%;
        width: calc(100vw - 28px);
        max-width: 420px;
    }
    .sort-select {
        width: 100%;
        height: 42px;
        padding: 0 10px;
        font-size: 0.82rem;
    }

    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .modal-card { grid-template-columns: 1fr; max-height: 90vh; overflow-y: auto; }
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 480px) {
    .card-body { padding: 12px; }
    .card-title { font-size: 0.9rem; }
    .price-value { font-size: 1.12rem; }
    .btn-wa-card { font-size: 0.8rem; padding: 9px 10px; }
}
