:root {
  color-scheme: light;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--sapphire);
  background: var(--pearl);
  font-synthesis: none;
  --sapphire: #13285a;
  --pearl: #ece6dc;
  --orange: #ff5a12;
  --white: #fff;
  --muted: color-mix(in srgb, var(--sapphire) 76%, var(--pearl));
  --line: color-mix(in srgb, var(--sapphire) 14%, var(--pearl));
  --surface: color-mix(in srgb, var(--pearl) 40%, var(--white));
  --focus: var(--sapphire);
  --width: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; }
body:has(.product-dialog[open]) { overflow: hidden; }
[hidden] { display: none !important; }
button, input, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }

.contenedor { width: min(var(--width), calc(100% - 5rem)); margin-inline: auto; }
.sr-only, .skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link:focus { position: fixed; z-index: 5; top: 1rem; left: 1rem; padding: .75rem; background: var(--white); }

.site-header, .site-footer, .hero { background: var(--sapphire); color: var(--pearl); --focus: var(--pearl); }
.site-header { border-bottom: 1px solid color-mix(in srgb, var(--pearl) 18%, transparent); }
.header-inner, .footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.wordmark { position: relative; display: block; width: 16.75rem; aspect-ratio: 16 / 5; overflow: hidden; }
.wordmark img { position: absolute; top: 50%; left: -23%; width: 140%; max-width: none; height: auto; transform: translateY(-50%); }
.nav-link { display: inline-flex; align-items: center; min-height: 2.75rem; color: var(--pearl); font-size: .9375rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.nav-link:hover { text-decoration: underline; text-decoration-color: var(--orange); text-underline-offset: .25em; }

.hero { overflow: hidden; }
.hero-inner { min-height: 30rem; display: grid; grid-template-columns: minmax(0, .97fr) minmax(0, 1.03fr); align-items: center; }
.hero-content { position: relative; z-index: 1; padding: 3.6rem 0; }
.hero h1 { margin: 0; font-size: clamp(3rem, 5.3vw, 5rem); line-height: 1; letter-spacing: -.048em; }
.hero-description { max-width: 25rem; margin: 1.3rem 0 1.75rem; font-size: 1.0625rem; line-height: 1.55; }
.button { display: inline-flex; min-height: 2.9rem; align-items: center; justify-content: center; padding: .7rem 1.25rem; border: 1px solid transparent; border-radius: .45rem; font-size: .9375rem; font-weight: 700; text-decoration: none; transition: background-color 160ms ease, border-color 160ms ease; }
.button-primary { background: var(--orange); color: var(--sapphire); }
.button-primary:hover { background: color-mix(in srgb, var(--orange) 82%, var(--pearl)); }
.button-secondary { background: var(--white); border-color: var(--line); color: var(--sapphire); }
.button-secondary:hover { border-color: var(--sapphire); background: var(--surface); }

.hero-showcase { position: relative; align-self: stretch; isolation: isolate; }
.hero-showcase::before { content: ""; position: absolute; z-index: -1; top: 50%; left: 50%; width: min(85%, 27rem); aspect-ratio: 1; border: 1px solid color-mix(in srgb, var(--pearl) 22%, transparent); border-radius: 50%; background: radial-gradient(circle, #ece6dc16, transparent 72%); transform: translate(-50%, -50%); }
.hero-mascot { position: absolute; bottom: -2rem; left: 50%; width: min(108%, 33rem); max-width: none; height: auto; transform: translateX(-50%); }

.catalogo { padding-top: 3.6rem; padding-bottom: 4rem; scroll-margin-top: 1rem; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.65rem; }
.section-heading h2 { margin: 0; font-size: clamp(1.95rem, 4vw, 2.65rem); letter-spacing: -.053em; line-height: 1.1; }
.section-heading p { margin: .55rem 0 0; color: var(--muted); }
.catalogo-controls { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; }
.brand-filters, .catalogo-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.filter-button { min-height: 2.55rem; padding: .5rem .88rem; border: 1px solid var(--line); border-radius: 999px; background: var(--white); color: var(--muted); font-size: .875rem; font-weight: 650; }
.filter-button:hover { color: var(--sapphire); border-color: var(--sapphire); }
.filter-button[aria-pressed="true"] { background: var(--sapphire); color: var(--pearl); border-color: var(--sapphire); }
.search-field, .sort-field { position: relative; display: flex; align-items: center; }
.search-field input, .sort-field select { width: 100%; min-height: 2.75rem; border: 1px solid var(--line); border-radius: .55rem; background: var(--white); color: var(--sapphire); font-size: .875rem; }
.search-field input { width: 15.5rem; padding: .6rem .75rem .6rem 2.3rem; }
.search-field input::placeholder { color: var(--muted); opacity: 1; }
.search-icon { position: absolute; left: .82rem; width: .78rem; height: .78rem; border: 1.6px solid var(--muted); border-radius: 50%; pointer-events: none; }
.search-icon::after { content: ""; position: absolute; width: .39rem; height: 1.6px; top: .65rem; left: .49rem; background: var(--muted); transform: rotate(45deg); border-radius: 5px; }
.sort-field select { appearance: none; padding: .6rem 2rem .6rem .8rem; }
.sort-field::after { position: absolute; right: .84rem; content: ""; width: .46rem; height: .46rem; border: solid var(--muted); border-width: 0 1.5px 1.5px 0; transform: translateY(-30%) rotate(45deg); pointer-events: none; }
.results { margin: 1.35rem 0 .85rem; color: var(--muted); font-size: .875rem; }

.product-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.product-card { display: flex; flex-direction: column; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: .95rem; background: var(--white); transition: box-shadow 150ms ease, border-color 150ms ease; }
.product-card:hover, .product-card:focus-within { border-color: var(--muted); box-shadow: 0 .45rem 1.25rem #13285a12; }
.product-visual { position: relative; height: 12.8rem; padding: 1.3rem; background: radial-gradient(ellipse at 49% 48%, var(--white) 0%, var(--surface) 97%); }
.product-photo { display: grid; place-items: center; width: 100%; height: 100%; min-height: 0; }
.product-photo img { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.product-card[data-marca="apple"] .product-visual, .dialog-layout[data-marca="apple"] .dialog-visual { background: var(--white); }
.product-card[data-marca="apple"] .product-visual { border-bottom: 1px solid var(--surface); }
.photo-note { margin: 0; padding: .6rem; text-align: center; color: var(--muted); font-size: .875rem; }
.product-badge { position: absolute; top: .7rem; left: .7rem; padding: .28rem .55rem; background: var(--pearl); color: var(--sapphire); border: 1px solid var(--line); border-radius: .38rem; font-size: .8125rem; font-weight: 700; }
.product-badge[data-offer="true"] { background: var(--orange); border-color: var(--orange); }
.product-content { display: flex; flex: 1; flex-direction: column; padding: .95rem; }
.product-brand { margin: 0 0 .28rem; color: var(--muted); font-size: .875rem; font-weight: 600; }
.product-name { margin: 0; font-size: 1.125rem; line-height: 1.22; letter-spacing: -.026em; overflow-wrap: anywhere; }
.product-memory { margin: .45rem 0 .85rem; color: var(--muted); font-size: .875rem; line-height: 1.38; }
.product-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .35rem .45rem; margin-top: auto; }
.product-price { margin: 0; padding-inline-start: .42rem; border-inline-start: 3px solid var(--orange); font-size: 1.18rem; font-weight: 700; letter-spacing: -.025em; white-space: nowrap; }
.product-open { min-height: 2.5rem; padding: .3rem .1rem; border: 0; background: none; color: var(--sapphire); font-size: .875rem; font-weight: 700; border-radius: .2rem; }
.product-open:hover { text-decoration: underline; text-underline-offset: .2em; }
.product-order { margin-top: .75rem; padding-inline: .5rem; min-height: 2.75rem; font-size: .875rem; line-height: 1.25; text-align: center; }
.dialog-content .product-order { padding-inline: 1rem; }
.empty-state { margin: 0; padding: 2.4rem 1rem; text-align: center; background: var(--white); border: 1px solid var(--line); border-radius: .75rem; }
.pagination { display: flex; justify-content: center; margin-top: 1.5rem; }

.store-info { background: var(--surface); color: var(--sapphire); border-top: 1px solid var(--line); }
.store-info-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.5rem; padding: 2.35rem 0; margin-block: 0; list-style: none; }
.store-info-icon {
  display: block;
  width: 2.65rem;
  height: 2.65rem;
  margin-block-end: .75rem;
  padding: .64rem;
  border-radius: .65rem;
  background: color-mix(in srgb, var(--orange) 12%, var(--white));
  color: color-mix(in srgb, var(--orange) 75%, var(--sapphire));
}
.store-info-grid h2 { margin: 0 0 .35rem; font-size: 1.0625rem; line-height: 1.25; }
.store-info-grid p { margin: 0; line-height: 1.45; color: var(--muted); }
.store-advice { display: flex; align-items: center; justify-content: space-between; gap: 1.75rem; padding-block: 2.65rem; }
.store-advice h2 { margin: 0; font-size: clamp(1.65rem, 4vw, 2.4rem); line-height: 1.12; letter-spacing: -.04em; }
.store-advice p { max-width: 38rem; margin: .55rem 0 0; line-height: 1.5; }
.store-advice .button { flex-shrink: 0; }
.store-brands { padding: 1.6rem 0 1.8rem; border-top: 1px solid color-mix(in srgb, var(--pearl) 22%, transparent); }
.store-brands h2 { margin: 0 0 .9rem; font-size: 1rem; font-weight: 600; }
.store-brand-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .7rem; margin: 0; padding: 0; list-style: none; }
.store-brand-grid li { display: grid; place-items: center; min-width: 0; height: 4.3rem; padding: .9rem; border-radius: .55rem; background: var(--white); }
.store-brand-grid img { width: 100%; max-width: 6.5rem; height: 2rem; object-fit: contain; }
.store-brand-grid .store-brand-dark { border: 1px solid color-mix(in srgb, var(--pearl) 45%, transparent); background: var(--sapphire); }
.footer-bottom { border-top: 1px solid color-mix(in srgb, var(--pearl) 22%, transparent); }
.footer-inner { min-height: 5.5rem; }
.footer-inner p { margin: 0; font-size: .875rem; }
.footer-phone { font-size: .875rem; text-decoration: underline; text-underline-offset: .22em; }

.product-dialog { position: fixed; width: min(48rem, calc(100% - 1.5rem)); padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 1.1rem; background: var(--white); color: var(--sapphire); box-shadow: 0 1.4rem 4.5rem #13285a65; }
.product-dialog::backdrop { background: #13285aa6; }
#ficha-contenido { max-height: min(90vh, calc(100dvh - 1.5rem)); overflow: auto; overscroll-behavior: contain; }
.dialog-close { position: absolute; z-index: 1; top: .75rem; right: 1.1rem; display: grid; place-items: center; width: 2.55rem; height: 2.55rem; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--white); color: var(--sapphire); font-size: 1.55rem; line-height: 1; }
.dialog-close:hover { background: var(--surface); }
.dialog-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.14fr); }
.dialog-visual { display: flex; flex-direction: column; justify-content: center; min-width: 0; padding: 2rem; background: var(--surface); }
.dialog-visual .product-photo { height: 19rem; }
.dialog-image-label { margin: .8rem 0 0; color: var(--muted); font-size: .875rem; text-align: center; }
.dialog-content { padding: 2.4rem 2rem 2rem; }
.dialog-content h2 { margin: .32rem 0 .5rem; line-height: 1.12; letter-spacing: -.035em; font-size: 1.75rem; }
.dialog-content .product-price { margin: .5rem 0 1rem; font-size: 1.5rem; }
.dialog-content h3 { margin: 1.2rem 0 .5rem; font-size: 1rem; }
.color-options { display: flex; flex-wrap: wrap; gap: .45rem; }
.color-option { display: inline-flex; align-items: center; gap: .36rem; min-height: 2.5rem; padding: .35rem .65rem; border: 1px solid var(--line); border-radius: 999px; background: var(--white); color: var(--sapphire); font-size: .875rem; }
.color-option[aria-pressed="true"] { border-color: var(--sapphire); background: var(--pearl); }
.color-swatch { width: .68rem; height: .68rem; border: 1px solid #13285a40; border-radius: 50%; }
.specs { margin: 0; font-size: .875rem; }
.specs div { display: grid; grid-template-columns: minmax(5rem, .75fr) minmax(0, 1fr); gap: .45rem; padding: .52rem 0; border-bottom: 1px solid var(--line); }
.specs dt { color: var(--muted); }
.specs dd { margin: 0; overflow-wrap: anywhere; }
.source-link { display: inline-block; margin-top: 1rem; font-size: .875rem; color: var(--sapphire); text-underline-offset: .18em; }
.specs-note { margin: .78rem 0 0; font-size: .875rem; line-height: 1.45; color: var(--muted); }

@media (max-width: 1080px) {
  .contenedor { width: calc(100% - 3rem); }
  .catalogo-controls { align-items: flex-start; }
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .contenedor { width: calc(100% - 2rem); }
  .wordmark { width: min(13.5rem, 58vw); }
  .hero-inner { min-height: auto; grid-template-columns: 1fr; }
  .hero-content { padding: 2.55rem 0 .5rem; }
  .hero h1 { font-size: clamp(2.6rem, 10vw, 4rem); }
  .hero-description { margin: .95rem 0 1.25rem; }
  .hero-showcase { width: min(100%, 28rem); height: clamp(15.5rem, 75vw, 22rem); margin-inline: auto; }
  .hero-mascot { width: min(105%, 25rem); bottom: -1.2rem; }
  .catalogo { padding-top: 2.5rem; padding-bottom: 2.75rem; }
  .catalogo-tools { width: 100%; }
  .search-field { flex: 1 1 12rem; }
  .search-field input { width: 100%; }
  .sort-field { flex: 1 1 10rem; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
  .product-visual { height: 9.7rem; padding: 1rem .55rem .55rem; }
  .product-content { padding: .68rem; }
  .product-name { font-size: 1rem; }
  .product-price { font-size: 1.07rem; }
  .product-bottom { row-gap: 0; }
  .product-badge { top: .42rem; left: .42rem; font-size: .75rem; }
  .dialog-layout { grid-template-columns: 1fr; }
  .dialog-visual { padding: 1.2rem; }
  .dialog-visual .product-photo { height: 13rem; }
  .dialog-content { padding: 1.35rem; }
  .store-info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem 1rem; padding-block: 1.75rem; }
  .store-advice { align-items: flex-start; flex-direction: column; gap: 1rem; padding-block: 2rem; }
  .store-brand-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
  .store-brand-grid li { height: 3.6rem; padding: .65rem; }
  .footer-inner { align-items: flex-start; flex-direction: column; gap: 0; padding-block: .3rem .6rem; }
}

@media (max-width: 360px) {
  .contenedor { width: calc(100% - 1.4rem); }
  .product-grid { gap: .5rem; }
  .product-content { padding: .58rem; }
  .store-info-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
