/* ================= PRODUCT PAGE ================= */

/* ============== CONTAINER & GRID ============== */
.product-page {
  max-width: 1200px;
  margin: 20px auto;
  padding: 12px;
}

.product-layout {
  display: grid;
  grid-template-columns: 1.8fr 2fr;
  gap: 24px;
  align-items: flex-start;
}

/* Tablet / Mobile – single column */
@media (max-width: 991.98px) {
  .product-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* ============== LEFT: GALLERY ============== */
.product-gallery {
  position: sticky;
  top: 90px;
  align-self: flex-start;
  display: flex;
  gap: 15px;
}

.product-gallery .thumbs {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.product-gallery .thumbs img {
  width: 75px;
  height: 110px;
  object-fit: cover;
  border: 1px solid #ccc;
  border-radius: 6px;
  cursor: pointer;
  transition: .25s ease;
  background: #fff;
}

.product-gallery .thumbs img.active {
  border: 2px solid #D4A830;
}

.product-gallery .thumbs img:hover {
  border-color: #D4A830;
  transform: scale(1.05);
}

.gallery-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.product-gallery .main-image img {
  width: 100%;
  max-width: 600px;
  max-height: 700px;
  object-fit: contain;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fff;
}

/* Buttons under photo */
.action-buttons {
  display: flex;
  gap: 16px;
  margin-top: 18px;
  width: 100%;
  justify-content: center;
}

.action-buttons .pp-btn {
  flex: 1;
  max-width: 240px;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #111;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
  transition: .25s ease;
  text-decoration: none;
}

.action-buttons .pp-btn i {
  margin-right: 8px;
  font-size: 18px;
}

.action-buttons .pp-btn.add-cart {
  background: linear-gradient(45deg, #D4A830, #b8891a);
  color: #111;
}

.action-buttons .pp-btn.buy-now {
  background: linear-gradient(45deg, #111, #374151);
  color: #fff;
}

.action-buttons .pp-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,.3);
}

.action-buttons .pp-btn.disabled,
.action-buttons .pp-btn[disabled] {
  opacity: .6;
  pointer-events: none;
}

/* ============== RIGHT: DETAILS ============== */
.product-details.sticky-panel {
  position: relative;
  padding-right: 10px;
}

.product-details .product-title {
  font-size: clamp(18px, 2.6vw, 26px);
  line-height: 1.25;
  font-weight: 700;
  margin: 0 0 8px 0;
  color: #222;
}

/* Price */
.price {
  margin: 12px 0;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.price .current {
  font-size: 32px;
  font-weight: 800;
  color: #b12704;
}
.price .old {
  font-size: 16px;
  text-decoration: line-through;
  color: #888;
}
.price .discount {
  font-size: 14px;
  font-weight: 700;
  color: #388e3c;
}

/* Stock */
.stock {
  margin: 10px 0;
  font-size: 15px;
  font-weight: 700;
}
.stock.in-stock { color: green; }
.stock.out-stock { color: red; }

/* Ratings */
.ratings { margin: 6px 0 12px; }
.ratings .stars { color:#D4A830; font-size: 16px; }
.ratings .rating-meta { margin-top:4px; color:#444; font-size:13px; }

/* Attributes */
.attributes h4 {
  font-size: 15px;
  margin: 10px 0 6px;
  font-weight: 600;
}
.options {
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-bottom:14px;
}
.option {
  border:1px solid #ccc;
  padding:6px 12px;
  border-radius:6px;
  font-size:14px;
  cursor:pointer;
  background:#fff;
  transition:.2s ease;
}
.option.active {
  border:2px solid #D4A830;
  background:#FFF8E7;
  font-weight:600;
}
.option.disabled {
  opacity:.45;
  pointer-events:none;
}

/* Color swatches (image based) */
.color-swatches {
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.color-swatches .swatch {
  border:2px solid transparent;
  border-radius:10px;
  padding:0;
  background:transparent;
  cursor:pointer;
  width:56px;
  height:56px;
  box-shadow:0 2px 6px rgba(0,0,0,.08);
  overflow:hidden;
  transition:.2s;
}
.color-swatches .swatch img {
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  background:#fff;
}
.color-swatches .swatch:hover { transform:translateY(-2px); }
.color-swatches .swatch.active {
  border-color:#D4A830;
  box-shadow:0 0 0 2px #FFF8E7, 0 0 0 4px #D4A830;
}

/* Section titles */
.section-title {
  display:flex;
  align-items:center;
  gap:8px;
  font-size:15px;
  font-weight:800;
  color:#102a43;
  margin:18px 0 6px;
}
.section-title i { opacity:.9; }

.desc-html p {
  margin:6px 0;
  color:#333;
  line-height:1.6;
  font-size:14px;
}

/* Reviews */
.review-item {
  padding:10px 0;
  border-top:1px solid #eee;
}
.review-item:first-child { border-top:none; }

.review-header {
  display:grid;
  grid-template-columns:40px 1fr;
  gap:8px;
  align-items:center;
}
.avatar {
  width:40px;
  height:40px;
  border-radius:50%;
  display:grid;
  place-items:center;
  background:#FFF8E7;
  color:#b8891a;
  font-weight:800;
  border:1px solid #E8D8A0;
}
.review-head-meta .line-1 {
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:6px;
  font-size:13px;
  color:#111827;
}
.review-head-meta .name { font-weight:700; }
.stars-inline { color:#D4A830; font-size:13px; }
.review-head-meta .line-2 {
  margin-top:2px;
  display:flex;
  gap:6px;
  flex-wrap:wrap;
  font-size:12px;
  color:#6b7280;
}
.review-body p {
  margin:6px 0;
  font-size:13px;
  color:#1f2937;
  line-height:1.6;
}

/* Generic chip */
.chip {
  padding:2px 8px;
  font-size:11px;
  border-radius:999px;
}
.chip-success { background:#e8f5e9; color:#2e7d32; }
.chip-warn    { background:#fff8e1; color:#b28704; }

/* ===== Pincode checker (compact) ===== */
.pincode-check {
  background:#f3f4f6;
  border:1px solid #e5e7eb;
  border-radius:10px;
  padding:14px 14px;
  margin:16px 0;
}
.pincode-check .pin-title {
  font-size:14px;
  font-weight:600;
  color:#111827;
  margin:0 0 8px;
  display:flex;
  align-items:center;
  gap:8px;
}
.pincode-check .pin-container { display:grid; gap:8px; }
.pincode-check .pin-row {
  display:flex;
  align-items:center;
  gap:8px;
}
.pincode-check .pin-input-wrap {
  flex:1;
  display:flex;
  align-items:center;
  gap:8px;
  background:#fff;
  border:1px solid #d1d5db;
  border-radius:8px;
  padding:6px 10px;
}
.pincode-check .pin-input-wrap i { color:#D4A830; font-size:16px; }
.pincode-check #pincode {
  flex:1;
  border:none;
  outline:none;
  background:transparent;
  font-size:14px;
  letter-spacing:1px;
}
.pincode-check .pin-btn {
  background:#D4A830;
  color:#111;
  border:none;
  padding:8px 12px;
  border-radius:8px;
  font-size:13px;
  cursor:pointer;
  font-weight:700;
}
.pincode-check .pin-btn:hover { background:#b8891a; }
.pincode-check .pin-btn:disabled { opacity:.6; cursor:not-allowed; }
.pincode-check .pin-loader {
  width:16px;
  height:16px;
  border-radius:50%;
  border:2px solid rgba(0,0,0,.15);
  border-top-color:#D4A830;
  animation: spin .8s linear infinite;
  display:none;
}
@keyframes spin { to { transform:rotate(360deg); } }

.pincode-check .pin-saved {
  display:flex;
  align-items:center;
  gap:8px;
  font-size:12px;
  color:#6b7280;
}
.pincode-check .pin-saved select {
  border:1px solid #d1d5db;
  border-radius:8px;
  padding:6px 8px;
  background:#fff;
  font-size:13px;
}
.pincode-check .pin-result {
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  min-height:20px;
  margin-top:4px;
}
.pincode-check .chip {
  display:inline-flex;
  align-items:center;
  gap:6px;
  border-radius:999px;
  padding:4px 9px;
  font-size:11px;
  border:1px solid rgba(0,0,0,0.08);
}
.pincode-check .chip.success {
  background:rgba(16,185,129,.12);
  color:#047857;
  border-color:rgba(16,185,129,.25);
}
.pincode-check .chip.error {
  background:rgba(239,68,68,.12);
  color:#b91c1c;
  border-color:rgba(239,68,68,.25);
}

/* =====================================================
   MOBILE STICKY CTA BAR
   =====================================================
   ✅ bottom: 0  — একদম নিচে, screen-এর bottom-এ
   ✅ Add to Cart — Gold
   ✅ Buy Now — Gold (same style)
   ===================================================== */
.mobile-cta-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;                          /* ← একদম নিচে */
  display: none;                      /* desktop hidden */
  gap: 0;
  padding: 0;
  background: #fff;
  border-top: 2px solid #E8D8A0;
  box-shadow: 0 -3px 14px rgba(0,0,0,.13);
  z-index: 1998;
  transition: transform .28s ease, opacity .28s ease;
}

/* Hidden state */
.mobile-cta-bar.cta-hidden {
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
}

.mobile-cta-bar .mc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  height: 56px;                       /* একটু বড় touch area */
  border-radius: 0;                   /* full-width bar, no radius */
  text-decoration: none;
  font-weight: 800;
  font-size: 15px;
  transition: all .2s;
  border: none;
  cursor: pointer;
}
.mobile-cta-bar .mc-btn i { margin-right: 8px; font-size: 17px; }

/* ── Add to Cart — Gold ── */
.mobile-cta-bar .mc-add {
  background: linear-gradient(135deg, #D4A830, #b8891a);
  color: #111;
  border-right: 1px solid rgba(0,0,0,.10);
}
.mobile-cta-bar .mc-add:active {
  background: linear-gradient(135deg, #b8891a, #8c6a10);
}

/* ── Buy Now — Same Gold ── */
.mobile-cta-bar .mc-buy {
  background: linear-gradient(135deg, #c8961e, #D4A830);
  color: #111;
}
.mobile-cta-bar .mc-buy:active {
  background: linear-gradient(135deg, #a07815, #c8961e);
}

.mobile-cta-bar .mc-btn.disabled {
  opacity: .55;
  pointer-events: none;
}

/* =====================================================
   MOBILE LAYOUT
   ===================================================== */
@media (max-width: 767.98px) {

  .product-page {
    padding: 8px 0;
    padding-bottom: 72px;            /* sticky bar height (56px) + 16px breathing room */
  }

  .product-layout {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .product-gallery {
    position: static;
    flex-direction: column;
    gap: 6px;
  }

  /* Main image full width */
  .product-gallery .main-image {
    padding: 0;
  }
  .product-gallery .main-image img {
    width: 100vw;
    max-width: 100vw;
    height: auto;
    max-height: none;
    border-radius: 0;
    border: none;
  }

  /* Thumbs row under image */
  .product-gallery .thumbs {
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .product-gallery .thumbs::-webkit-scrollbar { display: none; }
  .product-gallery .thumbs img {
    width: 60px;
    height: 60px;
    flex: 0 0 auto;
  }

  /* Hide desktop buttons, use sticky bar */
  .action-buttons {
    display: none;
  }

  /* Show mobile sticky CTA */
  .mobile-cta-bar {
    display: flex;
  }

  /* Title & price smaller for mobile */
  .product-details {
    padding: 0 12px 0;
  }
  .product-details .product-title {
    font-size: 18px;
    margin-top: 4px;
  }
  .price .current { font-size: 22px; }
  .price .old { font-size: 13px; }
  .price .discount { font-size: 12px; }

  .section-title {
    font-size:14px;
    padding: 0 12px;
  }
  .desc-html { padding: 0 12px 12px; }
  .review-item { margin: 0 12px; }
  .review-body p { font-size:13px; }
}

/* ===== DESKTOP LAYOUT TWEAK ===== */
@media (min-width: 992px) {
  .product-layout {
    grid-template-columns: 600px 1fr;
    gap: 40px;
  }
  /* Desktop: no mobile CTA bar */
  .mobile-cta-bar {
    display: none !important;
  }
}
