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

:root {
  --bg: #f3f1eb;
  --surface: #f7f3e9;
  --surface-2: #fffefb;
  --text: #b99898;
  --text-muted: #7a6c51;
  --accent: #111;
  --accent-hover: #333;
  --border: rgba(0, 0, 0, 0.06);
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.07);
  --radius: 16px;
  --radius-sm: 12px;
}

body.single-product {
  font-family: 'Tajawal', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  direction: rtl;
}

body.single-product a {
  color: inherit;
  text-decoration: none;
}

body.single-product .page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

@media (max-width: 768px) {
  body.single-product .page {
    padding-bottom: calc(118px + env(safe-area-inset-bottom, 0px));
  }
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 28px;
  text-align: center;
}

.breadcrumb a:hover {
  color: var(--text);
}

.breadcrumb-sep {
  opacity: 0.45;
}

.product-layout {
  display: grid;
  grid-template-columns: 42% 1fr;
  gap: 50px;
  align-items: start;
}

@media (max-width: 900px) {
  .product-layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

.gallery {
  position: sticky;
  top: 24px;
}

@media (max-width: 900px) {
  .gallery {
    position: static;
  }
}

.gallery-input,
.variant-chips .size-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.gallery-main {
  position: relative;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid var(--border);
  aspect-ratio: 4 / 3;
}

.gallery-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.gallery-slide:first-child {
  opacity: 1;
  z-index: 1;
  pointer-events: auto;
}

.gallery-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.gallery-thumbs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.thumb {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  background: var(--surface);
  transition: border-color 0.15s ease, opacity 0.15s ease;
  display: block;
}

.thumb:hover {
  opacity: 0.92;
}

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

.product-info {
  padding-top: 4px;
  text-align: center;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
}

.badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.badge--accent {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.product-title {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
  line-height: 1.25;
  text-align: center;
}

.product-sku {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  text-align: center;
}

.product-sku-label {
  margin-inline-end: 6px;
}

.product-sku-value {
  font-weight: 600;
  color: var(--text);
  font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", monospace;
  letter-spacing: 0.02em;
}

.price-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
}

.price-row .woocommerce-Price-amount {
  font: inherit;
}

.price-row ins,
.suggested-card-price ins {
  text-decoration: none;
}

.price-row del,
.suggested-card-price del {
  opacity: 0.55;
  margin-inline-start: 8px;
}

.price-row--bar {
  display: none;
  margin-bottom: 0;
}

@media (max-width: 768px) {
  .price-row--inline {
    display: none;
  }

  .price-row--bar {
    display: flex;
  }
}

.price-current {
  font-size: 1.75rem;
  font-weight: 800;
}

.price-old {
  font-size: 1.1rem;
  color: var(--text-muted);
  text-decoration: line-through;
}

.price-note {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  text-align: center;
}

.product-lead {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 22px;
  max-width: 38em;
  margin-inline: auto;
  text-align: center;
}

.section-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.variants {
  margin-bottom: 22px;
}

.variant-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.chip {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  display: inline-block;
}

.chip:hover {
  border-color: rgba(0, 0, 0, 0.15);
}

.size-input:focus-visible + .chip {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.size-input:checked + .chip {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.qty-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.purchase-bar .quantity {
  margin: 0;
}

.qty-input,
.purchase-bar .quantity .qty {
  width: 88px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  color: var(--text);
  font-family: inherit;
}

.qty-input:focus,
.purchase-bar .quantity .qty:focus {
  outline: none;
  border-color: rgba(0, 0, 0, 0.2);
}

.actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  margin-bottom: 32px;
}

@media (min-width: 480px) {
  .actions {
    flex-direction: row;
  }
}

.purchase-bar {
  margin-bottom: 32px;
}

.purchase-bar-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.purchase-bar-qty-label {
  margin: 0;
}

@media (min-width: 769px) {
  .purchase-bar-inner {
    gap: 20px;
  }

  .purchase-bar-actions {
    width: 100%;
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .purchase-bar {
    position: static;
    margin-bottom: 20px;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    text-align: right;
  }

  .purchase-bar .price-row--bar {
    display: none; /* إخفاء السعر المتكرر هنا لأنه موجود فوق أساساً */
  }

  .purchase-bar-inner {
    flex-direction: row;
    align-items: stretch;
    justify-content: space-between;
    gap: 12px;
    max-width: 100%;
  }

  .purchase-bar-qty {
    margin: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    flex-shrink: 0;
  }

  .purchase-bar .purchase-bar-qty-label {
    font-size: 13px;
    color: var(--text-muted);
  }

  .qty-input,
  .purchase-bar .quantity .qty {
    width: 70px;
    padding: 10px;
    font-size: 16px;
    height: 48px;
    border-radius: 8px;
  }

  .purchase-bar-actions {
    margin: 0;
    flex: 1;
    display: flex;
    align-items: flex-end;
  }

  .purchase-bar-actions .btn {
    padding: 10px;
    font-size: 15px;
    height: 48px;
    width: 100%;
    border-radius: 8px;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 24px;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
  flex: 1;
}

.btn-primary {
  background: #1a1a1a !important;
  color: #fff !important;
}

.btn-primary:hover {
  background: #0d9488 !important;
  box-shadow: 0 6px 15px rgba(255, 107, 129, 0.3);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-ghost {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}

.btn-ghost:hover {
  background: rgba(0, 0, 0, 0.04);
}

.details {
  border-top: 1px solid var(--border);
  padding-top: 8px;
}

.details details {
  border-bottom: 1px solid var(--border);
}

.details summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 0;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.details summary::-webkit-details-marker {
  display: none;
}

.details summary::after {
  content: "+";
  font-size: 1.25rem;
  font-weight: 400;
  opacity: 0.5;
}

.details details[open] summary::after {
  content: "-";
}

.details-body {
  padding: 0 0 18px;
  font-size: 0.95rem;
  color: var(--text-muted);
  text-align: center;
}

.details-body ul {
  margin: 10px 0 0;
  padding-inline-start: 0;
  list-style-position: inside;
}

.details-body li {
  margin-bottom: 6px;
}

.woocommerce-Tabs-panel,
.woocommerce-Reviews,
.commentlist,
.woocommerce-product-attributes {
  text-align: center;
}

.woocommerce-product-attributes {
  width: 100%;
  border-collapse: collapse;
}

.woocommerce-product-attributes th,
.woocommerce-product-attributes td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}

.suggested-section {
  margin-top: 48px;
  padding-top: 36px;
  border-top: 1px solid var(--border);
}

.suggested-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
  text-align: center;
}

.suggested-grid {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 2px 12px;
  margin-inline: -4px;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 4px;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  scrollbar-width: thin;
}

.suggested-grid::-webkit-scrollbar {
  height: 6px;
}

.suggested-grid::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.18);
  border-radius: 999px;
}

/* الحركة */
@keyframes tickerMove {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.suggested-card {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  width: 200px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.suggested-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  animation-play-state: paused !important;
}

/* حركة على الجوال فقط */
@media (max-width: 768px) {
  .suggested-card {
    animation: tickerMove 35s linear infinite;
  }
  
  .suggested-card:active {
    animation-play-state: paused !important;
  }
}

.suggested-card-image {
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--surface);
}

.suggested-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.suggested-card-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  text-align: center;
  align-items: stretch;
  color: var(--text);
}

.suggested-card-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1f1a16;
  line-height: 1.35;
}

.suggested-card-sku {
  font-size: 0.75rem;
  color: #6a6258;
  font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", monospace;
}

.suggested-card-price {
  font-size: 1rem;
  font-weight: 700;
  color: #111;
}

.suggested-card-price .woocommerce-Price-amount {
  color: rgb(160, 35, 35);
}

.suggested-card-image,
.suggested-card-image:hover,
.suggested-card-name:hover {
  color: inherit;
}

.suggested-card-buy {
  margin-top: auto;
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}

.suggested-card-buy:hover {
  background: var(--accent-hover);
}

.suggested-card-buy:active {
  transform: translateY(1px);
}

.suggested-card-buy:focus-visible,
.btn:focus-visible,
.thumb:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ══════════════════════════════════
   FOMO Delivery ETA
══════════════════════════════════ */
.k-fomo-eta {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff8f0;
    border: 1px dashed #fbd38d;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
}
.k-fomo-icon {
    font-size: 20px;
    animation: gentleShake 3s infinite;
}
.k-fomo-text {
    font-size: 14px;
    color: #c05621;
}
.k-fomo-text strong {
    background: #c05621;
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 15px;
    margin: 0 4px;
}

@keyframes gentleShake {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

/* ══════════════════════════════════
   Trust Badges
══════════════════════════════════ */
.k-trust-badges {
    background: #f9f9f9;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid #eee;
    text-align: center;
    margin-bottom: 30px;
}
.k-trust-title {
    font-size: 13px;
    font-weight: 700;
    color: #4CAF50;
    margin-bottom: 12px;
}
.k-trust-icons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}
.k-trust-features {
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 12px;
    color: #555;
    font-weight: 600;
}
.k-trust-features span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ══════════════════════════════════
   Sticky Add To Cart Bar
══════════════════════════════════ */
.k-sticky-cart-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
    z-index: 99;
    transform: translateY(100%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1);
}
.k-sticky-cart-bar.active {
    transform: translateY(0);
    opacity: 1;
}
.k-sticky-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    max-width: 1200px;
    margin: 0 auto;
}
.k-sticky-product-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.k-sticky-product-info img {
    border-radius: 6px;
    border: 1px solid #eee;
}
.k-sticky-title {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a1a;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.k-sticky-price {
    font-size: 16px;
    font-weight: 800;
    color: #0d9488;
}
.k-sticky-actions .btn {
    padding: 12px 30px;
    border-radius: 8px;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .k-sticky-cart-bar {
        bottom: 60px; /* Above mobile nav */
    }
    .k-sticky-title {
        max-width: 120px;
        font-size: 12px;
    }
    .k-sticky-actions .btn {
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* ══════════════════════════════════
   🛍️ Frequently Bought Together
══════════════════════════════════ */
.k-fbt-wrapper {
    background: #fdfdfd;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 24px;
    margin: 30px 0;
}

.k-fbt-title {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 20px;
}

.k-fbt-images {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.k-fbt-img-item {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: opacity 0.2s;
}

.k-fbt-img-item.current {
    border-color: #0d9488;
}

.k-fbt-img-item.disabled {
    opacity: 0.3;
}

.k-fbt-img-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.k-fbt-plus {
    font-size: 24px;
    font-weight: bold;
    color: #888;
}

.k-fbt-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.k-fbt-checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
}

.k-fbt-check {
    width: 18px;
    height: 18px;
    accent-color: #0d9488;
    margin-top: 2px;
    cursor: pointer;
}

.k-fbt-desc {
    display: flex;
    flex-direction: column;
}

.k-fbt-name {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    color: #333;
}

.k-fbt-price {
    font-size: 15px;
    font-weight: 700;
    color: #0d9488;
    margin-top: 4px;
}

.k-fbt-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.k-fbt-total-price-box {
    font-size: 16px;
    font-weight: 600;
}

.k-fbt-total-price {
    font-size: 22px;
    font-weight: 800;
    color: #0d9488;
}

.k-fbt-actions .btn {
    width: 100%;
    padding: 14px;
    border-radius: 8px;
    font-size: 16px;
}

[data-theme="dark"] .k-fbt-wrapper {
    background: #1a1a1a;
    border-color: #333;
}
[data-theme="dark"] .k-fbt-name {
    color: #fff;
}
[data-theme="dark"] .k-fbt-actions {
    border-color: #333;
}

/* ══════════════════════════════════
   Read More Container
══════════════════════════════════ */
.k-read-more-container {
    position: relative;
    transition: max-height 0.3s ease;
}

.k-read-more-content {
    max-height: none;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.k-read-more-fade, .k-read-more-btn {
    display: none !important;
}

@media (max-width: 900px) {
    .k-read-more-content {
        max-height: 120px !important;
    }

    .k-read-more-container.is-expanded .k-read-more-content {
        max-height: 2500px !important;
    }

    .k-read-more-fade {
        display: block !important;
        position: absolute;
        bottom: 40px; /* Space for the button */
        left: 0;
        right: 0;
        height: 60px;
        background: linear-gradient(to bottom, rgba(247, 243, 233, 0), rgba(247, 243, 233, 1));
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    [data-theme="dark"] .k-read-more-fade {
        background: linear-gradient(to bottom, rgba(18, 18, 18, 0), rgba(18, 18, 18, 1));
    }

    .k-read-more-container.is-expanded .k-read-more-fade {
        opacity: 0;
    }

    .k-read-more-btn {
        display: block !important;
        margin: 10px auto 0;
        background: transparent;
        border: 1px solid var(--border);
        color: var(--text);
        padding: 8px 16px;
        border-radius: 20px;
        font-size: 14px;
        cursor: pointer;
        font-weight: 600;
        transition: all 0.2s ease;
    }

    .k-read-more-btn:hover {
        background: var(--surface);
        color: var(--accent);
    }

    [data-theme="dark"] .k-read-more-btn {
        border-color: #333;
        color: #ccc;
    }
    [data-theme="dark"] .k-read-more-btn:hover {
        background: #2a2a2a;
        color: #fff;
    }
}
