:root {
  --ink: #0e121b;
  --muted: #6b7280;
  --muted-light: #9ca3af;
  --line: #e6e7eb;
  --line-light: #f3f4f6;
  --accent: #2f7d5b;
  --accent-2: #267052;
  --success: #10b981;
  --paper: #ffffff;
  --background: #fafafa;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --transition: 0.2s ease;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body, html {
  margin: 0;
  padding: 0;
  background: var(--background);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.pd {
  background: var(--background);
  min-height: 100vh;
  padding: 0;
}

.container-xxl {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 24px 40px;
}

@media (max-width: 768px) {
  .container-xxl {
    padding: 16px !important;
  }
}

.pd-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
  background: var(--paper);
  padding: 0;
  border-radius: var(--radius-lg);
}

@media (max-width: 992px) {
  .pd-hero {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

.pd-gallery {
  position: relative;
  background: transparent;
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (max-width: 992px) {
  .pd-gallery {
    padding: 24px;
  }
}

.pd-thumbs {
  display: flex;
  flex-direction: row;
  gap: 12px;
  margin: 0;
  justify-content: center;
  flex-wrap: wrap;
}

.pd-thumbs .pd-thumb {
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  width: 72px;
  height: 72px;
  transition: all var(--transition);
  background: var(--paper);
  cursor: pointer;
  opacity: 0.6;
  padding: 4px;
}

.pd-thumbs .pd-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
}

.pd-thumbs .pd-thumb:hover {
  opacity: 1;
  border-color: var(--muted);
}

.pd-thumbs .pd-thumb.active {
  border-color: var(--ink);
  opacity: 1;
}

.pd-main {
  flex: 1;
  position: relative;
  background: var(--paper);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  min-height: 500px;
  padding: 40px;
  width: 100%;
}

.pd-main img {
  width: 100%;
  max-width: 450px;
  height: 400px;
  max-height: 400px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.pd-main:hover img {
  transform: scale(1.03);
}

.gallery-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.95);
  border: 1.5px solid var(--line);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--ink);
  font-size: 1.25rem;
  box-shadow: var(--shadow-sm);
  z-index: 10;
}

.gallery-nav-btn:hover {
  background: var(--paper);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-50%) scale(1.05);
}

.gallery-nav-btn:active {
  transform: translateY(-50%) scale(0.95);
}

.gallery-nav-btn.prev {
  left: 20px;
}

.gallery-nav-btn.next {
  right: 20px;
}

.gallery-indicator {
  margin-top: 16px;
  position: static;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--line-light);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.875rem;
  color: var(--ink);
  font-weight: 500;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.gallery-indicator i {
  font-size: 1rem;
  color: var(--accent);
}

.pd-buy {
  background: none;
  border: none;
  padding: 48px 40px;
}

@media (max-width: 992px) {
  .pd-buy {
    padding: 32px 24px;
  }
}

.pd-bc {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 0.875rem;
  margin-bottom: 24px;
  color: var(--muted);
}

.pd-bc a {
  color: var(--muted);
  text-decoration: none;
  transition: color var(--transition);
}

.pd-bc a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.pd-brand {
  font-size: 0.8125rem;
  color: var(--muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.8px;
}

.pd-title {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 20px;
  color: var(--ink);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.pd-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 20px 0;
}

.pd-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--line-light);
  color: var(--ink);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
  border: 1px solid var(--line);
  transition: all var(--transition);
}

.pd-chip.sale {
  background: #fef3c7;
  color: #d97706;
  border-color: #fde68a;
}

.pd-chip:hover {
  background: var(--line);
  border-color: var(--muted-light);
}

.pd-chip i {
  font-size: 0.875rem;
}

.pd-reviews {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 0.875rem;
}

.pd-reviews .stars {
  color: #fbbf24;
  display: flex;
  gap: 2px;
}

.pd-reviews .count {
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

.pd-price {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 24px 0;
  padding: 20px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.pd-now {
  font-size: 2.25rem;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.pd-was {
  color: var(--muted-light);
  text-decoration: line-through;
  font-size: 1.25rem;
  font-weight: 500;
}

.pd-desc {
  color: var(--muted);
  line-height: 1.6;
  margin: 20px 0 24px;
  font-size: 0.9375rem;
}

.pd-save {
  background: #dcfce7;
  color: var(--success);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.8125rem;
  font-weight: 600;
}

.pd-stock {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 16px 0 24px;
  font-size: 0.875rem;
  color: var(--muted);
}

.pd-stock span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.variant-selector {
  margin: 28px 0;
  padding: 20px;
  background: var(--line-light);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
}

.variant-selector label,
.variant-selector h6 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--ink);
  margin-bottom: 16px;
}

.variant-selector h6 i {
  color: var(--accent);
  font-size: 1rem;
}

.variant-options {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.variant-option {
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--ink);
  background: var(--paper);
  transition: all var(--transition);
  min-width: 80px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
}

.variant-option:hover {
  border-color: var(--accent);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.variant-option.active {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--paper);
  box-shadow: var(--shadow-md);
}

.variant-option.out-of-stock {
  opacity: 0.4;
  cursor: not-allowed;
  text-decoration: line-through;
}

.variant-option.out-of-stock:hover {
  transform: none;
  box-shadow: none;
}

.variant-option:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  text-decoration: line-through;
}

.variant-price {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
}

.variant-option.active .variant-price {
  color: rgba(255, 255, 255, 0.9);
}

.stock-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #ef4444;
  color: white;
  font-size: 0.6875rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.variant-info {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin: 20px 0;
}

.variant-info h6 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
}

.variant-info h6 i {
  color: var(--accent);
}

.variant-info div {
  font-size: 0.875rem;
  color: var(--muted);
}

.variant-info strong {
  color: var(--success);
  font-weight: 600;
}

.size-guide {
  font-size: 0.875rem;
  color: var(--muted);
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  margin-left: auto;
}

.pd-actions {
  display: flex;
  gap: 12px;
  align-items: stretch;
  margin: 32px 0;
  flex-wrap: wrap;
}

.pd-qty {
  display: flex;
  align-items: center;
  justify-content: center
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
  height: 52px;
  overflow: hidden;
}

.pd-qty button {
  padding: 0 18px;
  font-size: 1.25rem;
  color: var(--ink);
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all var(--transition);
  height: 100%;
  font-weight: 600;
}

.pd-qty button:hover {
  background: var(--accent);
  color: var(--paper);
}

.pd-qty button:active {
  transform: scale(0.95);
}

.pd-qty input {
  width: 60px;
  border: none;
  background: transparent;
  font-size: 1rem;
  text-align: center;
  color: var(--ink);
  font-weight: 600;
  outline: none;
}

.pd-add {
  flex: 1;
  padding: 0 32px;
  background: var(--accent);
  color: var(--paper);
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition);
  height: 52px;
  min-width: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(47, 125, 91, 0.2);
}

.pd-add:hover {
  background: var(--accent-2);
  box-shadow: 0 4px 12px rgba(47, 125, 91, 0.3);
  transform: translateY(-1px);
}

.pd-add:active {
  transform: translateY(0);
}

.pd-ghost {
  padding: 0 24px;
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: all var(--transition);
  height: 52px;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  text-decoration: none;
}

.pd-ghost:hover {
  border-color: var(--ink);
  background: var(--line-light);
  color: var(--ink);
}

.pd-ghost:active {
  transform: scale(0.98);
}

.pd-trust {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 0;
  padding: 20px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  width: 100%;
}

.pd-trust .item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--ink);
  padding: 0;
  font-weight: 500;
  line-height: 1.4;
}

.pd-trust .item i {
  font-size: 1.5rem;
  color: var(--accent);
}

.pd-trust .item svg,
.pd-trust .item::before {
  content: '✓';
  font-size: 1.125rem;
  font-weight: 700;
}

.pd-divider {
  height: 1px;
  background: var(--line);
  margin: 32px 0;
}

.pd-reviews {
  margin: 32px 0;
}

.pd-reviews h4 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 20px;
}

.review-stars {
  color: #fbbf24;
  font-size: 1rem;
  letter-spacing: 2px;
}

.pd-acc {
  margin-top: 40px;
  border-top: 1px solid var(--line);
}

.pd-acc-sum {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--ink);
  cursor: pointer;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
  transition: color var(--transition);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pd-acc-sum:hover {
  color: var(--muted);
}

.pd-acc-body {
  padding: 20px 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.9375rem;
}

.pd-acc-body ul {
  margin: 12px 0;
  padding-left: 20px;
}

.pd-acc-body ul li {
  margin: 8px 0;
}

.pd-rail {
  margin-top: 48px;
}

.pd-rail h5 {
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 20px;
  letter-spacing: -0.01em;
}

.review-card {
  background: var(--line-light);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 16px;
  transition: all var(--transition);
}

.review-card:hover {
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

/* === People Also Like (Horizontal Scroll) === */
.rail {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 16px;
  padding-bottom: 10px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.rail::-webkit-scrollbar {
  height: 6px;
}

.rail::-webkit-scrollbar-track {
  background: transparent;
}

.rail::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 4px;
}

.rail > * {
  flex: 0 0 auto;
  scroll-snap-align: start;
  min-width: 220px;
}

/* Mobile Responsive Styles */
@media (max-width: 992px) {
  .pd-gallery {
    padding: 24px;
     gap: 12px;
  }

  .pd-main {
    order: 1; /* Main image first */
    margin-bottom: 0;
  }

    .pd-thumbs {
    order: 2;
    flex-direction: row;
    justify-content: center;
    margin-top: 0; /* Remove any extra margin */
  }

.pd-trust {
    order: 3;
    grid-template-columns: repeat(3, 1fr);
    padding: 16px 0;
    margin-top: 8px; /* Add small space above trust */
  }
}

@media (max-width: 768px) {

   .pd-gallery {
    gap: 0px; /* Even smaller gap on mobile */
  }

  .pd-main {
    padding: 20px; /* Reduce padding inside main image container */
    min-height: 350px; /* Slightly reduce height */
  }
  .pd-title {
    font-size: 1.5rem;
  }

  .pd-now {
    font-size: 1.875rem;
  }

  .pd-hero {
    gap: 0;
  }

  .pd-actions {
    flex-direction: column;
    width: 100%;
  }

  .pd-qty,
  .pd-add,
  .pd-ghost {
    width: 100%;
      justify-content: center;
      padding: 10px;
  }

  .pd-main {
    min-height: 400px;
  }

  .gallery-nav-btn {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .gallery-nav-btn.prev {
    left: 12px;
  }

  .gallery-nav-btn.next {
    right: 12px;
  }

  .gallery-indicator {
    padding: 6px 12px;
    font-size: 0.8125rem;
  }

  .rail > * {
    min-width: 180px;
  }

  .variant-selector {
    padding: 16px;
  }

  .variant-option {
    min-width: 70px;
  }

  .pd-trust {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    font-size: 0.75rem;
    order: 3; /* Keep trust at bottom */
  }

  .pd-trust .item {
    gap: 4px;
    font-size: 0.75rem;
  }

  .pd-trust .item i {
    font-size: 1.125rem;
  }

  .pd-thumbs {
    justify-content: center;
    order: 2; /* Keep thumbnails in middle */
  }
}

/* === Fixed Star Rating Overlay === */
.stars {
  position: relative;
  display: inline-block;
  font-size: 18px;
  line-height: 1;
  color: #ddd; /* gray stars (background layer) */
  width: 90px; /* width for 5 stars */
  letter-spacing: 2px;
}

.stars-bg,
.stars-fill {
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden;
  white-space: nowrap;
}

.stars-bg {
  color: #ddd; /* background stars */
  z-index: 1;
}

.stars-fill {
  color: #ffc107; /* gold stars */
  z-index: 2;
}
