/* Buyer screens (buyer/index.html). Loaded after app.css; colours only via tokens. */

/* ── Screens: each one fills the phone and scrolls on its own ── */
.buyer .screen { height: 100dvh; overflow-y: auto; }
.screen-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 60px 32px;
  text-align: center;
}
.screen-empty .title-display { font-size: 30px; }
.screen-empty p { margin: 0; }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }

/* ── Feed ── */
.feed-screen { position: relative; overflow: hidden; background: var(--ink); }
.feed-list {
  height: 100%;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.feed-list::-webkit-scrollbar { display: none; }
.feed-post {
  position: relative;
  height: 100dvh;
  overflow: hidden;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background: var(--ink);
}
/* Keep the 9:16 frame (dots are % of it) and let it cover the screen, cropped at the sides */
.feed-post .media-frame {
  position: absolute;
  top: 0;
  left: 50%;
  width: auto;
  height: 100%;
  min-width: 100%;
  transform: translateX(-50%);
}
/* the scrim sits inside the frame, under the dots (z-index 2) */
.feed-overlay {
  position: absolute;
  left: 18px;
  right: 76px;
  bottom: 28px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--white);
  pointer-events: none;
}
.feed-overlay__row { display: flex; align-items: center; gap: 10px; }
.feed-overlay__seller { font-size: 16px; font-weight: 700; text-shadow: var(--shadow-sm); }
.feed-overlay__tags { margin: 0; font-size: 14px; font-weight: 500; white-space: pre-wrap; text-shadow: var(--shadow-sm); }
.feed-follow {
  pointer-events: auto;
  min-height: 32px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--white);
  background: var(--white);
  color: var(--rose);
  font-size: 13px;
  font-weight: 700;
  position: relative;
}
.feed-follow::after { content: ''; position: absolute; inset: -6px; } /* 44px tap target */
.feed-follow.is-following { background: transparent; color: var(--white); }

.feed-badge {
  position: absolute;
  top: 72px; /* below the top bar (menu + tabs) */
  right: 14px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  pointer-events: none;
}
.feed-badge__label {
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: var(--white);
  color: var(--sage-deep);
  font-size: 11px;
  font-weight: 700;
}
.recycle-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--sage-bg);
  border: 2px solid var(--white);
  box-shadow: var(--shadow-sm);
  color: var(--sage);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.recycle-icon svg { width: 28px; height: 28px; }
.recycle-icon--sm { width: 34px; height: 34px; border: 0; box-shadow: none; background: var(--white); }
.recycle-icon--sm svg { width: 20px; height: 20px; }
.recycle-icon--xs { width: 30px; height: 30px; border: 0; box-shadow: none; }
.recycle-icon--xs svg { width: 17px; height: 17px; }

.feed-topbar {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: none; /* only the menu and the tabs catch taps; the reel stays scrollable */
}
.feed-topbar > * { pointer-events: auto; }
.feed-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-pill);
  background: var(--glass);
  box-shadow: var(--shadow-sm);
}
.feed-tab {
  position: relative;
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}
.feed-tab::after { content: ''; position: absolute; inset: -4px 0; } /* 44px tap target */
.feed-tab[aria-selected="true"] { background: var(--ink); color: var(--white); }

/* Menu button (top-left, bag icon): goes straight to the cart; the rose dot = the cart has lines */
.menu-btn { position: relative; color: var(--ink); }
.menu-dot {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--rose-dot);
  border: 1.5px solid var(--white);
}
.feed-empty {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 36px;
  text-align: center;
  background: var(--blush);
}
.feed-empty p { margin: 0; }

/* ── Tag bubble (centred modal) ── */
.bubble { padding: 0; border-radius: 22px; }
.bubble__body { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 14px; }
.bubble__close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  background: var(--blush);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.bubble__close svg { width: 16px; height: 16px; }
.bubble__top { display: flex; gap: 12px; align-items: flex-start; }
.bubble__thumb {
  width: 112px;
  height: 140px;
  flex: none;
  border-radius: 14px;
  object-fit: cover;
  background: var(--petal);
}
.bubble__info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding-right: 30px; }
.bubble__title-row { display: flex; align-items: center; gap: 2px; margin-left: -8px; }
.bubble__name { margin: 0; font-family: var(--font-display); font-size: 23px; font-weight: 600; line-height: 1.05; }
.bubble__brand { margin: 0; font-size: 13px; }
.bubble__details { margin: 0; padding: 0; list-style: none; font-size: 13px; color: var(--muted); line-height: 1.5; }
.heart-btn {
  width: 40px;
  height: 40px;
  flex: none;
  border: 0;
  background: transparent;
  color: var(--rose-2);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.heart-btn svg { width: 22px; height: 22px; fill: none; }
.heart-btn[aria-pressed="true"] svg { fill: currentColor; }
.bubble__condition {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--sage-bg);
  color: var(--sage-deep);
  font-size: 14px;
}
.bubble__condition div { display: flex; flex-direction: column; }
.bubble__note { font-size: 12px; }
.bubble__sizes { display: flex; flex-direction: column; gap: 8px; }
.bubble__sizes-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 12px; }
.bubble__sizes .chip { min-height: 40px; min-width: 46px; font-size: 14px; }
.bubble__sizes .chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--white); }
.bubble__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.bubble__price { display: flex; flex-direction: column; font-size: 12px; }
.bubble__price strong { font-size: 22px; }
.bubble__shipping { font-size: 12px; }
.bubble__foot { flex-wrap: wrap; }
.badge-sold { background: var(--ink); color: var(--white); font-size: 13px; padding: 6px 14px; }
.bubble__actions { display: flex; gap: 8px; flex-basis: 100%; }
.bubble__actions .btn { padding: 0 12px; font-size: 14px; white-space: nowrap; }
.bubble__actions .btn-ghost { flex: 1 1 auto; }
.bubble__actions .btn-primary { flex: 1.4 1 auto; }

/* ── Me gusta ── */
.likes-screen { background: var(--likes-bg); }
.like-card { background: var(--white); border-radius: var(--radius-sm); overflow: hidden; display: flex; flex-direction: column; }
.like-card__media { position: relative; height: 200px; background: var(--petal); }
.like-card__img { width: 100%; height: 100%; object-fit: cover; }
.like-card__heart, .like-card__bag {
  position: absolute;
  right: 6px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--rose);
}
.like-card__heart { top: 6px; background: var(--glass); }
.like-card__bag { bottom: 8px; background: var(--petal); }
.like-card__heart svg, .like-card__bag svg { width: 18px; height: 18px; }
.like-card__used { position: absolute; left: 8px; bottom: 8px; }
.like-card__sold { position: absolute; right: 8px; bottom: 8px; }
.like-card.is-sold .like-card__img { opacity: 0.6; }
.like-card__body { padding: 10px 12px 8px; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.like-card__name { font-size: 15px; font-weight: 500; line-height: 1.25; }
.like-card__detail { align-self: flex-start; font-size: 14px; min-height: 36px; }

/* ── Carrito ──
   The whole screen scrolls: header → lines → sticky footer ("Pagar") → "Tu cuenta" block. The
   footer sticks to the bottom while the lines are longer than the screen. */
.cart-screen { display: flex; flex-direction: column; }
.cart-list { flex: none; padding: 10px 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.cart-line { display: flex; gap: 12px; flex: none; }
.cart-line__thumb { width: 76px; height: 96px; flex: none; border-radius: 12px; object-fit: cover; background: var(--petal); }
.cart-line__info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cart-line__top { display: flex; justify-content: space-between; gap: 8px; line-height: 1.25; }
.cart-line__price { white-space: nowrap; }
.cart-line__seller { font-size: 13px; }
.cart-line__chosen { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.cart-line__change {
  border: 0;
  background: transparent;
  padding: 10px 6px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
}
.cart-line__missing { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.cart-line__warn { font-size: 13px; font-weight: 700; color: var(--rose-deep); }
.cart-line__remove {
  align-self: flex-start;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 50%;
  border: 0;
  background: var(--blush);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.cart-line__remove svg { width: 18px; height: 18px; }
.cart-footer {
  position: sticky;
  bottom: 0;
  z-index: 2;
  background: var(--white);
  border-top: 1px solid var(--line);
  padding: 14px 16px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cart-footer__row { display: flex; justify-content: space-between; font-size: 15px; }
.cart-footer__row.muted { font-size: 13px; }
.cart-checkout { min-height: 52px; font-size: 16px; margin-top: 4px; }
.cart-checkout:disabled { opacity: 1; background: var(--petal); color: var(--muted); }

/* "Tu cuenta": account line (simulated Google), Me gusta / Pedidos, Reiniciar demo. Bottom
   padding keeps "Reiniciar demo" clear of the toast. */
.cart-more {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
  padding: 18px 16px 96px;
  border-top: 1px solid var(--line);
  background: var(--white);
}
.cart-more .eyebrow { margin: 0; }
.cart-account__out, .cart-account__in { margin: 0; font-size: 13px; line-height: 1.4; }
.cart-account__out { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cart-account .link { flex: none; min-height: var(--tap); padding: 0; font-size: 13px; font-weight: 700; }
.cart-account__in strong { font-size: 15px; color: var(--rose-deep); }
.cart-nav { display: flex; flex-direction: column; gap: 6px; }
.cart-nav__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--blush);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  text-align: left;
}
.cart-nav__count {
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  border-radius: var(--radius-pill);
  background: var(--petal);
  color: var(--rose-deep);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cart-more__reset { align-self: flex-start; min-height: var(--tap); font-size: 14px; }

/* ── Checkout sheet (over the feed or the cart): lines, fields, summary, pay, trust line ── */
.checkout__form { display: flex; flex-direction: column; gap: 12px; }
.checkout__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.checkout__head .title-display { font-size: 28px; }
.field__error { margin: 0; font-size: 13px; font-weight: 700; color: var(--rose-deep); }
.checkout__summary {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.checkout__total { font-size: 17px; padding-top: 4px; }
.checkout__lines { display: flex; flex-direction: column; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.checkout-line { display: flex; align-items: center; gap: 12px; }
.checkout-line__thumb { width: 48px; height: 60px; flex: none; border-radius: 10px; object-fit: cover; background: var(--petal); }
.checkout-line__info { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.checkout-line__info strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.checkout-line__info .muted { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.checkout-line__price { font-size: 14px; white-space: nowrap; }
.checkout__fields-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0 12px; }
.checkout__fields-head .eyebrow { margin: 0; }
.checkout__signin { margin: 0; font-size: 13px; }
.checkout__signin .link { min-height: var(--tap); padding: 0; font-size: 13px; font-weight: 700; }
.checkout__prefilled { margin: -6px 0 0; font-size: 13px; }
.checkout__trust { margin: -4px 0 0; font-size: 12px; text-align: center; line-height: 1.4; }

/* ── Webpay (simulated) ── */
.webpay-screen { background: var(--white); }
.webpay-body { display: flex; flex-direction: column; gap: 16px; padding: 8px 16px 28px; }
.webpay-note {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--amber-bg);
  color: var(--ink);
  font-size: 13px;
}
.webpay-card { display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.webpay-row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.webpay-row--total { padding-top: 10px; border-top: 1px solid var(--line); font-size: 17px; }
.webpay-cancel { align-self: center; min-height: var(--tap); font-size: 14px; }

/* ── Payment result sheet (over the feed) ── */
.result__body { display: flex; flex-direction: column; gap: 12px; padding-bottom: 4px; text-align: center; }
.result__body .title-display { font-size: 30px; }
.result__body p { margin: 0 0 6px; }
.result__details {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 6px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--blush);
  font-size: 14px;
  text-align: left;
}
.result__details p { margin: 0; font-size: 13px; }
.result__lines { margin: 0; padding-left: 18px; }

/* ── Pedidos ── */
.orders-list { display: flex; flex-direction: column; gap: 12px; padding: 10px 16px 28px; }
.order-card { display: flex; flex-direction: column; gap: 12px; padding: 14px; }
.order-card__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.order-card__title { font-size: 16px; }
.order-card__meta { font-size: 13px; }
.order-card__note { margin: 0; font-size: 13px; }
.order-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.order-step { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 700; color: var(--muted); }
.order-step__bar { height: 4px; border-radius: 2px; background: var(--line); }
.order-step.is-done { color: var(--ink); }
.order-step.is-done .order-step__bar { background: var(--rose-2); }
.order-card__lines { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; }
.order-line { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.order-line__thumb { width: 44px; height: 54px; flex: none; border-radius: 8px; object-fit: cover; background: var(--petal); }
.order-line__info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.order-line__info .muted { font-size: 12px; }
.order-card__row { display: flex; justify-content: space-between; font-size: 14px; }

/* ── Feed hints: a hand that taps the deep-linked reel's first dot, and a swipe-up after paying ──
   Decorative only: aria-hidden and pointer-events: none, so the dot under the hand still works. */
.hint { position: absolute; pointer-events: none; }
.hint-hand { display: block; width: 46px; height: 46px; filter: drop-shadow(var(--shadow-sm)); }
.hint-hand path { fill: var(--white); stroke: var(--ink); }

/* Tap: anchored at the fingertip; left/top = start (JS), it moves to --hint-to-x/y (the dot). */
.hint-tap {
  z-index: 3; /* above the dots (2), inside the frame */
  width: 46px;
  height: 46px;
  margin: -4px 0 0 -17px; /* fingertip (9, 2 of 24) on the anchor point */
  animation: hint-tap-move 2.6s ease-in-out infinite;
}
.hint-tap .hint-hand { animation: hint-tap-press 2.6s ease-in-out infinite; transform-origin: 37% 4%; }
.hint-tap__pulse {
  position: absolute;
  left: 17px; /* centred on the fingertip */
  top: 4px;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border-radius: 50%;
  border: 2px solid var(--white);
  opacity: 0;
  animation: hint-tap-pulse 2.6s ease-out infinite;
}
@keyframes hint-tap-move {
  0% { opacity: 0; }
  12% { opacity: 1; }
  45%, 82% { left: var(--hint-to-x); top: var(--hint-to-y); opacity: 1; }
  100% { left: var(--hint-to-x); top: var(--hint-to-y); opacity: 0; }
}
@keyframes hint-tap-press { 0%, 48%, 68%, 100% { scale: 1; } 56% { scale: 0.86; } }
@keyframes hint-tap-pulse {
  0%, 52% { opacity: 0; scale: 0.4; }
  58% { opacity: 1; }
  80%, 100% { opacity: 0; scale: 1.5; }
}

/* Swipe up: bottom-centre over the feed, above the overlay and the top bar */
.hint-scroll {
  left: 50%;
  bottom: 220px; /* well above the toast (bottom: 24px) so both read at once */
  z-index: 6;
  translate: -50% 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.hint-scroll .hint-hand { animation: hint-swipe 1.6s ease-in-out infinite; }
.hint-scroll__label {
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background: var(--glass);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}
@keyframes hint-swipe {
  0% { translate: 0 40px; opacity: 0; }
  20% { translate: 0 40px; opacity: 1; }
  75% { translate: 0 -50px; opacity: 1; }
  100% { translate: 0 -60px; opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .hint-tap, .hint-tap .hint-hand, .hint-scroll .hint-hand { animation: none; }
  .hint-tap__pulse { display: none; }
}
