/* =========================================================
   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;
}

.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; }
