/* ==========================================================================
   Ryze Coffee — item detail sheet + footer
   A bottom sheet, not a centred modal: on a phone held one-handed the
   thumb reaches the bottom of the screen, never the middle.
   ========================================================================== */

.sheet-scrim {
  position: fixed; inset: 0;
  background: rgba(28, 20, 13, .55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 40;
  opacity: 0;
  transition: opacity var(--mid) var(--ease);
}
.sheet-scrim.is-open { opacity: 1; }

.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  background: var(--cream);
  border-radius: 10px 10px 0 0;
  box-shadow: 0 -8px 40px rgba(40, 24, 8, .28);
  max-height: 92dvh;              /* dvh, not vh — mobile Safari's toolbar */
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform var(--slow) var(--ease);
  overscroll-behavior: contain;
}
.sheet.is-open { transform: translateY(0); }

@media (min-width: 720px) {
  /* On a wide screen it becomes a centred card — a full-width bar
     would leave the photo stranded. */
  .sheet {
    left: 50%; bottom: 50%;
    transform: translate(-50%, 60%) scale(.97);
    width: min(460px, 92vw);
    border-radius: 10px;
    max-height: 88dvh;
    opacity: 0;
  }
  .sheet.is-open { transform: translate(-50%, 50%) scale(1); opacity: 1; }
}

.sheet__grip {
  width: 38px; height: 4px;
  border-radius: var(--r-full);
  background: var(--line);
  margin: var(--s-3) auto var(--s-1);
  flex-shrink: 0;
}
@media (min-width: 720px) { .sheet__grip { display: none; } }

.sheet__close {
  position: absolute;
  top: var(--s-3); right: var(--s-3);
  z-index: 3;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 0; cursor: pointer;
  border-radius: var(--r-full);
  background: color-mix(in srgb, var(--cream) 82%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--wine);
  box-shadow: var(--shadow-soft);
}
.sheet__close svg { width: 17px; height: 17px; }

.sheet__scroll {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--safe-b) + var(--s-5));
}

.sheet__shot {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--cream-3);
  margin: 0;
  border-radius: 0;
}

.sheet__shot img { width: 100%; height: 100%; object-fit: cover; }

.sheet__body { padding: var(--s-4) var(--s-5) 0; }

.sheet__badges { display: inline-flex; flex-wrap: wrap; gap: 4px; vertical-align: middle; }
.sheet__badges:not(:empty) { margin-left: 6px; }
.sheet__badges .badge { width: 22px; height: 22px; }
.sheet__badges .badge svg { width: 22px; height: 22px; }

.sheet__name {
  font-family: var(--font);
  
  
  font-weight: 600;
  font-size: clamp(1.4rem, 1.1rem + 1.4vw, 1.75rem);
  line-height: 1.1;
  letter-spacing: -.02em;
  margin: 0;
  text-wrap: balance;
}

.sheet__meta {
  display: flex; align-items: baseline; gap: var(--s-3);
  margin-top: var(--s-3);
}
.sheet__price {
  font-size: 1.3rem; font-weight: 700;
  color: var(--olive);
  font-variant-numeric: tabular-nums;
}
.sheet__kcal {
  position: absolute;
  left: 16px; bottom: 12px;
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(255,255,255,.7);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  color: #000;
  font-size: 12px; font-weight: 600;
  padding: 6px 8px; border-radius: 16px;
  font-variant-numeric: tabular-nums;
  z-index: 2;
}
.sheet__kcal svg { width: 13px; height: 13px; }

.sheet__desc {
  margin: var(--s-4) 0 0;
  color: var(--wine);
  font-size: var(--t-item);
  line-height: 1.62;
  text-wrap: pretty;
}
.sheet__desc:empty { display: none; }

.sheet__allergens { margin-top: var(--s-5); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sheet__allergens:empty { display: none; }
.sheet__allergens-label {
  width: 100%;
  font-size: var(--t-meta);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--wine-soft);
  margin-bottom: var(--s-1);
}
.allergen {
  font-size: var(--t-meta);
  padding: 5px 10px;
  border-radius: var(--r-full);
  background: var(--cream-3);
  color: var(--wine);
  border: 1px solid var(--line);
}

/* ---------- Footer ------------------------------------------------------ */

.footer {
  padding: var(--s-7) var(--s-5) calc(var(--safe-b) + var(--s-6));
  text-align: center;
  border-top: 1px solid var(--line);
  margin-top: var(--s-7);
}
.footer p { margin: 0; font-size: var(--t-meta); color: var(--wine-soft); text-wrap: pretty; }
.footer__brand { font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--olive); font-size: 12px; }

.sheet__name { display: block; }
.sheet__name #sheetName { display: inline; }
