/* ===== Zetrum Store — sistema de diseño según maqueta ===== */
:root {
    --violet: #33258b;        /* hero */
    --violet-btn: #7a48dc;    /* texto de botones claros */
    --yellow: #ffe864;        /* acento hero */
    --red: #ff4d4d;           /* banner promo */
    --red-price: #ee3333;     /* precios */
    --bg: #f4f5f7;            /* fondo página */
    --card: #ffffff;
    --search-bg: #f0f1f4;
    --text: #1e2235;
    --muted: #7a7f96;
    --dark: #202124;          /* topbar y footer */
    --radius: 16px;
    --shadow: 0 2px 10px rgba(30, 34, 53, .06);
    --shadow-hover: 0 12px 30px rgba(51, 37, 139, .16);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
main { flex: 1; }
.container { max-width: 1140px; margin: 0 auto; padding: 0 20px; }
.container.page { padding-top: 36px; padding-bottom: 50px; }
.muted { color: var(--muted); font-size: .88rem; }
a { color: inherit; }

/* ---------- Topbar ---------- */
.topbar { background: var(--dark); color: #cfd1d6; font-size: .8rem; padding: 8px 0; }
.topbar-inner { display: flex; justify-content: center; gap: 34px; flex-wrap: wrap; }

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: #fff;
    box-shadow: 0 1px 0 rgba(30, 34, 53, .07);
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 16px 20px;
}
.logo {
    font-size: 1.45rem;
    font-weight: 900;
    letter-spacing: 1px;
    color: var(--text);
    text-decoration: none;
}
.search {
    flex: 1;
    max-width: 460px;
    display: flex;
    align-items: center;
    background: var(--search-bg);
    border-radius: 999px;
    padding: 4px 6px 4px 18px;
}
.search input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: .92rem;
    padding: 8px 0;
    outline: none;
    color: var(--text);
}
.search button {
    border: none;
    background: #fff;
    border-radius: 999px;
    width: 36px;
    height: 36px;
    cursor: pointer;
    font-size: .95rem;
    box-shadow: var(--shadow);
}
.header-nav { margin-left: auto; display: flex; align-items: center; gap: 20px; }
.header-nav a { text-decoration: none; font-weight: 600; font-size: .95rem; }
.header-nav a:hover { color: var(--violet-btn); }
.cart-badge {
    background: var(--red);
    color: #fff;
    border-radius: 999px;
    padding: 1px 7px;
    font-size: .74rem;
    font-weight: 800;
}
.subnav {
    display: flex;
    gap: 30px;
    padding: 0 20px 12px;
    overflow-x: auto;
}
.subnav a {
    text-decoration: none;
    font-size: .9rem;
    font-weight: 600;
    color: var(--muted);
    white-space: nowrap;
}
.subnav a:first-child { color: var(--text); }
.subnav a:hover { color: var(--violet-btn); }

/* ---------- Hero ---------- */
.hero { background: var(--violet); color: #fff; overflow: hidden; }
.hero-inner {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    align-items: center;
    gap: 30px;
    padding: 64px 20px;
}
.hero-eyebrow {
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: .8rem;
    font-weight: 800;
    margin-bottom: 18px;
}
.hero-eyebrow span {
    background: var(--yellow);
    color: var(--violet);
    padding: 3px 10px;
    border-radius: 4px;
}
.hero h1 {
    font-size: 3rem;
    line-height: 1.12;
    font-weight: 900;
    letter-spacing: -1px;
    margin-bottom: 18px;
}
.hero-sub { color: #cfc8ec; font-size: 1.08rem; margin-bottom: 30px; max-width: 420px; }
.btn-hero {
    display: inline-block;
    background: #fff;
    color: var(--violet-btn);
    font-weight: 800;
    text-decoration: none;
    border-radius: 999px;
    padding: 14px 30px;
    font-size: 1rem;
    transition: transform .12s, box-shadow .12s;
}
.btn-hero:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0,0,0,.25); }
.hero-img { display: flex; justify-content: center; }
.hero-img img { max-width: 320px; width: 100%; filter: drop-shadow(0 24px 40px rgba(0,0,0,.35)); }

/* ---------- Categorías ---------- */
.categories { padding: 52px 20px 8px; }
.categories h2, .section-head h2 { font-size: 1.55rem; font-weight: 800; letter-spacing: -.3px; }
.section-sub { color: var(--muted); margin: 6px 0 22px; }
.chips { display: flex; gap: 12px; flex-wrap: wrap; padding-bottom: 10px; }
.chip {
    background: #fff;
    border-radius: 999px;
    padding: 12px 24px;
    text-decoration: none;
    font-weight: 700;
    font-size: .92rem;
    box-shadow: var(--shadow);
    transition: transform .12s, color .12s;
}
.chip:hover { transform: translateY(-2px); color: var(--violet-btn); }

/* ---------- Secciones ---------- */
section.container { padding-top: 34px; }
.section-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 20px;
}
.ver-todo { text-decoration: none; font-weight: 700; color: var(--violet-btn); font-size: .95rem; }

/* ---------- Grid de productos ---------- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    padding-bottom: 24px;
}
.product-card {
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    transition: transform .18s ease, box-shadow .18s ease;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.product-thumb {
    position: relative;
    background: #fff;
    height: 186px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-emoji { font-size: 3.2rem; }
.badge-low {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ffe1e6;
    color: var(--red-price);
    border-radius: 999px;
    padding: 3px 10px;
    font-size: .72rem;
    font-weight: 800;
}
.product-body { padding: 14px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.product-body h3 { font-size: 1rem; font-weight: 700; }
.product-body .desc { font-size: .84rem; color: var(--muted); margin: 4px 0 12px; flex: 1; }
.product-footer { display: flex; justify-content: space-between; align-items: center; }
.price { font-size: 1.18rem; font-weight: 900; color: var(--red-price); }
.btn-cart {
    border: none;
    background: var(--violet);
    color: #fff;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    font-size: 1rem;
    cursor: pointer;
    transition: background .15s, transform .1s;
}
.btn-cart:hover { background: var(--violet-btn); }
.btn-cart:active { transform: scale(.92); }

/* ---------- Banner promo ---------- */
.promo-banner {
    background: var(--red);
    color: #fff;
    border-radius: var(--radius);
    padding: 44px 52px;
    margin-bottom: 10px;
}
.promo-eyebrow {
    text-transform: uppercase;
    letter-spacing: 1.6px;
    font-size: .78rem;
    font-weight: 800;
    opacity: .9;
    margin-bottom: 8px;
}
.promo-banner h2 { font-size: 2rem; font-weight: 900; letter-spacing: -.5px; }
.promo-sub { opacity: .92; margin-top: 6px; }

/* ---------- Botones genéricos ---------- */
.btn {
    display: inline-block;
    background: var(--violet);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 11px 20px;
    font-size: .92rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background .15s, transform .1s;
}
.btn:hover { background: var(--violet-btn); }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--red); }
.btn-primary:hover { background: #e03333; }
.btn-danger { background: var(--red-price); }
.btn-danger:hover { background: #c92525; }
.btn-outline { background: transparent; color: var(--violet); border: 2px solid var(--violet); }
.btn-outline:hover { background: var(--violet); color: #fff; }
.btn-small { padding: 6px 11px; font-size: .82rem; border-radius: 8px; }
.btn-block { width: 100%; }

/* ---------- Alertas ---------- */
.alert { padding: 13px 18px; border-radius: 10px; margin-bottom: 18px; font-weight: 600; }
.alert-ok { background: #ddf7ec; color: #0a6b4d; }
.alert-error { background: #fde3e6; color: #a02c3e; }
.empty { text-align: center; padding: 50px 0 60px; color: var(--muted); display: grid; gap: 16px; justify-items: center; }

/* ---------- Carrito ---------- */
.cart-form { max-width: 780px; }
.cart-row {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    margin-bottom: 12px;
}
.cart-emoji { font-size: 1.9rem; }
.cart-info { flex: 1; display: flex; flex-direction: column; }
.cart-row input[type=number] {
    width: 72px;
    padding: 8px;
    border: 1px solid #d8dbe6;
    border-radius: 8px;
    font-size: .95rem;
    text-align: center;
}
.cart-subtotal { font-weight: 800; min-width: 100px; text-align: right; color: var(--red-price); }
.cart-summary { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; margin-top: 20px; }
.total { font-size: 1.25rem; }
.total strong { color: var(--red-price); }
.cart-actions { display: flex; gap: 10px; }

/* ---------- Checkout ---------- */
.checkout-layout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; align-items: start; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.card h2 { font-size: 1.1rem; margin-bottom: 18px; }
.checkout-form { display: flex; flex-direction: column; gap: 15px; }
.checkout-form label { font-weight: 700; font-size: .88rem; display: flex; flex-direction: column; gap: 6px; }
.checkout-form input, .checkout-form textarea {
    padding: 11px 13px;
    border: 1px solid #d8dbe6;
    border-radius: 9px;
    font-size: .95rem;
    font-family: inherit;
    transition: border-color .15s, box-shadow .15s;
}
.checkout-form input:focus, .checkout-form textarea:focus {
    outline: none;
    border-color: var(--violet-btn);
    box-shadow: 0 0 0 3px rgba(122, 72, 220, .15);
}
.summary-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid #eef0f6; font-size: .92rem; }
.summary-total { border-bottom: none; font-size: 1.08rem; padding-top: 14px; }
.summary-total strong { color: var(--red-price); }
.success-box {
    max-width: 560px;
    margin: 40px auto;
    text-align: center;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 46px 34px;
    display: grid;
    gap: 12px;
    justify-items: center;
}
.success-icon { font-size: 3.2rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--dark); color: #b9bcc4; margin-top: 56px; padding: 44px 0 0; }
.footer-inner {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 26px;
    padding-bottom: 30px;
}
.footer-logo { font-weight: 900; letter-spacing: 1px; color: #fff; font-size: 1.2rem; margin-bottom: 8px; }
.footer-inner strong { color: #fff; }
.footer-inner a { color: #b9bcc4; text-decoration: none; font-size: .9rem; }
.footer-inner a:hover { color: #fff; }
.footer-inner p { margin-bottom: 6px; font-size: .92rem; }
.footer-copy { border-top: 1px solid rgba(255,255,255,.12); padding: 16px 20px; font-size: .82rem; color: #8b8e98; }

/* ---------- Admin ---------- */
.admin-login { max-width: 380px; margin: 70px auto; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.admin-stats { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 26px; }
.stat-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 22px; min-width: 150px; }
.stat-card .num { font-size: 1.5rem; font-weight: 800; color: var(--violet-btn); }
.stat-card .lbl { font-size: .8rem; color: var(--muted); }
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 34px;
}
.admin-table th, .admin-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid #eef0f6; font-size: .9rem; }
.admin-table th { background: #f3f1fd; font-size: .8rem; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table .actions { display: flex; gap: 8px; }
.status-pill { border-radius: 999px; padding: 2px 10px; font-size: .76rem; font-weight: 800; background: #fff3d6; color: #8a6100; }
.section-title { font-size: 1.5rem; margin: 30px 0 20px; font-weight: 800; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
    .hero-inner { grid-template-columns: 1fr; text-align: center; }
    .hero-sub { margin-left: auto; margin-right: auto; }
    .hero-img img { max-width: 240px; margin: 0 auto; }
    .hero h1 { font-size: 2.2rem; }
    .header-inner { flex-wrap: wrap; gap: 14px; }
    .search { order: 3; max-width: none; flex-basis: 100%; }
    .footer-inner { grid-template-columns: 1fr; }
    .checkout-layout { grid-template-columns: 1fr; }
    .cart-row { flex-wrap: wrap; }
    .promo-banner { padding: 32px 26px; }
}
