/* High-Fidelity Product Detail Styles - Adapted from Figma Layers */

:root {
  --brand-purple: #4c0080;
  --brand-purple-light: #6a0dad;
  --bg-gray: #f9f9fb;
  --card-bg: #f3f3f5;
  --text-main: #1a1c1d;
  --text-muted: #4d4353;
  --accent-gold: #eab308;
  --border-light: #eeeef0;
  --radius-lg: 24px;
  --radius-md: 16px;
  --shadow-soft: 0px 20px 40px rgba(106, 13, 173, 0.04);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", sans-serif;
  background: var(--bg-gray);
  color: var(--text-main);
}

.product-detail-page {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 112px;
  padding-bottom: 80px;
}

.product-container {
  width: 1280px;
  max-width: 1440px;
  display: flex;
  flex-direction: column;
  gap: 48px;
  padding: 0 32px;
}

/* Breadcrumbs */
.breadcrumbs {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  height: 24px;
}

.breadcrumb-link {
  font-size: 16px;
  line-height: 24px;
  color: var(--text-muted);
  text-decoration: none;
  display: flex;
  align-items: center;
}

.breadcrumb-sep {
  color: var(--text-muted);
  font-size: 14px;
}

.breadcrumb-current {
  font-weight: 600;
  font-size: 16px;
  line-height: 24px;
  color: var(--text-main);
}

/* Hero Section */
.product-hero {
  display: flex;
  flex-direction: row;
  gap: 80px; /* Space between columns */
  position: relative;
  width: 100%;
}

/* =========================================
   PREMIUM IMAGE ZOOM
========================================= */

.main-image-container {
  position: relative;

  overflow: hidden;

  border-radius: 32px;

  background: #ffffff;

  cursor: zoom-in;
}

/* MAIN IMAGE */
#mainImage {
  width: 100%;

  height: 100%;

  object-fit: cover;

  transition: transform 1s ease-out;

  transform-origin: center center;

  will-change: transform;

  backface-visibility: hidden;

  transform: scale(1);
}

/* GLASS LIGHT EFFECT */

.main-image-container::after {
  content: "";

  position: absolute;

  inset: 0;

  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.16) 0%,

    rgba(255, 255, 255, 0.04) 35%,

    transparent 60%
  );

  pointer-events: none;

  opacity: 0;

  transition: opacity 0.25s ease;
}

.main-image-container:hover::after {
  opacity: 1;
}

/* MOBILE */

@media (max-width: 768px) {
  .main-image-container {
    cursor: default;
  }
}

/* =========================================
   FULLSCREEN IMAGE VIEWER
========================================= */

.fullscreen-viewer {
  position: fixed;

  inset: 0;

  width: 100%;

  height: 100%;

  background: rgba(10, 10, 10, 0.92);

  backdrop-filter: blur(18px);

  display: flex;

  align-items: center;

  justify-content: center;

  z-index: 9999;

  opacity: 0;

  visibility: hidden;

  transition:
    opacity 0.35s ease,
    visibility 0.35s ease;
}

/* ACTIVE */

.fullscreen-viewer.active {
  opacity: 1;

  visibility: visible;
}

/* IMAGE */

.fullscreen-viewer img {
  width: 100%;

  height: auto;

  max-width: 92vw;

  max-height: 92vh;

  border-radius: 24px;

  object-fit: contain;

  transform: scale(0.88);

  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);

  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.45);
}

/* ACTIVE IMAGE */

.fullscreen-viewer.active img {
  transform: scale(1);
}

/* CLOSE BUTTON */

.fullscreen-close {
  position: absolute;

  top: 28px;

  right: 32px;

  width: 54px;

  height: 54px;

  border: none;

  border-radius: 999px;

  background: rgba(255, 255, 255, 0.08);

  backdrop-filter: blur(12px);

  color: white;

  font-size: 22px;

  cursor: pointer;

  transition: 0.25s ease;
}

.fullscreen-close:hover {
  background: rgba(255, 255, 255, 0.16);

  transform: scale(1.08);
}

/* MOBILE */

@media (max-width: 768px) {
  .fullscreen-viewer img {
    max-width: 96vw;

    max-height: 82vh;

    border-radius: 18px;
  }

  .fullscreen-close {
    top: 18px;

    right: 18px;

    width: 46px;

    height: 46px;

    font-size: 18px;
  }
}

/* Info Column */
.info-column {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-label {
  font-size: 12px;
  line-height: 16px;
  font-weight: 400;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--brand-purple);
  margin-bottom: 12px;
}

.product-title {
  font-size: 48px;
  line-height: 48px;
  font-weight: 400;
  letter-spacing: -1.2px;
  color: var(--text-main);
  margin-bottom: 16px;
}

.rating-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.stars {
  display: flex;
  gap: 0;
}

.stars i {
  color: var(--accent-gold);
}

.rating-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
}

.product-price {
  font-size: 30px;
  line-height: 36px;
  font-weight: 400;
  color: var(--brand-purple);
  margin-bottom: 24px;
  padding-top: 16px;
}

.price-stack {
  display: flex;

  flex-direction: column;

  gap: 10px;

  margin-bottom: 28px;
}

.price-row {
  display: flex;

  align-items: center;

  gap: 14px;

  flex-wrap: wrap;
}

.compare-price {
  font-size: 22px;

  color: #9ca3af;

  text-decoration: line-through;

  font-weight: 500;
}

.discount-badge {
  padding: 8px 14px;

  border-radius: 999px;

  background: rgba(22, 163, 74, 0.12);

  color: #15803d;

  font-size: 13px;

  font-weight: 700;

  letter-spacing: 0.4px;
}

/* =========================================
   OFFER UI
========================================= */

.offer-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.offer-badge-purple {
  width: fit-content;

  padding: 8px 14px;

  border-radius: 999px;

  background: linear-gradient(135deg, #603763, #7a4e7c);

  color: white;

  font-size: 12px;

  font-weight: 700;

  letter-spacing: 0.5px;

  text-transform: uppercase;
}

.offer-saving {
  font-size: 14px;

  font-weight: 600;

  color: #16a34a;
}

.offer-name {
  font-size: 13px;

  color: var(--text-muted);

  font-weight: 500;
}

.tax-text {
  font-size: 14px;

  color: var(--text-muted);
}

.emi-text {
  font-size: 14px;

  color: var(--brand-purple);

  font-weight: 600;
}

.stock-status {
  font-size: 14px;

  font-weight: 600;

  margin-top: -12px;

  margin-bottom: 24px;

  display: inline-flex;

  align-items: center;

  gap: 8px;
}

.stock-status.in-stock {
  color: #15803d;
}

.stock-status.out-stock {
  color: #dc2626;
}

.stock-status::before {
  content: "";

  width: 10px;

  height: 10px;

  border-radius: 999px;

  background: currentColor;
}

.ram-options {
  display: flex;

  gap: 12px;

  flex-wrap: wrap;
}

.ram-btn,
.storage-btn {
  padding: 12px 24px;

  border: 2px solid var(--border-light);

  border-radius: 24px;

  background: white;

  cursor: pointer;

  transition: all 0.25s ease;
}

.ram-btn.active,
.storage-btn.active {
  border-color: var(--brand-purple);

  background: rgba(76, 0, 128, 0.06);

  color: var(--brand-purple);

  font-weight: 700;
}

.ram-btn.disabled,
.storage-btn.disabled {
  opacity: 0.55;

  cursor: pointer;

  text-decoration: none;

  pointer-events: auto;
}

.unavailable {
  opacity: 0.55;

  filter: grayscale(0.2);

  cursor: pointer;

  position: relative;

  pointer-events: auto;
}

.variant-message {
  font-size: 14px;

  color: #dc2626;

  margin-bottom: 14px;

  font-weight: 600;
}

.color-btn.unavailable,
.ram-btn.unavailable,
.storage-btn.unavailable {
  opacity: 0.45;
}

.product-summary {
  font-size: 16px;
  line-height: 26px;
  font-weight: 400;
  color: var(--text-muted);
  margin-bottom: 40px;
  max-width: 568px;
}

/* Configuration */
.config-container {
  display: flex;
  flex-direction: column;
  gap: 32px;
  margin-bottom: 48px;
}

.config-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.config-label {
  font-size: 14px;
  color: var(--text-main);
}

.color-options {
  display: flex;
  gap: 16px;
}

.color-option-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.color-name {
  font-size: 12px;
  color: #4b5563;
  text-transform: capitalize;
  font-weight: 500;
}

.color-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  border: 1px solid var(--border-light, #e5e7eb);
  position: relative;
}

.color-btn.active {
  box-shadow:
    0px 0px 0px 2px #ffffff,
    0px 0px 0px 4px var(--brand-purple);
}

.storage-options {
  display: flex;
  gap: 12px;
}

.storage-btn {
  padding: 12px 24px;
  border: 2px solid var(--border-light);
  border-radius: 24px;
  background: transparent;
  font-size: 16px;
  font-weight: 400;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.3s;
}

.storage-btn.active {
  background: rgba(76, 0, 128, 0.05);
  border-color: var(--brand-purple);
  color: var(--brand-purple);
  font-weight: 700;
}

/* Actions */
.action-row {
  display: flex;

  align-items: center;

  gap: 16px;

  margin-bottom: 40px;

  width: 100%;
}

.btn-primary {
  flex: 1;

  height: 72px;

  background: linear-gradient(
    135deg,
    var(--brand-purple) 0%,
    var(--brand-purple-light) 100%
  );

  box-shadow: 0px 10px 20px rgba(106, 13, 173, 0.2);

  border-radius: 24px;

  border: none;

  color: white;

  font-size: 18px;

  font-weight: 700;

  cursor: pointer;
}

.btn-secondary {
  flex: 1;

  height: 72px;

  border: 2px solid var(--brand-purple);

  border-radius: 24px;

  background: transparent;

  color: var(--brand-purple);

  font-size: 18px;

  font-weight: 700;

  cursor: pointer;
}

.btn-wishlist {
  width: 72px;

  min-width: 72px;

  height: 72px;

  border: 2px solid var(--border-light);

  border-radius: 24px;

  background: white;

  display: flex;

  align-items: center;

  justify-content: center;

  cursor: pointer;

  transition: all 0.3s ease;

  flex-shrink: 0;
}

.btn-wishlist.active {
  background: #e5484d;

  border-color: #e5484d;
}

.btn-wishlist.active svg {
  fill: white;

  stroke: white;
}

.action-row .btn-wishlist {
  position: relative !important;

  top: unset !important;

  right: unset !important;

  left: unset !important;

  bottom: unset !important;

  transform: none !important;
}

/* Trust Badges */
.trust-badges {
  display: flex;
  gap: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border-light);
}

.badge-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-main);
}

.badge-item i {
  color: var(--brand-purple);
}

/* Bento Section */
.bento-section {
  display: flex;
  flex-direction: row;
  gap: 32px;
  margin-bottom: 80px;
}

.features-card {
  flex: 2;
  background: var(--card-bg);
  border-radius: 24px;
  padding: 48px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.specs-card {
  flex: 1;
  background: white;
  border: 1px solid var(--border-light);
  border-radius: 24px;
  padding: 40px;
  box-shadow: 0px 20px 40px rgba(106, 13, 173, 0.04);
}

.bento-title {
  font-size: 30px;
  font-weight: 400;
  letter-spacing: -0.75px;
  color: var(--text-main);
}

.features-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.feature-item h3 {
  font-size: 16px;
  color: var(--brand-purple);
  margin-bottom: 12px;
}

.feature-item p {
  font-size: 14px;
  line-height: 23px;
  color: var(--text-muted);
}

.specs-table {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 32px;
}

.spec-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.spec-row:last-child {
  border-bottom: none;
}

.spec-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.spec-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

/* Related Section */
.related-section {
  display: flex;
  flex-direction: column;
  gap: 32px;
  margin-bottom: 80px;
}

.related-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.view-all-link {
  font-size: 16px;
  font-weight: 700;
  color: var(--brand-purple);
  text-decoration: none;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

/* Review Section */
.reviews-section {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.reviews-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.review-card {
  background: white;
  border: 1px solid var(--border-light);
  border-radius: 24px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.review-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 16px;
  color: var(--brand-purple);
}

.review-info h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.review-body {
  font-size: 16px;
  line-height: 26px;
  color: var(--text-muted);
}

/* =========================================
   FULLSCREEN IMAGE VIEWER
========================================= */

.fullscreen-viewer {
  position: fixed;

  inset: 0;

  width: 100%;

  height: 100vh;

  background: rgba(8, 8, 10, 0.94);

  backdrop-filter: blur(20px);

  display: flex;

  align-items: center;

  justify-content: center;

  z-index: 99999;

  opacity: 0;

  visibility: hidden;

  transition:
    opacity 0.35s ease,
    visibility 0.35s ease;

  padding: 40px;
}

/* ACTIVE */

.fullscreen-viewer.active {
  opacity: 1;

  visibility: visible;
}

/* IMAGE */

.fullscreen-viewer img {
  width: 100%;

  height: auto;

  max-width: 92vw;

  max-height: 92vh;

  object-fit: contain;

  border-radius: 28px;

  transform: scale(0.88);

  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);

  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.45);
}

/* IMAGE ANIMATION */

.fullscreen-viewer.active img {
  transform: scale(1);
}

/* CLOSE BUTTON */

.fullscreen-close {
  position: absolute;

  top: 28px;

  right: 28px;

  width: 52px;

  height: 52px;

  border: none;

  border-radius: 50%;

  background: rgba(255, 255, 255, 0.08);

  backdrop-filter: blur(10px);

  color: white;

  font-size: 24px;

  cursor: pointer;

  transition: 0.25s ease;

  z-index: 2;
}

/* HOVER */

.fullscreen-close:hover {
  background: rgba(255, 255, 255, 0.16);

  transform: scale(1.08);
}

/* Mobile Responsive */
@media (max-width: 1200px) {
  .product-container {
    width: 100%;
  }
}

@media (max-width: 1024px) {
  .product-hero,
  .bento-section {
    flex-direction: column;
  }

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

@media (max-width: 768px) {
  .product-detail-page {
    padding-top: 90px;
  }

  .product-container {
    padding: 0 18px;

    gap: 36px;
  }

  .product-hero {
    gap: 36px;
  }

  .gallery-column {
    position: relative;

    top: unset;
  }

  .main-image-container {
    border-radius: 28px;
  }

  .product-title {
    font-size: 38px;

    line-height: 1;
  }

  .action-row {
    flex-direction: column;
  }

  .btn-primary,
  .btn-secondary,
  .btn-wishlist {
    width: 100%;
  }

  .features-grid,
  .reviews-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================
   PREMIUM REVIEWS SECTION
========================================= */

.reviews-section {
  margin-top: 40px;

  gap: 36px;
}

/* =========================================
   REVIEW FORM
========================================= */

.review-form {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.95),
    rgba(255, 255, 255, 0.82)
  );

  border: 1px solid rgba(255, 255, 255, 0.7);

  border-radius: 32px;

  padding: 32px;

  box-shadow: 0 20px 50px rgba(76, 0, 128, 0.06);

  backdrop-filter: blur(18px);

  display: flex;

  flex-direction: column;

  gap: 24px;
}

.review-form h4 {
  font-size: 24px;

  font-weight: 700;

  letter-spacing: -0.6px;

  color: var(--text-main);
}

/* FORM */

.review-form form {
  display: flex;

  flex-direction: column;

  gap: 18px;
}

/* SELECT */

.review-form select {
  width: 180px;

  height: 52px;

  border-radius: 18px;

  border: 1px solid var(--border-light);

  background: white;

  padding: 0 18px;

  font-size: 15px;

  font-weight: 600;

  color: var(--text-main);

  outline: none;

  transition: 0.25s ease;
}

.review-form select:focus {
  border-color: var(--brand-purple);

  box-shadow: 0 0 0 4px rgba(76, 0, 128, 0.08);
}

/* TEXTAREA */

.review-form textarea {
  width: 100%;

  min-height: 140px;

  resize: vertical;

  border-radius: 24px;

  border: 1px solid var(--border-light);

  background: white;

  padding: 20px;

  font-size: 15px;

  line-height: 1.7;

  font-family: inherit;

  color: var(--text-main);

  outline: none;

  transition: 0.25s ease;
}

.review-form textarea:focus {
  border-color: var(--brand-purple);

  box-shadow: 0 0 0 4px rgba(76, 0, 128, 0.08);
}

/* BUTTON */

.review-form button {
  width: fit-content;

  height: 56px;

  padding: 0 34px;

  border: none;

  border-radius: 18px;

  background: linear-gradient(
    135deg,
    var(--brand-purple),
    var(--brand-purple-light)
  );

  color: white;

  font-size: 15px;

  font-weight: 700;

  letter-spacing: 0.2px;

  cursor: pointer;

  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;

  box-shadow: 0 14px 30px rgba(76, 0, 128, 0.18);
}

.review-form button:hover {
  transform: translateY(-2px);

  box-shadow: 0 18px 36px rgba(76, 0, 128, 0.22);
}

/* =========================================
   REVIEW GRID
========================================= */

.reviews-grid {
  display: grid;

  grid-template-columns: repeat(2, 1fr);

  gap: 28px;
}

/* =========================================
   REVIEW CARD
========================================= */

.review-card {
  position: relative;

  overflow: hidden;

  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.96),
    rgba(255, 255, 255, 0.88)
  );

  border-radius: 32px;

  padding: 32px;

  border: 1px solid rgba(255, 255, 255, 0.7);

  backdrop-filter: blur(20px);

  box-shadow: 0 24px 60px rgba(76, 0, 128, 0.05);

  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.review-card:hover {
  transform: translateY(-4px);

  box-shadow: 0 30px 70px rgba(76, 0, 128, 0.1);
}

/* GLOW */

.review-card::before {
  content: "";

  position: absolute;

  top: -100px;

  right: -100px;

  width: 220px;

  height: 220px;

  background: radial-gradient(circle, rgba(168, 85, 247, 0.1), transparent 70%);

  pointer-events: none;
}

/* HEADER */

.review-header {
  display: flex;

  align-items: center;

  gap: 18px;

  margin-bottom: 20px;
}

/* AVATAR */

.avatar {
  width: 58px;

  height: 58px;

  min-width: 58px;

  border-radius: 50%;

  background: linear-gradient(135deg, #f3e8ff, #e9d5ff);

  display: flex;

  align-items: center;

  justify-content: center;

  font-size: 20px;

  font-weight: 800;

  color: var(--brand-purple);

  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.8);
}

/* REVIEW INFO */

.review-info {
  display: flex;

  flex-direction: column;

  gap: 6px;
}

.review-info h4 {
  font-size: 16px;

  font-weight: 700;

  color: var(--text-main);
}

/* REVIEW BODY */

.review-body {
  font-size: 15px;

  line-height: 1.9;

  color: var(--text-muted);
}

/* NO REVIEWS */

.no-reviews {
  font-size: 16px;

  color: var(--text-muted);

  padding: 24px 0;
}

.review-date {
  font-size: 13px;

  color: #9ca3af;
}

/* =========================================
   MOBILE
========================================= */

@media (max-width: 768px) {
  .reviews-grid {
    grid-template-columns: 1fr;
  }

  .review-form {
    padding: 24px;
  }

  .review-card {
    padding: 24px;
  }
}

.info-column {
  position: relative;
  z-index: 50;
}

.ram-options,
.storage-options,
.color-options {
  position: relative;
  z-index: 60;
}

.ram-btn,
.storage-btn,
.color-btn {
  position: relative;
  z-index: 70;
  pointer-events: auto;
}
