/* Instagram-style Amazon perfume feed — luxury polish */

:root {
  --ig-bg: #f7f4f1;
  --ig-card: #ffffff;
  --ig-border: #ebe4dc;
  --ig-ink: #1c1917;
  --ig-muted: #78716c;
  --ig-link: #7c2d12;
  --ig-heart: #e11d48;
  --ig-accent: #c9a96e;
  --ig-blush: #fdf2f8;
  --ig-blush-border: #f9c4d8;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --ig-max: 490px;
}

* {
  box-sizing: border-box;
}

html,
body.shop-feed-body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--ig-bg);
  color: var(--ig-ink);
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* —— Top bar: large centered Loved Scents wordmark —— */
.shop-feed-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 0.45rem;
  max-width: var(--ig-max);
  margin: 0 auto;
  padding: calc(0.65rem + var(--safe-top)) 0.7rem 0.65rem;
  min-height: calc(4.75rem + var(--safe-top));
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.98) 0%,
    rgba(255, 252, 250, 0.96) 100%
  );
  border-bottom: 1px solid var(--ig-border);
  box-shadow: 0 1px 0 rgba(201, 169, 110, 0.12), 0 8px 24px rgba(28, 25, 23, 0.04);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.shop-feed-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  min-width: 0;
  justify-self: center;
  width: 100%;
  max-width: min(70vw, 15.5rem);
}

.shop-feed-brand img,
.shop-feed-logo {
  display: block;
  /* Tight-cropped wordmark — large & readable on mobile */
  height: 3.75rem;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: center;
}

@media (min-width: 400px) {
  .shop-feed-brand img,
  .shop-feed-logo {
    height: 4.25rem;
  }

  .shop-feed-header {
    min-height: calc(5.1rem + var(--safe-top));
    padding-top: calc(0.85rem + var(--safe-top));
    padding-bottom: 0.85rem;
  }

  .shop-feed-brand {
    max-width: min(72vw, 17.5rem);
  }
}

@media (min-width: 500px) {
  .shop-feed-brand img,
  .shop-feed-logo {
    height: 4.6rem;
  }

  .shop-feed-brand {
    max-width: 19rem;
  }
}

.shop-feed-tag {
  justify-self: end;
  max-width: 6.75rem;
  font-size: 0.62rem;
  font-weight: 700;
  color: #9d174d;
  letter-spacing: 0.01em;
  background: linear-gradient(135deg, #fdf2f8 0%, #fff 100%);
  border: 1px solid var(--ig-blush-border);
  border-radius: 999px;
  padding: 0.35rem 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  box-shadow: 0 1px 2px rgba(190, 24, 93, 0.06);
}

@media (min-width: 400px) {
  .shop-feed-tag {
    max-width: 8rem;
  }
}

.shop-menu-btn,
.shop-menu-close {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0.4rem;
  margin: 0;
  cursor: pointer;
  color: var(--ig-ink);
  line-height: 0;
  border-radius: 0.55rem;
  justify-self: start;
}

.shop-menu-btn {
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid var(--ig-border);
  box-shadow: 0 1px 3px rgba(28, 25, 23, 0.05);
}

.shop-menu-btn svg,
.shop-menu-close svg {
  width: 1.4rem;
  height: 1.4rem;
  display: block;
}

.shop-menu-btn:active,
.shop-menu-close:active {
  opacity: 0.55;
}

body.shop-menu-open {
  overflow: hidden;
}

.shop-menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.shop-menu-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.shop-menu {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 90;
  width: min(86vw, 20rem);
  background: #fff;
  box-shadow: 8px 0 32px rgba(0, 0, 0, 0.12);
  transform: translateX(-105%);
  transition: transform 0.22s ease;
  display: flex;
  flex-direction: column;
  padding: calc(0.75rem + var(--safe-top)) 0 calc(1rem + var(--safe-bottom));
}

.shop-menu.is-open {
  transform: translateX(0);
}

.shop-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.25rem 0.85rem 0.65rem;
  border-bottom: 1px solid var(--ig-border);
}

.shop-menu-head h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.shop-menu-note {
  margin: 0.75rem 0.9rem 0.35rem;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--ig-muted);
}

.shop-menu-note--candy {
  color: #9d174d;
  background: #fdf2f8;
  border-radius: 0.65rem;
  padding: 0.65rem 0.75rem;
  margin-top: 0.5rem;
}

.shop-menu-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.65rem 0.65rem 1rem;
  overflow-y: auto;
}

.shop-menu-item {
  appearance: none;
  border: 1px solid var(--ig-border);
  background: #fff;
  text-align: left;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ig-ink);
  padding: 0.75rem 0.85rem;
  border-radius: 0.65rem;
  cursor: pointer;
}

.shop-menu-item.is-active {
  border-color: #f9a8d4;
  background: linear-gradient(135deg, #fdf2f8 0%, #fff 60%);
  color: #9d174d;
  box-shadow: inset 0 0 0 1px #fbcfe8;
}

.shop-feed-banner {
  margin: 0;
  padding: 0.8rem 1rem;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--ig-muted);
  background: linear-gradient(180deg, #fffafc 0%, #ffffff 100%);
  border-bottom: 1px solid var(--ig-blush-border);
}

.shop-feed-banner strong {
  color: #9d174d;
  font-weight: 700;
}

.shop-feed-banner em {
  font-style: normal;
  color: var(--ig-ink);
  font-weight: 600;
}

.shop-feed-empty-hint {
  margin-top: 0.5rem;
  font-size: 0.85rem;
}

.ig-post--candy {
  box-shadow: 0 0 0 1px rgba(249, 168, 212, 0.35);
}

.ig-deal-pill--candy,
.ig-media-badge--candy {
  background: linear-gradient(135deg, #f472b6, #ec4899 50%, #db2777) !important;
}

.ig-deal-pill--market,
.ig-media-badge--market {
  background: linear-gradient(135deg, #6b4e71, #8b6b92 50%, #4a3550) !important;
}

.ig-post--market {
  box-shadow: 0 0 0 1px rgba(107, 78, 113, 0.28);
}

.ig-deal-pill {
  flex-shrink: 0;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #fff;
  background: #ed4956;
  border-radius: 0.35rem;
  padding: 0.22rem 0.4rem;
  max-width: 5.5rem;
  text-align: center;
  line-height: 1.15;
}

.ig-media-badge {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
  z-index: 2;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(237, 73, 86, 0.92);
  border-radius: 0.35rem;
  padding: 0.28rem 0.5rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

/* —— Feed —— */
.shop-feed {
  max-width: var(--ig-max);
  margin: 0 auto;
  padding-bottom: calc(4.5rem + var(--safe-bottom));
  min-height: 60dvh;
}

.shop-feed-loading {
  padding: 4rem 1rem;
  text-align: center;
  color: var(--ig-muted);
  font-size: 0.95rem;
}

.shop-feed-empty {
  padding: 4rem 1.5rem;
  text-align: center;
  color: var(--ig-muted);
}

/* —— Post card —— */
.ig-post {
  background: var(--ig-card);
  border-bottom: 1px solid var(--ig-border);
  margin: 0 0 0.85rem;
}

@media (min-width: 500px) {
  .ig-post {
    border: 1px solid var(--ig-border);
    border-radius: 0.85rem;
    margin: 0.9rem 0;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(28, 25, 23, 0.05);
  }

  .shop-feed {
    padding-top: 0.5rem;
    padding-left: 0.35rem;
    padding-right: 0.35rem;
  }
}

.ig-post-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.85rem 0.95rem 0.75rem;
}

.ig-avatar {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  border: 1.5px solid #f3e8d9;
  box-shadow: 0 0 0 1px rgba(201, 169, 110, 0.25);
  flex-shrink: 0;
}

.ig-post-meta {
  flex: 1;
  min-width: 0;
}

.ig-username {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ig-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ig-location {
  margin: 0.1rem 0 0;
  font-size: 0.75rem;
  color: var(--ig-muted);
}

.ig-more {
  color: var(--ig-ink);
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.25rem;
  opacity: 0.7;
}

/* Media — Instagram 4:5 portrait (or 1:1) */
.ig-media {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  background: #f3efe9;
  overflow: hidden;
  touch-action: manipulation;
  cursor: pointer;
  user-select: none;
}

.ig-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background:
    radial-gradient(ellipse at 50% 35%, #fff 0%, transparent 55%),
    linear-gradient(165deg, #faf7f3 0%, #f3ebe3 48%, #efe6dc 100%);
  display: block;
  min-height: 12rem;
}

.ig-media .sales-amazon-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 16rem;
  font-size: 4rem;
  background: linear-gradient(165deg, #fff7ed 0%, #fce7f3 50%, #f5f0ea 100%);
}

.ig-media-heart {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0);
  font-size: 5rem;
  color: #fff;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  opacity: 0;
  transition: none;
}

.ig-media-heart.is-pop {
  animation: ig-heart-pop 0.75s ease forwards;
}

@keyframes ig-heart-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.2);
  }
  15% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.15);
  }
  30% {
    transform: translate(-50%, -50%) scale(0.95);
  }
  45% {
    transform: translate(-50%, -50%) scale(1.05);
  }
  80% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* Actions */
.ig-actions {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.7rem 0.9rem 0.25rem;
}

.ig-action-btn {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0.2rem;
  cursor: pointer;
  color: var(--ig-ink);
  line-height: 0;
  border-radius: 0.25rem;
}

.ig-action-btn:active {
  opacity: 0.55;
}

.ig-action-btn svg {
  width: 1.65rem;
  height: 1.65rem;
  display: block;
}

.ig-action-btn.is-liked {
  color: var(--ig-heart);
}

.ig-action-btn.is-liked svg {
  fill: var(--ig-heart);
  stroke: var(--ig-heart);
}

.ig-actions-spacer {
  flex: 1;
}

.ig-likes {
  margin: 0;
  padding: 0.15rem 0.9rem 0.2rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.ig-caption {
  margin: 0;
  padding: 0 0.9rem 0.35rem;
  font-size: 0.875rem;
  line-height: 1.4;
  word-break: break-word;
}

.ig-caption strong {
  font-weight: 600;
  margin-right: 0.3rem;
}

.ig-price {
  color: var(--ig-ink);
  font-weight: 600;
}

.ig-shop-link {
  display: inline-flex;
  align-items: center;
  margin: 0.2rem 0.9rem 0.65rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.84rem;
  font-weight: 700;
  color: #9d174d;
  text-decoration: none;
  background: linear-gradient(135deg, #fdf2f8 0%, #fff7ed 100%);
  border: 1px solid #f9c4d8;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(190, 24, 93, 0.08);
}

.ig-shop-link:active {
  opacity: 0.75;
  transform: scale(0.98);
}

.ig-shop-link--market {
  color: #5b3d63;
  background: linear-gradient(135deg, #f5f0f7 0%, #fff 100%);
  border-color: #d4c4db;
}

.ig-time {
  margin: 0;
  padding: 0 0.9rem 0.85rem;
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ig-muted);
}

/* Bottom tab bar */
.ig-tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  justify-content: center;
  background: rgba(255, 255, 255, 0.97);
  border-top: 1px solid var(--ig-border);
  box-shadow: 0 -6px 20px rgba(28, 25, 23, 0.04);
  padding-bottom: var(--safe-bottom);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.ig-tabbar-inner {
  width: 100%;
  max-width: var(--ig-max);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
  min-height: 3.35rem;
}

.ig-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.18rem;
  text-decoration: none;
  color: var(--ig-muted);
  font-size: 0.64rem;
  font-weight: 500;
  padding: 0.4rem 0.25rem;
}

.ig-tab svg {
  width: 1.5rem;
  height: 1.5rem;
}

.ig-tab.is-active {
  color: var(--ig-ink);
  font-weight: 700;
}

.ig-tab.is-active svg {
  stroke-width: 2.35;
  color: #9d174d;
}

.shop-feed-disclosure {
  max-width: var(--ig-max);
  margin: 0 auto;
  padding: 0.5rem 1rem calc(5.75rem + var(--safe-bottom));
  text-align: center;
  font-size: 0.65rem;
  color: var(--ig-muted);
  line-height: 1.35;
}

/* —— Background music: Glamorous — Fergie (YouTube, user-started) —— */
.shop-music-dock {
  position: fixed;
  left: 50%;
  bottom: calc(3.35rem + var(--safe-bottom));
  transform: translateX(-50%);
  z-index: 45;
  width: min(calc(100% - 1.25rem), var(--ig-max));
  display: flex;
  align-items: center;
  gap: 0.45rem;
  pointer-events: none;
}

.shop-music-btn {
  pointer-events: auto;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.85rem;
  margin: 0;
  padding: 0.4rem 0.75rem 0.4rem 0.55rem;
  border: 1px solid #f9a8d4;
  border-radius: 999px;
  background: linear-gradient(135deg, #1a0a14 0%, #3b0d2a 45%, #1a0a14 100%);
  color: #fff;
  box-shadow: 0 10px 28px rgba(190, 24, 93, 0.35);
  cursor: pointer;
  text-align: left;
  font: inherit;
  position: relative;
  overflow: hidden;
}

.shop-music-btn.is-playing {
  border-color: #f472b6;
  box-shadow: 0 10px 32px rgba(236, 72, 153, 0.45);
}

.shop-music-pulse {
  position: absolute;
  left: 0.85rem;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: rgba(244, 114, 182, 0.45);
  animation: shop-music-pulse 1.4s ease-out infinite;
}

@keyframes shop-music-pulse {
  0% {
    transform: scale(0.7);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.8);
    opacity: 0;
  }
}

.shop-music-icon {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #f9a8d4, #db2777);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
}

.shop-music-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
}

.shop-music-title {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fbcfe8;
}

.shop-music-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shop-music-credit {
  pointer-events: auto;
  flex-shrink: 0;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--ig-muted);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--ig-border);
  border-radius: 999px;
  padding: 0.45rem 0.55rem;
}

.shop-music-yt-wrap {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  opacity: 0;
  pointer-events: none;
}

/* AI scent guide (beautiful female voice) */
.shop-voice-toggle {
  pointer-events: auto;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.85rem;
  margin: 0;
  padding: 0.4rem 0.65rem 0.4rem 0.5rem;
  border: 1px solid #c4b5fd;
  border-radius: 999px;
  background: linear-gradient(135deg, #1e1b4b 0%, #4c1d95 50%, #1e1b4b 100%);
  color: #fff;
  box-shadow: 0 10px 28px rgba(91, 33, 182, 0.28);
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.shop-voice-toggle.is-on {
  border-color: #e9d5ff;
  box-shadow: 0 10px 32px rgba(167, 139, 250, 0.45);
}

.shop-voice-toggle--solo {
  position: fixed;
  left: 0.75rem;
  right: 0.75rem;
  bottom: calc(3.5rem + var(--safe-bottom));
  z-index: 46;
  max-width: var(--ig-max);
  margin: 0 auto;
}

.shop-voice-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #ddd6fe, #a78bfa);
  font-size: 0.95rem;
}

.shop-voice-copy {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
}

.shop-voice-title {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ddd6fe;
}

.shop-voice-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shop-music-dock {
  flex-wrap: wrap;
  gap: 0.4rem;
}

.shop-music-dock .shop-voice-toggle,
.shop-music-dock .shop-music-btn {
  flex: 1 1 calc(50% - 0.25rem);
  min-width: 9.5rem;
}

.scent-voice-btn.is-speaking {
  color: #7c3aed;
  animation: scent-voice-pulse 1.2s ease-in-out infinite;
}

@keyframes scent-voice-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.08);
    opacity: 0.85;
  }
}
