/* ── PRODUCT DETAIL STYLING (LIGHT PREMIUM THEME) ── */

.product-detail-container {
  max-width: 1200px;
  margin: 130px auto 60px auto;
  padding: 0 24px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--blue);
  text-decoration: none;
  font-weight: 600;
  margin-bottom: 28px;
  font-size: 0.95rem;
  transition: transform 0.2s ease, color 0.2s ease;
}

.back-link:hover {
  color: var(--deep);
  transform: translateX(-4px);
}

.detail-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: start;
}

/* Gallery Container */
.gallery-container {
  background: var(--white);
  border: 1px solid rgba(12, 74, 124, 0.14);
  border-radius: 24px;
  padding: 18px;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  grid-template-areas: "thumbnails main-image";
  gap: 16px;
  box-shadow: 0 20px 50px rgba(18, 68, 103, 0.1);
}

.main-image-wrap {
  grid-area: main-image;
  width: 100%;
  height: clamp(420px, 38vw, 500px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  border-radius: 18px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(0, 89, 187, 0.1);
}

.main-image-wrap img {
  max-width: 85%;
  max-height: 85%;
  object-fit: contain;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.main-image-wrap img[data-image-shape="wide"] {
  width: 92%;
  height: auto;
  max-width: 92%;
  max-height: 78%;
}

.main-image-wrap img[data-image-shape="tall"] {
  width: auto;
  height: 90%;
  max-width: 72%;
  max-height: 90%;
}

.main-image-wrap img[data-image-shape="balanced"] {
  width: 86%;
  height: 86%;
}

.main-image-wrap:hover img {
  transform: scale(1.04);
}

.thumbnails-row {
  grid-area: thumbnails;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  max-height: clamp(420px, 38vw, 500px);
  padding: 2px 4px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  scroll-snap-type: y proximity;
}

.thumbnails-row::-webkit-scrollbar { display: none; }

.thumb-btn {
  width: 68px;
  height: 68px;
  border-radius: 14px;
  border: 1px solid rgba(0, 89, 187, 0.12);
  background: #f8fbff;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  box-shadow: none;
  scroll-snap-align: center;
}

.thumb-btn img {
  max-width: 80%;
  max-height: 80%;
  object-fit: contain;
}

.thumb-btn img[data-image-shape="wide"] { width: 88%; height: auto; }
.thumb-btn img[data-image-shape="tall"] { width: auto; height: 88%; }
.thumb-btn img[data-image-shape="balanced"] { width: 82%; height: 82%; }

.thumb-btn:hover {
  transform: translateX(2px);
  border-color: var(--sky);
  background: var(--white);
}

.thumb-btn.active {
  border-color: var(--blue);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.13), 0 8px 18px rgba(0, 89, 187, 0.12);
}

.thumb-btn:focus-visible {
  outline: 3px solid rgba(0, 102, 204, 0.28);
  outline-offset: 2px;
}

/* Info Column */
.product-info-panel {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand-badge {
  display: inline-block;
  align-self: flex-start;
  padding: 6px 14px;
  background: var(--tag-bg);
  color: var(--deep);
  border-radius: 30px;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.brand-badge,
.services-section-title,
.service-title,
.spec-label {
  font-family: var(--font-subtitle);
}

.product-title {
  font-size: 2.3rem;
  color: var(--black);
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.rating-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
}

.stars {
  color: #f7b600; /* Primary gold accent */
  letter-spacing: 2px;
  font-size: 1.1rem;
}

.rating-count {
  color: var(--muted);
  font-weight: 500;
}

.product-detail-desc {
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--navy);
}

.price-box {
  background: var(--gray);
  border-left: 5px solid var(--blue);
  padding: 20px 24px;
  border-radius: 4px 12px 12px 4px;
  border: 1px solid var(--border-clr);
  border-left-width: 5px;
  box-shadow: var(--shadow-sm);
}

.previous-price {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 700;
  text-decoration: line-through;
  margin-bottom: 4px;
}

.promotion-label {
  color: var(--blue);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.original-price {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--black);
  letter-spacing: -0.5px;
}

.installment-preview {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
  margin-top: 6px;
}

/* Services Additional Cards */
.services-section-title {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--black);
  margin-bottom: 16px;
}

.services-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.service-card {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--white);
  border: 1px solid var(--border-clr);
  padding: 18px 24px;
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.service-card:hover {
  transform: translateY(-2px);
  border-color: var(--blue);
  box-shadow: var(--shadow);
}

.service-card.selected {
  border-color: var(--blue);
  background: var(--ice);
  box-shadow: 0 8px 20px rgba(0, 89, 187, 0.12);
}

.service-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gray);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
  transition: var(--transition);
}

.service-card.selected .service-icon {
  background: var(--blue);
  color: var(--white);
}

.service-details {
  flex-grow: 1;
}

.service-title {
  font-weight: 700;
  color: var(--black);
  font-size: 1rem;
}

.service-desc {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.4;
}

.service-price {
  font-weight: 800;
  color: var(--navy);
  font-size: 1.05rem;
}

.service-card.selected .service-price {
  color: var(--deep);
}

/* Summary Box */
.detail-summary-box {
  background: linear-gradient(145deg, #f6f7ff 0%, #eef2ff 100%);
  border: 1px solid rgba(66, 104, 180, 0.18);
  border-radius: 16px;
  padding: 18px 20px;
  margin-top: 0;
  box-shadow: 0 10px 24px rgba(35, 67, 130, 0.08);
  font-family: 'Poppins', sans-serif;
}

.detail-summary-box *,
.actions-row button {
  font-family: 'Poppins', sans-serif;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 1rem;
  color: var(--navy);
  font-weight: 500;
}

.summary-row.total {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-clr);
  color: var(--black);
  font-weight: 900;
  font-size: 1.35rem;
}

.actions-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 24px;
  margin-bottom: 16px;
}

.actions-row .btn-primary,
.actions-row .btn-ghost {
  width: 100%;
}

.actions-row .btn-ghost {
  color: var(--navy);
  border-color: var(--border-clr);
}

.actions-row .btn-ghost:hover {
  background: var(--gray);
  border-color: var(--blue);
  color: var(--blue);
}

/* Specs & Reviews tab section */
.extra-details-section {
  max-width: 1200px;
  margin: 80px auto;
  padding: 0 24px;
}

.tabs-header {
  display: flex;
  gap: 32px;
  border-bottom: 2px solid var(--gray);
  margin-bottom: 40px;
}

.tab-nav-btn {
  background: none;
  border: none;
  color: var(--muted);
  padding: 16px 4px;
  font-size: 1.15rem;
  font-weight: 800;
  cursor: pointer;
  position: relative;
  transition: color 0.2s ease;
}

.tab-nav-btn.active {
  color: var(--blue);
}

.tab-nav-btn.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--blue);
  border-radius: 2px;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Specs Layout */
.specs-table-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.spec-row {
  display: flex;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--gray);
  border-radius: 10px;
  border: 1px solid rgba(0, 89, 187, 0.06);
  transition: var(--transition);
}

.spec-row:hover {
  background: var(--white);
  border-color: var(--border-clr);
  box-shadow: var(--shadow-sm);
}

.spec-label {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
}

.spec-val {
  color: var(--black);
  font-weight: 700;
  font-size: 0.95rem;
}

/* Reviews Layout */
.reviews-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 48px;
  align-items: start;
}

.reviews-summary-card {
  background: var(--gray);
  border: 1px solid var(--border-clr);
  border-radius: 16px;
  padding: 40px 32px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.reviews-summary-card h4 {
  font-size: 1.2rem;
  color: var(--black);
  margin-bottom: 8px;
}

.average-score {
  font-size: 4.5rem;
  font-weight: 900;
  color: var(--black);
  line-height: 1;
}

.stars-large {
  font-size: 1.6rem;
  color: #f7b600;
  margin: 16px 0;
}

.rating-total-txt {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
}

.reviews-list-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.review-card {
  background: var(--white);
  border: 1px solid var(--border-clr);
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.review-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.review-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.reviewer-name {
  font-weight: 700;
  color: var(--black);
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.verified-badge {
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(34, 197, 94, 0.1);
  color: var(--success-dark);
  padding: 2px 10px;
  border-radius: 12px;
}

.review-date {
  font-size: 0.85rem;
  color: var(--muted);
}

.review-comment {
  color: var(--navy);
  font-size: 0.98rem;
  line-height: 1.6;
}

/* Write Review Form Box */
.write-review-box {
  margin-top: 40px;
  background: var(--gray);
  border: 1px solid var(--border-clr);
  border-radius: 16px;
  padding: 32px;
  box-shadow: var(--shadow-sm);
}

.write-review-box h4 {
  color: var(--black);
  font-size: 1.2rem;
  margin-bottom: 16px;
  font-weight: 800;
}

.rating-select {
  display: flex;
  gap: 8px;
  font-size: 1.8rem;
  color: #ccc;
  cursor: pointer;
  margin-bottom: 20px;
  align-self: flex-start;
}

.rating-star-option {
  transition: color 0.15s ease, transform 0.15s ease;
}

.rating-star-option:hover {
  transform: scale(1.15);
}

.rating-star-option.active {
  color: #f7b600;
}

.review-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* Input design polished to be beautiful and high fidelity */
.review-form input,
.review-form textarea {
  background: var(--white);
  border: 1.5px solid var(--border-clr);
  border-radius: 10px;
  padding: 14px 18px;
  color: var(--navy);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
  width: 100%;
}

.review-form input::placeholder,
.review-form textarea::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

.review-form input:hover,
.review-form textarea:hover {
  border-color: var(--sky);
}

.review-form input:focus,
.review-form textarea:focus {
  border-color: var(--blue);
  background: var(--white);
  outline: none;
  box-shadow: 0 0 0 4px rgba(0, 89, 187, 0.12), inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.review-form button[type="submit"] {
  align-self: flex-start;
  padding: 14px 32px;
}

/* Responsive adjustments */
@media (max-width: 992px) {
  .detail-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  
  .reviews-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

@media (max-width: 768px) {
  .specs-table-grid {
    grid-template-columns: 1fr;
  }
  
  .actions-row {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  
  .form-group-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* Product content must be allowed to shrink inside the grid. */
.detail-grid > *, .reviews-grid > *, .form-group-row > * { min-width: 0; }
.services-container-box {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  overflow-wrap: anywhere;
}
.services-container-box p { margin: 0; line-height: 1.55; }
.services-container-box .btn-primary {
  display: inline-flex;
  margin-top: 16px;
}
.thumb-btn { flex-shrink: 0; }
@media (max-width: 600px) {
  .product-detail-container { margin-top: 100px; padding-inline: 16px; }
  .gallery-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 12px;
    border-radius: 20px;
  }
  .services-container-box, .write-review-box, .reviews-summary-card { padding: 16px; }
  .main-image-wrap { height: auto; aspect-ratio: 1; border-radius: 15px; }
  .thumbnails-row {
    width: 100%;
    max-height: none;
    flex-direction: row;
    justify-content: flex-start;
    gap: 10px;
    padding: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
  }
  .thumb-btn { width: 64px; height: 64px; }
  .thumb-btn:hover { transform: translateY(-2px); }
  .detail-grid { gap: 24px; }
  .tabs-header { flex-wrap: wrap; }
  .tab-nav-btn { flex: 1 1 180px; padding: 12px; white-space: normal; }
  .specs-table-grid { overflow-wrap: anywhere; }
  .review-form input, .review-form textarea { font-size: 16px; }
  .services-container-box .btn-primary { width: 100%; margin-top: 16px; }
}
