* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f7f7f5;
  color: #171717;
}

.product-topbar {
  background: #fff;
  border-bottom: 1px solid #e8e8e5;
  position: sticky;
  top: 0;
  z-index: 50;
}

.product-nav {
  width: min(1320px, calc(100% - 40px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 34px;
}

.product-logo {
  font-size: 25px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #111;
  text-decoration: none;
  margin-left: auto;
}

.product-nav-links {
  display: flex;
  gap: 24px;
}

.product-nav-links a {
  color: #444;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
}

.product-nav-links a:hover {
  color: #000;
}

.product-cart-link {
  display: flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  color: #111;
  font-weight: 800;
  background: #f2f2ef;
  padding: 10px 15px;
  border-radius: 12px;
}

.product-cart-link b {
  min-width: 23px;
  height: 23px;
  padding: 0 6px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  background: #111;
  color: #fff;
  border-radius: 30px;
  font-size: 12px;
}

.product-page {
  width: min(1320px, calc(100% - 40px));
  margin: 0 auto;
  padding-bottom: 80px;
}

.product-breadcrumb {
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: #888;
  font-size: 13px;
}

.product-breadcrumb a {
  color: #666;
  text-decoration: none;
}

.product-breadcrumb a:hover {
  color: #111;
}

.product-loading {
  min-height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 20px;
}

.product-detail-card {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(400px, .92fr);
  gap: 58px;
  background: #fff;
  padding: 42px;
  border-radius: 24px;
  border: 1px solid #ecece8;
}

.product-gallery {
  min-width: 0;
}

.product-main-image {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #f5f5f2;
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* دوائر صغيرة بزاوية الصورة الرئيسية تدل على وجود ألوان/تنويعات
   تانية للمنتج — تمرير الماوس فوق الصورة ينقّلها بين التنويعات
   تلقائياً (راجع public/js/product-card-swatch.js). */
.product-main-image .product-swatch-badges {
  position: absolute;
  bottom: 14px;
  left: 14px;
  z-index: 2;
  display: flex;
  gap: 5px;
}

.product-main-image .product-swatch-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: #fff;
  background-size: cover;
  background-position: center;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18);
  flex-shrink: 0;
}

.product-main-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  cursor: zoom-in;
}

.product-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(20, 18, 15, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
  box-sizing: border-box;
}

.product-lightbox.hidden {
  display: none;
}

.product-lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  cursor: zoom-out;
}

.product-lightbox-close {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

.product-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

body.lightbox-open {
  overflow: hidden;
}

.product-image-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #777;
}

.product-image-placeholder span {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 3px;
}

.product-discount-badge {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  background: #111;
  color: #fff;
  border-radius: 30px;
  padding: 8px 13px;
  font-size: 13px;
  font-weight: 800;
}

.product-information {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 8px 0;
}

.product-title {
  margin: 0;
  font-size: clamp(18px, 2vw, 26px);
  line-height: 1.35;
  letter-spacing: -.3px;
  color: #171717;
}

.product-sku {
  margin-top: 13px;
  font-size: 12px;
  color: #999;
  direction: ltr;
  text-align: right;
}

.product-sku span {
  color: #555;
}

.product-brand {
  margin-top: 6px;
  font-size: 12px;
  color: #999;
}

.product-brand span {
  color: #555;
  font-weight: 600;
}

.product-price-area {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 13px;
  padding: 26px 0 17px;
}

.product-current-price {
  font-size: 31px;
  color: #111;
}

.product-old-price {
  font-size: 17px;
  color: #999;
}

.product-save {
  font-size: 12px;
  font-weight: 800;
  padding: 6px 10px;
  border-radius: 20px;
  background: #eef7ef;
  color: #28723b;
}

.product-stock-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 800;
}

.stock-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.in-stock {
  color: #247238;
}

.in-stock .stock-dot {
  background: #32a852;
}

.out-stock {
  color: #a22;
}

.out-stock .stock-dot {
  background: #c33;
}

.price-alert-box,
.stock-alert-box {
  margin: 14px 0;
}

.stock-alert-box {
  grid-column: 1 / -1;
  margin-top: 14px;
}

.alert-toggle-btn {
  border: 1px dashed #bbb;
  background: #fff;
  color: #55585b;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 9px 16px;
  border-radius: 20px;
  cursor: pointer;
  transition: .2s ease;
}

.alert-toggle-btn:hover {
  border-color: #111214;
  color: #111214;
}

.alert-inline-form {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.alert-inline-form input {
  flex: 1;
  min-width: 0;
  height: 42px;
  padding: 0 14px;
  border: 1px solid #dcdcd8;
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  outline: none;
}

.alert-inline-form input:focus {
  border-color: #111214;
}

.alert-inline-form button {
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  background: #111214;
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.alert-status {
  margin: 8px 0 0;
  font-size: 12px;
}

.alert-status.success {
  color: #247238;
}

.alert-status.error {
  color: #a22;
}

.product-short-description {
  color: #555;
  font-size: 15px;
  line-height: 1.9;
  margin: 24px 0;
  padding-bottom: 23px;
  border-bottom: 1px solid #eee;
  white-space: pre-line;
}

.product-short-description.muted {
  color: #777;
}

.purchase-area {
  margin-top: 2px;
}

.variant-options {
  margin-bottom: 20px;
}

.variant-group {
  margin-bottom: 14px;
}

.variant-group-label {
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 8px;
}

.variant-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.variant-pill {
  min-width: 44px;
  padding: 8px 16px;
  border: 1px solid #dcdcd8;
  border-radius: 10px;
  background: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.variant-pill:hover {
  border-color: #111;
}

.variant-pill.selected {
  background: #111;
  border-color: #111;
  color: #fff;
}

.variant-pill.unavailable {
  opacity: .4;
  text-decoration: line-through;
}

.variant-select-prompt {
  font-size: 13px;
  color: #a15c00;
  margin: 4px 0 0;
}

.variant-select-prompt.variant-out-of-stock {
  color: #b00020;
}

.quantity-label {
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 10px;
}

.quantity-row {
  display: flex;
  align-items: center;
  gap: 15px;
}

.quantity-selector {
  width: 142px;
  height: 47px;
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  border: 1px solid #dcdcd8;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  direction: ltr;
}

.quantity-selector button {
  border: 0;
  background: #f5f5f2;
  cursor: pointer;
  font-size: 21px;
}

.quantity-selector input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  text-align: center;
  font-weight: 800;
  background: #fff;
  -moz-appearance: textfield;
}

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

.available-text {
  font-size: 12px;
  color: #888;
}

.product-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 11px;
  margin-top: 20px;
}

.product-actions-sold-out {
  grid-template-columns: 2fr 1fr;
}

.add-cart-button,
.buy-now-button,
.sold-out-button,
.favorite-detail-button {
  min-height: 54px;
  border-radius: 13px;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
}

.favorite-detail-button {
  background: #fff;
  color: #111;
  border: 1px solid #bbb;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.favorite-detail-button:hover {
  border-color: #111;
}

.favorite-detail-button .fav-icon {
  display: inline-flex;
  line-height: 1;
}

/* أيقونة قلب SVG بدل رمز يونيكود ♡ — يبين بنفس الدقة بكل المتصفحات
   (نفس منطق .fav-icon-svg بـ home.css لبطاقات المنتجات). */
.favorite-detail-button .fav-icon-svg {
  display: block;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.favorite-detail-button.active {
  border-color: #c0143c;
  color: #c0143c;
}

.favorite-detail-button.active .fav-icon-svg {
  fill: currentColor;
}

@media (max-width: 560px) {
  .product-actions {
    grid-template-columns: 1fr 1fr;
  }

  .favorite-detail-button {
    grid-column: 1 / -1;
  }
}

.add-cart-button {
  border: 1px solid #111;
  background: #111;
  color: #fff;
}

.add-cart-button:hover {
  opacity: .9;
}

.add-cart-button.added {
  background: #26763b;
  border-color: #26763b;
}

.buy-now-button {
  background: #fff;
  color: #111;
  border: 1px solid #bbb;
}

.buy-now-button:hover {
  border-color: #111;
}

.add-cart-button:disabled,
.buy-now-button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.add-cart-button:disabled:hover,
.buy-now-button:disabled:hover {
  opacity: .45;
}

.sold-out-button {
  margin-top: 20px;
  width: 100%;
  border: 0;
  background: #eee;
  color: #888;
  cursor: not-allowed;
}

.product-benefits {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.benefit-item {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 10px;
  background: #f7f7f5;
  border-radius: 12px;
}

.benefit-icon {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  font-size: 14px;
}

.benefit-item strong {
  display: block;
  font-size: 11px;
  margin-bottom: 3px;
}

.benefit-item small {
  display: block;
  color: #888;
  font-size: 9px;
  line-height: 1.4;
}

.product-description-section {
  margin-top: 28px;
  background: #fff;
  border: 1px solid #ecece8;
  border-radius: 22px;
  padding: 38px 42px;
}

.description-title {
  margin-bottom: 18px;
}

.description-title span,
.section-eyebrow {
  font-size: 12px;
  color: #888;
  font-weight: 800;
}

.description-title h2 {
  margin: 5px 0 22px;
  font-size: 25px;
}

.description-content {
  color: #555;
  line-height: 2;
  font-size: 15px;
  max-width: 900px;
}

.product-info-table {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 32px;
  border-top: 1px solid #eee;
  border-right: 1px solid #eee;
}

.product-info-table div {
  padding: 18px;
  border-left: 1px solid #eee;
  border-bottom: 1px solid #eee;
}

.product-info-table span {
  display: block;
  color: #888;
  font-size: 11px;
  margin-bottom: 7px;
}

.product-info-table strong {
  font-size: 13px;
}

/* ===== PRODUCT TABS (الوصف / الفيديو / معلومات إضافية) ===== */

.product-tabs-nav {
  display: flex;
  align-items: center;
  gap: 26px;
  flex-wrap: wrap;
  border-bottom: 1px solid #eee;
  margin: 6px 0 26px;
}

.product-tab-btn {
  appearance: none;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0 0 14px;
  font-size: 14px;
  font-weight: 800;
  color: #999;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease;
}

.product-tab-btn:hover {
  color: #111;
}

.product-tab-btn.active {
  color: #111;
  border-bottom-color: #111;
}

.product-tab-panel {
  display: none;
}

.product-tab-panel.active {
  display: block;
}

.product-tab-panel .product-video-wrap {
  margin-top: 0;
  max-width: 620px;
}

.product-additional-info {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 28px;
}

.product-additional-info li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: #faf9f6;
  border: 1px solid #eee;
  border-radius: 14px;
}

.product-additional-info .info-icon {
  font-size: 17px;
  line-height: 1;
}

.product-additional-info .info-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.product-additional-info .info-text strong {
  font-size: 11px;
  color: #888;
  font-weight: 800;
}

.product-additional-info .info-text span {
  font-size: 14px;
  color: #171717;
  font-weight: 600;
}

@media (max-width: 640px) {
  .product-additional-info {
    grid-template-columns: 1fr;
  }
}

.related-section {
  margin-top: 55px;
}

.related-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 22px;
}

.related-heading h2 {
  margin: 5px 0 0;
  font-size: 27px;
}

.related-heading > a {
  color: #555;
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
}

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

.related-product-card {
  min-width: 0;
  display: block;
  background: #fff;
  border: 1px solid #ecece8;
  border-radius: 17px;
  overflow: hidden;
  color: #111;
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease;
}

.related-product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(0,0,0,.06);
}

.related-product-image {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #f4f4f1;
  overflow: hidden;
}

.related-product-image .product-swatch-badges {
  position: absolute;
  bottom: 8px;
  left: 8px;
  z-index: 2;
  display: flex;
  gap: 4px;
}

.related-product-image .product-swatch-dot {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background-color: #fff;
  background-size: cover;
  background-position: center;
  border: 1.5px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18);
  flex-shrink: 0;
}

.related-product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.related-no-image {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: #aaa;
}

.related-product-body {
  padding: 16px;
}

.related-product-body > span {
  color: #999;
  font-size: 11px;
}

.related-product-body h3 {
  margin: 7px 0 17px;
  font-size: 14px;
  line-height: 1.6;
  min-height: 44px;
}

.related-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.related-bottom strong {
  font-size: 16px;
}

.related-bottom small {
  color: #5d8065;
}

.product-error {
  min-height: 430px;
  background: #fff;
  border-radius: 20px;
  border: 1px solid #eee;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 30px;
}

.product-error h2 {
  margin: 0 0 10px;
}

.product-error p {
  color: #777;
}

.product-error a {
  margin-top: 10px;
  background: #111;
  color: #fff;
  text-decoration: none;
  padding: 12px 20px;
  border-radius: 10px;
}

@media (max-width: 1000px) {
  .product-detail-card {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    padding: 28px;
  }

  .product-benefits {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  .product-nav {
    width: min(100% - 24px, 1320px);
    min-height: 64px;
  }

  .product-nav-links {
    display: none;
  }

  .product-logo {
    margin-left: auto;
  }

  .product-page {
    width: min(100% - 24px, 1320px);
  }

  .product-breadcrumb {
    min-height: 52px;
  }

  .product-detail-card {
    grid-template-columns: 1fr;
    gap: 25px;
    padding: 14px;
    border-radius: 17px;
  }

  .product-information {
    padding: 5px 5px 15px;
  }

  .product-title {
    font-size: 19px;
  }

  .product-current-price {
    font-size: 27px;
  }

  .product-actions {
    grid-template-columns: 1fr;
  }

  .product-description-section {
    padding: 25px 20px;
    border-radius: 17px;
  }

  .product-info-table {
    grid-template-columns: 1fr;
  }

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

  .related-heading {
    align-items: center;
  }
}

@media (max-width: 430px) {
  .product-cart-link > span:nth-child(2) {
    display: none;
  }

  .product-main-image {
    border-radius: 13px;
  }

  .related-product-body {
    padding: 12px;
  }

  .related-product-body h3 {
    font-size: 12px;
  }
}


/* ===== PRODUCT THUMBNAILS ===== */

.product-thumbnails {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  overflow-x: auto;
  padding: 2px 2px 6px;
}

.product-thumbnail {
  flex: 0 0 82px;
  width: 82px;
  height: 82px;
  border: 2px solid transparent;
  border-radius: 11px;
  padding: 4px;
  background: #fff;
  cursor: pointer;
  overflow: hidden;
}

.product-thumbnail img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 7px;
}

.product-thumbnail.active {
  border-color: #111;
}

.product-thumbnail:hover {
  border-color: #777;
}

@media (max-width: 760px) {
  .product-thumbnail {
    flex-basis: 68px;
    width: 68px;
    height: 68px;
  }
}


/* ===== PRODUCT VIDEO (مركز الفيديو) ===== */

.product-video-wrap {
  margin-top: 14px;
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #111;
  border-radius: 16px;
  overflow: hidden;
}

.product-video-wrap iframe,
.product-video-wrap video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
