/* KDF Reels v7 — premium video shopping (web) */
:root {
  --kdf-r-green: #1b4d3e;
  --kdf-r-green-deep: #0f3d2e;
  --kdf-r-green-soft: #166534;
  --kdf-r-gold: #d4af37;
  --kdf-r-bg: #0a1210;
  --kdf-r-text: #f7faf8;
  --kdf-r-muted: #b7c7bf;
  --kdf-r-nav-h: 48px;
}

/* ========== Homepage strip ========== */
.kdf-reels-home-strip {
  margin-top: 10px;
  margin-bottom: 8px;
}
.kdf-reels-home-panel {
  width: 100%;
  box-sizing: border-box;
  position: relative;
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(212, 175, 55, 0.08), transparent 52%),
    linear-gradient(180deg, #f4f8f5 0%, #ffffff 48%);
  border: 1px solid rgba(15, 61, 46, 0.10);
  border-radius: 18px;
  box-shadow: 0 8px 28px rgba(15, 61, 46, 0.07);
  overflow: hidden;
}
.kdf-reels-home-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px 6px;
}
.kdf-reels-home-head__eyebrow {
  margin: 0 0 2px;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #c47a1a;
  font-weight: 800;
}
.kdf-reels-home-head__title {
  margin: 0;
  font-size: clamp(1.35rem, 2vw, 1.7rem);
  font-weight: 800;
  color: var(--kdf-r-green-deep);
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.kdf-reels-home-head__sub {
  margin: 3px 0 0;
  font-size: 12px;
  color: #6b7280;
  font-weight: 500;
}
.kdf-reels-home-head__cta {
  flex: 0 0 auto;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: var(--kdf-r-green-deep);
  border: 1px solid var(--kdf-r-green-deep);
  border-radius: 11px;
  padding: 9px 14px;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(15, 61, 46, 0.18);
  transition: transform .15s ease, background .15s ease;
}
.kdf-reels-home-head__cta:hover {
  background: var(--kdf-r-green-soft);
  color: #fff;
  transform: translateY(-1px);
}
.kdf-reels-strip-wrap { position: relative; }
.kdf-reels-strip {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 8px 16px 18px;
  scrollbar-width: none;
}
.kdf-reels-strip::-webkit-scrollbar { display: none; }
.kdf-reels-strip__item {
  flex: 0 0 auto;
  width: 118px;
  scroll-snap-align: start;
  text-decoration: none;
  color: inherit;
}
.kdf-reels-strip__thumb-wrap {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: 14px;
  overflow: hidden;
  background: #e8efe9;
  box-shadow: 0 6px 18px rgba(15, 61, 46, 0.12);
  transition: transform .2s ease, box-shadow .2s ease;
}
.kdf-reels-strip__item:hover .kdf-reels-strip__thumb-wrap {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(15, 61, 46, 0.16);
}
.kdf-reels-strip__thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.kdf-reels-strip__thumb--empty {
  background: linear-gradient(160deg, #d7e4db, #b8cfc2);
}
.kdf-reels-strip__shade {
  position: absolute;
  inset: auto 0 0 0;
  height: 52%;
  background: linear-gradient(180deg, transparent, rgba(8, 20, 15, .82));
  pointer-events: none;
  z-index: 1;
}
.kdf-reels-strip__views {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 3;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 999px;
  padding: 3px 7px;
  backdrop-filter: blur(6px);
  line-height: 1.2;
}
/* Small subtle play — never covers the video */
.kdf-reels-strip__play {
  position: absolute;
  left: 50%;
  top: 40%;
  transform: translate(-50%, -50%);
  z-index: 3;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.78);
  color: var(--kdf-r-green-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  pointer-events: none;
}
.kdf-reels-strip__play svg { display: block; margin-left: 1px; width: 12px; height: 12px; }
.kdf-reels-strip__item:hover .kdf-reels-strip__play {
  transform: translate(-50%, -50%) scale(1.05);
}
.kdf-reels-strip__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 8px 9px 10px;
  pointer-events: none;
}
.kdf-reels-strip__title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  font-size: 12px;
  line-height: 1.25;
  font-weight: 800;
  color: #fff;
  word-break: normal;
  overflow-wrap: normal;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .4);
}
.kdf-reels-strip__sub {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 2px;
  font-size: 10px;
  line-height: 1.3;
  color: rgba(255, 255, 255, .82);
  word-break: normal;
  overflow-wrap: normal;
}
.kdf-reels-strip-nav {
  position: absolute;
  top: 42%;
  z-index: 5;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(15, 61, 46, 0.12);
  background: rgba(255, 255, 255, .95);
  color: var(--kdf-r-green-deep);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(15, 61, 46, 0.14);
}
.kdf-reels-strip-nav:disabled { opacity: .35; cursor: default; }
.kdf-reels-strip-nav--prev { left: 8px; }
.kdf-reels-strip-nav--next { right: 8px; }

@media (max-width: 767.98px) {
  .kdf-reels-home-head { padding: 12px 12px 4px; }
  .kdf-reels-home-head__cta { padding: 7px 10px; font-size: 11px; }
  .kdf-reels-strip { padding: 6px 12px 16px; gap: 10px; }
  .kdf-reels-strip__item { width: 108px; }
  .kdf-reels-strip__play { width: 30px; height: 30px; }
  .kdf-reels-strip-nav { display: none; }
}

@media (min-width: 768px) {
  .kdf-reels-strip { gap: 14px; padding: 10px 24px 22px; }
  .kdf-reels-strip__item { width: 148px; }
  .kdf-reels-strip__play { width: 34px; height: 34px; }
  .kdf-reels-strip__title { font-size: 13px; }
}

@media (min-width: 1200px) {
  .kdf-reels-strip__item { width: 160px; }
  .kdf-reels-home-panel { border-radius: 20px; }
}

/* ========== Full-screen player page ========== */
.kdf-reels-page {
  margin: 0;
  background: #000;
  color: var(--kdf-r-text);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  min-height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.kdf-reels-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  height: calc(var(--kdf-r-nav-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 10px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: linear-gradient(180deg, rgba(0, 0, 0, .5) 0%, transparent 100%);
  pointer-events: none;
}
.kdf-reels-nav > * { pointer-events: auto; }
.kdf-reels-nav__btn {
  flex: 0 0 auto;
  min-width: 38px;
  height: 34px;
  padding: 0 11px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-decoration: none;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  background: rgba(0, 0, 0, .38);
  border: 1px solid rgba(255, 255, 255, .14);
  backdrop-filter: blur(10px);
  position: relative;
}
.kdf-reels-nav__brand {
  flex: 1 1 auto;
  text-align: center;
  min-width: 0;
  pointer-events: none;
}
.kdf-reels-nav__mark {
  display: block;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: #fff;
  font-weight: 700;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .45);
}
.kdf-reels-nav__cart-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--kdf-r-gold);
  color: #111;
  font-size: 9px;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
}
.kdf-reels-nav__cart-count:empty { display: none; }

.kdf-reels-feed {
  flex: 1 1 auto;
  height: 100dvh;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  background: #000;
}
.kdf-reels-slide {
  position: relative;
  height: 100dvh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}
.kdf-reels-stage {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 100vw;
  background: #000;
  overflow: hidden;
}
.kdf-reels-video,
.kdf-reels-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}
.kdf-reels-video { z-index: 1; }
.kdf-reels-poster { z-index: 0; }

.kdf-reels-views-chip {
  position: absolute;
  top: calc(var(--kdf-r-nav-h) + env(safe-area-inset-top) + 6px);
  right: 12px;
  z-index: 9;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: rgba(0, 0, 0, .4);
  border-radius: 999px;
  padding: 4px 9px;
  backdrop-filter: blur(8px);
  pointer-events: none;
}

/* Compact glass actions — above Flutter-style shop card */
.kdf-reels-actions {
  position: absolute;
  right: 10px;
  bottom: 200px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}
.kdf-reels-action {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(0, 0, 0, 0.38);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(12px);
  padding: 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .28);
}
.kdf-reels-action__icon { font-size: 14px; line-height: 1; }
.kdf-reels-action__label {
  font-size: 8px;
  font-weight: 700;
  line-height: 1;
  margin-top: 1px;
  color: rgba(255, 255, 255, .9);
  max-width: 36px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kdf-reels-action.is-liked {
  background: rgba(212, 175, 55, 0.92);
  color: #111;
}
.kdf-reels-action.is-liked .kdf-reels-action__label { color: #111; }

/* Slim bottom shop — matches Flutter ReelProductCarousel */
.kdf-reels-shop {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 8;
  padding: 24px 0 calc(6px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, .15) 40%, rgba(0, 0, 0, .42) 100%);
  pointer-events: none;
}
.kdf-reels-shop > * { pointer-events: auto; }

.kdf-reels-carousel {
  width: 100%;
  padding: 0 14px;
  box-sizing: border-box;
}
.kdf-reels-carousel__track {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0;
}
.kdf-reels-carousel__track::-webkit-scrollbar { display: none; }

/* Flutter ReelProductCard — dark glass, compact */
.kdf-reels-product {
  flex: 0 0 100%;
  width: 100%;
  max-width: 100%;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: 16px;
  color: #fff !important;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.52));
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: opacity .25s ease;
}
.kdf-reels-product.is-swap { opacity: 0.35; }

.kdf-reels-product__row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}
.kdf-reels-product__img-link {
  flex: 0 0 auto;
}
.kdf-reels-product img {
  width: 48px;
  height: 48px;
  border-radius: 11px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.12);
  display: block;
}
.kdf-reels-product__meta {
  flex: 1 1 auto;
  min-width: 0;
  text-decoration: none;
  color: inherit !important;
}
.kdf-reels-product__name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.2;
  font-weight: 700;
  color: #fff !important;
  word-break: normal;
  overflow-wrap: normal;
  white-space: normal;
}
.kdf-reels-product__price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 3px;
  flex-wrap: nowrap;
}
.kdf-reels-product__price {
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
}
.kdf-reels-product__was {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.55);
  text-decoration: line-through;
  white-space: nowrap;
}
.kdf-reels-product__count {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.8);
  padding-top: 2px;
}

/* Add to Cart (left) + View (right) — Flutter parity */
.kdf-reels-product__btns {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.kdf-reels-product__atc {
  flex: 3 1 0;
  border: 0;
  border-radius: 11px;
  height: 38px;
  padding: 0 12px;
  background: var(--kdf-r-green-deep);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.kdf-reels-product__atc:disabled { opacity: 0.7; cursor: wait; }
.kdf-reels-product__atc.is-done {
  background: var(--kdf-r-green-soft);
}
.kdf-reels-product__view {
  flex: 2 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: #fff !important;
  text-decoration: none !important;
  font-weight: 700;
  font-size: 13px;
  background: transparent;
}

/* Page dots like Flutter */
.kdf-reels-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0;
  margin-top: 6px;
  min-height: 10px;
}
.kdf-reels-dots:empty { display: none; }
.kdf-reels-dot {
  width: 6px;
  height: 6px;
  margin: 0 3px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.38);
  cursor: pointer;
  transition: width .2s ease, background .2s ease;
}
.kdf-reels-dot.is-active {
  width: 14px;
  background: #fff;
}

/* legacy selectors no longer used */
.kdf-reels-title,
.kdf-reels-indicator,
.kdf-reels-thumbs,
.kdf-reels-product__tagline,
.kdf-reels-product__cta-row { display: none !important; }

/* Progress */
.kdf-reels-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  color: rgba(255, 255, 255, .85);
  font-size: 10px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.kdf-reels-progress__bar {
  position: relative;
  flex: 1 1 auto;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .22);
  overflow: visible;
}
.kdf-reels-progress__fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  border-radius: 999px;
  background: var(--kdf-r-green-soft);
}
.kdf-reels-progress__knob {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
  pointer-events: none;
}
.kdf-reels-progress__marks {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.kdf-reels-progress__mark {
  position: absolute;
  top: -2px;
  width: 2px;
  height: 7px;
  margin-left: -1px;
  background: rgba(212, 175, 55, .85);
  border-radius: 1px;
}

.kdf-reels-empty {
  height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  color: var(--kdf-r-muted);
}
.kdf-reels-toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 80;
  background: rgba(15, 61, 46, 0.96);
  color: #fff;
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  max-width: 90vw;
  text-align: center;
}

body.kdf-reels-page .kdf-mini-cart,
body.kdf-reels-page .floating-btn-grp { display: none !important; }

/* Desktop: centered 9:16 stage, premium side chrome */
@media (min-width: 900px) {
  .kdf-reels-page {
    background:
      radial-gradient(ellipse at 50% 35%, #163528 0%, var(--kdf-r-bg) 70%);
  }
  .kdf-reels-feed {
    background: transparent;
  }
  .kdf-reels-stage {
    width: min(420px, 36vw);
    height: min(100dvh - 24px, calc(36vw * 16 / 9));
    max-height: calc(100dvh - 24px);
    margin: 12px 0;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
  }
  .kdf-reels-slide {
    min-height: 100dvh;
    height: auto;
  }
  .kdf-reels-actions { right: 14px; bottom: 210px; }
  .kdf-reels-carousel__track { padding: 0 16px; }
  .kdf-reels-nav__mark { font-size: 13px; letter-spacing: 0.06em; }
}

@media (max-width: 399px) {
  .kdf-reels-product { padding: 9px; gap: 7px; }
  .kdf-reels-product img { width: 44px; height: 44px; }
  .kdf-reels-product__atc,
  .kdf-reels-product__view { height: 36px; font-size: 12px; }
  .kdf-reels-actions { bottom: 190px; }
}


/* ========== Product details — linked Reels (clean, Flutter-parity) ========== */
.pd-img-wrap .quickviewSlider2 {
  position: relative;
}
/* Small play on the MAIN image only — not a long bar */
.kdf-pdp-gallery-play {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 8;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none !important;
  color: #0f3d2e !important;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(15, 61, 46, 0.12);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
  transition: transform .15s ease, background .15s ease;
}
.kdf-pdp-gallery-play svg {
  margin-left: 2px;
  display: block;
}
.kdf-pdp-gallery-play:hover {
  color: #fff !important;
  background: #0f3d2e;
  transform: scale(1.05);
}

/* One compact CTA under title — same idea as Flutter app */
.kdf-pdp-reel-cta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  padding: 11px 12px;
  text-decoration: none !important;
  color: inherit !important;
  border-radius: 14px;
  border: 1px solid rgba(15, 61, 46, 0.2);
  background: linear-gradient(90deg, rgba(15, 61, 46, 0.09), #f4f8f5 70%);
  transition: transform .15s ease, box-shadow .15s ease;
}
.kdf-pdp-reel-cta:hover {
  color: inherit !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(15, 61, 46, 0.1);
}
.kdf-pdp-reel-cta__play {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #0f3d2e;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(15, 61, 46, 0.28);
}
.kdf-pdp-reel-cta__play svg { margin-left: 2px; display: block; }
.kdf-pdp-reel-cta__copy {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.kdf-pdp-reel-cta__copy strong {
  font-size: 13px;
  font-weight: 800;
  color: #0f3d2e;
  line-height: 1.25;
}
.kdf-pdp-reel-cta__copy em {
  font-style: normal;
  font-size: 12px;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kdf-pdp-reel-cta__chev {
  flex: 0 0 auto;
  font-size: 24px;
  line-height: 1;
  color: #0f3d2e;
  opacity: 0.7;
}

/* Hide older strip / long-bar leftovers if cached HTML appears */
.kdf-pdp-reel-strip,
.kdf-pdp-gallery-play__label,
.kdf-pdp-gallery-play__btn,
.kdf-pdp-reel-cta__thumb { display: none !important; }

@media (max-width: 767.98px) {
  .kdf-pdp-gallery-play {
    left: 10px;
    bottom: 10px;
    width: 40px;
    height: 40px;
  }
  .kdf-pdp-reel-cta { padding: 10px 11px; margin-bottom: 12px; }
  .kdf-pdp-reel-cta__play { width: 38px; height: 38px; }
}
