/* =====================================================================
   BREW COFFEE STUDIO | WEB SHELL REFRESH
   Web-only visual layer. It is scoped behind html.is-web-shell so the
   Capacitor/iOS native shell, RevenueCat flow, auth, sync, and app logic
   are not affected.
   ===================================================================== */

html.is-web-shell {
  --web-rail-width: 92px;
  --web-gap: clamp(22px, 2.2vw, 36px);
  --web-card-bg: rgba(14,14,16,0.78);
  --web-card-border: rgba(255,255,255,0.09);
  --web-topbar-height: 68px;
}

html.is-web-shell body {
  background:
    radial-gradient(circle at 15% 5%, rgba(194,124,46,0.18) 0%, rgba(194,124,46,0.06) 27%, transparent 48%),
    radial-gradient(circle at 88% 8%, rgba(255,225,180,0.10) 0%, transparent 36%),
    linear-gradient(135deg, rgba(0,0,0,0.72), rgba(0,0,0,0.52)),
    url('../img/brand/bg_marble_gold.jpg') center/cover fixed no-repeat;
}

html.is-web-shell body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255,255,255,0.026) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(circle at 50% 0%, rgba(0,0,0,0.72), transparent 72%);
  -webkit-mask-image: radial-gradient(circle at 50% 0%, rgba(0,0,0,0.72), transparent 72%);
}

/* Web splash: brand-visible. Native uses the Capacitor splash and keeps its
   existing black handoff, because these selectors only run in web shell. */
html.is-web-shell #security-layer:not(.native-handoff) {
  background-color: #050505;
  background-image:
    url('../img/brand/brew_coffee_studio_auth_seal.png'),
    radial-gradient(circle at 50% 40%, rgba(194,124,46,0.18), transparent 34%),
    radial-gradient(circle at 18% 8%, rgba(255,225,180,0.08), transparent 30%),
    linear-gradient(145deg, #050505 0%, #101012 48%, #050505 100%);
  background-size: clamp(132px, 18vw, 210px) auto, cover, cover, cover;
  background-position: 50% calc(50% - 38px), center, center, center;
  background-repeat: no-repeat;
}

html.is-web-shell #security-layer:not(.native-handoff)::after {
  content: 'BREW COFFEE STUDIO\A Barismo • Recetas • Negocio';
  white-space: pre;
  position: absolute;
  left: 24px;
  right: 24px;
  top: calc(50% + 95px);
  text-align: center;
  font-family: var(--font-ui, Manrope, system-ui, sans-serif);
  color: rgba(255,255,255,0.92);
  letter-spacing: .18em;
  font-size: clamp(.74rem, 1.3vw, .92rem);
  font-weight: 900;
  line-height: 1.9;
  text-transform: uppercase;
  text-shadow: 0 12px 38px rgba(0,0,0,0.7);
  opacity: .96;
}

html.is-web-shell #app-shell {
  width: 100%;
  max-width: none;
  margin: 0;
  background: transparent;
}

html.is-web-shell #top-bar {
  background: linear-gradient(180deg, rgba(14,14,18,0.86), rgba(9,9,12,0.78));
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 18px 52px rgba(0,0,0,0.30), inset 0 1px 0 rgba(255,255,255,0.07);
}

html.is-web-shell #top-bar.top-bar-scrolled {
  background: linear-gradient(180deg, rgba(14,14,18,0.94), rgba(9,9,12,0.86));
  border-color: rgba(255,255,255,0.12);
}

html.is-web-shell #header-title {
  letter-spacing: .22em;
}

html.is-web-shell #viewport {
  scrollbar-color: rgba(194,124,46,0.42) rgba(255,255,255,0.04);
}

html.is-web-shell #viewport::-webkit-scrollbar { width: 10px; }
html.is-web-shell #viewport::-webkit-scrollbar-track { background: rgba(255,255,255,0.035); }
html.is-web-shell #viewport::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(194,124,46,0.62), rgba(194,124,46,0.24));
  border-radius: 999px;
  border: 2px solid rgba(0,0,0,0.35);
}

html.is-web-shell .tech-card,
html.is-web-shell .dash-card,
html.is-web-shell .dash-tile,
html.is-web-shell .section-header,
html.is-web-shell .business-hero-shell,
html.is-web-shell .food-hero-shell,
html.is-web-shell .settings-hero,
html.is-web-shell .pantry-hero,
html.is-web-shell .biz-report-shell,
html.is-web-shell .foundations-meta-card {
  background-color: var(--web-card-bg);
  border-color: var(--web-card-border);
  box-shadow: 0 22px 58px rgba(0,0,0,0.28), inset 0 1px 0 rgba(255,255,255,0.055);
}

html.is-web-shell .btn-arch:hover,
html.is-web-shell .dash-tile:hover,
html.is-web-shell .tech-card:hover {
  transform: translateY(-2px);
}

@media (min-width: 1080px) and (hover: hover) and (pointer: fine) {
  html.is-web-shell {
    --viewport-pad-x: clamp(26px, 2.6vw, 46px);
    --content-max-width: 1320px;
  }

  html.is-web-shell body {
    overflow: hidden;
  }

  html.is-web-shell #top-bar {
    top: 18px;
    left: calc(var(--web-gap) + var(--web-rail-width) + 18px);
    right: var(--web-gap);
    width: auto;
    height: var(--web-topbar-height);
    min-height: var(--web-topbar-height);
    padding: 0 clamp(22px, 2.4vw, 38px);
    border-radius: 24px;
    transform: none;
  }

  html.is-web-shell #top-bar::before {
    content: '';
    width: clamp(86px, 10vw, 132px);
    height: 32px;
    margin-right: 18px;
    background: url('../img/brand/brew_coffee_studio_header.png') left center / contain no-repeat;
    opacity: .88;
    flex: 0 0 auto;
  }

  html.is-web-shell #header-title {
    font-size: .78rem;
    color: rgba(255,255,255,0.78);
  }

  html.is-web-shell #viewport {
    width: 100%;
    max-width: none;
    padding-top: calc(var(--web-topbar-height) + 42px);
    padding-left: calc(var(--web-gap) + var(--web-rail-width) + 18px);
    padding-right: var(--web-gap);
    padding-bottom: 44px;
    scroll-padding-top: calc(var(--web-topbar-height) + 56px);
  }

  html.is-web-shell #viewport.brew-tight-top,
  html.is-web-shell #viewport.home-tight-top {
    padding-top: calc(var(--web-topbar-height) + 42px);
  }

  html.is-web-shell #viewport > * {
    max-width: var(--content-max-width);
    margin-left: auto;
    margin-right: auto;
  }

  html.is-web-shell #bottom-dock {
    left: var(--web-gap);
    top: 18px;
    bottom: 18px;
    right: auto;
    width: var(--web-rail-width);
    height: auto;
    max-height: none;
    transform: none;
    border-radius: 30px;
    background:
      linear-gradient(180deg, rgba(18,18,22,0.86), rgba(8,8,10,0.88)),
      radial-gradient(circle at 50% 0%, rgba(194,124,46,0.18), transparent 42%);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 22px 60px rgba(0,0,0,0.34), inset 0 1px 0 rgba(255,255,255,0.075);
    backdrop-filter: blur(24px) saturate(135%);
    -webkit-backdrop-filter: blur(24px) saturate(135%);
    padding: 12px 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  html.is-web-shell #bottom-dock::before {
    content: '';
    position: relative;
    inset: auto;
    display: block;
    width: 58px;
    height: 58px;
    margin: 2px auto 12px;
    border-radius: 20px;
    background:
      linear-gradient(180deg, rgba(0,0,0,0.05), rgba(0,0,0,0.34)),
      url('../img/brand/brew_coffee_studio_auth_seal.png') center/contain no-repeat;
    box-shadow: 0 12px 28px rgba(0,0,0,0.25);
    opacity: .96;
    flex: 0 0 auto;
    pointer-events: none;
  }

  html.is-web-shell #bottom-nav {
    position: relative;
    inset: auto;
    width: 100%;
    height: calc(100% - 74px);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 9px;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0 4px 8px;
    scrollbar-width: none;
  }

  html.is-web-shell #bottom-nav::-webkit-scrollbar { display: none; }

  html.is-web-shell #bottom-nav .nav-item:first-child,
  html.is-web-shell #bottom-nav .nav-item:last-child {
    margin-left: 0;
    margin-right: 0;
  }

  html.is-web-shell #bottom-nav .nav-item {
    width: 66px;
    min-width: 66px;
    height: 58px;
    min-height: 58px;
    border-radius: 20px;
    flex-direction: column;
    gap: 5px;
    padding: 8px 4px;
  }

  html.is-web-shell #bottom-nav .nav-item span,
  html.is-web-shell #bottom-nav .nav-item.active span {
    display: block;
    max-width: 58px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .48rem;
    line-height: 1;
    letter-spacing: .08em;
    opacity: .72;
  }

  html.is-web-shell #bottom-nav .nav-item i {
    font-size: 1.04rem;
  }

  html.is-web-shell #bottom-nav .nav-item.active {
    width: 66px;
    min-width: 66px;
    background: linear-gradient(135deg, rgba(194,124,46,0.24), rgba(255,255,255,0.055));
    border-color: rgba(194,124,46,0.34);
    box-shadow: 0 12px 26px rgba(0,0,0,0.28), 0 0 24px rgba(194,124,46,0.10);
  }

  html.is-web-shell .hero-home,
  html.is-web-shell .brew-lab-hero,
  html.is-web-shell .brew-method-hero,
  html.is-web-shell .foundations-hero,
  html.is-web-shell .business-hero-img,
  html.is-web-shell .drinks-hero,
  html.is-web-shell .food-hero-shell,
  html.is-web-shell .pantry-hero,
  html.is-web-shell .settings-hero {
    border-radius: 32px !important;
    border: 1px solid rgba(255,255,255,0.09);
    box-shadow: 0 28px 80px rgba(0,0,0,0.34);
    overflow: hidden;
  }

  html.is-web-shell .hero-home {
    min-height: clamp(420px, 48vh, 560px);
  }

  html.is-web-shell .hero-brand,
  html.is-web-shell .hero-greet {
    text-shadow: 0 12px 36px rgba(0,0,0,0.60);
  }

  html.is-web-shell .dash-grid,
  html.is-web-shell .foundations-tiles {
    gap: 16px;
  }

  html.is-web-shell .dash-tile,
  html.is-web-shell .tech-card {
    border-radius: 24px;
  }

  html.is-web-shell .modal-card,
  html.is-web-shell .biz-modal .biz-modal-card,
  html.is-web-shell .ux-modal-card,
  html.is-web-shell .more-sheet-panel,
  html.is-web-shell .brew-steps-sheet {
    border-radius: 26px;
  }
}

@media (max-width: 1079px) {
  html.is-web-shell #security-layer:not(.native-handoff)::after {
    top: calc(50% + 82px);
    letter-spacing: .14em;
  }
}

/* =====================================================================
   FINAL WEB POLISH | header, section title, sync chip
   Web-only. Does not affect Capacitor/iOS native shell.
   ===================================================================== */
html.is-web-shell #cloud-sync-chip {
  height: 30px !important;
  min-width: 30px !important;
  width: auto !important;
  padding: 0 8px !important;
  border-radius: 999px !important;
  border-color: rgba(111,226,156,0.34) !important;
  background: rgba(10,12,14,0.54) !important;
  box-shadow: 0 10px 28px rgba(0,0,0,0.18), inset 0 0 0 1px rgba(255,255,255,0.025) !important;
  backdrop-filter: blur(12px) saturate(135%) !important;
  -webkit-backdrop-filter: blur(12px) saturate(135%) !important;
}
html.is-web-shell #cloud-sync-chip-dot {
  width: 4px !important;
  height: 4px !important;
  box-shadow: 0 0 16px currentColor !important;
}
html.is-web-shell #cloud-sync-chip-label {
  font-size: .60rem !important;
  letter-spacing: .02em !important;
}

@media (min-width: 1080px) and (hover: hover) and (pointer: fine) {
  html.is-web-shell #top-bar {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
  }
  html.is-web-shell #top-bar::before {
    content: none !important;
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    background: none !important;
  }
  html.is-web-shell #header-title {
    grid-column: 2;
    justify-self: center;
    font-size: clamp(.90rem, .78vw, 1.02rem) !important;
    letter-spacing: .34em !important;
    line-height: 1 !important;
    color: rgba(255,255,255,0.84) !important;
    text-shadow: 0 10px 30px rgba(0,0,0,0.38);
  }
  html.is-web-shell #header-actions {
    grid-column: 3;
    justify-self: end;
    min-width: 40px;
  }
  html.is-web-shell #cloud-sync-chip {
    top: 36px !important;
    right: calc(var(--web-gap) + 23px) !important;
  }
  html.is-web-shell #bottom-nav .nav-item span,
  html.is-web-shell #bottom-nav .nav-item.active span {
    font-size: .54rem !important;
    letter-spacing: .09em !important;
  }
}
