/* inta-reel.css
   Enhanced reel styles — adds pink underline under .reel-title and small UX/accessibility improvements
*/

/* Theme variables (fallbacks provided) */
:root {
  --muted-text: #17202a;
  --accent: #ff8e9e;            /* pink accent to match home categories */
  --reel-gap: 16px;
  --reel-max-width: 1200px;
  --card-radius: 12px;
  --nav-size: 34px;
  --overlay-bg: rgba(0,0,0,0.42);
}

/* Container */
.carousel-container {
  position: relative;
  width: 100%;
  overflow: hidden;
  margin: 40px auto;
  padding: 10px;
  max-width: var(--reel-max-width);
  box-sizing: border-box;
}

/* Title — centered with pink underline to match home-cats */
.reel-title {
  font-family: 'Montserrat', 'Helvetica Neue', sans-serif;
  font-size: 28px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 1.6px;
  margin: 0 0 6px;
  color: var(--muted-text);
  text-transform: uppercase;
  display: block;
  position: relative;
  line-height: 1.05;
  padding-bottom: 2px;
}

/* pink underline (gradient fade left/right) */
.reel-title::after {
  content: "";
  display: block;
  width: 64px;
  height: 3px;
  margin: 12px auto 0;
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(255,142,158,0), var(--accent), rgba(255,142,158,0));
  opacity: 0.95;
}

/* carousel track */
.reel-carousel {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  gap: var(--reel-gap);
  padding: 20px;
  scroll-behavior: smooth;
  align-items: start;
}

/* hide native scrollbar on webkit */
.reel-carousel::-webkit-scrollbar {
  display: none;
}

/* Reel card (9:16 aspect ratio, slim) */
.reel-card {
  flex: 0 0 220px;
  background: #fff;
  border-radius: var(--card-radius);
  box-shadow: 0 6px 18px rgba(23,32,42,0.06);
  overflow: hidden;
  position: relative;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  transition: transform .28s cubic-bezier(.2,.9,.2,1), box-shadow .28s;
}

/* Slight lift on hover/focus for pointer users */
.reel-card:focus-within,
.reel-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 22px 50px rgba(23,32,42,0.08);
  cursor: pointer;
}

/* video wrapper fixed 9:16 */
.video-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  background: #000;
}

/* video element */
.reel-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform-origin: center;
  transition: transform .6s cubic-bezier(.2,.9,.2,1);
}

/* subtle scale on hover */
.reel-card:hover .reel-video,
.reel-card:focus-within .reel-video {
  transform: scale(1.04);
}

/* Right side overlay — icons (views/likes/share) */
.reel-overlay {
  position: absolute;
  top: 20%;
  right: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  color: #fff;
  font-size: 12px;
  z-index: 2;
  pointer-events: none; /* allow clicks to pass through unless child enables */
}

/* each overlay button */
.overlay-btn {
  background: var(--overlay-bg);
  padding: 8px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  backdrop-filter: blur(6px);
  transition: transform .18s ease, background .18s ease;
  pointer-events: auto; /* enable interactions */
  box-shadow: 0 6px 18px rgba(0,0,0,0.18);
}

/* icon size and numbers */
.overlay-btn i {
  font-size: 14px;
  line-height: 1;
}
.overlay-btn span {
  font-size: 10px;
  margin-top: 2px;
  display: block;
  line-height: 1;
}

/* hover/focus states for overlay buttons */
.overlay-btn:hover,
.overlay-btn:focus {
  background: rgba(255,255,255,0.12);
  transform: translateY(-6px) scale(1.06);
  outline: none;
}

/* share button slightly wider */
.overlay-btn.share-btn {
  width: 56px;
  height: 44px;
  border-radius: 12px;
}

/* audio mute/unmute button */
.audio-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  transition: background .2s ease, transform .12s ease;
}
.audio-btn:hover,
.audio-btn:focus {
  background: rgba(255,255,255,0.12);
  transform: scale(1.05);
  outline: none;
}

/* product info area under the reel */
.reel-info {
  padding: 10px;
  border-top: 1px solid #eee;
  background: #fff;
}
.reel-info p {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.price {
  font-weight: 700;
  color: #111;
  font-size: 14px;
}
.old-price {
  text-decoration: line-through;
  color: #888;
  margin-left: 8px;
  font-size: 12px;
}
.discount {
  color: #138000;
  font-size: 12px;
  margin-top: 4px;
  display: inline-block;
}

/* Navigation arrows (prev/next) */
.nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.5);
  color: #fff;
  border: none;
  width: var(--nav-size);
  height: var(--nav-size);
  border-radius: 50%;
  cursor: pointer;
  z-index: 5;
  transition: background .18s ease, transform .12s ease;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(0,0,0,0.18);
}
.nav-btn:hover,
.nav-btn:focus {
  background: rgba(0,0,0,0.8);
  transform: translateY(-50%) scale(1.03);
  outline: none;
}
.prev { left: 8px; }
.next { right: 8px; }

/* small accessible label for nav buttons */
.nav-btn[aria-label]::after {
  content: attr(aria-label);
  position: absolute;
  left: 50%;
  transform: translateX(-50%) translateY(-140%);
  background: rgba(0,0,0,0.7);
  color: #fff;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 11px;
  display: none; /* only shown on focus via media below */
  white-space: nowrap;
}

/* show nav labels on focus for keyboard users */
.nav-btn:focus::after {
  display: block;
}

/* Responsive behavior */
@media (max-width: 1024px) {
  .reel-card { flex: 0 0 200px; }
  .reel-carousel { gap: 14px; padding: 18px; }
}

@media (max-width: 768px) {
  .reel-card { flex: 0 0 45%; }
  .reel-title { font-size: 22px; }
  .carousel-container { margin: 28px auto; padding: 6px; }
  .reel-info p { font-size: 13px; }
}

@media (max-width: 480px) {
  .reel-card { flex: 0 0 75%; }
  .reel-card { box-shadow: 0 6px 14px rgba(23,32,42,0.04); border-radius: 10px; }
  .reel-carousel { padding: 12px; gap: 12px; }
  .nav-btn { width: 30px; height: 30px; }
  .reel-title::after { width: 48px; height: 3px; margin-top: 10px; }
}

/* small accessibility niceties */
.reel-card a,
.reel-card button,
.overlay-btn,
.audio-btn,
.nav-btn {
  -webkit-tap-highlight-color: rgba(0,0,0,0);
}

/* Optional: keyboard focus visible (avoid only outline) */
:focus {
  outline: 3px solid rgba(255,142,158,0.12);
  outline-offset: 3px;
}
