/* ============================================================================
   tienda.tnydark.com — TEMA POR DEFECTO: claro y moderno (estilo Woodmart).
   El storefront usa el tema claro. El panel /foh (body.foh) mantiene la estética
   terminal (oscuro/mono) reescribiendo las variables al final del archivo.
   ========================================================================== */

:root {
  --font-head: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --bg: #ffffff;
  --bg-soft: #f6f5f3;
  --panel: #ffffff;
  --fg: #2b2b2b;
  --heading: #1a1a1a;
  --muted: #8c8c8c;
  --border: #ececec;
  --accent: #be9b71;       /* tono madera/cálido Woodmart */
  --accent-ink: #9c7c54;
  --primary: #1d1d1d;      /* botones */
  --primary-fg: #ffffff;
  --danger: #c0392b;
  --ok: #3a9a4e;
  --input-bg: #ffffff;
  --radius: 4px;
  --maxw: 1080px;        /* ancho máximo del diseño (no full width) */
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--fg);
  font-family: var(--font-body); font-size: 15px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent-ink); }
h1, h2, h3, h4 { font-family: var(--font-head); color: var(--heading); font-weight: 600; line-height: 1.25; }
.muted { color: var(--muted); }
.empty { color: var(--muted); padding: 3rem 0; text-align: center; }
.error { color: var(--danger); }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.page { max-width: var(--maxw); margin: 0 auto; padding: 26px 24px 64px; }

input, textarea, select {
  background: var(--input-bg); color: var(--fg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.6rem 0.75rem; font-family: inherit; font-size: 0.95rem;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }

.btn {
  display: inline-block; background: var(--primary); color: var(--primary-fg);
  border: 1px solid var(--primary); font-family: var(--font-head); font-weight: 600;
  font-size: 0.8rem; letter-spacing: 0.6px; text-transform: uppercase; cursor: pointer;
  padding: 0.72rem 1.5rem; border-radius: var(--radius); transition: all 0.15s; text-align: center;
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; text-decoration: none; }
.btn.ghost { background: transparent; color: var(--fg); border-color: var(--border); }
.btn.ghost:hover { background: transparent; color: var(--fg); border-color: var(--fg); }

/* ---------- Top bar ---------- */
.topbar { background: #1d1d1d; color: #cfcfcf; font-size: 0.78rem; }
.topbar .container { display: flex; align-items: center; justify-content: space-between; height: 38px; }
.topbar a { color: #cfcfcf; }
.topbar a:hover { color: #fff; }

/* ---------- Header ---------- */
.site-header { background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 78px; gap: 24px; }
.brand {
  font-family: var(--font-head); font-weight: 700; font-size: 1.5rem; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--heading);
}
.brand:hover { color: var(--heading); }
.main-nav { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.main-nav a {
  font-family: var(--font-head); font-weight: 500; font-size: 0.8rem; letter-spacing: 0.6px;
  text-transform: uppercase; color: var(--fg);
}
.main-nav a:hover, .main-nav a.active { color: var(--accent-ink); }
.header-actions { display: flex; align-items: center; gap: 18px; white-space: nowrap; }
.cart-link {
  font-family: var(--font-head); font-weight: 600; font-size: 0.78rem; text-transform: uppercase;
  letter-spacing: 0.5px; display: inline-flex; align-items: center; gap: 7px; color: var(--fg);
}
.cart-link:hover { color: var(--accent-ink); }
.cart-link::before { content: "\1F6D2"; font-size: 1.05rem; }

/* ---------- Hero ---------- */
.hero { background: var(--bg-soft); }
.hero .container { padding: 92px 24px; text-align: center; }
.hero-label { text-transform: uppercase; letter-spacing: 3px; font-size: 0.76rem; color: var(--accent-ink); font-weight: 600; }
.hero h1 { font-size: 3rem; margin: 0.6rem 0 1rem; }
.hero p { color: var(--muted); font-size: 1.05rem; max-width: 560px; margin: 0 auto 1.9rem; }

/* ---------- Sections ---------- */
.section { padding: 66px 0; }
.section-soft { background: var(--bg-soft); }
.section-head { text-align: center; margin-bottom: 42px; }
.section-head .label { text-transform: uppercase; letter-spacing: 3px; font-size: 0.74rem; color: var(--accent-ink); font-weight: 600; }
.section-head h2 { font-size: 1.9rem; margin: 0.4rem 0 0; }

/* ---------- Category tiles ---------- */
.cat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.cat-tile {
  position: relative; aspect-ratio: 3/4; border-radius: var(--radius); overflow: hidden;
  display: flex; align-items: flex-end; background: #e3e0db;
}
.cat-tile .cat-img { position: absolute; inset: 0; background-size: cover; background-position: center; transition: transform 0.55s; }
.cat-tile:hover .cat-img { transform: scale(1.07); }
.cat-tile .cat-name {
  position: relative; z-index: 2; width: 100%; padding: 16px;
  background: linear-gradient(transparent, rgba(0,0,0,0.7)); color: #fff;
  font-family: var(--font-head); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; font-size: 0.95rem;
}
.cat-tile:hover .cat-name { color: #fff; }

/* ---------- Category quick links ---------- */
.cat-list { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 32px; }
.cat-list a {
  border: 1px solid var(--border); padding: 8px 16px; border-radius: 40px; font-size: 0.8rem;
  text-transform: uppercase; letter-spacing: 0.5px; font-family: var(--font-head); color: var(--fg);
}
.cat-list a:hover { border-color: var(--fg); color: var(--fg); }

/* ---------- Product grid + cards ---------- */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(245px, 1fr)); gap: 10px; }
.product-card {
  background: #fff; border: 1px solid var(--border); display: flex; flex-direction: column;
  transition: box-shadow 0.2s, border-color 0.2s; position: relative; color: var(--fg);
}
.product-card:hover { box-shadow: 0 14px 34px rgba(0,0,0,0.1); border-color: #ddd; z-index: 2; text-decoration: none; }
.card-imgwrap { position: relative; aspect-ratio: 1/1; overflow: hidden; background: var(--bg-soft); }
.card-img { position: absolute; inset: 0; background-size: cover; background-position: center; transition: transform 0.55s; }
.product-card:hover .card-img { transform: scale(1.06); }
.card-img--empty { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 0.8rem; }
.badge-feat {
  position: absolute; top: 10px; left: 10px; z-index: 3; background: var(--accent); color: #fff;
  font-family: var(--font-head); font-size: 0.64rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.5px; padding: 3px 9px; border-radius: 2px;
}
.card-body { padding: 16px; text-align: center; display: flex; flex-direction: column; gap: 6px; }
.card-cat { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); }
.card-name { font-family: var(--font-head); font-weight: 500; font-size: 0.95rem; color: var(--heading); }
.product-card:hover .card-name { color: var(--accent-ink); }
.card-price { font-family: var(--font-head); font-weight: 600; color: var(--heading); }
.card-cta { margin-top: 8px; }

/* ---------- Breadcrumbs ---------- */
.crumbs { color: var(--muted); font-size: 0.82rem; margin-bottom: 1.4rem; }
.crumbs a:hover { color: var(--accent-ink); }
.cat-desc { color: var(--muted); margin-bottom: 1.6rem; }

/* ---------- Product detail ---------- */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 52px; padding: 6px 0 10px; }
.detail-img { aspect-ratio: 1/1; background-size: cover; background-position: center; background-color: var(--bg-soft); border: 1px solid var(--border); }
.detail-img--empty { display: flex; align-items: center; justify-content: center; color: var(--muted); }
.detail-info h1 { font-size: 2rem; margin: 0.2rem 0 0.4rem; }
.detail-cat { text-transform: uppercase; letter-spacing: 1px; font-size: 0.74rem; color: var(--muted); }
.detail-price { font-family: var(--font-head); color: var(--heading); font-size: 1.7rem; font-weight: 600; margin: 1rem 0; }
.sku { color: var(--muted); font-size: 0.82rem; }
.stock { margin: 0.5rem 0; }
.in-stock { color: var(--ok); font-weight: 600; font-size: 0.85rem; }
.no-stock { color: var(--danger); font-weight: 600; }
.detail-desc { color: #555; margin-top: 1.5rem; white-space: pre-wrap; border-top: 1px solid var(--border); padding-top: 1.4rem; }
.add-cart { display: flex; gap: 12px; align-items: center; margin: 1.6rem 0; }
.add-cart input[type=number], .qty-form input[type=number] { width: 74px; }

/* ---------- Tablas (carrito / checkout / pedidos) ---------- */
table.data { width: 100%; border-collapse: collapse; }
table.data th, table.data td { text-align: left; padding: 13px 12px; border-bottom: 1px solid var(--border); }
table.data th { font-family: var(--font-head); font-weight: 600; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); }
.cart-total { font-family: var(--font-head); font-size: 1.3rem; margin: 1.5rem 0; }

/* ---------- Formularios ---------- */
.form { display: flex; flex-direction: column; gap: 1rem; max-width: 520px; }
.form label { display: flex; flex-direction: column; gap: 0.35rem; color: var(--muted); font-size: 0.85rem; }
.form label.check { flex-direction: row; align-items: center; gap: 0.5rem; }
.form input, .form textarea, .form select { width: 100%; color: var(--fg); }

/* ---------- Footer ---------- */
.site-footer { background: #1a1a1a; color: #b3b3b3; margin-top: 30px; }
.footer-cols { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; max-width: var(--maxw); margin: 0 auto; padding: 56px 24px 40px; }
.footer-cols h4 { color: #fff; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 1px; margin: 0 0 1rem; }
.footer-cols a, .footer-cols .foot-info { color: #b3b3b3; display: block; padding: 4px 0; font-size: 0.9rem; }
.footer-cols a:hover { color: #fff; }
.footer-brand .brand { color: #fff; display: inline-block; margin-bottom: 0.7rem; }
.footer-brand p { margin: 0; max-width: 360px; font-size: 0.9rem; line-height: 1.7; }
.footer-bottom { border-top: 1px solid #2c2c2c; padding: 20px 0; font-size: 0.8rem; color: #777; text-align: center; }

/* ---------- Aviso de envío (módulo carrito) ---------- */
.ship-note { color: var(--muted); font-size: 0.9rem; margin: 0.4rem 0 1.2rem; }
.ship-free { color: var(--ok); font-weight: 600; }

/* ---------- Banner de cookies (core) ---------- */
.cookie-banner {
  display: none; position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 200;
  max-width: var(--maxw); margin: 0 auto; background: #1a1a1a; color: #e6e6e6;
  border: 1px solid #2c2c2c; border-radius: 8px; padding: 14px 18px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.35);
  align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.cookie-banner.show { display: flex; }
.cookie-banner span { font-size: 0.88rem; line-height: 1.5; }
.cookie-banner .btn { flex-shrink: 0; }

@media (max-width: 900px) {
  .product-detail { grid-template-columns: 1fr; gap: 26px; }
  .footer-cols { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: 2.2rem; }
  .main-nav { gap: 16px; font-size: 0.74rem; }
}
@media (max-width: 560px) {
  .footer-cols { grid-template-columns: 1fr; }
  .site-header .container { height: 64px; }
  .brand { font-size: 1.2rem; }
}

/* ============================================================================
   Panel /foh — estética terminal (oscuro / monoespaciado).
   Reescribe las variables y conserva los componentes de administración.
   ========================================================================== */
body.foh {
  --bg: #0a0a0a; --bg-soft: #121212; --panel: #121212; --fg: #e6e6e6; --heading: #e6e6e6;
  --muted: #888; --border: #262626; --accent: #00d977; --accent-ink: #00d977;
  --primary: #00d977; --primary-fg: #002b16; --danger: #e0533d; --input-bg: #0f0f0f;
  background: var(--bg); color: var(--fg); font-family: var(--mono);
}
body.foh h1, body.foh h2, body.foh h3, body.foh h4 { font-family: var(--mono); }
body.foh a { color: var(--accent); }
body.foh .btn { text-transform: none; letter-spacing: 0; font-family: var(--mono); font-size: 0.9rem; padding: 0.5rem 0.9rem; }
code { color: var(--accent); font-family: var(--mono); }

/* /foh — layout con menú vertical izquierdo (estilo PrestaShop) */
.foh-layout { display: flex; min-height: 100vh; align-items: stretch; }
.foh-sidebar {
  width: 232px; flex-shrink: 0; background: var(--panel); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.foh-brand {
  display: flex; flex-direction: column; gap: 0.15rem; padding: 1rem 1.2rem;
  font-weight: 700; letter-spacing: 0.5px; color: var(--fg); border-bottom: 1px solid var(--border);
}
.foh-brand:hover { text-decoration: none; color: var(--fg); }
.foh-brand-sub { color: var(--muted); font-size: 0.72rem; font-weight: 400; }
.foh-menu { flex: 1; overflow-y: auto; display: flex; flex-direction: column; padding: 0.5rem 0; }
.foh-menu a { padding: 0.5rem 1.2rem; color: var(--muted); border-left: 2px solid transparent; }
.foh-menu a:hover { color: var(--fg); background: #181818; text-decoration: none; }
.foh-menu a.active { color: var(--accent); border-left-color: var(--accent); background: #141414; }
.foh-menu-section { padding: 0.95rem 1.2rem 0.3rem; color: #5a5a5a; font-size: 0.68rem; letter-spacing: 1px; text-transform: uppercase; }
.foh-sidebar-foot { border-top: 1px solid var(--border); padding: 0.5rem 0; display: flex; flex-direction: column; }
.foh-sidebar-foot a { padding: 0.4rem 1.2rem; color: var(--muted); }
.foh-sidebar-foot a:hover { color: var(--fg); text-decoration: none; }
.foh-content { flex: 1; min-width: 0; padding: 1.6rem 2rem; max-width: 1120px; }
@media (max-width: 760px) {
  .foh-layout { flex-direction: column; }
  .foh-sidebar { width: 100%; height: auto; position: static; }
  .foh-menu { padding: 0.3rem 0; }
}

/* /foh — login */
.login-box {
  max-width: 320px; margin: 8vh auto; padding: 2rem; border: 1px solid var(--border);
  border-radius: 8px; background: var(--panel); text-align: center;
}
.login-box h1 { font-size: 1.4rem; margin: 0 0 0.2rem; }
.login-box form { display: flex; flex-direction: column; gap: 0.7rem; margin-top: 1rem; }

/* /foh — componentes de administración */
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.2rem; }
.actions { display: flex; gap: 0.6rem; align-items: center; }
.actions form { display: inline; }
.actions button { background: transparent; border: none; color: var(--danger); cursor: pointer; padding: 0; font-family: var(--mono); }
.actions button:hover { text-decoration: underline; }
.stat-grid { display: flex; gap: 1rem; margin: 1rem 0 1.5rem; flex-wrap: wrap; }
.stat { border: 1px solid var(--border); border-radius: 6px; padding: 1rem 1.5rem; background: var(--panel); }
.stat .n { display: block; font-size: 1.8rem; color: var(--accent); font-weight: 700; }
.stat .l { color: var(--muted); font-size: 0.85rem; }
.module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.module-card { border: 1px solid var(--border); border-radius: 6px; padding: 1rem; background: var(--panel); }
.module-card.on { border-color: var(--accent); }
.module-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.module-name { font-weight: 700; }
.badge { font-size: 0.75rem; color: var(--muted); border: 1px solid var(--border); border-radius: 3px; padding: 0.1rem 0.4rem; }
.module-card.on .badge { color: var(--accent); border-color: var(--accent); }
.ver { color: var(--muted); font-size: 0.8rem; }

/* /foh — editar imagen de producto */
.img-edit { margin-top: 2rem; border-top: 1px solid var(--border); padding-top: 1.2rem; max-width: 560px; }
.img-edit h2 { font-size: 1.05rem; margin: 0 0 0.8rem; }
.img-current { margin-bottom: 1rem; }
.img-current img { max-width: 220px; border: 1px solid var(--border); border-radius: 4px; }
.img-form { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
