/* v11.0.71: Shoppable Video Widgets — reference images se exact match. */

/* Common */
.sw-widget { --sw-radius: 10px; }
.sw-card { position: relative; border-radius: var(--sw-radius); overflow: hidden; cursor: pointer; background: #111; aspect-ratio: 9/16; }
.sw-thumb { width: 100%; height: 100%; object-fit: cover; display: block; }
.sw-thumb-ph { display: flex; align-items: center; justify-content: center; height: 100%; background: linear-gradient(135deg, #1a1a2e, #16213e); color: #fff; font-size: 3rem; }
.sw-play { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 48px; height: 48px; border-radius: 50%; background: rgba(255,255,255,0.9); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; color: #111; pointer-events: none; }
.sw-card:hover .sw-play { transform: translate(-50%, -50%) scale(1.08); }
.sw-card.sw-playing .sw-play { display: none; }

/* Mute toggle — bottom-right */
.sw-mute { position: absolute; right: 10px; bottom: 10px; z-index: 4; width: 34px; height: 34px; border-radius: 50%; border: none; background: rgba(0,0,0,0.55); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 1rem; }
.sw-mute:hover { background: rgba(0,0,0,0.75); }
/* Badge ho to uske upar, warna bottom-right corner */
.sw-card .sw-mute { bottom: 64px; }
.sw-card:not(:has(.sw-badge-wrap)) .sw-mute { bottom: 10px; }

/* Bottom gradient (reference jaisa) */
.sw-grad { position: absolute; left: 0; right: 0; bottom: 0; height: 45%; background: linear-gradient(transparent, rgba(0,0,0,0.75)); pointer-events: none; }
.sw-badge-wrap { position: absolute; left: 12px; right: 12px; bottom: 12px; }

/* Product badge — reference: white square thumb + white text */
.sw-prod { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; }
.sw-prod:hover { color: #fff; }
.sw-prod-thumb { width: 44px; height: 44px; border-radius: 8px; overflow: hidden; flex-shrink: 0; background: #fff; display: flex; align-items: center; justify-content: center; }
.sw-prod-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sw-prod-noimg { color: #666; font-size: 1.2rem; }
.sw-prod-info { display: flex; flex-direction: column; min-width: 0; }
.sw-prod-name { font-size: 14px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; }
.sw-prod-price { font-size: 14px; color: #fff; font-weight: 500; }
.sw-prod-price s { opacity: 0.7; font-weight: 400; margin-right: 4px; }

/* Arrows — reference: white circle, dark chevron */
.sw-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 5; width: 40px; height: 40px; border-radius: 50%; border: none; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,0.25); display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 1.1rem; color: #111; }
.sw-arrow:hover { transform: translateY(-50%) scale(1.05); }
.sw-prev { left: 12px; } .sw-next { right: 12px; }

/* Dots — reference: small, dark active */
.sw-dots { display: flex; gap: 8px; justify-content: center; margin-top: 18px; }
.sw-dots button { width: 8px; height: 8px; border-radius: 50%; border: none; background: #d0d0d0; cursor: pointer; padding: 0; }
.sw-dots button.active { background: #111; }

/* ===== LAYOUT 1: Video Carousel (ref image 1) ===== */
.sw-carousel { position: relative; }
.sw-carousel .sw-track { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 4px 2px; }
.sw-carousel .sw-track::-webkit-scrollbar { display: none; }
.sw-carousel .sw-slide { flex: 0 0 250px; scroll-snap-align: start; }
@media (max-width: 640px) {
  .sw-carousel .sw-slide { flex-basis: 210px; }
  .sw-carousel .sw-arrow { display: none; }
}

/* ===== LAYOUT 2: Stacked Carousel (ref image 2) ===== */
.sw-stacked { position: relative; display: flex; align-items: center; justify-content: center; min-height: 440px; overflow: hidden; padding: 20px 0; }
.sw-stacked-track { position: relative; width: 100%; max-width: 1000px; height: 420px; }
.sw-stacked-slide { position: absolute; top: 50%; left: 50%; width: 270px; transition: all 0.45s cubic-bezier(0.25, 0.8, 0.25, 1); opacity: 0; pointer-events: none; }
.sw-stacked-slide .sw-card { aspect-ratio: 9/16; box-shadow: 0 8px 30px rgba(0,0,0,0.2); }
.sw-stacked-slide.active { transform: translate(-50%, -50%) scale(1); opacity: 1; z-index: 5; pointer-events: auto; }
.sw-stacked-slide.prev1 { transform: translate(-135%, -50%) scale(0.88); opacity: 0.85; z-index: 4; pointer-events: auto; }
.sw-stacked-slide.next1 { transform: translate(35%, -50%) scale(0.88); opacity: 0.85; z-index: 4; pointer-events: auto; }
.sw-stacked-slide.prev2 { transform: translate(-205%, -50%) scale(0.74); opacity: 0.5; z-index: 3; }
.sw-stacked-slide.next2 { transform: translate(105%, -50%) scale(0.74); opacity: 0.5; z-index: 3; }
@media (max-width: 640px) {
  .sw-stacked-slide { width: 230px; }
  .sw-stacked .sw-arrow { display: none; }
}

/* ===== LAYOUT 3: IG Stories (ref image 3) ===== */
.sw-stories { display: flex; gap: 24px; overflow-x: auto; padding: 10px 4px; scrollbar-width: none; }
.sw-stories::-webkit-scrollbar { display: none; }
.sw-story { flex: 0 0 auto; text-align: center; cursor: pointer; width: 100px; }
.sw-story-ring { width: 92px; height: 92px; border-radius: 50%; padding: 3px; background: linear-gradient(45deg, #f9ce34, #f5a623, #ee2a7b); margin: 0 auto 10px; position: relative; }
.sw-story-ring img, .sw-story-ring video { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 3px solid #fff; display: block; }
.sw-story-ph { width: 100%; height: 100%; border-radius: 50%; background: #e9ecef; border: 3px solid #fff; display: flex; align-items: center; justify-content: center; color: #adb5bd; font-size: 1.5rem; }
/* Reference: sirf white triangle, circle nahi */
.sw-story-play { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: #fff; font-size: 1.8rem; text-shadow: 0 1px 6px rgba(0,0,0,0.5); pointer-events: none; }
.sw-story-title { font-size: 13px; color: #6c757d; line-height: 1.35; max-height: 2.7em; overflow: hidden; }

/* ===== LAYOUT 4: Row Playlist (ref image 4) ===== */
.sw-rows { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
@media (max-width: 768px) { .sw-rows { grid-template-columns: repeat(2, 1fr); gap: 12px; } }

/* ===== LAYOUT 5: Masonry (ref image 5) ===== */
.sw-masonry { columns: 4; column-gap: 18px; }
.sw-m-item { break-inside: avoid; margin-bottom: 18px; }
.sw-m-item .sw-card { aspect-ratio: auto; }
.sw-m-item.sw-tall .sw-card { height: 400px; }
.sw-m-item.sw-medium .sw-card { height: 310px; }
.sw-m-item.sw-short .sw-card { height: 230px; }
@media (max-width: 768px) { .sw-masonry { columns: 2; column-gap: 12px; } }

/* Video modal — v11.0.162: video left + products right (reference image 3) */
.sw-modal { position: fixed; inset: 0; z-index: 10002; display: none; align-items: center; justify-content: center; background: rgba(0,0,0,0.88); padding: 16px; }
.sw-modal.open { display: flex; }
.sw-modal-box { position: relative; display: flex; width: 880px; max-width: 94vw; max-height: 88vh; background: #fff; border-radius: 14px; overflow: hidden; }
.sw-modal-media { flex: 0 0 380px; max-width: 42%; background: #000; display: flex; align-items: center; justify-content: center; min-height: 480px; }
.sw-modal-media video, .sw-modal-media iframe { width: 100%; height: 100%; border: none; object-fit: contain; max-height: 88vh; }
.sw-modal-x { position: absolute; top: 8px; right: 12px; z-index: 5; background: none; border: none; color: #111; font-size: 2rem; cursor: pointer; line-height: 1; }
.sw-modal-side { flex: 1; padding: 20px; overflow-y: auto; min-width: 0; }
.sw-modal-title { font-size: 1.25rem; font-weight: 700; margin: 0 0 16px; padding-bottom: 12px; border-bottom: 1px solid #eee; }
.sw-modal-products { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.sw-modal-empty { color: #888; }
/* Modal product card */
.sw-mp-card { display: flex; flex-direction: column; }
.sw-mp-img { display: block; aspect-ratio: 1; background: #f5f5f5; border-radius: 8px; overflow: hidden; }
.sw-mp-img img { width: 100%; height: 100%; object-fit: cover; }
.sw-mp-noimg { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #bbb; font-size: 2rem; }
.sw-mp-info { padding-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.sw-mp-name { font-size: 14px; color: #333; text-decoration: none; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sw-mp-name:hover { color: #111; }
.sw-mp-price { font-size: 15px; font-weight: 600; color: #111; }
.sw-mp-price s { color: #999; font-weight: 400; margin-right: 6px; }
.sw-mp-add { margin-top: 6px; background: #111; color: #fff; border: none; border-radius: 8px; padding: 10px; font-size: 14px; font-weight: 600; cursor: pointer; }
.sw-mp-add:hover { background: #333; }
.sw-mp-add:disabled { opacity: 0.7; cursor: default; }
@media (max-width: 640px) {
  .sw-modal-box { flex-direction: column; width: 400px; }
  .sw-modal-media { flex: none; max-width: none; min-height: 0; aspect-ratio: 9/14; max-height: 52vh; }
  .sw-modal-media video, .sw-modal-media iframe { max-height: 52vh; }
  .sw-modal-side { padding: 16px; }
  .sw-modal-products { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}
