/* Loja Gratiluz — estilos */
:root {
    --bg: #0f0f10;
    --surface: #17171a;
    --surface-2: #1f1f24;
    --border: #2a2a30;
    --text: #f5f5f7;
    --muted: #a1a1aa;
    --brand: #ffbb01;
    --brand-hover: #ffd042;
    --brand-ink: #131313;
    --radius: 14px;
    --radius-pill: 999px;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    --transition: 160ms ease;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background: radial-gradient(1200px 600px at 50% -200px, #1c1c22 0%, var(--bg) 60%) fixed;
    color: var(--text);
    margin: 0;
    padding: 0;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

.container {
    width: min(1160px, 92%);
    margin: 24px auto;
    background: var(--surface);
    padding: 28px clamp(16px, 3vw, 32px);
    border-radius: calc(var(--radius) + 4px);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

h1, h2 { color: var(--brand); margin: 0 0 .4em; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.5rem, 2.4vw, 2rem); }
h2 { font-size: clamp(1.25rem, 2vw, 1.6rem); }
h3 { color: var(--text); margin: 0 0 .3em; }

a { color: var(--brand); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--brand-hover); }

hr { border: 0; border-top: 1px solid var(--border); margin: 22px 0; }

/* ---------- Header ---------- */
.site-header {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 8px;
}

.header-top {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: inherit;
    text-decoration: none;
}
.brand-link img { height: 40px; width: auto; display: block; }
.brand-link h1 { margin: 0; }

.search-form {
    display: flex;
    flex: 1 1 320px;
    min-width: 220px;
    max-width: 480px;
    margin-left: auto;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 4px 4px 4px 16px;
    align-items: center;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.search-form:focus-within {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(255, 187, 1, 0.15);
}
.search-form input {
    flex: 1;
    background: transparent;
    border: 0;
    outline: 0;
    color: var(--text);
    font-size: 0.95rem;
    padding: 8px 6px;
}
.search-form input::placeholder { color: var(--muted); }
.search-form button {
    border: 0;
    background: var(--brand);
    color: var(--brand-ink);
    font-weight: 600;
    padding: 8px 18px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
}
.search-form button:hover { background: var(--brand-hover); }
.search-form button:active { transform: scale(0.97); }

/* Navegação em pills */
.nav-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.nav-pills a {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition);
}
.nav-pills a:hover {
    background: var(--brand);
    color: var(--brand-ink);
    border-color: var(--brand);
    transform: translateY(-1px);
}
.nav-pills a.active {
    background: var(--brand);
    color: var(--brand-ink);
    border-color: var(--brand);
}

/* ---------- Botões ---------- */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--brand);
    color: var(--brand-ink);
    padding: 12px 24px;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: 1rem;
    text-align: center;
    transition: background var(--transition), transform var(--transition), opacity var(--transition);
    border: 0;
    cursor: pointer;
    width: 100%;
    font-family: inherit;
    line-height: 1.2;
}
.button:hover { background: var(--brand-hover); color: var(--brand-ink); text-decoration: none; }
.button:active { transform: scale(0.98); }

.button.btn-whatsapp { background: #25D366; color: #fff; }
.button.btn-whatsapp:hover { background: #1ebe5b; color: #fff; }
.button.btn-telegram { background: #0088cc; color: #fff; }
.button.btn-telegram:hover { background: #0077b3; color: #fff; }
.button.btn-email { background: #ea4335; color: #fff; }
.button.btn-email:hover { background: #d33b2f; color: #fff; }

.button.btn-fit { width: auto; }

/* ---------- Grid de produtos ---------- */
.product-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.product-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 14px;
    border-radius: var(--radius);
    transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.product-card:hover {
    transform: translateY(-3px);
    border-color: var(--brand);
    box-shadow: 0 12px 28px rgba(0,0,0,0.4);
}
.product-card { color: inherit; text-decoration: none; display: flex; flex-direction: column; cursor: pointer; }
.product-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 10px;
    display: block;
    margin-bottom: 12px;
}
.product-card h3 { font-size: 1rem; margin: 6px 0; }
.product-card .price { color: var(--brand); font-weight: 700; margin: 6px 0 12px; }

.empty-state {
    padding: 40px;
    text-align: center;
    color: var(--muted);
    background: var(--surface-2);
    border-radius: var(--radius);
    border: 1px dashed var(--border);
}

/* ---------- Página de produto ---------- */
.product-detail {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    margin-top: 8px;
}
.product-gallery { flex: 1; min-width: 300px; max-width: 520px; }
.product-info { flex: 1; min-width: 300px; }

#mainImage {
    width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: var(--radius);
    background: var(--surface-2);
    cursor: zoom-in;
}
.thumbnails { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.thumb-img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    cursor: pointer;
    border-radius: 8px;
    border: 2px solid transparent;
    transition: border-color var(--transition);
}
.thumb-img:hover { border-color: var(--muted); }
.thumb-img.active { border-color: var(--brand); }

.product-info .price-tag {
    font-size: 1.8em;
    color: var(--brand);
    margin: 18px 0;
    font-weight: 700;
}
.buy-box {
    margin-top: 24px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
}
.buy-box p { margin: 0 0 10px; }
.buy-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.back-link { display: inline-block; margin-top: 20px; }

/* ---------- Modal fullscreen ---------- */
.fullscreen-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.92);
    justify-content: center;
    align-items: center;
}
.fullscreen-modal img { max-width: 92%; max-height: 92%; object-fit: contain; }
.fullscreen-modal .close-btn {
    position: absolute; top: 20px; right: 30px;
    color: #fff; font-size: 40px; font-weight: bold; cursor: pointer;
}
.fullscreen-modal .fs-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 52px; height: 52px;
    border-radius: 50%;
    font-size: 22px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background var(--transition);
}
.fullscreen-modal .fs-nav:hover { background: rgba(0, 0, 0, 0.75); }
.fullscreen-modal .fs-prev { left: 20px; }
.fullscreen-modal .fs-next { right: 20px; }
@media (max-width: 520px) {
    .fullscreen-modal .fs-nav { width: 42px; height: 42px; font-size: 18px; }
    .fullscreen-modal .fs-prev { left: 8px; }
    .fullscreen-modal .fs-next { right: 8px; }
}
.thumb-img.thumb-var { border-color: rgba(255, 187, 1, 0.35); }
.thumb-img.thumb-var.active { border-color: var(--brand); }

/* ---------- Footer ---------- */
footer { color: var(--muted); font-size: 0.9rem; }
footer p { margin: 6px 0; line-height: 1.6; }
footer strong { color: var(--text); }
.footer-licenca { font-size: 0.85em; margin-top: 12px; }

/* ---------- Forms (admin) ---------- */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; color: var(--muted); }
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input[type="number"],
.form-group input[type="file"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    outline: 0;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(255, 187, 1, 0.15);
}
.form-group input[type="submit"] {
    background: var(--brand);
    color: var(--brand-ink);
    border: 0;
    padding: 10px 22px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    font-weight: 600;
    width: auto;
}
.form-group input[type="submit"]:hover { background: var(--brand-hover); }

/* ---------- Tabelas (admin) ---------- */
table { border-collapse: collapse; width: 100%; margin-top: 20px; }
table th, table td { border: 1px solid var(--border); padding: 10px 12px; text-align: left; }
table th { background: var(--surface-2); color: var(--brand); font-weight: 600; }

/* ---------- Admin Styles ---------- */
.admin-form-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

.form-main { display: flex; flex-direction: column; gap: 20px; }
.form-sidebar { display: flex; flex-direction: column; gap: 20px; }

.category-box {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 15px;
    max-height: 300px;
    overflow-y: auto;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.2s ease;
}

.category-item:last-child { border-bottom: 0; }
.category-item:hover { background: rgba(255, 187, 1, 0.05); }
.category-item input { width: auto; margin: 0; }

.photo-gallery-admin {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
    background: var(--surface-2);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.photo-item-admin {
    position: relative;
    text-align: center;
}

.photo-item-admin img {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: transform 0.2s ease;
}

.photo-item-admin img:hover { transform: scale(1.05); }

.photo-item-admin label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 0.75rem;
    margin-top: 5px;
    color: #ea4335;
    cursor: pointer;
}

.login-card {
    max-width: 400px;
    margin: 60px auto;
    padding: 40px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header img {
    height: 60px;
    margin-bottom: 15px;
}

.error-message {
    background: rgba(234, 67, 53, 0.1);
    border: 1px solid #ea4335;
    color: #ea4335;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    text-align: center;
}

/* ---------- Responsivo ---------- */
@media (max-width: 850px) {
    .admin-form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .container { width: 96%; padding: 18px; }
    
    .header-top {
        flex-direction: row; /* Mantém na horizontal */
        justify-content: space-between; /* Afasta logo e carrinho para as extremidades */
        align-items: center;
    }
    
    .search-form {
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        flex: none;
        order: 3; /* Joga a barra de busca para a linha debaixo */
    }
    
    .nav-pills {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .nav-pills a {
        font-size: 0.85rem;
        padding: 6px 12px;
    }
    
    table {
        font-size: 0.85rem;
    }
    
    table th, table td {
        padding: 8px 6px;
    }
    
    .button {
        padding: 8px 14px;
        font-size: 0.85rem;
    }
    
    .login-card {
        margin: 30px auto;
        padding: 25px;
    }
    
    .photo-gallery-admin {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
}

/* ---------- Carrinho ---------- */
.cart-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    background: var(--brand);
    border-radius: 50%;
    border: 0;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}
.cart-button:hover { background: var(--brand-hover); transform: translateY(-1px); }
.cart-button img { width: 24px; height: 24px; display: block; }
.cart-button.has-items {
    box-shadow: 0 0 0 3px rgba(255, 187, 1, 0.35), 0 8px 20px rgba(255, 187, 1, 0.25);
    animation: cartPulse 1.8s ease-in-out infinite;
}
@keyframes cartPulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(255, 187, 1, 0.35); }
    50%      { box-shadow: 0 0 0 6px rgba(255, 187, 1, 0.15); }
}
.cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #ea4335;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--surface);
}

/* Botões amarelos primários (voltar, compartilhar, adicionar) */
.button.btn-brand { background: var(--brand); color: var(--brand-ink); }
.button.btn-brand:hover { background: var(--brand-hover); color: var(--brand-ink); }

.product-actions-top {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

/* Seletor de quantidade */
.qty-selector {
    display: inline-flex;
    align-items: center;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: var(--surface);
    overflow: hidden;
    margin: 6px 0 14px;
}
.qty-selector button {
    width: 40px; height: 40px;
    background: transparent; color: var(--text);
    border: 0; font-size: 1.2rem; font-weight: 700; cursor: pointer;
    transition: background var(--transition);
}
.qty-selector button:hover { background: var(--surface-2); }
.qty-selector input {
    width: 56px; height: 40px;
    text-align: center;
    background: transparent;
    border: 0; border-left: 1px solid var(--border); border-right: 1px solid var(--border);
    color: var(--text); font-weight: 600; font-size: 1rem;
    -moz-appearance: textfield;
}
.qty-selector input::-webkit-outer-spin-button,
.qty-selector input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-label { display: block; color: var(--muted); font-size: 0.9rem; margin-top: 6px; }

/* Página do carrinho */
.cart-page { margin-top: 8px; }
.cart-empty { padding: 40px; text-align: center; color: var(--muted); background: var(--surface-2); border-radius: var(--radius); border: 1px dashed var(--border); }
.cart-items { display: flex; flex-direction: column; gap: 12px; }
.cart-item {
    display: grid;
    grid-template-columns: 88px 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.cart-item img { width: 88px; height: 88px; object-fit: cover; border-radius: 10px; background: var(--surface); }
.cart-item .ci-info h3 { margin: 0 0 4px; font-size: 1rem; }
.cart-item .ci-info .ci-price { color: var(--brand); font-weight: 700; }
.cart-item .ci-info .ci-sub { color: var(--muted); font-size: 0.9rem; margin-top: 4px; }
.cart-item .ci-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.cart-item .qty-selector { margin: 0; }
.ci-remove {
    background: transparent; color: var(--muted); border: 0; cursor: pointer;
    font-size: 0.85rem; text-decoration: underline;
}
.ci-remove:hover { color: #ea4335; }

.cart-summary {
    margin-top: 20px;
    padding: 18px 20px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.cart-summary .total-label { color: var(--muted); }
.cart-summary .total-value { font-size: 1.4rem; font-weight: 700; color: var(--brand); }

.cart-checkout {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Aviso de cookies (LGPD) */
.cookie-notice[hidden] { display: none !important; }
.cookie-notice {
    position: fixed;
    left: 16px; right: 16px; bottom: 16px;
    max-width: 720px;
    margin: 0 auto;
    padding: 14px 16px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
    z-index: 1000;
}
.cookie-notice p { margin: 0; flex: 1 1 240px; color: var(--muted); font-size: 0.9rem; }
.cookie-notice p strong { color: var(--text); }

@media (max-width: 520px) {
    .cart-item { grid-template-columns: 72px 1fr; }
    .cart-item .ci-actions { grid-column: 1 / -1; align-items: stretch; flex-direction: row; justify-content: space-between; }
    .cart-item img { width: 72px; height: 72px; }
}

/* ================= Variações de produto ================= */
.variacao-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 6px 0 14px;
}
.variacao-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
    color: inherit;
    transition: border-color .15s, background .15s;
}
.variacao-item:hover { border-color: var(--brand); }
.variacao-item.active {
    border-color: var(--brand);
    background: rgba(255, 187, 1, 0.1);
    font-weight: 600;
}
.variacao-item img {
    width: 34px;
    height: 34px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border);
}

/* ================= Descrição com markdown ================= */
.product-description p { margin: 0 0 10px; }
.product-description a { color: var(--brand); text-decoration: underline; }
.md-table-wrap { overflow-x: auto; margin: 10px 0; }
.md-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--border);
    font-size: 0.95rem;
}
.md-table th, .md-table td {
    border: 1px solid var(--border);
    padding: 8px 10px;
    text-align: left;
}
.md-table th { background: var(--surface-2); }

/* ================= Página Sobre ================= */
.about-page {
    max-width: 760px;
    margin: 0 auto;
    padding: 8px 0 24px;
}

.about-hero {
    text-align: center;
    padding: 28px 20px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 24px;
}

.about-hero h2 {
    margin: 0 0 14px;
    font-size: clamp(1.6rem, 3vw, 2.1rem);
}

.about-lead {
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.65;
    margin: 0 auto;
    max-width: 640px;
}

.about-lead strong { color: var(--text); }

.about-section {
    padding: 20px;
    margin-bottom: 16px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.about-section h3 {
    color: var(--brand);
    margin: 0 0 12px;
    font-size: 1.15rem;
}

.about-section p {
    margin: 0 0 12px;
    color: var(--muted);
}

.about-section p:last-child { margin-bottom: 0; }

.about-list {
    margin: 0;
    padding-left: 20px;
    color: var(--muted);
}

.about-list li { margin-bottom: 8px; }

.about-address {
    font-style: normal;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    margin: 12px 0;
    display: inline-block;
}

.about-map-links {
    font-size: 0.95rem;
}

.about-contact {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.about-contact .button {
    width: auto;
    padding: 10px 18px;
    font-size: 0.95rem;
}

.about-license {
    text-align: center;
    font-size: 0.9rem;
    background: transparent;
    border: 0;
    padding: 10px 0 0;
}

.about-license p { margin: 0; }

@media (max-width: 520px) {
    .about-hero { padding: 22px 16px; }
    .about-section { padding: 16px; }
    .about-contact .button { flex: 1 1 calc(50% - 10px); }
}

