/* ── Yomi Home Screen — Figma Redesign ─────────────────────────
   Tokens extracted from node-id=9:175
   ──────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:            #eaf9f6;
  --ink:           #0d3d35;
  --ink-muted:     #5f7568;
  --accent:        #f5a623;
  --teal-soft:     #4bc5ab;
  --white:         #ffffff;
  --shadow-card:   0 1px 3px rgba(45,188,158,0.07);
  --shadow-stat:   0 1px 1px rgba(45,188,158,0.05);
  --shadow-scan:   0 4px 12px rgba(45,188,158,0.2);
  --radius:        4px;
  --paper:         var(--white);
  --border:        rgba(45,188,158,0.2);
  --ink-3:         var(--ink-muted);
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

html, body { height: 100%; background: var(--bg); }

body {
  font-family: 'Inter', sans-serif;
  -webkit-font-smoothing: antialiased;
  display: flex;
  justify-content: center;
}

/* ── App shell ───────────────────────────────────────────────── */
.app-shell {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 540px;
  height: 100dvh;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

/* ── Header ─────────────────────────────────────────────────── */
.app-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 48px 20px 12px;
  background: var(--bg);
}

.app-logo {
  height: 38px;
  width: auto;
  display: block;
}

/* ── Scrollable main ─────────────────────────────────────────── */
.app-main {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: var(--bg);
  padding-bottom: 16px;
}

/* ── Heading ─────────────────────────────────────────────────── */
.section-heading {
  padding: 8px 20px 16px;
}

.heading-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.5;
  letter-spacing: -0.56px;
  margin-bottom: 2px;
}

.heading-sub {
  font-size: 14px;
  font-weight: 400;
  color: var(--ink-muted);
  line-height: 1.5;
}

/* ── Scan CTA ─────────────────────────────────────────────────── */
.section-scan {
  padding: 0 20px 20px;
}

.scan-cta {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  background: var(--ink);
  border: none;
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  box-shadow: var(--shadow-scan);
  transition: opacity 0.15s;
}

.scan-cta:active { opacity: 0.85; }

.scan-cta-icon-wrap {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  background: rgba(126,189,172,0.2);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
}

.scan-cta-icon {
  width: 26px;
  height: 26px;
}

.scan-cta-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}

.scan-cta-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--white);
  line-height: 1.5;
  white-space: nowrap;
}

.scan-cta-sub {
  font-size: 13px;
  font-weight: 500;
  color: rgba(126,189,172,0.8);
  line-height: 1.5;
}
/* ── About card ──────────────────────────────────────────────── */
.section-about {
  padding: 0 20px 16px;
}
.about-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--paper);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}
.about-card-icon {
  font-size: 24px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}
.about-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.about-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
}
.about-text {
  font-size: 13px;
  color: var(--ink-3);
  margin: 0;
  line-height: 1.5;
}

/* ── Recent products ─────────────────────────────────────────── */
.section-recent {
  padding: 0 0 0;
}

.section-recent-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px 12px;
}

.recent-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.5;
}


.products-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 20px 20px;
}

@media (min-width: 520px) {
  .products-grid { grid-template-columns: 1fr 1fr 1fr; }
}

@media (min-width: 768px) and (min-height: 600px) {
  .app-shell { max-width: 1100px; }
  .app-main {
    display: grid;
    grid-template-columns: 380px 1fr;
    overflow: hidden;
    padding-bottom: 0;
    min-height: 0;
  }
  .home-left {
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-right: 1px solid rgba(45,188,158,0.2);
    overflow: hidden;
    background: var(--ink);
    position: relative;
  }
  .home-left .heading-title { color: var(--white); }
  .home-left .heading-sub   { color: rgba(126,189,172,0.8); }
  .home-left .scan-cta {
    background: rgba(75,197,171,0.15);
    border: 1px solid rgba(75,197,171,0.35);
  }
  .home-left .scan-cta-title { white-space: normal; }
  .home-right {
    overflow-y: auto;
    padding-bottom: 20px;
    min-height: 0;
  }
  .products-grid { grid-template-columns: 1fr 1fr 1fr 1fr; }
  .home-scan-frame {
    position: absolute;
    inset: 24px;
    pointer-events: none;
  }
  .home-scan-frame::before,
  .home-scan-frame::after,
  .home-scan-frame span { content: ''; display: block; position: absolute; width: 28px; height: 28px; }
  .home-scan-frame::before      { top: 0; left: 0;  border-top: 2px solid rgba(255,255,255,0.55); border-left: 2px solid rgba(255,255,255,0.55); border-radius: 3px 0 0 0; }
  .home-scan-frame::after       { top: 0; right: 0; border-top: 2px solid rgba(255,255,255,0.55); border-right: 2px solid rgba(255,255,255,0.55); border-radius: 0 3px 0 0; }
  .home-scan-frame span:first-child { bottom: 0; left: 0;  border-bottom: 2px solid rgba(255,255,255,0.55); border-left: 2px solid rgba(255,255,255,0.55); border-radius: 0 0 0 3px; }
  .home-scan-frame span:last-child  { bottom: 0; right: 0; border-bottom: 2px solid rgba(255,255,255,0.55); border-right: 2px solid rgba(255,255,255,0.55); border-radius: 0 0 3px 0; }
}

.products-empty {
  padding: 24px 20px;
  text-align: center;
  font-size: 13px;
  color: var(--ink-muted);
}

.products-empty.hidden { display: none; }

.activation-hint {
  padding: 10px 20px 0;
  text-align: center;
  font-size: 12px;
  color: var(--ink-muted);
}

.activation-hint.hidden { display: none; }

/* ── Product card ────────────────────────────────────────────── */
.product-card {
  position: relative;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
  display: flex;
  flex-direction: column;
}

.product-card:active {
  transform: scale(0.98);
  box-shadow: none;
}

.product-card-img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: contain;
  display: block;
  background: #d8f5ef;
}

.product-card-img-placeholder {
  width: 100%;
  aspect-ratio: 1/1;
  background: #d8f5ef;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.product-card-img-placeholder svg { opacity: 0.4; }

.product-card-body {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.product-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-card-brand {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-muted);
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-card-badge-row {
  margin-top: 4px;
  min-height: 20px;
  display: flex;
  align-items: flex-end;
}

/* Health badges */
.badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.54px;
  padding: 7px 8px 6px;
  border-radius: var(--radius);
  line-height: 1;
  text-transform: uppercase;
}

.badge-sano   { background: rgba(22,163,74,0.12);  color: #107535; }
.badge-evitar { background: rgba(220,38,38,0.12);  color: #ac1e1e; }
.badge-regular{ background: rgba(234,179,8,0.15);  color: #836404; }

/* ── Social links ────────────────────────────────────────────── */
.section-social {
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 32px 20px 24px;
}

.social-link {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: var(--shadow-stat);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s;
}

.social-link:active { opacity: 0.7; }

.social-icon {
  width: 20px;
  height: 20px;
  display: block;
}

/* ── Bottom nav ──────────────────────────────────────────────── */
.bottom-nav {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  background: var(--white);
  border-top: 1px solid rgba(45,188,158,0.2);
  padding: 9px 8px max(24px, env(safe-area-inset-bottom));
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 0;
}

.nav-icon {
  width: 22px;
  height: 22px;
  display: block;
}

.nav-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.1px;
  line-height: 1.5;
}

.nav-label-muted {
  font-weight: 400;
  color: var(--ink-muted);
}

.nav-disabled {
  opacity: 0.35;
  pointer-events: none;
  cursor: default;
}

/* Scan tab — bigger icon with frame */
.nav-scan-ring {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: -8px;
}

.nav-scan-icon {
  width: 48px;
  height: 48px;
  display: block;
}
