/* Vista previa del comercio tal como se ve en el app de Yelli.
   Las medidas siguen merchant_detail_page.dart a 390 px de ancho; el teléfono se escala con zoom. */

.ap-phone {
  --ap-zoom: 0.82;
  --ap-primary: #2A1538;
  --ap-primary-dark: #1A0D24;
  --ap-reward: #F4A81D;
  --ap-reward-dark: #D4890A;
  --ap-text: #1A1A1A;
  --ap-muted: #757575;
  --ap-border: rgba(221, 213, 232, 0.6);
  --ap-shadow: 0 2px 6px rgba(42, 21, 56, 0.06);
  position: relative;
  width: calc(390px * var(--ap-zoom) + 24px);
  padding: 12px;
  border-radius: 54px;
  background: linear-gradient(160deg, #2b2135, #120c18);
  box-shadow: 0 30px 70px rgba(42, 21, 56, 0.28), inset 0 0 0 2px rgba(255, 255, 255, 0.08);
  margin-inline: auto;
}
.ap-phone::before {
  content: "";
  position: absolute;
  top: calc(12px + 11px * var(--ap-zoom));
  left: 50%;
  width: calc(112px * var(--ap-zoom));
  height: calc(32px * var(--ap-zoom));
  transform: translateX(-50%);
  border-radius: 999px;
  background: #050307;
  z-index: 6;
}
.ap-viewport {
  width: calc(390px * var(--ap-zoom));
  height: calc(800px * var(--ap-zoom));
  border-radius: 42px;
  overflow: hidden;
  background: #fff;
  position: relative;
}
.ap-screen {
  zoom: var(--ap-zoom);
  width: 390px;
  height: 800px;
  position: relative;
  overflow: hidden;
  background: #fff;
  color: var(--ap-text);
  font-family: 'Plus Jakarta Sans', 'DM Sans', system-ui, sans-serif;
  line-height: 1.3;
  -webkit-font-smoothing: antialiased;
}
.ap-screen * { box-sizing: border-box; }
.ap-screen img { display: block; max-width: none; }
.ap-icon {
  font-family: 'Material Symbols Rounded';
  font-weight: normal;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  direction: ltr;
  -webkit-font-feature-settings: 'liga';
  font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24;
  user-select: none;
}

.ap-status {
  position: absolute;
  inset: 0 0 auto 0;
  height: 50px;
  padding: 16px 30px 0 34px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  z-index: 5;
  pointer-events: none;
}
.ap-status--dark { color: var(--ap-text); }
.ap-status-icons { display: flex; gap: 6px; align-items: center; }
.ap-status-icons svg { width: 17px; height: 12px; fill: currentColor; }

.ap-scroll {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}
.ap-scroll::-webkit-scrollbar { display: none; }

/* Portada */
.ap-cover {
  position: relative;
  height: 300px;
  background: linear-gradient(135deg, var(--ap-primary-dark), var(--ap-primary));
  overflow: hidden;
}
.ap-cover img { width: 100%; height: 100%; object-fit: cover; }
.ap-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0) 45%, rgba(0,0,0,0.55) 100%);
}
.ap-cover-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.7);
}
.ap-cover-fallback .ap-icon { font-size: 72px; }
.ap-back {
  position: absolute;
  top: 55px;
  left: 12px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  z-index: 2;
}

.ap-body { padding: 20px 20px 0; }
.ap-section { margin-top: 24px; }
.ap-section--wide { margin-top: 28px; }
.ap-name-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ap-name {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--ap-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ap-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  padding: 4px 10px 4px 9px;
  border-radius: 999px;
  background: linear-gradient(135deg, #FFD978 0%, #E8A020 45%, #D4890A 100%);
  box-shadow: 0 2px 6px rgba(212, 137, 10, 0.22);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.05px;
}
.ap-pill-emoji { font-size: 12px; line-height: 1; }
.ap-schedule {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--ap-muted);
}
.ap-placeholder { color: #c4bccd !important; }
.ap-name.ap-placeholder { color: #cfc6d9 !important; }

.ap-head { display: flex; align-items: flex-end; }
.ap-head-text { flex: 1; min-width: 0; }
.ap-head h3 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--ap-text);
  line-height: 1.2;
}
.ap-head p {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--ap-muted);
}
.ap-head-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 20px;
  background: rgba(42, 21, 56, 0.1);
  color: var(--ap-primary);
  font-size: 11px;
  font-weight: 700;
}
.ap-head-action .ap-icon { font-size: 14px; }

.ap-card {
  margin-top: 14px;
  background: #fff;
  border: 1px solid var(--ap-border);
  border-radius: 20px;
  box-shadow: var(--ap-shadow);
}
.ap-about { padding: 18px 18px 20px; }
.ap-quote {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(42, 21, 56, 0.1);
  color: var(--ap-primary);
}
.ap-about p {
  margin-top: 14px;
  font-size: 15px;
  line-height: 1.65;
  font-weight: 500;
  color: var(--ap-muted);
  overflow-wrap: anywhere;
}

.ap-chips { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.ap-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px 8px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1;
}
.ap-chip .ap-icon { font-size: 18px; }

/* Galería: mismas proporciones que MerchantDetailGallerySection */
.ap-gallery { margin-top: 14px; display: flex; gap: 8px; }
.ap-gallery img { width: 100%; height: 100%; object-fit: cover; }
.ap-gallery--1 { aspect-ratio: 16 / 10; border-radius: 20px; overflow: hidden; }
.ap-gallery--2 { height: 220px; }
.ap-gallery--2 > div { flex: 1; overflow: hidden; }
.ap-gallery--2 > div:first-child { border-radius: 20px 0 0 20px; }
.ap-gallery--2 > div:last-child { border-radius: 0 20px 20px 0; }
.ap-gallery--3 { height: 240px; }
.ap-gallery--3 > .ap-g-main { flex: 3; border-radius: 20px 0 0 20px; overflow: hidden; }
.ap-gallery--3 > .ap-g-side { flex: 2; display: flex; flex-direction: column; gap: 8px; }
.ap-gallery--3 .ap-g-side > div { flex: 1; overflow: hidden; }
.ap-gallery--3 .ap-g-side > div:first-child { border-radius: 0 20px 0 0; }
.ap-gallery--3 .ap-g-side > div:last-child { border-radius: 0 0 20px 0; }

.ap-location { overflow: hidden; }
.ap-map {
  position: relative;
  height: 190px;
  background: #e9e5ee;
}
.ap-map-canvas { position: absolute; inset: 0; }
.ap-map-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #a79fb2;
  font-size: 13px;
  font-weight: 600;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.5) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(rgba(255,255,255,0.5) 1px, transparent 1px) 0 0 / 28px 28px,
    #ece8f1;
}
.ap-map-chip {
  position: absolute;
  left: 14px;
  bottom: 14px;
  right: 14px;
  width: fit-content;
  max-width: calc(100% - 28px);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--ap-shadow);
  font-size: 12px;
  font-weight: 700;
  color: var(--ap-text);
  z-index: 500;
}
.ap-map-chip span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-map-chip .ap-icon { font-size: 16px; color: var(--ap-primary); }
.ap-location-body { padding: 14px 16px 16px; }
.ap-directions {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  border-radius: 14px;
  background: var(--ap-primary);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}
.ap-directions .ap-icon { font-size: 18px; }

.ap-socials { margin-top: 12px; display: flex; gap: 10px; }
.ap-social {
  flex: 1;
  padding: 14px 10px;
  border-radius: 16px;
  border: 1px solid var(--ap-border);
  background: #fff;
  box-shadow: var(--ap-shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ap-text);
}
.ap-social svg { width: 24px; height: 24px; }

.ap-bottom-space { height: 88px; }
.ap-fab {
  position: absolute;
  right: 16px;
  bottom: 24px;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: #25D366;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
  z-index: 4;
}
.ap-fab svg { width: 28px; height: 28px; fill: #fff; }

/* Pestaña Descubre (cómo aparece en el listado) */
.ap-discover {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: linear-gradient(180deg, #2A1538 0%, #3b1f4f 230px, #f6f3f9 230px);
  padding: 62px 0 0;
}
.ap-discover-head { padding: 0 20px; color: #fff; }
.ap-discover-head small { font-size: 13px; font-weight: 600; opacity: 0.75; }
.ap-discover-head h3 { font-size: 26px; font-weight: 800; letter-spacing: -0.4px; margin-top: 2px; }
.ap-search {
  margin: 16px 20px 0;
  height: 48px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
  font-weight: 500;
}
.ap-cats { display: flex; gap: 8px; padding: 16px 20px 0; overflow: hidden; }
.ap-cat {
  flex: none;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
}
.ap-cat--on { background: #fff; color: var(--ap-primary); }
.ap-discover-section { padding: 26px 20px 0; }
.ap-discover-section h4 { font-size: 18px; font-weight: 800; color: var(--ap-text); }
.ap-discover-section p { font-size: 12px; color: var(--ap-muted); font-weight: 500; margin-top: 2px; }
.ap-cards { display: flex; gap: 14px; margin-top: 14px; }
.ap-bcard {
  flex: none;
  width: 250px;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #ece6f2;
  box-shadow: 0 8px 22px rgba(42, 21, 56, 0.1);
}
.ap-bcard--ghost { opacity: 0.45; filter: grayscale(0.6); }
.ap-bcard-img { position: relative; height: 150px; background: linear-gradient(135deg, var(--ap-primary-dark), var(--ap-primary)); }
.ap-bcard-img img { width: 100%; height: 100%; object-fit: cover; }
.ap-bcard-img .ap-cover-fallback .ap-icon { font-size: 44px; }
.ap-logo-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  background: #fff;
  border: 1px solid #ece6f2;
}
.ap-logo-badge img { width: 100%; height: 100%; object-fit: cover; }
.ap-bcard-body { padding: 10px 12px 12px; }
.ap-bcard-body strong {
  display: block;
  font-size: 14px;
  font-weight: 800;
  color: var(--ap-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ap-bcard-meta {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ap-primary);
}
.ap-bcard-meta .ap-icon { font-size: 13px; }
.ap-ghost-line { height: 12px; border-radius: 6px; background: #ece6f2; }

.ap-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin: 0 auto 14px;
  border-radius: 999px;
  background: #f1ebf4;
}
.ap-tabs button {
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  color: #6b6178;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  min-height: 36px;
}
.ap-tabs button[aria-selected="true"] { background: #fff; color: #2A1538; box-shadow: 0 2px 8px rgba(42, 21, 56, 0.12); }

@media (max-width: 420px) {
  .ap-phone { --ap-zoom: 0.74; }
}
.ap-phone [hidden], .ap-wrap [hidden] { display: none !important; }
