/* ================= 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 #2874f0;
}

.product-gallery .thumbs img:hover {
  border-color: #2874f0;
  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: #fff;
  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,#ffd700,#d4af37);
}

.action-buttons .pp-btn.buy-now {
  background: linear-gradient(45deg,#ffbf00,#b8860b);
}

.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:#f39c12; 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 #2874f0;
  background:#eaf2ff;
  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:#2874f0; }

/* 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:#eef2ff;
  color:#374151;
  font-weight:800;
  border:1px solid #e5e7eb;
}
.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:#f59e0b; 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;
}

/* COD etc */
.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:#2563eb; 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:#2563eb;
  color:#fff;
  border:none;
  padding:8px 12px;
  border-radius:8px;
  font-size:13px;
  cursor:pointer;
  font-weight:600;
}
.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:rgba(0,0,0,.6);
  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 ===== */
.mobile-cta-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: none; /* desktop hidden */
  gap: 10px;
  padding: 10px;
  background: #fff;
  border-top: 1px solid #eee;
  z-index: 50;
}
.mobile-cta-bar .mc-btn {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:1 1 auto;
  height:46px;
  border-radius:10px;
  text-decoration:none;
  font-weight:800;
}
.mobile-cta-bar .mc-btn i { margin-right:8px; }
.mobile-cta-bar .mc-add {
  background: linear-gradient(45deg,#ffd700,#d4af37);
  color:#fff;
}
.mobile-cta-bar .mc-buy {
  background: linear-gradient(45deg,#ffbf00,#b8860b);
  color:#fff;
}
.mobile-cta-bar .mc-btn.disabled {
  opacity:.6;
  pointer-events:none;
}

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

  .product-page {
    padding: 8px 0 90px; /* নিচে CTA bar এর জন্য extra bottom-padding */
  }

  .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;
  }
  .product-gallery .thumbs img {
    width: 60px;
    height: 60px;
    flex: 0 0 auto;
  }

  /* Hide big 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 10px 0;
  }
  .product-details .product-title {
    font-size: 18px;
    margin-top: 4px;
  }
  .price .current { font-size: 20px; }
  .price .old { font-size: 13px; }
  .price .discount { font-size: 12px; }

  .section-title {
    font-size:14px;
  }
  .desc-html p,
  .review-body p {
    font-size:13px;
  }
}

/* ===== DESKTOP LAYOUT TWEAK ===== */
@media (min-width: 992px) {
  .product-layout {
    grid-template-columns: 600px 1fr;
    gap: 40px;
  }
}
