/**
 * Product detail page — standalone styles
 * Layout matches Tailwind-style reference: bg-white, max-w-2xl → lg:max-w-7xl, lg:grid-cols-2
 */

/* ---- Root & container ---- */
.pdp {
  background: #fafaff;
  background-image: radial-gradient(ellipse 60% 40% at 50% 0%, rgba(99, 102, 241, 0.06), transparent);
}

.pdp-container {
  margin-left: auto;
  margin-right: auto;
  max-width: 42rem;
  padding: 4rem 1rem;
  box-sizing: border-box;
}

@media (min-width: 640px) {
  .pdp-container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    padding-top: 6rem;
    padding-bottom: 6rem;
  }
}

@media (min-width: 1024px) {
  .pdp-container {
    max-width: 80rem;
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* ---- Two-column grid (desktop) ---- */
.pdp-grid {
  width: 100%;
}

@media (min-width: 1024px) {
  .pdp-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: 2rem;
  }
}

/* ---- Image gallery ---- */
.pdp-gallery {
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* Main image */
.pdp-gallery-main {
  width: 100%;
  aspect-ratio: 1;
  background: linear-gradient(145deg, #f5f3ff 0%, #ede9fe 100%);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(30, 27, 75, 0.06), 0 0 0 1px rgba(30, 27, 75, 0.05);
}

.pdp-gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pdp-gallery-main .no-img {
  color: #9ca3af;
  font-size: 0.875rem;
}

/* Thumbnail list — hidden on small mobile, grid from sm ---- */
.pdp-gallery-thumbs {
  margin-top: 1.5rem;
  width: 100%;
  display: none;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .pdp-gallery-thumbs {
    display: grid;
    max-width: 42rem;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (min-width: 1024px) {
  .pdp-gallery-thumbs {
    max-width: none;
  }
}

.pdp-thumb {
  position: relative;
  display: flex;
  height: 6rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #fff;
  border: 1px solid rgba(30, 27, 75, 0.1);
  overflow: hidden;
  padding: 0;
  box-sizing: border-box;
  box-shadow: 0 1px 3px rgba(30, 27, 75, 0.05);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.pdp-thumb:hover {
  background: #fafaff;
  border-color: rgba(99, 102, 241, 0.25);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.12);
}

.pdp-thumb.active {
  border-color: #4f46e5;
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.35), 0 4px 12px rgba(99, 102, 241, 0.15);
}

.pdp-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pdp-thumb.no-img {
  font-size: 0.75rem;
  color: #9ca3af;
}

/* Mobile: horizontal thumb strip below main image */
.pdp-gallery-thumbs-mobile {
  display: flex;
  gap: 0.625rem;
  margin-top: 0.75rem;
  overflow-x: auto;
  padding: 0.5rem 0;
  -webkit-overflow-scrolling: touch;
}

@media (min-width: 640px) {
  .pdp-gallery-thumbs-mobile {
    display: none;
  }
}

.pdp-thumb-mobile {
  flex-shrink: 0;
  width: 4rem;
  height: 4rem;
  border-radius: 0.375rem;
  border: 1px solid #e5e7eb;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  background: #fff;
}

.pdp-thumb-mobile.active {
  border-color: #4f46e5;
}

.pdp-thumb-mobile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---- Product info (right column) ---- */
.pdp-info {
  margin-top: 2.5rem;
  padding: 0 1rem;
  box-sizing: border-box;
}

@media (min-width: 640px) {
  .pdp-info {
    margin-top: 4rem;
    padding: 0;
  }
}

@media (min-width: 1024px) {
  .pdp-info {
    margin-top: 0;
  }
}

.pdp-info h1,
.pdp-info h2,
.pdp-info h3,
.pdp-info p,
.pdp-info form,
.pdp-info label {
  margin: 0;
}

.pdp-brand {
  font-size: 0.875rem;
  color: #6b7280;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.pdp-title {
  font-size: 1.875rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: #111;
}

.pdp-price-block {
  margin-top: 0.75rem;
}

.pdp-price {
  font-size: 1.875rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: #111;
}

.pdp-price-label {
  font-size: 0.875rem;
  color: #6b7280;
  margin-left: 0.5rem;
}

.pdp-price-converted {
  font-size: 0.875rem;
  color: #6b7280;
  margin-top: 0.25rem;
  margin-bottom: 0;
  display: block;
}

/* Reviews */
.pdp-reviews {
  margin-top: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.pdp-reviews-stars {
  color: #4f46e5;
  font-size: 1rem;
}

.pdp-reviews-text {
  font-size: 0.875rem;
  color: #6b7280;
  margin-left: 0.25rem;
}

/* Description */
.pdp-description {
  margin-top: 1rem;
  font-size: 1rem;
  line-height: 1.6;
  color: #374151;
}

/* Options: Color, Size */
.pdp-options {
  margin-top: 1.5rem;
}

.pdp-option-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #4b5563;
  margin-bottom: 0.5rem;
  display: block;
}

.pdp-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.pdp-color {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  padding: 0;
  flex-shrink: 0;
  box-sizing: border-box;
}

.pdp-color:hover {
  border-color: #9ca3af;
}

.pdp-color.active {
  border-color: #111;
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.pdp-sizes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.pdp-size {
  width: 3rem;
  height: 2.75rem;
  border-radius: 0.375rem;
  border: 1px solid #e5e7eb;
  background: #fff;
  cursor: pointer;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.pdp-size:hover {
  border-color: #9ca3af;
}

.pdp-size.active {
  background: #111;
  color: #fff;
  border-color: #111;
}

/* Quantity + Add to cart */
.pdp-actions {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.pdp-qty {
  display: flex;
  align-items: center;
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  overflow: hidden;
  width: 7.5rem;
  flex-shrink: 0;
}

.pdp-qty-btn {
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  background: #f9fafb;
  cursor: pointer;
  font-size: 1.125rem;
  line-height: 1;
}

.pdp-qty-btn:hover {
  background: #f3f4f6;
}

.pdp-qty-input {
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-left: 1px solid #e5e7eb;
  border-right: 1px solid #e5e7eb;
  text-align: center;
  font-size: 1rem;
  -moz-appearance: textfield;
}

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

.pdp-add-cart {
  flex: 1;
  min-width: 12rem;
  height: 3rem;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.2);
  background: linear-gradient(180deg, #6366f1 0%, #4f46e5 50%, #4338ca 100%);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-sizing: border-box;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4), inset 0 1px 0 rgba(255,255,255,0.2);
  transition: box-shadow 0.2s ease, transform 0.15s ease, filter 0.2s ease;
}

.pdp-add-cart:hover {
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45), inset 0 1px 0 rgba(255,255,255,0.25);
  transform: translateY(-1px);
  filter: brightness(1.05);
}

/* Referral share (approved referrers only) */
.pdp-share-referral {
  flex: 1 1 100%;
  min-width: 10rem;
  height: 3rem;
  border-radius: 10px;
  border: 2px solid #22c55e;
  background: #fff;
  color: #15803d;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-sizing: border-box;
  transition: background 0.2s ease, color 0.2s ease;
}

.pdp-share-referral:hover {
  background: #f0fdf4;
  color: #14532d;
}

@media (min-width: 640px) {
  .pdp-share-referral {
    flex: 0 1 auto;
  }
}

.pdp-referral-share {
  margin-top: 1.25rem;
  padding: 1rem 1.125rem;
  border-radius: 12px;
  background: linear-gradient(145deg, #f0fdf4 0%, #ecfdf5 100%);
  border: 1px solid rgba(34, 197, 94, 0.35);
  box-sizing: border-box;
}

.pdp-referral-share-label {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #14532d;
  margin: 0 0 0.35rem 0;
}

.pdp-referral-share-hint {
  font-size: 0.75rem;
  color: #4b5563;
  margin: 0 0 0.75rem 0;
  line-height: 1.45;
}

.pdp-referral-share-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: stretch;
}

.pdp-referral-share-input {
  flex: 1 1 12rem;
  min-width: 0;
  font-size: 0.75rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  color: #374151;
}

.pdp-referral-share-copy,
.pdp-referral-share-native {
  flex: 0 0 auto;
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
}

.pdp-referral-share-copy {
  background: #fff;
  color: #15803d;
  border: 1px solid #22c55e;
}

.pdp-referral-share-native {
  background: #22c55e;
  color: #fff;
}

.pdp-referral-share-native:disabled,
.pdp-referral-share-native.pdp-hidden {
  display: none;
}

/* Features row */
.pdp-features {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  font-size: 0.875rem;
  color: #4b5563;
}

/* ---- Additional details (accordion / tabs) ---- */
.pdp-details {
  margin-top: 3rem;
  padding: 1.5rem 0 0;
  border-top: 1px solid rgba(30, 27, 75, 0.1);
  background: linear-gradient(145deg, rgba(245,243,255,0.5) 0%, transparent 100%);
  border-radius: 12px;
}

.pdp-details-heading {
  font-size: 1rem;
  font-weight: 600;
  color: #111;
  margin: 0 0 1rem 0;
}

.pdp-details-body {
  padding: 0.5rem 0;
  font-size: 1rem;
  line-height: 1.6;
  color: #374151;
}

.pdp-details-body p {
  margin: 0 0 0.5rem 0;
}

.pdp-details-body p:last-child {
  margin-bottom: 0;
}

.pdp-details-empty {
  color: #6b7280;
  font-size: 0.9375rem;
}

/* ---- Related products ---- */
.pdp-related {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #e5e7eb;
}

.pdp-related-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #111;
  margin: 0 0 1rem 0;
}

.pdp-related-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (min-width: 768px) {
  .pdp-related-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.pdp-related-card {
  text-decoration: none;
  color: inherit;
  border-radius: 0.5rem;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e5e7eb;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.pdp-related-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: #d1d5db;
}

.pdp-related-card-img {
  aspect-ratio: 1;
  background: #f7f7f7;
  overflow: hidden;
}

.pdp-related-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pdp-related-card-title {
  font-size: 0.875rem;
  font-weight: 600;
  margin: 0;
  padding: 0.5rem 0.75rem 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
  color: #111;
}

.pdp-related-card-price {
  font-size: 1rem;
  font-weight: 700;
  color: #111;
  padding: 0 0.75rem 0.75rem;
  margin: 0;
}

/* ---- Breadcrumb ---- */
.pdp-breadcrumb {
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.pdp-breadcrumb-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  color: #6b7280;
}

.pdp-breadcrumb-list li + li::before {
  content: "›";
  margin-right: 0.5rem;
  color: #9ca3af;
}

.pdp-breadcrumb-list a {
  color: #111;
  text-decoration: none;
}

.pdp-breadcrumb-list a:hover {
  text-decoration: underline;
}

.pdp-breadcrumb-list [aria-current="page"] {
  color: #6b7280;
}

/* ---- Mobile sticky bar ---- */
.pdp-mobile-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  padding: 0.75rem 1rem;
  border-top: 1px solid #e5e7eb;
  gap: 0.625rem;
  z-index: 40;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.06);
  box-sizing: border-box;
}

.pdp-mobile-bar-spacer {
  display: none;
  height: 5rem;
}

.pdp-mobile-btn-share {
  display: none;
  flex: 0 0 3rem;
  width: 3rem;
  height: 3rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  border: 2px solid #22c55e;
  background: #f0fdf4;
  color: #15803d;
  font-size: 1.125rem;
  cursor: pointer;
  padding: 0;
  box-sizing: border-box;
}

.pdp-mobile-btn-share:hover {
  background: #dcfce7;
}

@media (max-width: 767px) {
  .pdp-mobile-bar {
    display: flex;
  }
  .pdp-mobile-btn-share {
    display: inline-flex;
  }
  .pdp-mobile-bar-spacer {
    display: block;
  }
  .pdp-mobile-bar .pdp-mobile-form {
    flex: 1;
    min-width: 0;
  }
  .pdp-mobile-btn {
    flex: 1;
    min-width: 0;
    height: 3rem;
    border-radius: 0.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border: none;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
  }
  .pdp-mobile-btn-cart {
    background: #fff;
    color: #111;
    border: 1px solid #d1d5db;
  }
  .pdp-mobile-btn-buy {
    background: #4f46e5;
    color: #fff;
  }
}
