:root {
  --brand: #0099E3;
  --brand-dark: #0077B5;
  --brand-royal: #3562E3;
  --brand-purple: #5A4FF7;
  --brand-soft: #E6F5FD;
  --brand-sky: #CBEEFF;
  --deep: #0B4A6F;
  --ink: #121B26;
  --body: #4D6272;
  --muted: #728594;
  --line: #E2ECF3;
  --bg: #F6F8FB;
  --surface: #FFFFFF;
  --surface-2: #F0F5FA;
  --price-bg: #CEFFCA;
  --price-ink: #0F4A1C;
  --success: #22A047;
  --danger: #E53935;
  --shadow-sm: 0 6px 18px -10px rgba(10, 42, 61, 0.14);
  --shadow-md: 0 18px 40px -20px rgba(10, 42, 61, 0.22);
  --shadow-lg: 0 30px 65px -26px rgba(10, 42, 61, 0.35);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-xl: 30px;
  --maxw: 1240px;
}

[data-theme="dark"] {
  --brand: #2DB2F5;
  --brand-dark: #57C4FA;
  --brand-royal: #4F78F7;
  --brand-soft: #102838;
  --brand-sky: #0D2636;
  --deep: #85CCF2;
  --ink: #EFF6FB;
  --body: #A5BAC9;
  --muted: #7C95A6;
  --line: #1E3446;
  --bg: #08131B;
  --surface: #101E29;
  --surface-2: #152836;
  --price-bg: #163E22;
  --price-ink: #92F4A4;
  --shadow-sm: 0 8px 20px -10px rgba(0, 0, 0, 0.55);
  --shadow-md: 0 20px 44px -20px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 32px 70px -26px rgba(0, 0, 0, 0.82);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 0;
}

@media (max-width: 840px) {
  body {
    padding-bottom: 76px;
  }
}

h1, h2, h3, h4 {
  color: var(--ink);
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.18;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select {
  font: inherit;
}

img {
  max-width: 100%;
  display: block;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Top Affiliate Banner ---------- */
.affiliate-Ribbon {
  background: linear-gradient(90deg, #0B4A6F, #0099E3);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 7px 16px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.affiliate-Ribbon[hidden] {
  display: none;
}
.affiliate-Ribbon code {
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.affiliate-Ribbon button {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: #fff;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 0.74rem;
  cursor: pointer;
}

/* ---------- Header ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 70px;
  padding: 10px 0;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  cursor: pointer;
}
.brand-logo img {
  height: 36px;
  width: auto;
}
.logo-oscuro {
  display: none;
}
[data-theme="dark"] .logo-claro {
  display: none;
}
[data-theme="dark"] .logo-oscuro {
  display: block;
}

/* Search Bar in Header */
.header-search {
  position: relative;
  flex: 1;
  max-width: 480px;
}
.header-search input {
  width: 100%;
  height: 44px;
  padding: 0 40px 0 42px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 0.92rem;
  transition: border-color 0.16s, background 0.16s, box-shadow 0.16s;
}
.header-search input::placeholder {
  color: var(--muted);
  font-style: italic;
}
.header-search input:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--brand);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent);
}
.header-search .search-ico {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--muted);
  pointer-events: none;
}
.header-search .search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 0;
  background: var(--line);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 14px;
  line-height: 1;
}
.header-search .search-clear[hidden] {
  display: none;
}

/* Quick search dropdown */
.search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 410px;
  overflow-y: auto;
  z-index: 80;
  padding: 8px;
}
.search-dropdown[hidden] {
  display: none;
}
.search-hit {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.12s;
}
.search-hit:hover {
  background: var(--surface-2);
}
.search-hit img {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--surface-2);
  flex-shrink: 0;
}
.search-hit-info {
  flex: 1;
  min-width: 0;
}
.search-hit-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-hit-sub {
  font-size: 0.78rem;
  color: var(--muted);
}
.search-hit-price {
  font-weight: 800;
  font-size: 0.86rem;
  color: var(--price-ink);
  background: var(--price-bg);
  padding: 3px 9px;
  border-radius: 8px;
  white-space: nowrap;
}

/* Nav Tabs Desktop */
.desktop-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: var(--body);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.nav-pill:hover {
  background: var(--surface-2);
  color: var(--ink);
}
.nav-pill.is-active {
  background: var(--brand-soft);
  color: var(--brand);
}
.nav-pill svg {
  width: 17px;
  height: 17px;
}
.fav-badge {
  display: inline-grid;
  place-items: center;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
}
.fav-badge[hidden] {
  display: none;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s, transform 0.12s;
}
.icon-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
}
.icon-btn svg {
  width: 18px;
  height: 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.16s ease, background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.btn svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}
.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--brand) 75%, transparent);
}
.btn-primary:hover {
  background: var(--brand-dark);
  transform: translateY(-1px);
}
.btn-royal {
  background: var(--brand-royal);
  color: #fff;
  box-shadow: 0 10px 24px -10px rgba(53, 98, 227, 0.65);
}
.btn-royal:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}
.btn-ghost {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}
.btn-ghost:hover {
  border-color: var(--brand);
  color: var(--brand);
}
.btn-sm {
  padding: 8px 15px;
  font-size: 0.84rem;
}

@media (max-width: 980px) {
  .desktop-nav .nav-text-secondary {
    display: none;
  }
}
@media (max-width: 840px) {
  .desktop-nav {
    display: none;
  }
  .topbar-inner {
    flex-wrap: wrap;
    gap: 10px;
  }
  .header-search {
    order: 3;
    flex: 1 1 100%;
    max-width: none;
  }
  .header-actions-mobile {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
  }
}
@media (min-width: 841px) {
  .header-actions-mobile {
    display: flex;
    align-items: center;
    gap: 8px;
  }
}

/* ---------- Mobile Bottom Tab Bar (mirrors YibloBottomNav in Flutter!) ---------- */
.mobile-tabbar {
  display: none;
}
@media (max-width: 840px) {
  .mobile-tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 70;
    height: 66px;
    background: #0F8AE0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    box-shadow: 0 -8px 26px rgba(10, 42, 61, 0.22);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .mob-tab {
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.72);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    position: relative;
  }
  .mob-tab svg {
    width: 21px;
    height: 21px;
  }
  .mob-tab.is-active {
    color: #fff;
    font-weight: 800;
  }
  .mob-tab .mob-badge {
    position: absolute;
    top: 6px;
    right: calc(50% - 20px);
    background: #fff;
    color: #0F8AE0;
    font-size: 0.63rem;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 999px;
    line-height: 1.3;
  }
  .mob-tab .mob-badge[hidden] {
    display: none;
  }
}

/* ---------- Store Hero / App Welcome ---------- */
.store-welcome {
  background: linear-gradient(180deg, var(--brand-sky) 0%, color-mix(in srgb, var(--brand-sky) 24%, var(--bg)) 65%, var(--bg) 100%);
  padding: 28px 0 18px;
}

.welcome-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.welcome-greeting {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 5px;
}
.welcome-headline {
  font-size: clamp(1.65rem, 3.3vw, 2.45rem);
  font-weight: 800;
  line-height: 1.12;
  color: var(--ink);
}
.welcome-headline span {
  font-weight: 500;
  color: var(--body);
}

.app-pill-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  font-size: 0.84rem;
  color: var(--ink);
}
.app-pill-cta svg {
  width: 22px;
  height: 22px;
  color: var(--brand);
  flex-shrink: 0;
}
.app-pill-cta b {
  color: var(--brand);
}

/* ---------- Banner Carousel ---------- */
.banner-carousel {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: linear-gradient(135deg, #0099E3, #0B4A6F);
  margin-bottom: 26px;
}
.banner-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.banner-slide {
  min-width: 100%;
  position: relative;
  height: clamp(185px, 27vw, 310px);
  cursor: pointer;
  overflow: hidden;
}
.banner-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(7, 24, 36, 0.72) 0%, rgba(7, 24, 36, 0.25) 55%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 26px 30px;
  color: #fff;
}
.banner-overlay h3 {
  color: #fff;
  font-size: clamp(1.25rem, 2.5vw, 1.9rem);
  max-width: 24ch;
  margin-bottom: 6px;
}
.banner-overlay p {
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95rem;
  max-width: 44ch;
}
.banner-dots {
  position: absolute;
  right: 20px;
  bottom: 16px;
  display: flex;
  gap: 6px;
  z-index: 4;
}
.banner-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: 0;
  padding: 0;
  background: rgba(255, 255, 255, 0.48);
  cursor: pointer;
  transition: width 0.2s, background 0.2s;
}
.banner-dot.is-active {
  width: 22px;
  background: #fff;
}

/* ---------- Section Headers ---------- */
.store-section {
  padding: 22px 0;
}
.sec-bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.sec-title {
  font-size: clamp(1.22rem, 2.2vw, 1.55rem);
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sec-sub {
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 3px;
}
.sec-link {
  background: transparent;
  border: 0;
  color: var(--brand);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
}
.sec-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.sec-link:hover {
  text-decoration: underline;
}

/* ---------- Categories Grid (mirrors App 6-Category Grid) ---------- */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}
@media (max-width: 960px) {
  .categories-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 460px) {
  .categories-grid {
    gap: 10px;
  }
}

.cat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px 12px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}
.cat-card:hover {
  transform: translateY(-3px);
  border-color: var(--brand);
  box-shadow: var(--shadow-md);
}
.cat-card-icon {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  overflow: hidden;
  padding: 8px;
}
.cat-card-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.cat-card-icon svg {
  width: 30px;
  height: 30px;
  color: var(--brand);
}
.cat-card-name {
  font-weight: 700;
  font-size: 0.94rem;
  color: var(--ink);
  line-height: 1.2;
}
.cat-card-meta {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 4px;
}

/* ---------- Filter & Subcategory Chips ---------- */
.chips-row {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: none;
}
.chips-row::-webkit-scrollbar {
  display: none;
}
.chip {
  border: 1.2px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: background 0.14s, color 0.14s, border-color 0.14s;
}
.chip img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  border-radius: 4px;
}
.chip:hover {
  border-color: var(--brand);
  color: var(--brand);
}
.chip.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

/* ---------- Product Grid & Cards ---------- */
.products-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(215px, 235px);
  gap: 16px;
  overflow-x: auto;
  padding: 4px 2px 14px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}
.products-rail > * {
  scroll-snap-align: start;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 18px;
}
@media (max-width: 540px) {
  .products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}

.prod-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s ease, box-shadow 0.18s ease, border-color 0.16s ease;
}
.prod-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--brand) 45%, var(--line));
}

.prod-media {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface-2);
  cursor: pointer;
}
.prod-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.prod-card:hover .prod-media img {
  transform: scale(1.04);
}
.prod-fav-btn {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.92);
  color: #1D1D1F;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.14);
  z-index: 2;
  transition: transform 0.12s;
}
.prod-fav-btn:hover {
  transform: scale(1.08);
}
.prod-fav-btn.is-fav {
  color: #E53935;
}
.prod-fav-btn svg {
  width: 17px;
  height: 17px;
}

.prod-badge {
  position: absolute;
  top: 9px;
  left: 9px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  z-index: 2;
}
.prod-badge.hot {
  background: #FF5C00;
  color: #fff;
}
.prod-badge.out {
  background: #171616;
  color: #fff;
}

.prod-body {
  padding: 11px 4px 2px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.prod-store {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--brand);
  background: transparent;
  border: 0;
  padding: 0;
  text-align: left;
  cursor: pointer;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.prod-store:hover {
  text-decoration: underline;
}
.prod-title {
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.28;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  cursor: pointer;
  min-height: 2.45em;
}
.prod-desc {
  font-size: 0.79rem;
  color: var(--muted);
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.prod-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.price-chip {
  background: var(--price-bg);
  color: var(--price-ink);
  font-weight: 800;
  font-size: 0.92rem;
  padding: 4px 10px;
  border-radius: 8px;
}
.rating-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px 7px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--ink);
}
.rating-chip svg {
  width: 12px;
  height: 12px;
  color: #F5A623;
}

.prod-actions {
  margin-top: auto;
  padding-top: 12px;
  display: flex;
  gap: 7px;
}
.btn-buy-card {
  flex: 1;
  height: 38px;
  border-radius: 12px;
  border: 0;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 0.83rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s, transform 0.12s;
}
.btn-buy-card:hover {
  background: var(--brand-dark);
}
.btn-buy-card.is-disabled {
  background: var(--surface-2);
  color: var(--muted);
  cursor: not-allowed;
}
.btn-buy-card svg {
  width: 15px;
  height: 15px;
}
.btn-detail-card {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
}
.btn-detail-card:hover {
  border-color: var(--brand);
  color: var(--brand);
}
.btn-detail-card svg {
  width: 16px;
  height: 16px;
}

@media (max-width: 540px) {
  .prod-card {
    padding: 9px;
    border-radius: 18px;
  }
  .prod-title {
    font-size: 0.87rem;
  }
  .prod-desc {
    display: none;
  }
  .btn-detail-card {
    display: none;
  }
}

/* ---------- Store / Company Cards (mirrors _CompanyCard in HomeScreen) ---------- */
.stores-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}
.store-card {
  position: relative;
  height: 184px;
  border-radius: 22px;
  overflow: hidden;
  background: #12212E;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.store-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.store-card > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.store-card:hover > img {
  transform: scale(1.05);
}
.store-card-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 19, 27, 0.12) 0%, rgba(8, 19, 27, 0.84) 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px 16px;
}
.store-status-pill {
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}
.store-status-pill.open {
  background: rgba(34, 160, 71, 0.9);
  color: #fff;
}
.store-status-pill.closed {
  background: rgba(15, 25, 34, 0.78);
  color: rgba(255, 255, 255, 0.85);
}
.store-card-info h3 {
  color: #fff;
  font-size: 1.12rem;
  margin-bottom: 3px;
}
.store-card-info p {
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.store-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 7px;
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.88);
  font-weight: 600;
}

/* ---------- Category Explorer View (mirrors StoreCategoryScreen) ---------- */
.view-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin: 22px 0 16px;
}
.back-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1.2px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
}
.back-pill:hover {
  border-color: var(--brand);
  color: var(--brand);
}
.back-pill svg {
  width: 16px;
  height: 16px;
}

.category-header-pill {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 14px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.cat-pill-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.cat-pill-left img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}
.cat-pill-eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  display: block;
}
.cat-pill-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--ink);
}
.sort-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.sort-select {
  height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
}

.promo-strip {
  background: color-mix(in srgb, var(--brand) 12%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--brand) 25%, var(--line));
  border-radius: 22px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 16px 0 20px;
}
.promo-strip img {
  width: 78px;
  height: 78px;
  border-radius: 14px;
  object-fit: cover;
  flex-shrink: 0;
}

/* ---------- Product Detail View (mirrors StoreProductDetailScreen) ---------- */
.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 30px;
  align-items: start;
  padding-bottom: 30px;
}
@media (max-width: 900px) {
  .detail-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

.gallery-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 16px;
  position: sticky;
  top: 88px;
  box-shadow: var(--shadow-sm);
}
@media (max-width: 900px) {
  .gallery-card {
    position: static;
  }
}
.gallery-stage {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 20px;
  overflow: hidden;
  background: var(--surface-2);
  display: grid;
  place-items: center;
}
.gallery-stage img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--surface);
}
.gallery-price-float {
  position: absolute;
  right: 14px;
  bottom: 14px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 1.05rem;
  box-shadow: var(--shadow-md);
}
.gallery-thumbs {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.gallery-thumb {
  width: 66px;
  height: 66px;
  border-radius: 14px;
  border: 2px solid transparent;
  overflow: hidden;
  padding: 0;
  background: var(--surface-2);
  cursor: pointer;
  flex-shrink: 0;
}
.gallery-thumb.is-active {
  border-color: var(--brand);
}
.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-stack {
  display: grid;
  gap: 14px;
}
.detail-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px 20px;
}
.detail-title {
  font-size: clamp(1.35rem, 2.4vw, 1.8rem);
  font-weight: 800;
  margin-bottom: 10px;
}
.detail-store-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--surface-2);
  cursor: pointer;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink);
  transition: background 0.15s, color 0.15s;
}
.detail-store-row:hover {
  color: var(--brand);
}
.detail-store-row img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
}
.detail-store-row svg {
  width: 18px;
  height: 18px;
}

/* Variant / Option Groups (listas) */
.opt-group + .opt-group {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.opt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.opt-head h4 {
  font-size: 0.96rem;
  font-weight: 800;
}
.req-tag {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  text-transform: uppercase;
}
.opt-list {
  display: grid;
  gap: 8px;
}
.opt-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.14s, background 0.14s;
}
.opt-row:hover {
  border-color: var(--brand);
}
.opt-row.is-selected {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 8%, var(--surface));
}
.color-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.18);
  flex-shrink: 0;
}
.opt-radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--muted);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.opt-row.is-selected .opt-radio {
  border-color: var(--brand);
  background: var(--brand);
}
.opt-row.is-selected .opt-radio::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
}
.opt-extra {
  margin-left: auto;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}

/* Purchase Box (mirrors _buildPurchaseSection in StoreProductDetailScreen!) */
.purchase-card {
  background: linear-gradient(135deg, #1197D8, #0077B5);
  border-radius: 22px;
  padding: 14px;
  color: #fff;
  box-shadow: 0 18px 34px -16px rgba(0, 119, 181, 0.55);
}
.purchase-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.btn-add-white {
  flex: 1;
  min-height: 52px;
  border-radius: 15px;
  border: 0;
  background: #fff;
  color: #0D7DB8;
  font-weight: 800;
  font-size: 0.98rem;
  cursor: pointer;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.12s, background 0.14s;
}
.btn-add-white svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.btn-add-white:hover:not(:disabled) {
  background: #F0F9FF;
  transform: translateY(-1px);
}
.btn-add-white:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.qty-stepper {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.qty-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid #fff;
  background: #fff;
  color: #0D7DB8;
  font-size: 1.15rem;
  font-weight: 800;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.qty-btn:disabled {
  background: rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.65);
  cursor: not-allowed;
}
.qty-val {
  min-width: 22px;
  text-align: center;
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
}

.btn-buy-royal {
  width: 100%;
  min-height: 52px;
  margin-top: 12px;
  border-radius: 14px;
  border: 0;
  background: var(--brand-royal);
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  box-shadow: 0 14px 28px -12px rgba(53, 98, 227, 0.65);
  transition: transform 0.12s, filter 0.15s;
}
.btn-buy-royal:hover:not(:disabled) {
  filter: brightness(1.06);
  transform: translateY(-1px);
}
.btn-buy-royal:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-buy-royal svg {
  width: 19px;
  height: 19px;
}

.stock-note {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.stock-note.out {
  color: var(--danger);
}

/* Specs & Shipping */
.specs-table {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.spec-row {
  display: grid;
  grid-template-columns: 42% 58%;
  gap: 10px;
  font-size: 0.88rem;
  padding-bottom: 7px;
  border-bottom: 1px dashed var(--line);
}
.spec-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.spec-key {
  color: var(--muted);
  font-weight: 600;
}
.spec-val {
  color: var(--ink);
  font-weight: 600;
}

.shipping-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 12px;
}
.ship-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
}
.ship-badge svg {
  width: 16px;
  height: 16px;
  color: var(--success);
}

details.accordion-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
}
details.accordion-box summary {
  padding: 16px 20px;
  font-weight: 800;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
details.accordion-box summary::-webkit-details-marker {
  display: none;
}
details.accordion-box .acc-content {
  padding: 0 20px 18px;
  font-size: 0.9rem;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

/* ---------- Storefront View (mirrors EmpresaStoreDetailScreen) ---------- */
.empresa-hero {
  position: relative;
  height: clamp(210px, 30vw, 320px);
  border-radius: 26px;
  overflow: hidden;
  background: #102331;
  margin-bottom: 20px;
  box-shadow: var(--shadow-md);
}
.empresa-hero > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.empresa-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6, 18, 28, 0.25) 0%, rgba(6, 18, 28, 0.86) 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px 24px 22px;
  color: #fff;
}
.empresa-hero-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.empresa-hero-bottom {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}
.empresa-avatar {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  object-fit: cover;
  border: 3px solid #fff;
  background: var(--surface);
  flex-shrink: 0;
}
.empresa-hero-bottom h1 {
  color: #fff;
  font-size: clamp(1.5rem, 3.2vw, 2.3rem);
  margin-bottom: 4px;
}
.empresa-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.84rem;
  color: rgba(255, 255, 255, 0.9);
  align-items: center;
}

/* ---------- Ecosystem / Seller & Affiliate Section ---------- */
.eco-section {
  margin-top: 44px;
  padding: 56px 0;
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.eco-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 900px) {
  .eco-grid {
    grid-template-columns: 1fr;
  }
}
.eco-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 26px 24px;
  display: flex;
  flex-direction: column;
}
.eco-card .eyebrow {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 8px;
}
.eco-card h3 {
  font-size: 1.3rem;
  margin-bottom: 10px;
}
.eco-card p {
  margin: 0 0 18px;
  font-size: 0.92rem;
}
.rates-mini {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}
.rates-mini div {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 6px;
  text-align: center;
}
.rates-mini b {
  display: block;
  color: var(--brand);
  font-size: 1.05rem;
  font-weight: 800;
}
.rates-mini span {
  font-size: 0.74rem;
  font-weight: 600;
}

/* ---------- Skeleton Loader & Empty States ---------- */
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, color-mix(in srgb, var(--line) 65%, var(--surface)) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
  border-radius: 18px;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.empty-box {
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: 24px;
  padding: 44px 24px;
  text-align: center;
  max-width: 520px;
  margin: 24px auto;
}
.empty-box h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}
.empty-box p {
  margin: 0 0 18px;
  color: var(--muted);
}

/* ---------- Deep Link Purchase Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(6, 20, 31, 0.64);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 18px;
  animation: fadeIn 0.16s ease;
}
.modal-backdrop[hidden] {
  display: none;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.deeplink-modal {
  width: 100%;
  max-width: 500px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 26px 24px 24px;
  box-shadow: var(--shadow-lg);
  position: relative;
  max-height: 92vh;
  overflow-y: auto;
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 18px;
}
.dl-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}
.deeplink-modal h2 {
  font-size: 1.38rem;
  margin-bottom: 6px;
}
.deeplink-modal .dl-lead {
  font-size: 0.9rem;
  color: var(--body);
  margin: 0 0 16px;
}

.dl-product-summary {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px;
  border-radius: 16px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  margin-bottom: 18px;
}
.dl-product-summary img {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--surface);
  flex-shrink: 0;
}
.dl-prod-info {
  flex: 1;
  min-width: 0;
}
.dl-prod-info h4 {
  font-size: 0.95rem;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dl-prod-info p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}
.dl-prod-total {
  font-weight: 800;
  font-size: 1rem;
  color: var(--price-ink);
  background: var(--price-bg);
  padding: 5px 10px;
  border-radius: 10px;
  white-space: nowrap;
}

.dl-qr-panel {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--bg);
  margin-bottom: 18px;
}
.dl-qr-box {
  background: #fff;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid #DCEAF3;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}
.dl-qr-box svg {
  width: 132px;
  height: 132px;
  display: block;
}
.dl-qr-copy h4 {
  font-size: 0.95rem;
  margin-bottom: 5px;
}
.dl-qr-copy p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--body);
  line-height: 1.45;
}
@media (max-width: 520px) {
  .dl-qr-panel {
    flex-direction: column;
    text-align: center;
  }
}

.dl-actions {
  display: grid;
  gap: 10px;
}
.dl-scheme-url {
  margin-top: 12px;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--surface-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.76rem;
  color: var(--muted);
  overflow-x: auto;
  white-space: nowrap;
  text-align: center;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 86px;
  transform: translateX(-50%) translateY(16px);
  background: #0A2A3D;
  color: #fff;
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 700;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 150;
}
.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- Footer ---------- */
footer.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 44px 0 36px;
  margin-top: 40px;
}
.foot-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  justify-content: space-between;
}
.foot-brand {
  max-width: 34ch;
}
.foot-brand p {
  font-size: 0.88rem;
  margin: 12px 0 0;
  color: var(--muted);
}
.foot-col h4 {
  font-size: 0.76rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.foot-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  font-size: 0.9rem;
}
.foot-col a:hover, .foot-col button:hover {
  color: var(--brand);
}
.foot-col button {
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--body);
  cursor: pointer;
  text-align: left;
}
.foot-bottom {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--muted);
}

/* ---------- Bloque "consigue la app" (modal de compra y sección ecosistema) ---------- */
.get-app {
  display: grid;
  gap: 6px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  font-size: 0.84rem;
  line-height: 1.45;
}
.get-app-label {
  font-weight: 700;
  color: var(--ink);
}
.get-app-soon {
  color: var(--muted);
}
.get-app-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
