/* ==========================================================================
   TechStore — Product detail page
   ========================================================================== */

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
.product-shell {
  padding-block: clamp(1rem, 2vw, 1.75rem);
}

.product-main {
  display: grid;
  grid-template-columns: minmax(0, 46%) minmax(0, 1fr);
  gap: clamp(1.25rem, 2.5vw, 2.5rem);
  align-items: start;
}

.product-column {
  min-width: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: clamp(1rem, 2vw, 1.75rem);
}

/* --------------------------------------------------------------------------
   Gallery
   -------------------------------------------------------------------------- */
.gallery__main {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface-soft);
  overflow: hidden;
}

.gallery__main img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  padding: 1.25rem;
  mix-blend-mode: multiply;
  display: block;
  cursor: zoom-in;
  transition: transform 0.35s var(--ease);
}

.gallery__main.is-zoomed img {
  transform: scale(1.6);
  cursor: zoom-out;
}

.gallery__discount {
  position: absolute;
  top: 0.9rem;
  left: 0.9rem;
  z-index: 2;
}

.gallery__badge {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  z-index: 2;
}

.gallery__thumbs {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-width: thin;
}

.gallery__thumb {
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  border: 2px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
  padding: 0.3rem;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.18s var(--ease), transform 0.18s var(--ease);
}

.gallery__thumb:hover {
  transform: translateY(-2px);
}

.gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.gallery__thumb.is-active {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
}

.gallery__note {
  margin-top: 0.7rem;
  font-size: var(--fs-xs);
  color: var(--ink-500);
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Info panel
   -------------------------------------------------------------------------- */
.product-info h1 {
  font-size: clamp(1.25rem, 1.1rem + 0.8vw, 1.6rem);
  line-height: 1.32;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.product-info__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  font-size: var(--fs-sm);
  color: var(--ink-600);
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 1rem;
}

.product-info__meta .sep-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--ink-400);
}

.product-info__meta a {
  color: var(--brand);
  font-weight: 600;
}

.rating-line {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--fs-sm);
  color: var(--ink-600);
}

.stars {
  color: #f5a623;
  font-size: 0.85rem;
  letter-spacing: 1px;
}

.review-count {
  font-weight: 600;
}

/* Price block */
.price-block {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
  margin-bottom: 0.9rem;
}

.price-now {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 1.4rem + 1.2vw, 2.3rem);
  font-weight: 800;
  color: var(--brand-dark);
  line-height: 1.1;
}

.price-old {
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--ink-400);
  text-decoration: line-through;
}

.price-save {
  font-size: var(--fs-sm);
  font-weight: 800;
  color: #fff;
  background: var(--danger);
  border-radius: var(--r-pill);
  padding: 0.25rem 0.7rem;
}

.price-tax-note {
  flex-basis: 100%;
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--ink-500);
}

/* Stock + avail */
.stock-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: var(--fs-sm);
  font-weight: 700;
  border-radius: var(--r-pill);
  padding: 0.35rem 0.8rem;
  margin-bottom: 1rem;
}

.stock-pill--in {
  color: #166534;
  background: #dcfce7;
}

.stock-pill--in .pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #16a34a;
  animation: pulse-dot 2s infinite;
}

.stock-pill--out {
  color: #991b1b;
  background: #fee2e2;
}

.stock-pill--out .pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  animation: none;
}

/* Quick spec bullets */
.short-specs {
  list-style: none;
  margin: 0 0 1.1rem;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.short-specs li {
  display: flex;
  gap: 0.6rem;
  font-size: var(--fs-sm);
  color: var(--ink-600);
  align-items: baseline;
}

.short-specs li i {
  color: var(--brand);
  font-size: 0.7rem;
}

.short-specs li b {
  color: var(--ink);
  font-weight: 600;
}

/* Qty + actions */
.buy-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
  overflow: hidden;
}

.qty-stepper button {
  width: 40px;
  height: 44px;
  border: 0;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 0.95rem;
  cursor: pointer;
  transition: background-color 0.16s var(--ease), color 0.16s var(--ease);
}

.qty-stepper button:hover:not(:disabled) {
  background: var(--brand);
  color: #fff;
}

.qty-stepper input {
  width: 52px;
  border: 0;
  text-align: center;
  font-weight: 700;
  font-size: var(--fs-base);
  -moz-appearance: textfield;
  appearance: textfield;
}

.qty-stepper input::-webkit-outer-spin-button,
.qty-stepper input::-webkit-inner-spin-button {
  -webkit-appearance: none;
}

.buy-row .btn {
  min-height: 44px;
}

.btn-buy-now {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--ink);
  --bs-btn-border-color: var(--ink);
  --bs-btn-hover-bg: var(--ink-800);
  --bs-btn-hover-border-color: var(--ink-800);
  --bs-btn-hover-color: #fff;
}

.icon-actions {
  display: flex;
  gap: 0.5rem;
}

.icon-actions .icon-btn {
  width: 44px;
  height: 44px;
}

/* EMI + services */
.emi-block {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  background: var(--brand-soft);
  border: 1px solid #dcefd0;
  border-radius: var(--r-md);
  padding: 0.7rem 0.9rem;
  margin-bottom: 1rem;
  font-size: var(--fs-sm);
}

.emi-block i {
  color: var(--brand-darker);
  font-size: 1.1rem;
}

.emi-block strong {
  color: var(--brand-darker);
}

.emi-block .btn {
  margin-left: auto;
}

.service-strip {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.service-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 0.5rem 0.85rem;
  transition: all 0.18s var(--ease);
}

.service-chip i {
  color: var(--brand);
}

.service-chip:hover {
  border-color: var(--brand);
  color: var(--brand-darker);
}

/* Share */
.share-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line-soft);
}

.share-row span {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink-600);
}

.share-row .social-links a {
  width: 34px;
  height: 34px;
  font-size: 0.85rem;
}

/* --------------------------------------------------------------------------
   Tabs
   -------------------------------------------------------------------------- */
.product-tabs {
  margin-top: clamp(1.5rem, 3vw, 2.5rem);
}

.nav-tabs.product-tab-nav {
  border-bottom: 2px solid var(--line);
  gap: 0.25rem;
}

.nav-tabs.product-tab-nav .nav-link {
  border: 0;
  border-bottom: 3px solid transparent;
  color: var(--ink-600);
  font-weight: 700;
  font-size: var(--fs-base);
  padding: 0.65rem 1.1rem;
  margin-bottom: -2px;
  border-radius: 0;
  transition: color 0.16s var(--ease), border-color 0.16s var(--ease);
}

.nav-tabs.product-tab-nav .nav-link:hover {
  color: var(--ink);
}

.nav-tabs.product-tab-nav .nav-link.active {
  color: var(--brand-darker);
  border-color: var(--brand);
  background: transparent;
}

.tab-pane-body {
  background: #fff;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  padding: clamp(1.1rem, 2.5vw, 1.75rem);
}

/* Specification table */
.spec-table {
  border: 0;
}

.spec-table thead th {
  background: var(--surface-soft);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-500);
}

.spec-table th,
.spec-table td {
  padding: 0.65rem 0.8rem;
  font-size: var(--fs-sm);
  vertical-align: top;
}

.spec-table td:first-child,
.spec-table th:first-child {
  color: var(--ink-500);
  width: 34%;
  background: var(--surface-mute);
}

.spec-table td:last-child {
  color: var(--ink);
  font-weight: 500;
}

.spec-group-title td {
  background: var(--brand-soft) !important;
  font-weight: 800;
  color: var(--brand-darker) !important;
}

/* Details prose */
.details-prose {
  font-size: var(--fs-base);
  line-height: 1.75;
  color: var(--ink-600);
}

.details-prose p {
  margin-bottom: 0.9rem;
}

.details-prose h3 {
  font-size: var(--fs-md);
  margin: 1.25rem 0 0.5rem;
}

.details-prose ul {
  padding-left: 1.2rem;
  margin-bottom: 0.9rem;
}

/* --------------------------------------------------------------------------
   Reviews
   -------------------------------------------------------------------------- */
.review-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
  margin-bottom: 1.5rem;
}

.review-score {
  text-align: center;
}

.review-score .big {
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1;
}

.review-score .stars {
  font-size: 1rem;
}

.review-score small {
  color: var(--ink-500);
}

.review-dist .bar-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: var(--fs-xs);
  color: var(--ink-500);
  margin-bottom: 0.3rem;
}

.review-dist .bar {
  flex: 1;
  height: 8px;
  border-radius: var(--r-pill);
  background: var(--line);
  overflow: hidden;
}

.review-dist .bar span {
  display: block;
  height: 100%;
  background: var(--brand);
  border-radius: var(--r-pill);
}

.review-dist .pct {
  width: 3ch;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.review-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.review-card {
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line-soft);
}

.review-card__head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
}

.review-card__avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-darker);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: var(--fs-sm);
  flex: 0 0 auto;
}

.review-card__name {
  font-weight: 700;
  font-size: var(--fs-sm);
}

.review-card__stars {
  margin-left: auto;
}

.review-card__stars .stars {
  font-size: 0.8rem;
}

.review-card p {
  margin: 0.25rem 0 0;
  font-size: var(--fs-sm);
  color: var(--ink-600);
  line-height: 1.6;
}

.review-card__date {
  font-size: var(--fs-xs);
  color: var(--ink-400);
}

/* Rating input */
.rating-input {
  direction: rtl;
  display: inline-flex;
  gap: 0.25rem;
  font-size: 1.6rem;
}

.rating-input input {
  display: none;
}

.rating-input label {
  color: var(--line);
  cursor: pointer;
  transition: color 0.15s var(--ease);
}

.rating-input label:hover,
.rating-input label:hover ~ label,
.rating-input input:checked ~ label {
  color: #f5a623;
}

/* --------------------------------------------------------------------------
   Related products
   -------------------------------------------------------------------------- */
.related-section {
  margin-top: clamp(2rem, 4vw, 3rem);
}

/* --------------------------------------------------------------------------
   Sticky mobile buy bar
   -------------------------------------------------------------------------- */
.sticky-buy {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1070;
  background: #fff;
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 20px rgba(24, 24, 27, 0.1);
  padding: 0.7rem 1rem;
  transform: translateY(110%);
  transition: transform 0.3s var(--ease);
}

.sticky-buy.is-visible {
  transform: translateY(0);
}

.sticky-buy__inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sticky-buy__price {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--fs-lg);
  color: var(--brand-dark);
  white-space: nowrap;
}

.sticky-buy__actions {
  display: flex;
  gap: 0.5rem;
  flex: 1;
  justify-content: flex-end;
}

.sticky-buy .qty-stepper button {
  height: 40px;
  width: 36px;
}

@media (min-width: 768px) {
  .sticky-buy {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 991.98px) {
  .product-main {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
  }

  .review-summary {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
  }
}

@media (max-width: 575.98px) {
  .product-column {
    padding: 0.9rem;
    border-radius: var(--r-lg);
  }

  .gallery__main img {
    padding: 0.9rem;
  }

  .buy-row {
    gap: 0.45rem;
  }

  .buy-row .btn {
    flex: 1;
  }

  .buy-row .qty-stepper input {
    width: 44px;
  }

  .service-strip {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}