/* Mobile experience — separate, readable sections instead of compressed desktop grids. */
.category-nav nav a.is-current-category { color: #ffe189; box-shadow: inset 0 -2px #ffe189; }
.catalog-category-landing { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 13px; padding: 17px 20px; }
.catalog-category-caption { font-size: 10px; letter-spacing: .12em; font-weight: 800; color: #6b849a; }
.catalog-category-title { font: 800 20px/1.25 Manrope, sans-serif; letter-spacing: -.035em; color: #173f5e; }
.catalog-category-count { font-size: 12px; color: #4e718c; }
@media (max-width: 640px) {
  html { scroll-padding-top: 148px; }
  body { overflow-x: clip; padding-bottom: calc(77px + env(safe-area-inset-bottom)); }
  .shell { width: calc(100% - 30px); }
  section[id], .new-collection-section, .new-stock-listing, .used-stock-listing { scroll-margin-top: 145px; }

  /* Header and mobile wayfinding. */
  .demo-strip { padding: 8px 14px; gap: 5px 10px; line-height: 1.45; }
  .header-inner { height: auto; min-height: 106px; padding: 10px 0 11px; gap: 9px 12px; }
  .logo { font-size: 27px; }
  .logo-market { display: none; }
  .header-actions { gap: 9px; }
  .header-actions .account-link { font-size: 12px; padding: 9px 10px; }
  .global-search { order: 3; flex: 1 0 100%; min-width: 0; width: 100%; height: 47px; margin: 3px 0 0; }
  .global-search input { font-size: 16px; line-height: 1.3; }
  .global-search span { padding: 0 15px; }
  .category-nav-inner { height: 46px; gap: 10px; }
  .departments-trigger { height: 46px; padding: 0 12px; font-size: 11px; }
  .category-nav nav { gap: 21px; }
  .category-nav nav a, .category-nav nav button { font-size: 12px; padding: 13px 0; }
  .departments-menu { top: 46px; grid-template-columns: 1fr; width: calc(100% - 30px); max-height: min(68vh, 550px); overflow-y: auto; gap: 20px; padding: 22px; }
  .departments-menu .menu-help { grid-column: auto; }
  .departments-menu button, .departments-menu a { min-height: 30px; font-size: 13px; }
  .mobile-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: minmax(0, 1fr);
    align-items: stretch;
    width: 100%;
    box-sizing: border-box;
    min-height: calc(70px + env(safe-area-inset-bottom));
    padding: 5px 5px calc(5px + env(safe-area-inset-bottom));
    gap: 0;
  }
  .mobile-nav > a, .mobile-nav > button {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 59px;
    padding: 5px 1px 4px;
    overflow: hidden;
    gap: 5px;
    line-height: 1.2;
    white-space: nowrap;
    text-align: center;
    border-radius: 9px;
  }
  .mobile-nav a + a, .mobile-nav a + button, .mobile-nav button + a, .mobile-nav button + button {
    border-left: 1px solid #edf1f4;
    border-radius: 0;
  }
  .mobile-nav .mobile-nav-icon {
    display: block;
    flex: 0 0 auto;
    font-size: 18px;
    line-height: 1;
  }
  .mobile-nav .mobile-nav-label {
    display: block;
    width: auto;
    max-width: 100%;
    flex: 0 1 auto;
    min-width: 0;
    font-size: 10px;
    line-height: 1.25;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .mobile-nav a:focus-visible, .mobile-nav button:focus-visible { outline: 2px solid #2d6b95; outline-offset: -3px; }
  .mobile-nav b { right: 4px; top: 2px; }

  /* Give the first screen room to breathe. */
  .breadcrumb { flex-wrap: wrap; gap: 7px; line-height: 1.5; }
  .hero-copy { padding: 31px 23px 30px; }
  .hero h1 { font-size: clamp(32px, 8.9vw, 44px); line-height: 1.17; letter-spacing: -.055em; }
  .hero-copy > p { font-size: 14px; line-height: 1.7; }
  .hero-ctas { align-items: stretch; flex-direction: column; gap: 16px; }
  .hero .button-dark { width: 100%; min-height: 47px; font-size: 13px; }
  .hero-compare-link { align-self: flex-start; font-size: 12px; }
  .hero-qualifiers { gap: 9px 14px; font-size: 10px; margin-top: 26px; }
  .hero-art { min-height: 240px; }
  .hero-art .hero-watermark { font-size: 58px; }
  .value-strip { grid-template-columns: 1fr; margin-bottom: 46px; }
  .value-strip > div { padding: 13px 17px; min-height: 64px; }
  .value-strip > div + div { border-left: 0; border-top: 1px solid var(--border); }
  .value-strip strong { font-size: 13px; }
  .value-strip small { font-size: 11px; }
  .retail-heading h2, .section-heading h2 { font-size: clamp(27px, 7.5vw, 34px); line-height: 1.2; }
  .category-grid { gap: 12px; }
  .category-tile { min-height: 168px; padding: 17px; }
  .category-tile strong { font-size: 17px; }
  .category-tile small, .category-tile b { font-size: 11px; line-height: 1.4; }
  .offer-main, .offer-secondary { padding: 24px; }

  /* Distinct pathways for new and pre-owned devices. */
  .purchase-paths, .new-collection-section, .catalog-section { overflow: clip; }
  .purchase-path-grid, .stock-type-selector, .collection-flow { grid-template-columns: 1fr; gap: 12px; }
  .purchase-path { min-height: 0; padding: 26px 23px; }
  .path-title { font-size: 29px; line-height: 1.2; }
  .path-copy { font-size: 13px; line-height: 1.65; }
  .stock-type-tab { padding: 16px; gap: 13px; align-items: center; }
  .stock-type-icon { width: 42px; height: 42px; font-size: 22px; }
  .stock-type-tab strong { font-size: 15px; }
  .stock-type-tab small { font-size: 11px; line-height: 1.55; }
  .new-collection-section { padding: 47px 0 65px; }
  .new-collection-intro, .used-collection-intro { padding: 29px 23px; border-radius: 14px; }
  .new-collection-intro h2, .used-collection-intro h2 { font-size: clamp(29px, 8vw, 37px); }
  .new-collection-intro p, .used-collection-intro p { font-size: 13px; line-height: 1.7; }
  .new-stock-link { gap: 15px; padding: 18px; margin: 20px 0 31px; }
  .new-stock-copy small { font-size: 10px; }
  .new-stock-copy strong { font-size: 21px; }
  .new-stock-copy > span { font-size: 12px; }
  .new-stock-action { min-height: 46px; font-size: 12px; }
  .new-stock-heading h3 { font-size: 26px; }
  .new-stock-heading p { font-size: 12px; }
  /* Los pasos siguen disponibles arriba del título; el salto a stock deja a la vista título + tarjeta + elección. */
  .new-stock-listing .collection-flow { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; margin: 12px 0 16px; }
  .new-stock-listing .flow-step { flex-direction: column; justify-content: center; gap: 6px; min-height: 76px; padding: 9px 3px; text-align: center; }
  .new-stock-listing .flow-step > b { width: 25px; height: 25px; font-size: 10px; }
  .new-stock-listing .flow-step small { display: none; }
  .new-stock-listing .flow-step strong { font-size: 9px; line-height: 1.25; }
  .new-stock-listing .flow-next > span:last-child { display: none; }
  .catalog-identity { padding: 16px; }
  .catalog-identity p { font-size: 12px; }
  .catalog-identity-switch { padding-left: 0; }

  /* Steps now read vertically, in their correct sequence. */
  .flow-step { gap: 13px; min-height: 66px; padding: 13px 15px; }
  .flow-step > b { width: 34px; height: 34px; font-size: 12px; }
  .flow-step small { font-size: 10px; }
  .flow-step strong { font-size: 13px; }
  .flow-next > span:last-child { font-size: 20px; }

  /* Search and filters should not squeeze the results. */
  .collection-search { padding: 15px; }
  .collection-search > label { font-size: 11px; line-height: 1.4; }
  .collection-search-field { min-height: 52px; gap: 9px; }
  .collection-search-field input, #searchInput, #usedSearchInput { font-size: 16px; line-height: 1.35; }
  .collection-search-field small { display: none; }
  .used-stock-listing .catalog-toolbar { gap: 14px; }
  .used-stock-listing .brand-tabs { width: 100%; padding: 6px; gap: 5px; }
  .used-stock-listing .brand-tab { flex-shrink: 0; font-size: 12px; padding: 12px 13px; }
  .used-stock-listing .filter-trigger { width: 100%; justify-content: center; min-height: 46px; font-size: 13px; }
  .used-stock-listing .filters-panel { gap: 16px; padding: 17px; }
  .used-stock-listing .filters-panel label { font-size: 12px; }
  .filters-panel select { font-size: 16px; min-height: 46px; }
  .catalog-meta { margin: 18px 0; line-height: 1.6; }
  .catalog-meta p { font-size: 12px; }
  .catalog-category-landing { display: grid; gap: 4px; padding: 15px 17px; }
  .catalog-category-title { font-size: 19px; }

  /* Single-column product cards — full image, details, price, and CTA. */
  .new-product-grid, .used-stock-listing #productGrid, .product-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .product-card { border-radius: 14px; }
  .product-visual, .new-product-grid .product-visual { height: 242px; }
  .new-product-grid .product-card { overflow: hidden; }
  .new-product-grid .product-visual { height: 165px; }
  .new-product-grid .product-details { padding: 14px 16px 17px; }
  .new-product-grid .product-title { font-size: 18px; line-height: 1.25; margin: 7px 0; }
  .new-product-grid .product-specs { margin: 9px 0 10px; }
  .new-product-grid .price-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 9px; }
  .new-product-grid .price-row strong { font-size: 23px; }
  .new-product-grid .price-row button { flex: 0 0 auto; width: auto; min-height: 42px; margin: 0; padding: 10px 12px; font-size: 11px; }
  .new-product-grid .buy-quick-button { width: 100%; min-height: 48px; margin-top: 10px; }
  .new-product-grid .compare-toggle { min-height: 39px; margin-top: 9px; }
  .product-tag { left: 14px; top: 13px; font-size: 10px; padding: 7px 10px; }
  .fav-button { right: 13px; top: 12px; width: 38px; height: 38px; }
  .product-details { padding: 20px; }
  .product-kicker { font-size: 11px; }
  .product-title { font-size: 20px; line-height: 1.3; }
  .product-specs { margin: 12px 0 16px; gap: 7px; }
  .spec-chip { font-size: 11px; padding: 6px 9px; }
  .price-row { gap: 12px; padding-top: 12px; }
  .price-row strong { font-size: 26px; }
  .price-row button, .product-card .buy-quick-button { width: 100%; min-height: 46px; margin-top: 13px; font-size: 13px; padding: 12px 14px; }
  .compare-toggle { min-height: 43px; margin-top: 12px; font-size: 12px; padding: 10px; }
  .device-photo-caption { font-size: 9px; left: 13px; bottom: 12px; }
  .new-collection-note { padding: 19px; }
  .new-collection-note p, .new-collection-note a { font-size: 12px; line-height: 1.6; }

  /* Comfortable dialogs and requests, including Safari's focus behavior. */
  .detail-description { padding: 25px 22px 45px; }
  .detail-description h2 { font-size: 29px; }
  .detail-description > p { font-size: 14px; }
  .detail-spec strong { font-size: 13px; }
  .request-form input, .request-form select, .request-form textarea { font-size: 16px; min-height: 47px; }
  .request-form label { font-size: 13px; }
  .checkout-steps { gap: 10px; }
  .checkout-steps span { gap: 8px; padding: 11px 9px; font-size: 11px; line-height: 1.4; }
  .checkout-summary { flex-wrap: wrap; }
  .compare-tray { bottom: calc(78px + env(safe-area-inset-bottom)); flex-wrap: wrap; }
  .compare-tray > span { white-space: normal; font-size: 11px; }
  .compare-tray > div { width: 100%; }
  .compare-tray button { flex: 1; font-size: 12px; }
}

@media (max-width: 380px) {
  .shell { width: calc(100% - 24px); }
  .header-inner { gap: 7px; }
  .header-actions .account-link { padding: 8px 7px; font-size: 11px; }
  .hero-copy { padding: 27px 18px; }
  .hero h1 { font-size: 32px; }
  .hero-art .note-condition { display: none; }
  .category-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .category-tile { padding: 13px; min-height: 156px; }
  .category-tile strong { font-size: 15px; }
  .new-stock-link { padding: 15px; }
  .new-stock-copy strong { font-size: 19px; }
  .product-visual, .new-product-grid .product-visual { height: 220px; }
  .new-product-grid .product-visual { height: 155px; }
  .product-details { padding: 17px; }
  .mobile-nav > a, .mobile-nav > button { gap: 3px; padding-inline: 0; }
  .mobile-nav .mobile-nav-icon { font-size: 16px; }
  .mobile-nav .mobile-nav-label { font-size: 9px; }
}

/* En pantallas bajas, mantener visibles el título y la acción principal del primer equipo. */
@media (max-width: 640px) and (max-height: 740px) {
  .new-stock-heading { margin-bottom: 11px; }
  .new-stock-heading p { display: none; }
  .new-product-grid .product-visual { height: 116px; }
  .new-product-grid .product-details { padding: 11px 15px 13px; }
  .new-product-grid .product-title { font-size: 17px; margin: 5px 0; }
  .new-product-grid .product-specs { margin: 7px 0 8px; }
}

/* Escala de lectura del catálogo público. */
.shell { width: min(1480px, calc(100% - clamp(28px, 5vw, 80px))); }
.hero p, .section-heading p, .new-collection-intro p, .help-inner p,
.checkout-subtitle, .checkout-explanation p { font-size: clamp(1rem, 1.25vw, 1.2rem); line-height: 1.55; }
.demo-strip { flex-wrap: wrap; }
.demo-strip strong, .demo-strip span { font-size: .875rem; line-height: 1.45; }
.product-grid .product-title { font-size: clamp(1.45rem, 2vw, 1.85rem); line-height: 1.22; }
.product-grid .product-details { padding: clamp(16px, 1.7vw, 25px); }
.product-kicker { flex-wrap: wrap; gap: .4rem; font-size: .8rem; }
.product-grid .spec-chip, .product-grid .price-row small { font-size: .875rem; }
.product-grid .product-visual { height: clamp(220px, 22vw, 320px); }
.product-grid .price-row { flex-wrap: wrap; }
.product-grid .price-row strong { font-size: clamp(1.65rem, 2.2vw, 2rem); }
.product-grid .price-row button, .product-grid .buy-quick-button, .product-grid .compare-toggle {
  min-height: 46px; font-size: 1rem; line-height: 1.3; white-space: normal;
}
@media (min-width: 901px) {
  .new-product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .used-stock-listing #productGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .product-grid, .new-product-grid, .used-stock-listing #productGrid { grid-template-columns: minmax(0, 1fr); }
  .hero h1 { font-size: clamp(2.5rem, 10vw, 3.5rem); }
  .product-grid .product-visual { height: clamp(220px, 65vw, 310px); }
  html body nav.mobile-nav .mobile-nav-label { font-size: .8125rem !important; }
}

/* Mantener la fotografía completa cuando el catálogo usa el diseño de escritorio. */
@media (min-width: 901px) {
  .product-grid .product-visual {
    height: auto;
    aspect-ratio: 3 / 2;
  }
  .device-photo, .compare-sample-photo { background-color: #edf1f4; }
  .device-photo img, .compare-sample-photo, .hero-art .hero-photo,
  .category-tile .category-photo, .offer-secondary .offer-photo, .buyback-promo > img {
    object-fit: contain;
    object-position: center;
  }
  .product-card:hover .device-photo img, .category-tile:hover .category-photo { transform: none; }
  .purchase-path img {
    right: 0;
    bottom: 0;
    object-fit: contain;
    object-position: right center;
    border-radius: 0;
  }
}
