/* ==========================================================
   TOKENS: cada objeto de la web tiene sus propias variables.
   Para cambiar el aspecto de algo, se edita solo acá arriba.
   ========================================================== */
:root {
  /* Base: colores y tipografías de la marca */
  --paper: #f3f4f8;
  --surface: #ffffff;
  --plinth: #e7eaf1;
  --ink: #0d1230;
  --mute: #5a6078;
  --line: #d8dce6;
  --blue: #0a67fe;
  --wa: #25d366;
  --danger: #b42318;
  --display: "Archivo", "Arial Black", "Helvetica Neue", Arial, sans-serif;
  --text: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --maxw: 1180px;
  --gutter: 20px;

  /* Logo */
  --logo-size: 1.3rem;
  --logo-color: var(--ink);
  --logo-accent: var(--blue);

  /* Botones */
  --btn-radius: 999px;
  --btn-pad: .7rem 1.35rem;
  --btn-size: .95rem;
  --btn-weight: 600;
  --btn-ink-bg: var(--ink);
  --btn-ink-fg: #fff;
  --btn-ink-hover: var(--blue);
  --btn-line-fg: var(--ink);
  --btn-line-border: var(--ink);

  /* Encabezado y hero */
  --masthead-height: 72px;
  --hero-pad: 56px 0 52px;
  --hero-title-size: clamp(2.1rem, 8.4vw, 3.9rem);
  --hero-title-max: 16ch;
  --hero-actions-gap: 10px;

  /* Barra de filtros */
  --bar-bg: rgba(243, 244, 248, .9);
  --bar-border: var(--line);
  --tab-size: .98rem;
  --tab-gap: 22px;
  --tab-color: var(--mute);
  --tab-active: var(--ink);
  --search-bg: var(--surface);
  --search-border: var(--line);
  --search-radius: 999px;

  /* Secciones */
  --section-gap-top: 32px;
  --section-title-size: clamp(1.7rem, 5vw, 2.3rem);
  --section-count-size: .92rem;
  --section-note-size: .9rem;
  --grid-cols: 2;
  --grid-gap: 28px 14px;

  /* Tarjeta de producto */
  --card-row-gap: 10px;
  --card-rows: 6;

  /* Foto (nicho) */
  --tile-bg: linear-gradient(180deg, #dfe3ec, var(--plinth));
  --tile-radius: 999px 999px 18px 18px;
  --tile-ratio: 4 / 5;
  --tile-img-size: 94%;
  --tile-photo-size: 128%;

  /* Cartel sobre la foto ("Sin stock", "Imagen ilustrativa") */
  --flag-size: .7rem;
  --flag-color: var(--mute);
  --flag-bg: rgba(255, 255, 255, .78);
  --flag-pad: 2px 10px;
  --flag-out-color: #fff;
  --flag-out-bg: var(--danger);

  /* Nombre del modelo */
  --name-size: 1rem;
  --name-weight: 700;
  --name-leading: 1.25;

  /* Precio */
  --price-usd-size: 1.5rem;
  --price-usd-weight: 800;
  --price-usd-label-size: .72rem;
  --price-usd-label-color: var(--mute);
  --price-ars-size: .88rem;
  --price-ars-color: var(--mute);
  --price-ask-size: 1.1rem;
  --price-gap: 0 10px;
  --price-direction: column; /* celular: pesos siempre debajo de USD */
  --price-align: flex-start;

  /* Capacidad (botones y etiqueta fija) */
  --chip-gap: 6px;
  --chip-pad: 5px 12px;
  --chip-size: .82rem;
  --chip-weight: 600;
  --chip-radius: 999px;
  --chip-height: auto;
  --chip-bg: transparent;
  --chip-color: var(--mute);
  --chip-border: var(--line);
  --chip-hover-color: var(--ink);
  --chip-hover-border: var(--ink);
  --chip-active-bg: var(--ink);
  --chip-active-color: #fff;
  --chip-active-border: var(--ink);

  /* Colores y aclaraciones debajo de la capacidad */
  --extra-gap: 4px;
  --extra-size: .82rem;
  --extra-color: var(--mute);
  --detail-size: .8rem;

  /* Pie */
  --foot-bg: var(--ink);
  --foot-color: #dfe2f0;
  --foot-title-color: #fff;
  --foot-notes-color: #aeb4cc;
  --foot-legal-color: #8b92ad;
  --foot-pad: 52px 0 96px;

  /* WhatsApp flotante */
  --fab-size: 56px;
  --fab-bg: var(--wa);
  --fab-offset: 16px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body { font-family: var(--text); font-weight: 500; background: var(--paper); color: var(--ink); line-height: 1.5; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

/* Logo (marca del cliente: negro con E y S en azul) */
.logo { display: block; color: var(--logo-color); text-decoration: none; font-family: var(--display); font-weight: 900; font-style: italic; letter-spacing: -.05em; line-height: .88; font-size: var(--logo-size); text-transform: uppercase; }
.logo span { display: block; }
.logo b { color: var(--logo-accent); }
.logo.on-dark { color: #fff; }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; border-radius: var(--btn-radius); padding: var(--btn-pad); font-weight: var(--btn-weight); font-size: var(--btn-size); text-decoration: none; cursor: pointer; border: 1px solid var(--btn-line-border); transition: background .2s, color .2s, border-color .2s; }
.btn-ink { background: var(--btn-ink-bg); color: var(--btn-ink-fg); }
.btn-ink:hover { background: var(--btn-ink-hover); border-color: var(--btn-ink-hover); }
.btn-line { background: transparent; color: var(--btn-line-fg); }
.btn-line:hover { background: var(--btn-line-border); color: #fff; }
.btn-block { width: 100%; }
.btn svg { width: 18px; height: 18px; fill: currentColor; }

/* Encabezado */
.masthead .wrap { display: flex; align-items: center; justify-content: space-between; height: var(--masthead-height); }

/* Hero */
.hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0; padding: var(--hero-pad); }
.hero h1 { font-family: var(--display); font-style: italic; font-weight: 900; font-size: var(--hero-title-size); line-height: 1; letter-spacing: -.045em; max-width: var(--hero-title-max); text-wrap: balance; }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--hero-actions-gap); margin-top: 28px; }
@keyframes rise { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }

/* Barra de filtros (queda fija al scrollear) */
.bar { position: sticky; top: 0; z-index: 20; background: var(--bar-bg); backdrop-filter: blur(12px); border-top: 1px solid var(--bar-border); border-bottom: 1px solid var(--bar-border); }
.bar .wrap { display: grid; gap: 10px; padding-top: 10px; padding-bottom: 10px; }
.tabs { display: flex; gap: var(--tab-gap); overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent); mask-image: linear-gradient(90deg, #000 92%, transparent); }
.tabs::-webkit-scrollbar { display: none; }
.tab { background: none; border: 0; cursor: pointer; padding: 8px 0; font-weight: 600; font-size: var(--tab-size); color: var(--tab-color); white-space: nowrap; border-bottom: 2px solid transparent; transition: color .15s, border-color .15s; }
.tab:hover { color: var(--tab-active); }
.tab[aria-selected="true"] { color: var(--tab-active); border-bottom-color: var(--tab-active); }
.search { position: relative; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; stroke: var(--mute); fill: none; stroke-width: 2; stroke-linecap: round; }
.search input { width: 100%; background: var(--search-bg); border: 1px solid var(--search-border); border-radius: var(--search-radius); padding: 10px 16px 10px 42px; outline: none; }
.search input:focus { border-color: var(--ink); }

/* Secciones y productos */
.catalog { padding-top: 12px; padding-bottom: 28px; }
.section { padding-top: var(--section-gap-top); }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-bottom: 18px; }
.section-head h2 { font-family: var(--display); font-style: italic; font-weight: 800; font-size: var(--section-title-size); letter-spacing: -.04em; line-height: 1.1; }
.section-head .count { color: var(--mute); font-size: var(--section-count-size); }
.section-head .note { flex-basis: 100%; color: var(--mute); font-size: var(--section-note-size); }
.grid { display: grid; grid-template-columns: repeat(var(--grid-cols), minmax(0, 1fr)); gap: var(--grid-gap); }

.card { display: flex; flex-direction: column; gap: 12px; }
.tile { position: relative; background: var(--tile-bg); border-radius: var(--tile-radius); aspect-ratio: var(--tile-ratio); display: grid; place-items: center; overflow: hidden; }
.tile img { width: var(--tile-img-size); height: var(--tile-img-size); object-fit: contain; }
/* Las fotos traen mucho margen: se amplían para que el equipo llene el nicho. */
.tile img.photo { width: var(--tile-photo-size); height: var(--tile-photo-size); max-width: none; mix-blend-mode: multiply; }
.tile img.photo.fit { position: absolute; max-width: none; object-fit: fill; }
.tile .flag { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); font-size: var(--flag-size); color: var(--flag-color); background: var(--flag-bg); border-radius: 999px; padding: var(--flag-pad); white-space: nowrap; }
.tile .flag.out { color: var(--flag-out-color); background: var(--flag-out-bg); font-weight: 600; }

.meta { display: flex; flex-wrap: wrap; align-items: baseline; }
.meta h3 { font-size: var(--name-size); font-weight: var(--name-weight); line-height: var(--name-leading); }

.price { display: flex; flex-direction: var(--price-direction); flex-wrap: wrap; align-items: var(--price-align); gap: var(--price-gap); font-variant-numeric: tabular-nums; }
.price .usd { font-family: var(--display); font-style: italic; font-size: var(--price-usd-size); font-weight: var(--price-usd-weight); letter-spacing: -.03em; }
.price .usd small { font-size: var(--price-usd-label-size); font-weight: 600; color: var(--price-usd-label-color); margin-right: 3px; letter-spacing: 0; }
.price .ars { color: var(--price-ars-color); font-size: var(--price-ars-size); }
.price .ask { font-size: var(--price-ask-size); font-weight: 600; }

/* Capacidad: las etiquetas nunca se estiran, aunque la fila de la tarjeta sea más alta. */
.variants { display: flex; flex-wrap: wrap; gap: var(--chip-gap); align-items: flex-start; align-content: flex-start; }
.variant { height: var(--chip-height); flex: 0 0 auto; background: var(--chip-bg); border: 1px solid var(--chip-border); border-radius: var(--chip-radius); padding: var(--chip-pad); font-size: var(--chip-size); font-weight: var(--chip-weight); line-height: 1.4; color: var(--chip-color); cursor: pointer; font-variant-numeric: tabular-nums; transition: background .15s, color .15s, border-color .15s; }
.variant:hover { border-color: var(--chip-hover-border); color: var(--chip-hover-color); }
.variant[aria-checked="true"] { background: var(--chip-active-bg); border-color: var(--chip-active-border); color: var(--chip-active-color); }
.variant.out { text-decoration: line-through; }
.variant.single { cursor: default; }
.variant.single:hover { border-color: var(--chip-border); color: var(--chip-color); }

.extra { display: flex; flex-direction: column; gap: var(--extra-gap); }
.extra .colors { font-size: var(--extra-size); color: var(--extra-color); }
.extra .detail { color: var(--extra-color); font-size: var(--detail-size); }
.variants:empty, .extra:empty { display: none; }
.card .btn { margin-top: auto; }

/* Filas compartidas: nombre, precio, capacidad y extras quedan a la misma altura en cada fila de tarjetas. */
@supports (grid-template-rows: subgrid) {
  .grid > .card { display: grid; grid-row: span var(--card-rows); grid-template-rows: subgrid; row-gap: var(--card-row-gap); }
  .grid > .card .variants:empty, .grid > .card .extra:empty { display: block; }
  .grid > .card .extra { display: block; }
  .grid > .card .extra > p { margin: 0 0 var(--extra-gap); }
}
.empty { padding: 56px 0; text-align: center; color: var(--mute); }

/* Pie */
.foot { background: var(--foot-bg); color: var(--foot-color); margin-top: 36px; padding: var(--foot-pad); }
.foot-grid { display: grid; gap: 32px; }
.foot h4 { color: var(--foot-title-color); font-size: 1rem; font-weight: 700; margin-bottom: 10px; }
.foot ul { list-style: none; display: grid; gap: 4px; }
.foot a { text-decoration: none; }
.foot a:hover { text-decoration: underline; }
.foot .notes { color: var(--foot-notes-color); font-size: .92rem; margin-top: 4px; }
.foot .legal { margin-top: 40px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .14); color: var(--foot-legal-color); font-size: .85rem; }

/* WhatsApp flotante */
.fab { position: fixed; right: var(--fab-offset); bottom: var(--fab-offset); z-index: 30; width: var(--fab-size); height: var(--fab-size); border-radius: 50%; background: var(--fab-bg); display: grid; place-items: center; box-shadow: 0 10px 28px rgba(13, 18, 48, .28); }
.fab svg { width: 30px; height: 30px; fill: #fff; }

@media (min-width: 760px) {
  :root { --gutter: 32px; --hero-pad: 88px 0 80px; --hero-title-size: 4.6rem; --hero-title-max: 18ch; }
  .bar .wrap { grid-template-columns: 1fr 300px; align-items: center; }
  .tabs { -webkit-mask-image: none; mask-image: none; }
  :root { --price-direction: row; --price-align: baseline; --grid-cols: 3; --grid-gap: 36px 22px; }
  .foot-grid { grid-template-columns: 1.2fr 1fr 1fr 1fr; }
}
@media (min-width: 1100px) {
  :root { --grid-cols: 4; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
    * { transition: none !important; }
}

/* Ficha técnica */
.actions { display: flex; gap: 8px; margin-top: auto; }
.actions .btn { margin-top: 0; }
.actions .btn-block { flex: 1; width: auto; min-width: 0; }
.btn-specs { flex: 0 0 auto; padding: .7rem 1rem; }
.actions { min-width: 0; }
@media (max-width: 599px) {
  .actions { gap: 6px; }
  .actions .btn { padding: .65rem .5rem; font-size: .84rem; }
  .actions .btn-specs { padding: .65rem .7rem; }
  .specs { padding: 18px; }
  .specs-list { grid-template-columns: 6.2rem 1fr; font-size: .88rem; }
}
.specs { margin: auto; border: 0; border-radius: 16px; padding: 22px; width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 48px); background: var(--surface); color: var(--ink); font-family: var(--text); }
.specs::backdrop { background: rgba(13, 18, 48, .55); }
.specs-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.specs-head h3 { margin: 0; font-family: var(--display); font-style: italic; font-size: 1.4rem; }
.specs-close { background: none; border: 0; font-size: 1.8rem; line-height: 1; cursor: pointer; color: var(--mute); }
.specs-list { margin: 0; display: grid; grid-template-columns: 7.5rem 1fr; gap: 0; font-size: .92rem; }
.specs-list dt, .specs-list dd { margin: 0; padding: 9px 0; border-top: 1px solid var(--line); }
.specs-list dt { overflow-wrap: anywhere; padding-right: 10px; color: var(--mute); font-weight: 600; }
.specs-src { font-size: .78rem; color: var(--mute); margin: 12px 0 14px; }

/* Comparador */
/* El tile tiene forma de arco: el casillero va arriba al centro, donde el arco todavía es ancho. */
.cmp-toggle { position: absolute; top: 22px; left: 50%; transform: translateX(-50%); z-index: 2; width: max-content; max-width: calc(100% - 20px); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: .74rem; font-weight: 600; color: var(--ink); background: rgba(255, 255, 255, .92); border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px 5px 7px; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.cmp-toggle:hover:not(:disabled) { border-color: var(--ink); }
.cmp-toggle:disabled { opacity: .45; cursor: not-allowed; }
.cmp-box { width: 14px; height: 14px; border: 1.5px solid var(--mute); border-radius: 4px; display: inline-grid; place-items: center; font-size: 10px; line-height: 1; }
.cmp-toggle[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.cmp-toggle[aria-pressed="true"] .cmp-box { background: #fff; border-color: #fff; color: var(--ink); }
.cmp-toggle[aria-pressed="true"] .cmp-box::after { content: "✓"; font-weight: 800; }

.cmp-bar { position: fixed; z-index: 30; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 32px); background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 999px; box-shadow: 0 8px 30px rgba(13, 18, 48, .18); padding: 8px 10px 8px 20px; }
.cmp-bar[hidden] { display: none; }
.cmp-msg { font-size: .88rem; font-weight: 600; min-width: 0; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cmp-bar .btn { padding: .55rem 1.1rem; font-size: .88rem; flex: 0 0 auto; }
.cmp-bar .btn:disabled { opacity: .4; cursor: not-allowed; }
.cmp-clear { background: none; border: 0; font: inherit; font-size: 1.5rem; line-height: 1; color: var(--mute); cursor: pointer; padding: 0 8px; flex: 0 0 auto; }
.cmp-clear:hover { color: var(--ink); }

.specs.compare { width: min(860px, calc(100vw - 24px)); }
.cmp-only { display: flex; align-items: center; gap: 4px; font-size: .86rem; color: var(--mute); margin: 2px 0 10px; cursor: pointer; }
.cmp-scroll { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.cmp-table { width: 100%; border-collapse: collapse; font-size: .9rem; table-layout: fixed; min-width: 520px; }
.cmp-table th, .cmp-table td { padding: 10px 12px 10px 0; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
.cmp-table thead th { border-top: 0; vertical-align: bottom; padding-bottom: 12px; }
.cmp-corner, .cmp-table tbody th { width: 7.2rem; color: var(--mute); font-weight: 600; position: sticky; left: 0; background: var(--surface); z-index: 1; }
.cmp-table h4 { font-family: var(--display); font-style: italic; font-size: 1.05rem; margin-bottom: 8px; }
.cmp-variant { font: inherit; font-size: .82rem; font-weight: 600; max-width: 100%; border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; background: var(--surface); color: var(--ink); }
.cmp-single { font-size: .82rem; font-weight: 600; color: var(--mute); }
.cmp-price { margin-top: 8px; display: flex; flex-direction: column; gap: 2px; font-weight: 700; }
.cmp-price .usd { font-family: var(--display); font-style: italic; font-size: 1.35rem; }
.cmp-price .usd small { font-size: .6em; margin-right: 4px; }
.cmp-price .ars, .cmp-price .ask { font-size: .85rem; color: var(--mute); font-weight: 500; }
.cmp-table tr.diff td { background: rgba(10, 103, 254, .07); font-weight: 600; padding-left: 10px; }
.cmp-table tr.diff th { color: var(--blue); }
.cmp-empty { color: var(--mute); text-align: center !important; }
@media (max-width: 599px) {
  .cmp-bar { left: 16px; right: 84px; transform: none; max-width: none; padding: 6px 8px 6px 14px; gap: 8px; }
  .cmp-msg { font-size: .78rem; }
  .cmp-bar .btn { padding: .5rem .85rem; }
  .cmp-toggle { top: 20px; font-size: .7rem; padding: 4px 8px 4px 6px; }
  .cmp-table { min-width: 0; font-size: .8rem; }
  .cmp-table th, .cmp-table td { padding: 8px 8px 8px 0; }
  .cmp-corner, .cmp-table tbody th { width: 4.6rem; position: static; }
  .cmp-table h4 { font-size: .95rem; }
  .cmp-price .usd { font-size: 1.15rem; }
  .cmp-variant { font-size: .76rem; padding: 3px 6px; }
  .specs.compare { padding: 16px 14px; }
}
