/* ===== FONT IMPORT ===== */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&family=Tiro+Bangla&display=swap');

/* ===== VARIABLES ===== */
:root {
  --bg: #f5f5f5;
  --white: #ffffff;
  --primary: #D12C62;
  --regular: #519E87;
  --bangla: 'Shonar Bangla', 'SutonnyOMJ', 'SuttonyOMJ', 'Tiro Bangla', serif;
}

/* ===== GLOBAL ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Montserrat", sans-serif;
}

body {
  background: var(--bg);
}

/* ================================================= */
/* ================= MAIN LAYOUT =================== */
/* ================================================= */
.product-wrapper {
  width: 65%;
  margin: 80px auto;
  display: grid;
  grid-template-columns: 1.2fr 1.5fr 1fr;
  gap: 20px;
}

/* ================= LEFT ================= */
.product-images,
.product-details,
.delivery-box {
  min-width: 0;
}

.product-images {
  background: var(--white);
  padding: 15px;
}

.main-image {
  width: 100%;
  aspect-ratio: 360 / 400;
  height: auto;
  border: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  background: #fafafa;
}

.main-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: zoom-in;
  opacity: 1;
  transition: opacity .2s ease, transform .15s ease;
  transform-origin: center center;
}

.main-image img.is-fading {
  opacity: .82;
}

.main-image img.img-loading {
  opacity: 0;
}

.main-image.zoom-active img {
  cursor: zoom-out;
}

.main-image .main-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  display: block;
}

.main-image.is-video img {
  display: none;
}

.main-fullscreen-btn {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 4;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: #1e293b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  transition: background 0.2s, color 0.2s, transform 0.15s;
}

.main-fullscreen-btn:hover {
  background: var(--primary);
  color: #fff;
  transform: scale(1.05);
}

.main-image.is-video .main-fullscreen-btn {
  opacity: 0.85;
}

.thumb.thumb--video {
  position: relative;
}

.thumb.thumb--video::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.thumb.thumb--video::before {
  content: "\f04b";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 16px;
  z-index: 2;
  pointer-events: none;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.thumb.thumb--video.active::after,
.thumb.thumb--video.active::before {
  opacity: 1;
}

.main-image.is-video-idle {
  cursor: pointer;
}

.main-image.is-video-idle img {
  cursor: pointer;
}

.main-video-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  width: 64px;
  height: 64px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--primary);
  font-size: 52px;
  line-height: 1;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s ease, background 0.2s ease;
  padding: 0;
}

.main-image.is-video-idle .main-video-play:not([hidden]) {
  display: flex;
}

.main-video-play:hover {
  transform: translate(-50%, -50%) scale(1.06);
  background: #fff;
  color: #b02052;
}

.main-image.is-video .main-video-play {
  display: none !important;
}

.img-skeleton-overlay {
  position: absolute;
  inset: 0;
  background: #eceef3;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}

.img-skeleton-overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, #f9f9fc 50%, transparent 80%);
  transform: translateX(-100%);
  animation: imageShimmer 1.2s ease-in-out infinite;
}

.main-image.is-loading .img-skeleton-overlay {
  opacity: 1;
}

@keyframes imageShimmer {
  to { transform: translateX(100%); }
}

/* ================= THUMB SLIDER ================= */
.thumbs-wrapper {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
}

.thumbs-container {
  width: 300px;
  overflow: hidden;
  position: relative;
  min-height: 60px;
}

.thumbs {
  display: flex;
  gap: 10px;
  will-change: transform;
}

.thumbs img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border: 1px solid #ddd;
  cursor: pointer;
  flex-shrink: 0;
}

.thumb.active {
  border: 2px solid var(--regular);
}

.thumb-btn {
  width: 28px;
  height: 60px;
  background: #fff;
  border: 1px solid #ddd;
  cursor: pointer;
  font-size: 18px;
}

.thumbs-skeleton {
  position: absolute;
  inset: 0;
  display: flex;
  gap: 10px;
  align-items: center;
  pointer-events: none;
}

.thumbs-skeleton span {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  background: #eceef3;
  position: relative;
  overflow: hidden;
}

.thumbs-skeleton span::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, #f9f9fc 50%, transparent 80%);
  transform: translateX(-100%);
  animation: thumbShimmer 1.1s ease-in-out infinite;
}

@keyframes thumbShimmer {
  to { transform: translateX(100%); }
}

.thumbs-container.thumbs-loading .thumbs {
  visibility: hidden;
}

/* ================= SIZE SELECTION ================= */
.size {
  display: flex;
  gap: 10px;
  margin: 15px 0;
}

.size .box {
  width: 60px;
  height: 50px;
  border: 1px solid #727272;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
}

.size .box.active {
  border: 2px solid #2de71c;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Countdown styling */
.countdown, #countdown { 
  margin-top: 5px; 
  color: red; 
  font-weight: 300;
  font-size: 14px;
}

/* ================= MIDDLE ================= */
.product-details {
  background: var(--white);
  padding: 20px;
}

.product-details h1 {
  font-size: 20px;
  margin-bottom: 10px;
}

.rating {
  font-size: 14px;
  margin-bottom: 15px;
}

.price {
  font-size: 26px;
  color: var(--primary);
  font-weight: 700;
}

.old-price {
  margin-left: 10px;
  text-decoration: line-through;
  color: var(--regular);
}

.discount {
  margin-left: 10px;
  font-weight: 600;
}

hr {
  height: 1px;
  background: #ccc;
  border: none;
  margin: 15px 0;
}

/* ================= COLOR ================= */
.color .thumbs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.color .thumbs img {
  height: 50px;
  object-fit: contain;
  background: #fff;
  padding: 2px;
}

/* ================= QUANTITY ================= */
.quantity {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0;
}

.quantity button {
  width: 35px;
  height: 35px;
  border: 1px solid #ddd;
  background: #fff;
  cursor: pointer;
}

.quantity span {
  min-width: 30px;
  text-align: center;
  font-weight: 600;
}

/* ================= TOTAL ================= */
.total-box {
  margin: 20px 0;
}

.total-box span {
  color: var(--regular);
  font-weight: 600;
}

/* ================= BUTTONS ================= */
.buttons {
  display: flex;
  gap: 15px;
}

.buy {
  flex: 1;
  padding: 12px;
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
}

.cart {
  flex: 1;
  padding: 12px;
  background: #ffeadf;
  color: var(--primary);
  border: 1px solid var(--primary);
  cursor: pointer;
}

/* ================================================= */
/* ================= DELIVERY BOX ================== */
/* ================================================= */
.delivery-box {
  background: var(--white);
  padding: 22px;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  font-size: 14px;
}

.delivery-box h3 {
  color: var(--primary);
  margin-bottom: 10px;
}

.delivery-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.delivery-item .highlight {
  color: var(--primary);
  font-weight: 600;
}

/* ================= PAYMENT METHODS ================= */
.payment-list {
  list-style: none;
  margin-top: 10px;
  padding: 0;
}

.payment-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px dashed #ddd;
}

.payment-list li:last-child {
  border-bottom: none;
}

.payment-list .yes {
  color: var(--regular);
  font-weight: 600;
}

.payment-list .no {
  color: red;
  font-weight: 600;
}

/* ================================================= */
/* ================= DETAILS SECTION =============== */
/* ================================================= */
.details {
  width: 65%;
  margin: -70px auto 0;
  padding: 20px;
  background: var(--white);
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
  font-family: var(--bangla);
  line-height: 1.8;
}

.details h1 {
  color: var(--primary);
  margin-bottom: 15px;
}

.details span {
  white-space: pre-line;
}

/* ================================================= */
/* ================= REVIEWS SECTION =============== */
/* ================================================= */
.reviews-section {
  width: 65%;
  margin: 5px auto;
  background: var(--white);
  padding: 20px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
  font-family: var(--bangla);
}

.reviews-section h2 {
  color: var(--primary);
  margin-bottom: 20px;
}

/* ===== Average Rating ===== */
.average-rating {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  margin-bottom: 15px;
}

.average-rating .stars {
  color: gold;
}

/* ===== Rating Breakdown ===== */
.rating-breakdown div {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 14px;
}

.rating-breakdown .bar {
  flex: 1;
  height: 10px;
  background: #eee;
  border-radius: 5px;
  overflow: hidden;
}

.rating-breakdown .fill {
  height: 100%;
  background: gold;
  transition: width .9s ease;
}

/* ===== Individual Reviews ===== */
.product-reviews .review {
  border-top: 1px solid #eee;
  padding: 15px 0;
}

.product-reviews .review:first-child {
  border-top: none;
}

.product-reviews .review.review-pre {
  opacity: 0;
  transform: translateY(12px);
}

.product-reviews .review.review-in {
  opacity: 1;
  transform: translateY(0);
  transition: opacity .45s ease, transform .45s ease;
}

.review-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  margin-bottom: 5px;
}

.review-header .stars {
  color: gold;
}

.review-header .verified {
  color: green;
  font-weight: 600;
}

.review-body p {
  margin: 5px 0;
  font-family: var(--bangla);
}

/* ===== Review Images ===== */
.review-images {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.review-images img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border: 1px solid #ddd;
  cursor: pointer;
}

/* ================================================= */
/* ================= LIGHTBOX ====================== */
/* ================================================= */
#lightboxOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
}

#lightboxImg {
  max-width: 90vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  user-select: none;
}

#lightboxClose {
  position: fixed;
  top: 18px;
  right: 22px;
  background: rgba(14, 23, 42, 0.72);
  border: 1.5px solid rgba(255,255,255,0.55);
  color: #fff;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, transform .15s;
  z-index: 10000;
  backdrop-filter: blur(6px);
}
#lightboxClose:hover { background: rgba(209,44,98,0.92); transform: scale(1.08) rotate(90deg); }

#lightboxPrev,
#lightboxNext {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(14, 23, 42, 0.72);
  border: 1.5px solid rgba(255,255,255,0.55);
  color: #fff;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 26px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, transform .15s;
  z-index: 10000;
  backdrop-filter: blur(6px);
  user-select: none;
}
#lightboxPrev { left: 18px; }
#lightboxNext { right: 18px; }
#lightboxPrev:hover { background: rgba(209,44,98,0.92); transform: translateY(-50%) scale(1.08); }
#lightboxNext:hover { background: rgba(209,44,98,0.92); transform: translateY(-50%) scale(1.08); }


/* ================================================= */
/* ================= RESPONSIVE ==================== */
/* ================================================= */
@media (max-width: 1200px) {
  .product-wrapper {
    grid-template-columns: minmax(220px, 1fr) minmax(250px, 1.3fr);
    gap: 18px;
  }
  .delivery-box {
    grid-column: 1 / -1;
    max-width: 100%;
  }
}

@media (max-width: 900px) {
  .product-wrapper {
    grid-template-columns: 1fr 1fr;
    gap: 15px;
  }
  .delivery-box {
    grid-column: 1 / -1;
  }
  .main-image {
    aspect-ratio: 1 / 1;
    height: auto;
  }
}

@media (max-width: 768px) {
  .product-wrapper {
    width: 100%;
    grid-template-columns: 1fr;
    margin-top: 60px;
    padding: 0 10px;
    gap: 10px;
    box-sizing: border-box;
  }
  
  .product-images,
  .product-details,
  .delivery-box {
    border-radius: 8px;
    padding: 12px;
  }

  .delivery-box {
    border-radius: 8px;
  }

  .details,
  .reviews-section {
    width: 100%;
    box-sizing: border-box;
    padding: 15px;
  }

  .buttons {
    flex-direction: column;
    gap: 8px;
  }

  .main-image {
    aspect-ratio: auto;
    min-height: 420px;
    height: clamp(420px, 62vh, 620px);
  }

  .reviews-section {
    margin-bottom: 0;
  }

  .thumbs-container {
    width: 100%;
  }

  .color .thumbs {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 480px) {
  .product-wrapper {
    margin-top: 50px;
    padding: 0 8px;
  }

  .product-images,
  .product-details {
    padding: 10px;
  }

  .main-image {
    aspect-ratio: auto;
    min-height: 340px;
    height: clamp(340px, 58vh, 540px);
  }

  .product-details h1 {
    font-size: 16px;
  }

  .price {
    font-size: 20px;
  }

  .quantity {
    gap: 8px;
  }

  .quantity button {
    width: 30px;
    height: 30px;
  }

  .size .box {
    width: 50px;
    height: 40px;
    font-size: 12px;
  }

  .buttons {
    gap: 6px;
  }

  .buy, .cart {
    padding: 10px;
    font-size: 13px;
  }

  .color .thumbs {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .thumbs img {
    width: 50px;
  }
}

/* ===== PRODUCT SHARE ===== */
.product-share {
  position: relative;
  margin: 10px 0 4px;
}

.product-share__toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid #e8e8ec;
  border-radius: 999px;
  background: #fff;
  color: #333;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, box-shadow 0.2s;
}

.product-share__toggle:hover {
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 4px 14px rgba(209, 44, 98, 0.12);
}

.product-share__menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 40;
  min-width: 210px;
  padding: 8px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #ececf1;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
  display: grid;
  gap: 4px;
}

.product-share__menu[hidden] {
  display: none !important;
}

.product-share__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #1f2937;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}

.product-share__item i {
  width: 18px;
  text-align: center;
  font-size: 16px;
}

.product-share__item:hover {
  background: #f8f8fb;
}

.product-share__item--wa i { color: #25d366; }
.product-share__item--fb i,
.product-share__item--story i { color: #1877f2; }
.product-share__item--msg i { color: #0084ff; }
.product-share__item--email i { color: #ea580c; }
.product-share__item--copy i,
.product-share__item--native i { color: #64748b; }

.product-share__toast {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 50;
  padding: 8px 12px;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
}

.product-share__toast[hidden] {
  display: none !important;
}

.product-share__hint {
  margin: 8px 0 0;
  font-size: 11px;
  line-height: 1.45;
  color: #64748b;
  max-width: 320px;
}

.product-share__menu:not([hidden]) ~ .product-share__toast {
  top: calc(100% + 220px);
}

