/* =========================================================
   HOME FEED – IMMERSIVE SWIPE CARD
   ========================================================= */

/* Card shell */
.ad-shell {
  position: relative;
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
}

/* Image container */
.ad-media-container {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 0;
  margin: 0 10px;
  overflow: hidden;
  background: #f2f2f2;
  border-radius: 22px 22px 0 0;
  pointer-events: auto;

}

/* Media */
.ad-media-container img,
.ad-media-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Brand logo (top-right) */
.ad-profile-circle {
  position: absolute;
  top: 12px;
  right: 22px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  overflow: hidden;
  z-index: 30;
  background: rgba(0,0,0,0.08);
}

.ad-profile-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Action rail */
.action-rail {
  position: absolute;
  right: 28px;              /* moved left */
  top: 22%;
  z-index: 50;              /* ABOVE media */
  pointer-events: auto;     /* clickable */
  display: flex;
  flex-direction: column;
  gap: 14px;
}


/* Action buttons */
.rail-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  cursor: pointer;
}

.rail-btn:active {
  transform: scale(0.95);
}

/* SVG icons */
.rail-icon {
  width: 22px;
  height: 22px;
  stroke: #fff;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Card */
.home-card {
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  background: #fff;
  overflow: hidden;
}

/* Info box */
.home-info-box {
  background: #ededed;
  padding: 12px 14px 16px;
  margin: 0 10px 10px;
  border-radius: 0 0 18px 18px;
  flex-shrink: 0;
}

.home-brand-name {
  font-weight: 700;
  font-size: 16px;
  color: #111;
  line-height: 1.2;
}

.home-promo-line {
  margin-top: 2px;
  font-size: 14px;
  color: #444;
}

.home-expiry {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 600;
  color: #c62828;
}

/* Height control */
@media (max-width: 767px) {
  .home-card {
    height: min(78vh, 620px);
  }
}

@media (min-width: 768px) {
  .home-card {
    height: 560px;
  }
}

.rail-btn.is-saved .rail-icon {
  fill: #ff3b3b;
  stroke: #ff3b3b;
}

/* =========================
   OVERLAY PANELS (FILTER / HELP)
   ========================= */

.overlay-panel {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}

.overlay-panel.hidden {
  display: none;
}

.overlay-card {
  background: #fff;
  border-radius: 16px;
  padding: 18px;
  width: calc(100% - 32px);
  max-width: 420px;
  position: relative;
}

.overlay-card h3 {
  margin: 0 0 12px;
}

.overlay-card label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 10px;
}

.overlay-card select {
  width: 100%;
  padding: 8px;
  margin-top: 4px;
}

.overlay-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 14px;
}

.overlay-close {
  position: absolute;
  top: 10px;
  right: 10px;
  border: none;
  background: none;
  font-size: 1.2rem;
  cursor: pointer;
}

/* =========================
   HOME: PANELS ABOVE ACTION RAIL
   ========================= */

.panel {
  z-index: 1000 !important;
}

.panel.visible ~ .action-rail {
  opacity: 0.25;
  pointer-events: none;
}

/* =========================================================
   LOADING SKELETON (HOME)
   ========================================================= */

.ad-skeleton {
  position: absolute;
  inset: 0;
  border-radius: 22px 22px 0 0;
  background: linear-gradient(
    100deg,
    #e5e7eb 30%,
    #f3f4f6 40%,
    #e5e7eb 50%
  );
  background-size: 200% 100%;
  animation: budyShimmer 1.15s infinite;
  z-index: 1;
}

@keyframes budyShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Make sure real media sits above skeleton */
.ad-media-container img,
.ad-media-container video {
  position: relative;
  z-index: 2;
}

/* =========================================================
   BRAND LOGO: FADE IN (NO POP)
   ========================================================= */

.ad-profile-circle {
  background: rgba(0,0,0,0.08);
}

.ad-profile-circle img {
  opacity: 0;
  transition: opacity 160ms ease;
}

.ad-profile-circle img.is-loaded {
  opacity: 1;
}

.home-brand-name { min-height: 20px; }
.home-promo-line { min-height: 18px; }
.home-expiry { min-height: 18px; }

/* =========================================================
   TOP PILLS (ICONS + ACTIVE RED)
   ========================================================= */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;

  /* ALWAYS grey background */
  background: #ededed;

  border: none;
  cursor: pointer;

  /* default icon/text colour */
  color: #666;

  white-space: nowrap;
  transition: color 160ms ease;
}

.pill-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pill-icon svg {
  width: 18px;
  height: 18px;

  /* single colour driven by text colour */
  stroke: currentColor;
  fill: none;

  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pill-label {
  font-size: 13px;
  font-weight: 600;
}

/* Active pill = Budy red (ONLY icon/text changes) */
.pill.active {
  color: #e10600;
  background: #ededed; /* force grey, never changes */
}

.pill:hover {
  background: #ededed;
}

/* =========================
   EXPIRY BADGE (HOME)
   ========================= */

.home-expiry-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;

  height: 28px;
  padding: 0 10px;

  border-radius: 8px;
  background: #333;
  color: #fff;

  font-size: 12px;
  font-weight: 600;
  line-height: 1;

  white-space: nowrap;
}

.home-expiry-badge .expiry-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.home-expiry-badge svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.home-expiry-badge .expiry-text {
  display: flex;
  align-items: center;
}




/* =========================================================
   HELP ICON – PULSE FOR LOGGED-OUT USERS
   ========================================================= */

@keyframes helpPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(225, 6, 0, 0.7);
  }
  70% {
    box-shadow: 0 0 0 14px rgba(225, 6, 0, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(225, 6, 0, 0);
  }
}

.rail-btn.help-pulse {
  animation: helpPulse 2.2s infinite;
}

.rail-btn.help-pulse .rail-icon {
  stroke: #e10600;
}

.home-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.home-highlight-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.home-highlight-badge svg {
  width: 14px;
  height: 14px;
}

.pill[data-mode="clothing"] {
  display: none !important;
}


/* Brand name + price inline row */
.home-brand-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.home-brand-name {
  flex: 1;
  min-width: 0;
}

/* =========================
   INLINE PRICE (MATCH EXPIRY)
========================= */

.home-price-inline {
  display: inline-flex;
  align-items: center;
  height: 26px;                 /* EXACT same height as expiry */
  border-radius: 8px;
  overflow: hidden;
  white-space: nowrap;
  border: 1px solid #f3b7bf;
}

.home-price-inline.hidden {
  display: none;
}

/* LEFT: price */
.home-price-current {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 10px;

  font-size: 12px;
  font-weight: 600;
  line-height: 1;

  background: #f8d7db;
  color: #ce1126;
}

/* RIGHT: discount */
.home-discount-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 0 10px;

  font-size: 12px;
  font-weight: 600;
  line-height: 1;

  background: #ce1126;
  color: #fff;
}

/* 🔹 No discount state */
.home-price-inline.no-discount {
  border: 1px solid #d6d6d6;
}

.home-price-inline.no-discount .home-price-current {
  background: #f2f2f2;
  color: #333;
}
