/* CSS Reset & Variables (مطابقة تماماً للصفحة الرئيسية) */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Montserrat", sans-serif;
}

:root {
  --primary-bg: #0a0a0a;
  --accent-yellow: #6a6a6a;
  --whatsapp-green: #10b981;
  --text-gray: #a0a0a0;
  --light-bg: #f8f9fa;
  --border-color: #e5e7eb;
}

body {
  background-color: #ffffff;
  color: #111111;
}

/* --- 1. HEADER (matching the homepage layout) --- */
header {
  background-color: var(--primary-bg);
  padding: 14px 5%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid #262626;
  position: sticky;
  top: 0;
  z-index: 50;
  direction: ltr;
}

.logo {
  display: flex;
  align-items: center;
  color: #ffffff;
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-decoration: none;
}

.logo i {
  font-size: 1.8rem;
  margin-right: 10px;
}

.header-left {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}

.header-icon-box {
  width: 42px;
  height: 42px;
  border: 1px solid #2e2e2e;
  background-color: #141414;
  color: #ffffff;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.25s ease;
}

.header-icon-box:hover {
  background-color: #ffffff;
  color: #0a0a0a;
  border-color: #ffffff;
}

.product-menu-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1090;
  background: rgba(0, 0, 0, 0.65);
}

.product-menu-backdrop.open {
  display: block;
}

.product-menu-panel {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1100;
  width: min(320px, 85vw);
  height: 100vh;
  padding: 22px;
  background: #0f0f0f;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

.product-menu-panel.open {
  transform: translateX(0);
}

.product-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid #292929;
}

.product-menu-header h2 {
  font-size: 1.1rem;
  letter-spacing: 1px;
}

.product-menu-close {
  border: 0;
  background: transparent;
  color: #ffffff;
  font-size: 1.6rem;
  cursor: pointer;
}

.product-menu-nav {
  margin-top: 16px;
}

.product-menu-nav ul {
  display: flex;
  flex-direction: column;
  gap: 6px;
  list-style: none;
}

.product-menu-nav a {
  display: block;
  padding: 12px;
  border-radius: 6px;
  color: #d1d5db;
  text-decoration: none;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.product-menu-nav a:hover,
.product-menu-nav a:focus-visible {
  background: #262626;
  color: #ffffff;
}

.header-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

.brand-logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ffffff;
  text-decoration: none;
}

.brand-logo-mark {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  object-fit: contain;
  filter: invert(1);
  mix-blend-mode: screen;
}

.brand-logo-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1;
}

.brand-logo-title {
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  background: linear-gradient(180deg, #ffffff 30%, #9ca3af 100%);
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-logo-sub {
  margin-top: 3px;
  color: #9ca3af;
  font-size: 0.55rem;
  letter-spacing: 2.5px;
  text-transform: uppercase;
}

.header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.cart-icon-btn {
  position: relative;
  width: 44px;
  height: 42px;
  border: 1px solid #2e2e2e;
  background-color: #ffffff;
  color: #0a0a0a;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  text-decoration: none;
  transition:
    transform 0.2s,
    background-color 0.2s;
}

.cart-icon-btn:hover {
  background-color: #e5e7eb;
  transform: translateY(-1px);
}

.cart-badge-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 2px solid var(--primary-bg);
  border-radius: 999px;
  background-color: var(--whatsapp-green);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
}

/* --- 2. PRODUCT DETAIL SECTION --- */
.product-container {
  max-width: 1200px;
  margin: 50px auto 80px;
  padding: 0 5%;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 50px;
}

/* الجزء الأيسر: معرض الصور */
.product-gallery {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.main-image {
  position: relative;
  overflow: hidden;
  background-color: var(--light-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 3;
}

.main-image-zoom {
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-in;
}

.main-image img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  object-position: 50% center;
  transition: object-position 0.45s ease;
}

.gallery-arrow {
  position: absolute;
  top: 50%;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(17, 17, 17, 0.12);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #111111;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  transform: translateY(-50%);
  transition:
    background-color 0.2s ease,
    box-shadow 0.2s ease;
}

.gallery-arrow:hover {
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
}

.gallery-arrow:focus-visible,
.thumb:focus-visible {
  outline: 2px solid #111111;
  outline-offset: 3px;
}

.gallery-arrow-previous {
  left: 22px;
}

.gallery-arrow-next {
  right: 22px;
}

.thumbnails {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.thumb {
  padding: 0;
  width: 96px;
  max-width: 22vw;
  flex: 0 1 96px;
  aspect-ratio: 1;
  overflow: hidden;
  background-color: var(--light-bg);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
  transition:
    border-color 0.2s,
    transform 0.2s,
    box-shadow 0.2s;
}

.thumb:hover,
.thumb.active {
  border: 2px solid #111111;
}

.thumb.active {
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

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

.image-zoom-modal[hidden] {
  display: none;
}

.image-zoom-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  padding: 24px;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-zoom-modal img {
  max-width: min(94vw, 1100px);
  max-height: 88vh;
  object-fit: contain;
}

.image-zoom-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #ffffff;
  font-size: 1.5rem;
  cursor: pointer;
}

/* الجزء الأيمن: تفاصيل المنتج */
.product-details {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.product-brand {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #666666;
  margin-bottom: 5px;
  font-weight: 600;
}

.product-title {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.product-colorway {
  font-size: 1rem;
  color: #555555;
  margin-bottom: 20px;
}

.product-price {
  font-size: 1.8rem;
  font-weight: 800;
  color: #111111;
  margin-bottom: 25px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 20px;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
}

.product-price .original-price {
  color: #777777;
  font-size: 1rem;
  font-weight: 600;
}

.product-price .discount-badge {
  padding: 5px 8px;
  border-radius: 4px;
  background-color: #fee2e2;
  color: #b91c1c;
  font-family: "Cairo", sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
}

/* اختيار المقاسات */
.size-section {
  margin-bottom: 30px;
}

.size-header {
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
}

.size-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.size-box {
  border: 1px solid var(--border-color);
  padding: 12px 0;
  text-align: center;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  background-color: #ffffff;
  color: #111111;
}

.size-box:hover {
  border-color: #111111;
}

.size-box.selected {
  background-color: #111111;
  color: #ffffff;
  border-color: #111111;
}

/* زر الواتساب الكبير */
.btn-order-large {
  background-color: var(--whatsapp-green);
  color: #ffffff;
  padding: 16px;
  border: 0;
  border-radius: 8px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 700;
  font-family: "Cairo", sans-serif;
  transition: background-color 0.3s;
  cursor: pointer;
}

.btn-order-large:hover {
  background-color: #059669;
}

.product-actions {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 8px;
  margin-top: 10px;
}

.btn-add-cart {
  padding: 11px 10px;
  border: 0;
  border-radius: 6px;
  background-color: #0a0a0a;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-add-cart:hover {
  background-color: #333333;
}

.cart-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1090;
  background: rgba(0, 0, 0, 0.65);
}

.cart-backdrop.open {
  display: block;
}

.product-cart-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 1100;
  width: min(400px, 90vw);
  height: 100vh;
  padding: 22px;
  background: #0f0f0f;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.product-cart-panel.open {
  transform: translateX(0);
}

.cart-panel-header,
.product-cart-line,
.cart-qty-controls,
.cart-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cart-panel-header {
  padding-bottom: 16px;
  border-bottom: 1px solid #292929;
}

.cart-panel-header h2 {
  font-size: 1.1rem;
}

.cart-close,
.cart-qty-controls button {
  border: 0;
  color: #ffffff;
  cursor: pointer;
}

.cart-close {
  background: transparent;
  font-size: 1.6rem;
}

.cart-empty {
  margin: auto 0;
  color: #a0a0a0;
  text-align: center;
}

.cart-empty[hidden],
.product-cart-line[hidden] {
  display: none;
}

.product-cart-line {
  gap: 12px;
  padding: 20px 0;
  border-bottom: 1px solid #292929;
}

.product-cart-line h3 {
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.product-cart-line p {
  color: #a0a0a0;
  font-size: 0.85rem;
}

.cart-qty-controls {
  gap: 8px;
}

.cart-qty-controls button {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  background: #262626;
}

.cart-panel-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid #292929;
}

.cart-total-row {
  margin-bottom: 14px;
  font-weight: 700;
}

.cart-checkout,
.order-submit {
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: var(--whatsapp-green);
  color: #ffffff;
  padding: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

.cart-checkout:hover,
.order-submit:hover {
  background: #059669;
}

.cart-checkout:disabled {
  background: #555555;
  cursor: not-allowed;
}

.order-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1200;
  padding: 16px;
  background: rgba(0, 0, 0, 0.7);
  align-items: center;
  justify-content: center;
  overflow-y: auto;
}

.order-modal.open {
  display: flex;
}

.order-modal-box {
  position: relative;
  width: 100%;
  max-width: 460px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 22px 20px;
  border-radius: 10px;
  background: #ffffff;
  color: #111111;
}

.order-modal-box h2 {
  margin-bottom: 4px;
  font-size: 1.15rem;
}

.order-sub {
  margin-bottom: 14px;
  color: #666666;
  font-size: 0.82rem;
}

.order-close {
  position: absolute;
  top: 12px;
  right: 14px;
  border: 0;
  background: none;
  color: #111111;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.order-summary {
  margin-bottom: 16px;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--light-bg);
  font-size: 0.82rem;
}

.order-summary div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 3px 0;
}

.order-summary .order-total {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed #cfcfcf;
  font-weight: 700;
}

.order-field {
  margin-bottom: 12px;
}

.order-field label {
  display: block;
  margin-bottom: 5px;
  font-size: 0.82rem;
  font-weight: 700;
}

.order-field input,
.order-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  outline: none;
  background: #ffffff;
  color: #111111;
  font-size: 0.9rem;
}

.order-field input:focus,
.order-field textarea:focus {
  border-color: #111111;
}

.order-field textarea {
  min-height: 60px;
  resize: vertical;
}

.order-field.invalid input,
.order-field.invalid textarea {
  border-color: #ef4444;
}

.order-error {
  display: none;
  margin-top: 4px;
  color: #ef4444;
  font-size: 0.75rem;
}

.order-field.invalid .order-error {
  display: block;
}

.order-submit {
  margin-top: 6px;
}

/* تفاصيل إضافية */
.product-description {
  margin-top: 30px;
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
}

.product-description h4 {
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.product-description p {
  font-size: 0.9rem;
  color: #666666;
  line-height: 1.75;
  margin-bottom: 12px;
}

.product-description h5 {
  margin: 16px 0 8px;
  font-size: 0.9rem;
}

.product-description ul {
  margin: 0 0 14px;
  padding-inline-start: 20px;
  color: #666666;
}

.product-description li {
  margin-bottom: 8px;
  font-size: 0.9rem;
  line-height: 1.6;
}

/* --- 3. FOOTER (نفس الفوتر الأساسي) --- */
footer {
  background-color: var(--primary-bg);
  color: #ffffff;
  padding: 60px 5% 40px;
  display: grid;
  grid-template-columns: minmax(200px, 1.5fr) repeat(3, minmax(130px, 1fr));
  gap: 40px;
  border-top: 1px solid #222222;
}

.footer-brand .logo {
  margin-bottom: 15px;
}

.footer-brand p {
  color: var(--text-gray);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-top: 15px;
}

.footer-links h4,
.footer-contact h4 {
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.footer-links ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-links ul li a {
  color: var(--text-gray);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.3s;
}

.footer-links ul li a:hover {
  color: #ffffff;
}

.footer-contact .contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 15px;
  color: var(--text-gray);
  font-size: 0.9rem;
}

.footer-contact .contact-item i {
  font-size: 1.1rem;
  color: #ffffff;
}

.footer-contact .contact-item a {
  color: var(--text-gray);
  text-decoration: none;
  transition: color 0.3s;
}

.footer-contact .contact-item a:hover {
  color: #ffffff;
}

.footer-bottom {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
  padding-top: 20px;
  border-top: 1px solid #262626;
  color: #777777;
  font-size: 0.78rem;
}

.footer-bottom a {
  color: #aaaaaa;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-bottom a:hover {
  color: #ffffff;
}

/* Responsive Design */
@media (max-width: 1024px) {
  footer {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 850px) {
  .product-container {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .product-details {
    justify-content: flex-start;
  }
}

@media (max-width: 600px) {
  header {
    padding: 12px 4%;
  }

  .brand-logo-title {
    font-size: 1.1rem;
    letter-spacing: 1.5px;
  }

  .brand-logo-sub {
    font-size: 0.48rem;
    letter-spacing: 1.5px;
  }
  .brand-logo-mark {
    width: 42px;
    height: 42px;
  }

  .header-icon-box,
  .cart-icon-btn {
    width: 38px;
    height: 38px;
  }

  .product-container {
    margin-top: 30px;
  }

  .product-title {
    font-size: 1.8rem;
  }

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

  .gallery-arrow {
    width: 36px;
    height: 36px;
  }

  .gallery-arrow-previous {
    left: 12px;
  }

  .gallery-arrow-next {
    right: 12px;
  }

  .thumb {
    width: 76px;
    flex-basis: 76px;
  }
}
