:root {
    --bg: #f1f5f9;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --text: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-soft: #dbeafe;
    --green: #10b981;
    --green-hover: #059669;
    --danger: #dc2626;
    --warning: #f59e0b;
    --shadow-sm: 0 10px 30px rgba(15, 23, 42, .07);
    --shadow-md: 0 22px 50px rgba(15, 23, 42, .10);
    --radius: 16px;
    --container: min(1180px, calc(100% - 32px));
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: linear-gradient(180deg, #ffffff 0, var(--bg) 360px), var(--bg);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
p { margin: 0; color: var(--muted); }
h1, h2, h3 { margin: 0; line-height: 1.14; letter-spacing: 0; color: var(--text); }
h1 { font-size: clamp(2rem, 4vw, 3.35rem); max-width: 880px; }
h2 { font-size: clamp(1.45rem, 2.4vw, 2.25rem); }
h3 { font-size: 1.08rem; }
strong, b { color: var(--text); }
main { min-height: 66vh; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: .9rem max(16px, calc((100vw - 1180px) / 2));
    background: rgba(255, 255, 255, .82);
    border-bottom: 1px solid rgba(226, 232, 240, .8);
    backdrop-filter: blur(18px);
}
.brand { display: inline-flex; align-items: center; gap: .65rem; font-weight: 850; font-size: 1.08rem; }
.brand span { display: grid; place-items: center; width: 2.15rem; height: 2.15rem; border-radius: 12px; background: var(--text); color: #fff; font-size: .78rem; letter-spacing: .02em; }
.site-nav { display: flex; align-items: center; gap: .2rem; }
.site-nav a { min-height: 2.5rem; display: inline-flex; align-items: center; gap: .4rem; padding: 0 .85rem; border-radius: 999px; color: var(--muted); font-weight: 750; font-size: .94rem; transition: color .18s ease, background .18s ease, transform .18s ease; }
.site-nav a:hover, .site-nav a.active { background: var(--surface-soft); color: var(--text); }
.site-nav a:active { transform: translateY(1px); }
.site-nav b { min-width: 1.35rem; height: 1.35rem; display: inline-grid; place-items: center; border-radius: 999px; background: var(--primary); color: #fff; font-size: .75rem; }
.nav-cta { color: #fff !important; background: var(--primary) !important; }
.nav-toggle { display: none; width: 2.75rem; height: 2.75rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-sm); }
.nav-toggle i { display: block; width: 1.15rem; height: 2px; margin: 4px auto; background: var(--text); }

.hero, .section, .product-detail { width: var(--container); margin: 0 auto; }
.hero { min-height: 620px; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(300px, .9fr); align-items: center; gap: clamp(2rem, 5vw, 5rem); padding: clamp(3rem, 7vw, 6rem) 0 clamp(2rem, 5vw, 4rem); }
.hero.compact { min-height: 340px; grid-template-columns: 1fr; padding-bottom: 2rem; }
.hero > div:first-child, .section-head, .page, .checkout { display: grid; gap: 1rem; }
.hero p { max-width: 690px; font-size: clamp(1rem, 1.8vw, 1.12rem); }
.eyebrow { width: fit-content; color: var(--primary); font-size: .76rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.hero-box, .summary-card, .form-card, .auth-card, .product-card, .cart-item, .order-card, .stat-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.hero-box { min-height: 340px; display: grid; align-content: center; gap: 1rem; padding: clamp(1.25rem, 3vw, 2rem); background: linear-gradient(145deg, rgba(37, 99, 235, .08), rgba(16, 185, 129, .08)), var(--surface); }
.hero-box strong { font-size: clamp(1.45rem, 3vw, 2rem); }
.hero-box span { border: 1px solid var(--line); border-radius: 14px; padding: .9rem 1rem; color: var(--muted); background: rgba(255, 255, 255, .7); }
.actions, .inline-form { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.btn, button { min-height: 2.8rem; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; border: 1px solid transparent; border-radius: 999px; padding: .75rem 1.05rem; font: inherit; font-weight: 800; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease, color .18s ease; }
.btn:hover, button:hover { transform: translateY(-1px); }
.btn:active, button:active { transform: translateY(0); }
.btn-primary { color: #fff; background: var(--primary); box-shadow: 0 14px 30px rgba(37, 99, 235, .22); }
.btn-primary:hover { background: var(--primary-hover); box-shadow: 0 18px 36px rgba(37, 99, 235, .28); }
.btn-secondary, button { color: var(--text); border-color: var(--line); background: var(--surface); }
.btn-secondary:hover, button:hover { border-color: #cbd5e1; background: var(--surface-soft); }
.wide { width: 100%; }

.section { padding: clamp(2rem, 5vw, 4.5rem) 0; }
.section-head { max-width: 760px; margin-bottom: .35rem; }
.chips { display: flex; flex-wrap: wrap; gap: .65rem; }
.chips a { border: 1px solid var(--line); border-radius: 999px; padding: .62rem .9rem; color: var(--muted); background: var(--surface); font-weight: 750; box-shadow: 0 6px 18px rgba(15, 23, 42, .04); }
.chips a:hover, .chips a.active { color: #fff; border-color: var(--primary); background: var(--primary); }
.product-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.product-card { position: relative; overflow: hidden; display: grid; grid-template-rows: auto 1fr; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.product-card:hover { transform: translateY(-3px); border-color: #cbd5e1; box-shadow: var(--shadow-md); }
.product-image { position: relative; aspect-ratio: 4 / 3; display: grid; place-items: center; background: linear-gradient(145deg, rgba(37, 99, 235, .08), rgba(15, 23, 42, .04)), var(--surface-soft); overflow: hidden; }
.product-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.product-card:hover .product-image img { transform: scale(1.035); }
.product-image span { font-weight: 900; color: var(--primary); }
.badge { display: inline-flex; align-items: center; width: fit-content; border-radius: 999px; padding: .34rem .62rem; color: var(--primary); background: var(--primary-soft); font-size: .73rem; font-weight: 850; }
.badge-featured { position: absolute; top: .75rem; left: .75rem; color: #fff; background: rgba(15, 23, 42, .86); backdrop-filter: blur(8px); }
.product-body { display: grid; gap: .8rem; padding: 1rem; }
.product-body h3 a:hover { color: var(--primary); }
.product-body p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-meta, .price-row, .cart-total, .order-item-row { display: flex; justify-content: space-between; gap: .75rem; align-items: center; }
.product-meta { flex-wrap: wrap; justify-content: flex-start; }
.product-meta span { border-radius: 999px; padding: .28rem .55rem; color: var(--muted); background: var(--surface-soft); font-size: .74rem; font-weight: 800; }
.product-specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
.product-specs span { display: grid; gap: .1rem; min-width: 0; color: var(--muted); font-size: .75rem; }
.product-specs strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .86rem; }
.rating, .stars { color: var(--warning); font-weight: 800; }
.rating small { color: var(--muted); font-weight: 750; }
.price-row { align-items: baseline; justify-content: flex-start; }
.price-row strong, .price strong, .cart-total strong { color: var(--text); font-size: 1.35rem; }
.price.big { display: flex; align-items: baseline; gap: .75rem; }
.price.big strong { font-size: clamp(1.7rem, 4vw, 2.45rem); }
del { color: var(--muted); }
.inline-form .btn { flex: 1 1 130px; }

.product-detail { display: grid; grid-template-columns: minmax(280px, .9fr) minmax(0, 1.1fr); gap: clamp(1.5rem, 4vw, 4rem); padding: clamp(2.5rem, 6vw, 5rem) 0; }
.detail-image { min-height: 360px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); box-shadow: var(--shadow-sm); }
.detail-image img { width: 100%; height: 100%; object-fit: cover; }
.detail-image span { color: var(--primary); font-weight: 900; }
.detail-info { display: grid; gap: 1rem; align-content: start; }
.detail-info > p:not(.eyebrow) { font-size: 1.03rem; }
.specs { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: .7rem; }
.specs span, .empty { border: 1px solid var(--line); border-radius: 14px; padding: .9rem; background: var(--surface); color: var(--muted); }
.specs strong { display: block; margin-top: .15rem; }
.text-content { display: grid; gap: 1rem; max-width: 860px; }
.text-content p { color: #475569; }

.cart-list, .order-list { display: grid; gap: .85rem; }
.cart-item { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto auto; align-items: center; gap: 1rem; padding: 1rem; }
.cart-item > strong { min-width: 0; }
.qty { display: flex; align-items: center; gap: .5rem; }
.qty button { width: 2.2rem; min-height: 2.2rem; padding: 0; border-radius: 999px; }
.link-danger { color: var(--danger); background: transparent; border: 0; padding: 0; min-height: auto; box-shadow: none; }
.link-danger:hover { background: transparent; color: #991b1b; transform: none; }
.cart-total { border-top: 1px solid var(--line); padding-top: 1rem; font-size: 1.2rem; }
.checkout-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, .72fr); gap: 1rem; align-items: start; }
.form-card, .summary-card, .auth-card { display: grid; gap: 1rem; padding: clamp(1rem, 3vw, 1.35rem); }
.summary-card p { display: flex; justify-content: space-between; gap: 1rem; }
label { display: grid; gap: .45rem; font-weight: 800; color: var(--text); }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); padding: .85rem .95rem; font: inherit; outline: none; transition: border-color .18s ease, box-shadow .18s ease, background .18s ease; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(37, 99, 235, .12); }
input:disabled { background: var(--surface-soft); color: var(--muted); }
textarea { resize: vertical; }
.auth-page { min-height: 72vh; display: grid; place-items: center; padding: 2rem 1rem; }
.auth-card { width: min(460px, 100%); box-shadow: var(--shadow-md); }
.auth-card p a { color: var(--primary); font-weight: 800; }
.narrow { max-width: 720px; }
.alert { padding: .85rem 1rem; border-radius: 14px; }
.danger { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.success-box { display: grid; gap: 1rem; border: 1px solid #a7f3d0; border-radius: var(--radius); padding: 1.5rem; background: #ecfdf5; box-shadow: var(--shadow-sm); }

.site-footer { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem 2rem; align-items: start; padding: 2.5rem max(16px, calc((100vw - 1180px) / 2)); border-top: 1px solid var(--line); background: var(--surface); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 1rem; color: var(--muted); }
.site-footer a:hover { color: var(--primary); }
.site-footer small { color: var(--muted); }
.whatsapp-float { position: fixed; right: 1rem; bottom: 1rem; z-index: 25; border-radius: 999px; padding: .9rem 1rem; background: var(--green); color: #fff; font-weight: 900; box-shadow: 0 18px 44px rgba(16,185,129,.28); }
.whatsapp-float:hover { background: var(--green-hover); }

.admin-main { width: var(--container); margin: 0 auto; }
.admin-title-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 1rem; }
.stat-card { display: grid; gap: .5rem; padding: 1.25rem; }
.stat-card span { color: var(--muted); text-transform: uppercase; font-weight: 850; font-size: .78rem; }
.stat-card strong { font-size: 2.2rem; color: var(--primary); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
table { width: 100%; border-collapse: collapse; min-width: 720px; background: var(--surface); }
th, td { padding: .9rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: 0; }
.table-actions { display: flex; gap: .7rem; align-items: center; }
.table-actions form { margin: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1rem; }
.form-grid .full { grid-column: 1 / -1; }
.check-row { display: flex; align-items: center; gap: .5rem; }
.check-row input { width: auto; }
.admin-thumb { width: 135px; border-radius: 12px; border: 1px solid var(--line); margin-bottom: 1rem; }
.order-card { display: grid; gap: .85rem; padding: 1rem; }
.order-card h2 span { display: inline-flex; margin-left: .5rem; border-radius: 999px; padding: .25rem .6rem; color: var(--primary); background: var(--primary-soft); font-size: .78rem; }

@media (max-width: 1100px) { .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 980px) {
    .nav-toggle { display: block; }
    .site-nav { position: absolute; top: calc(100% + .6rem); left: 1rem; right: 1rem; display: none; flex-direction: column; align-items: stretch; padding: .8rem; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.96); box-shadow: var(--shadow-md); }
    .site-nav.open, .open-desktop { display: flex; }
    .site-nav a { width: 100%; justify-content: space-between; border-radius: 12px; }
    .hero, .product-detail, .checkout-grid { grid-template-columns: 1fr; }
    .hero { min-height: auto; }
    .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stats-grid, .specs { grid-template-columns: 1fr 1fr; }
    .cart-item { grid-template-columns: 1fr; align-items: stretch; }
    .site-footer { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    :root { --container: min(100% - 24px, 1180px); }
    .site-header { padding-inline: 12px; }
    h1 { font-size: clamp(1.8rem, 9vw, 2.35rem); }
    .product-grid, .stats-grid, .specs, .form-grid, .product-specs { grid-template-columns: 1fr; }
    .hero-box { min-height: 240px; }
    .actions .btn, .inline-form .btn { width: 100%; }
    .summary-card p, .order-item-row, .product-meta, .price-row { align-items: flex-start; }
    .whatsapp-float { right: .75rem; bottom: .75rem; }
}
