/* ==========================================================
   Kineed Shop Reels — Frontend CSS (Premium v2.3)
   ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* ── Variables ── */
:root {
  --ksr-primary:   #7C5CFC;
  --ksr-primary-h: #6647f5;
  --ksr-dark:      #0F1117;
  --ksr-radius:    16px;
  --ksr-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Scrollable grid ── */
.ksr-video-grid {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 16px;
  padding: 16px 4px 24px;
  scrollbar-width: thin;
  scrollbar-color: rgba(124, 92, 252, 0.4) transparent;
  -webkit-overflow-scrolling: touch;
}
.ksr-video-grid::-webkit-scrollbar {
  height: 4px;
}
.ksr-video-grid::-webkit-scrollbar-thumb {
  background: rgba(124, 92, 252, 0.4);
  border-radius: 4px;
}

/* ── Card ── */
.ksr-video-card {
  position: relative;
  width: 260px;
  height: 460px;
  flex: 0 0 260px;
  border-radius: 20px;
  overflow: hidden;
  background: #000;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.3s ease;
  user-select: none;
}
.ksr-video-card:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: 0 20px 50px rgba(0,0,0,0.4);
}
.ksr-video-card:active {
  transform: scale(0.98);
}

/* ── Video Layer (muted background) ── */
.ksr-video-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.ksr-video-container iframe,
.ksr-video-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: none;
  pointer-events: none;
}
/* Scale iframe to fill correctly */
.ksr-video-container iframe {
  transform: scale(1.1);
  transform-origin: center;
}

/* ── Gradient overlay ── */
.ksr-card-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.15) 0%,
    rgba(0,0,0,0) 30%,
    rgba(0,0,0,0) 55%,
    rgba(0,0,0,0.7) 75%,
    rgba(0,0,0,0.95) 100%
  );
  pointer-events: none;
}

/* ── Play hint (center icon) ── */
.ksr-play-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 52px;
  height: 52px;
  background: rgba(255,255,255,0.18);
  border: 1.5px solid rgba(255,255,255,0.4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: var(--ksr-transition);
  pointer-events: none;
}
.ksr-play-hint svg {
  width: 20px;
  height: 20px;
  fill: #fff;
  margin-left: 3px;
}
.ksr-video-card:hover .ksr-play-hint {
  background: rgba(124, 92, 252, 0.8);
  border-color: rgba(124, 92, 252, 1);
  transform: translate(-50%, -50%) scale(1.08);
}

/* ── Top creator bar ── */
.ksr-card-top {
  position: absolute;
  top: 0; left: 0; right: 0;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.55) 0%, transparent 100%);
}
.ksr-card-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.5);
  background: var(--ksr-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.ksr-card-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ksr-card-avatar svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: #fff;
  stroke-width: 2;
}
.ksr-card-top-text {
  overflow: hidden;
}
.ksr-card-creator-name {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 4px rgba(0,0,0,0.7);
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.ksr-card-creator-sub {
  font-size: 10px;
  color: rgba(255,255,255,0.65);
  font-family: 'Plus Jakarta Sans', sans-serif;
}

/* ── Platform badge (top right) ── */
.ksr-platform-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.ksr-platform-tag.yt  { background: rgba(255,0,0,0.8); color: #fff; }
.ksr-platform-tag.tk  { background: rgba(0,0,0,0.75); color: #fff; border: 1px solid rgba(255,255,255,0.2); }
.ksr-platform-tag.ig  { background: linear-gradient(45deg, #E1306C, #833AB4); color: #fff; }
.ksr-platform-tag.vm  { background: rgba(26,183,234,0.85); color: #fff; }
.ksr-platform-tag.mp4 { background: rgba(0,229,160,0.85); color: #000; }

/* ── Bottom product strip ── */
.ksr-product-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 0 12px 12px;
}
.ksr-product-info-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.ksr-product-thumb {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  background: rgba(255,255,255,0.12);
  border: 1.5px solid rgba(255,255,255,0.25);
  flex-shrink: 0;
  overflow: hidden;
}
.ksr-product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ksr-product-meta {
  flex: 1;
  overflow: hidden;
}
.ksr-product-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
}
.ksr-product-price {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.7);
  margin-top: 3px;
}
.ksr-product-price del {
  font-size: 11px;
  font-weight: 400;
  color: rgba(255,255,255,0.55);
  margin-right: 4px;
}

/* ── Add to Cart Button ── */
.ksr-btn-atc {
  width: 100%;
  background: #fff;
  color: #000;
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: var(--ksr-transition);
  letter-spacing: 0.2px;
  position: relative;
  overflow: hidden;
}
.ksr-btn-atc::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--ksr-primary), #9B6FF5);
  opacity: 0;
  transition: var(--ksr-transition);
}
.ksr-btn-atc:hover::before {
  opacity: 1;
}
.ksr-btn-atc:hover {
  color: #fff;
  transform: none;
  box-shadow: 0 4px 20px rgba(124, 92, 252, 0.5);
}
.ksr-btn-atc span {
  position: relative;
  z-index: 1;
}
.ksr-btn-atc.loading span::after {
  content: '...';
}
.ksr-btn-atc.success {
  background: #00E5A0;
  color: #000;
}
.ksr-btn-atc.success::before {
  display: none;
}

/* ══════════════════════════════════════
   MODAL (Foto 1 Match — White Right Panel)
   ══════════════════════════════════════ */
.ksr-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.ksr-modal-content {
  background: #ffffff;
  border-radius: 24px;
  width: 100%;
  max-width: 960px;
  height: 600px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 30px 70px rgba(0,0,0,0.3);
  animation: ksrModalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}
@keyframes ksrModalIn {
  from { opacity: 0; transform: scale(0.95) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Close button */
.ksr-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  background: rgba(0,0,0,0.06);
  border: none;
  border-radius: 50%;
  color: #111111;
  font-size: 24px;
  font-weight: 300;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  transition: var(--ksr-transition);
  line-height: 1;
}
.ksr-modal-close:hover {
  background: #ef4444;
  color: #ffffff;
}

.ksr-modal-body {
  display: flex;
  height: 100%;
}

/* Left Panel: Video (Black Background) */
.ksr-modal-video-panel {
  flex: 1.1;
  background: #000000;
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ksr-modal-video-embed {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ksr-modal-video-embed iframe,
.ksr-modal-video-embed video {
  width: 100%;
  height: 100%;
  border: none;
  object-fit: contain;
}

/* Mute Button inside video */
.ksr-mute-btn {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.22);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50%;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 15;
  transition: var(--ksr-transition);
}
.ksr-mute-btn:hover {
  background: rgba(255,255,255,0.35);
  transform: scale(1.05);
}
.ksr-mute-btn svg {
  width: 20px;
  height: 20px;
}

/* Right Panel: Product Details (White Background) */
.ksr-modal-product-panel {
  flex: 0.9;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 40px 32px 32px;
}
.ksr-modal-product-scroll {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-right: 8px;
}
.ksr-modal-product-scroll::-webkit-scrollbar {
  width: 4px;
}
.ksr-modal-product-scroll::-webkit-scrollbar-thumb {
  background: #e2e8f0;
  border-radius: 4px;
}

/* Big Title (Centered) */
.ksr-modal-product-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 26px;
  font-weight: 700;
  color: #111111;
  line-height: 1.3;
  text-align: center;
  margin: 0;
}

/* Description text */
.ksr-modal-product-desc {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  color: #334155;
  line-height: 1.6;
  margin: 0;
}

/* Mini Horizontal Product Card */
.ksr-modal-product-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 16px;
  display: flex;
  gap: 16px;
  align-items: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}
.ksr-modal-product-img {
  width: 76px;
  height: 76px;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
}
.ksr-modal-product-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.ksr-modal-product-details {
  flex: 1;
  overflow: hidden;
}
.ksr-modal-product-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.35;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.ksr-modal-product-price {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: #1e293b;
  line-height: 1;
}
.ksr-modal-product-price del {
  font-size: 12px;
  font-weight: 400;
  color: #64748b;
  margin-right: 6px;
}

/* Bottom ATC Button in modal */
.ksr-modal-footer {
  padding-top: 16px;
}
.ksr-modal-atc-btn {
  width: 100%;
  background: #0f1115;
  color: #ffffff;
  border: none;
  border-radius: 12px;
  padding: 16px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--ksr-transition);
  letter-spacing: 0.3px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.ksr-modal-atc-btn:hover {
  background: #252830;
  box-shadow: 0 8px 24px rgba(15, 17, 21, 0.15);
}
.ksr-modal-atc-btn:active {
  transform: scale(0.99);
}
.ksr-modal-atc-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.ksr-modal-atc-btn.success {
  background: #00E5A0;
  color: #000000;
}
.ksr-modal-atc-btn .ksr-btn-text { display: block; }
.ksr-modal-atc-btn .ksr-btn-loading { display: none; }
.ksr-modal-atc-btn.loading .ksr-btn-text { display: none; }
.ksr-modal-atc-btn.loading .ksr-btn-loading { display: block; }

/* ── Responsive Modal ── */
@media (max-width: 768px) {
  .ksr-video-card {
    width: 220px;
    height: 390px;
    flex: 0 0 220px;
  }
  .ksr-modal-content {
    height: auto;
    max-height: 95vh;
  }
  .ksr-modal-body {
    flex-direction: column;
  }
  .ksr-modal-video-panel {
    flex: none;
    height: 280px;
  }
  .ksr-modal-product-panel {
    width: 100%;
    height: auto;
    padding: 24px 20px 20px;
  }
  .ksr-modal-product-scroll {
    gap: 16px;
  }
  .ksr-modal-product-title {
    font-size: 20px;
  }
}

/* ── Carousel / Slider for Gallery reels ── */
.ksr-carousel-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.ksr-carousel {
  display: flex;
  overflow-x: auto;
  width: 100%;
  height: 100%;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.ksr-carousel::-webkit-scrollbar {
  display: none;
}
.ksr-carousel-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000000;
}
.ksr-carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.ksr-carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-size: 26px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--ksr-transition);
  outline: none;
  line-height: 1;
}
.ksr-carousel-arrow:hover {
  background: rgba(0, 0, 0, 0.7);
  scale: 1.05;
}
.ksr-carousel-arrow.prev {
  left: 20px;
}
.ksr-carousel-arrow.next {
  right: 20px;
}
.ksr-carousel-dots {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 12;
}
.ksr-carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: var(--ksr-transition);
}
.ksr-carousel-dot.active {
  background: #ffffff;
  transform: scale(1.2);
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
}

/* ── Subscription Modal (Foto 2 Match) ── */
.ksr-modal-subscription-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 40px;
  background: #ffffff;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  box-sizing: border-box;
}
.ksr-sub-header-icon {
  width: 80px;
  height: 80px;
  background: #22c55e;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  margin-bottom: 24px;
  box-shadow: 0 10px 25px rgba(34, 197, 94, 0.25);
}
.ksr-sub-header-icon svg {
  width: 36px;
  height: 36px;
}
.ksr-sub-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 26px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 8px;
  text-align: center;
}
.ksr-sub-subtitle {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  color: #64748b;
  margin: 0 0 32px;
  text-align: center;
  line-height: 1.5;
  max-width: 320px;
}
.ksr-sub-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.ksr-sub-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}
.ksr-sub-label {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #475569;
}
.ksr-sub-input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  color: #0f172a;
  background: #f8fafc;
  transition: all 0.2s ease;
  box-sizing: border-box;
}
.ksr-sub-input:focus {
  outline: none;
  border-color: #22c55e;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.1);
}
.ksr-sub-submit-btn {
  width: 100%;
  height: 52px;
  background: #0f1115;
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  margin-top: 8px;
}
.ksr-sub-submit-btn:hover {
  background: #22c55e;
  box-shadow: 0 10px 25px rgba(34, 197, 94, 0.25);
}
.ksr-sub-submit-btn svg {
  width: 18px;
  height: 18px;
  color: #ffffff;
  transition: transform 0.2s ease;
}
.ksr-sub-submit-btn:hover svg {
  transform: translateX(4px);
}
.ksr-sub-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 24px;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
}
.ksr-sub-footer svg {
  width: 14px;
  height: 14px;
}

@media (max-width: 520px) {
  .ksr-modal-subscription-panel {
    padding: 24px 20px;
  }
  .ksr-sub-title {
    font-size: 22px;
  }
}

