:root{
  --paper:#d2c6ba;
  --panel:#f2ede4;
  --brand-dark:#786255;
  --ink:#222;
  --muted:#6f655c;
  --line:#ddd;
  --brand:#6b4d3d;
  --danger:#e83262;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: Arial, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

button, input, textarea {
  font: inherit;
}

.site-header {
  position: relative;
  top: 0;
  z-index: 20;
  background:  #D2C4B7;
  border-top: 0;
  border-bottom: 0;
  backdrop-filter: none;
}

.site-header.compact .main-nav { min-height: 78px; }

.top-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 38px;
  padding: 0 40px;
  background: #D2C4B7;
  font-size: 13px;
}

.top-strip-meta {
  display: flex;
  gap: 15px;
  align-items: center;
  
  /* Force it 150px to the right regardless of flexbox layout */
  transform: translateX(150px); 
}

.top-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #222;
  cursor: pointer;
  font-weight: 500;
}

.top-strip-links {
  display: flex;
  gap: 20px;
  direction: rtl;
  
  /* Force it 150px to the left */
  transform: translateX(-100px);
}


.top-strip-meta {
  display: flex;
  gap: 15px;
  align-items: center;
  
  /* Force it 150px to the right regardless of flexbox layout */
  transform: translateX(100px); 
}

.top-strip-links a {
  color: #171514;
  font-weight: 500;
  padding: 4px 8px;
}

.top-strip-links a:hover {
  text-decoration: underline;
}

.main-nav {
    background: #6d5548;
    padding: 10px 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
        direction: ltr;
}


.header-search-wrapper {
    flex: 1;
    max-width: 900px;
}

.brand-band {
  min-height: 60px;
  width: 100%;
  padding: 0 40px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  background:#C6B9AE;
}

.brand {
  /* Keep your original structural positioning alignment */
  margin-inline-start: 0;
  margin-inline-end: auto; 
  
  /* Shift the logo slightly left by pushing it away from the right side */
  margin-right: 100px; 
}

.brand-logo {
  height: 50px;
  width: auto;
}

.service-links {
  order: 1; /* Keep or remove based on your previous cleanup */
  display: flex;
  gap: 30px;
  direction: rtl; /* Adds correct Right-to-Left arrangement to the row */
  margin-left: 100px; 
}

.service-links a {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: right;
  direction: rtl;
}
.service-text span {
  display: block;
  font-size: 14px;
  font-weight: bold;
  color: #222;
}

.service-text small {
  display: block;
  font-size: 10px;
  color: #777;
}

.service-links small {
  display: block;
  margin-top: 4px;
  color: #6f655c;
  font-size: 12px;
}

.service-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.service-icon.red { color: #c44732; border-color: rgba(196,71,50,0.2); }
.service-icon.green { color: #0aa026; border-color: rgba(10,160,38,0.2); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.nav-links a,
.top-strip a {
  padding: 4px 0;
  border-radius: 0;
}

.nav-links a:hover,
.top-strip a:hover {
  background: transparent;
  color: var(--brand-dark);
}

.cart-button {
  position: relative;
  background: #fcd74d !important;
  border: none;
  border-radius: 4px;
  height: 30px;
  min-width: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-button strong {
  position: absolute;
  top: 2px;
  right: 2px;
  background: #e83262;
  color: #fff;
  font-size: 9px;
  min-width: 14px;
  height: 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-icon {
  color: #222;
  display: flex;
  align-items: center;
}
.cart-icon svg {
    width: 16px;
    height: 16px;
}

/* زر حسابي بجانب السلة */
.account-link {
  order: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 11px;
  gap: 2px;
  cursor: pointer;
}

.account-icon {
  display: flex;
  align-items: center;
  color: #fff;
}

.account-link small {
  font-size: 11px;
  color: #fff;
  margin: 0;
}


.button {
  border: 0;
  border-radius: 7px;
  min-height: 44px;
  padding: 11px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 700;
}

.button.primary {
  background-color: var(--brand);
  color: #fff;
  padding: 16px 24px;
  border: none;
  border-radius: 6px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  text-align: center;
  transition: background-color 0.2s ease;
  width: 100%;
}

.button.primary:hover {
  background-color: var(--brand-dark);
}

.button.ghost {
  background: transparent;
  color: var(--brand-dark);
  border: 1px solid var(--brand);
}

.button.subtle {
  background: #f1e7de;
  color: var(--brand-dark);
}

.button.danger {
  background: #f8e5e8;
  color: var(--danger);
}

.button.full { width: 100%; }

.info-band,
.content-section {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 24px;
}

h1, h2, p { margin-top: 0; }

.content-section h2,
.info-band h2 {
  margin-bottom: 6px;
  font-size: 30px;
}

.content-section p,
.info-band p {
  color: var(--muted);
  margin-bottom: 0;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #587184;
}
.main-nav { padding: 2px 40px; min-height: 42px; }

.header-search {
  background: #fff;
  height: 28px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding: 0 15px;
  gap: 10px;
  width: 100%;
}

.search-icon {
  color: #888;
  display: flex;
  align-items: center;
}

.header-search span {
  font-size: 25px;
  line-height: 1;
}

input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 12px 13px;
}

.header-search input {
  flex: 1;
  border: 0;
  height: 100%;
  font-size: 11px;
  color: #333;
  text-align: right;
  padding: 0;
}
.search-filter-dropdown {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #666;
  border-inline-start: 1px solid #eee;
  padding-inline-start: 12px;
  cursor: pointer;
  font-size: 14px;
  white-space: nowrap;
}

.header-search input:focus {
  outline: none;
}

/* Payment card logos (Visa / Mastercard) */
.card-logos-container {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.card-logo {
  display: block;
  height: 24px;
  width: auto;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.08));
  transition: transform 0.2s ease, filter 0.2s ease;
  border-radius: 2px;
}

.card-logo:hover {
  transform: scale(1.05);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.12));
}

/* Payment info styling */
.payment-info {
  background: #f0f7ff;
  border: 1px solid #b8d4f0;
  border-radius: 8px;
  padding: 16px 18px;
  font-size: 14px;
  color: #1a3a5c;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.payment-info span {
  flex: 1;
}

/* Visa icon row in payment verify */
.visa-icon-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.visa-icon-row span {
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
}

/* Responsive adjustments */
@media (max-width: 980px) {
  .card-logo {
    height: 22px;
  }
  .card-logos-container {
    gap: 9px;
  }
}

@media (max-width: 768px) {
  .card-logo {
    height: 20px;
  }
  .card-logos-container {
    gap: 8px;
  }
  .payment-info {
    padding: 14px 16px;
  }
}

@media (max-width: 640px) {
  .card-logo {
    height: 20px;
  }
  .card-logos-container {
    gap: 8px;
    justify-content: center;
    width: 100%;
  }
  .payment-info {
    flex-direction: column;
    gap: 12px;
  }
  .payment-info span {
    text-align: center;
  }
  .visa-icon-row {
    width: 100%;
    align-items: center;
  }
  .visa-icon-row .card-logos-container {
    justify-content: center;
  }
  .visa-icon-row span {
    text-align: center;
  }
  
  /* Checkout page - keep icons bigger */
  body[data-page="checkout"] .card-logo {
    height: 32px;
  }
  body[data-page="checkout"] .card-logos-container {
    gap: 10px;
  }
  
  /* OTP page - keep icons bigger */
  body[data-page="payment-verify"] .card-logo {
    height: 32px;
  }
  body[data-page="payment-verify"] .card-logos-container {
    gap: 10px;
  }
}

/* OTP step card logos */
.otp-card-logos-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: #fafafa;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 14px;
}

.otp-card-logos-section .card-logos-container {
  justify-content: center;
}

@media (max-width: 640px) {
  .otp-card-logos-section {
    padding: 10px;
    gap: 6px;
    margin-bottom: 12px;
  }
}

textarea { resize: vertical; }

.product-grid {
  width: min(1280px, calc(100% - 32px));
  margin: 10px auto 48px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.product-card {
  background: #f2ede4;
  border-radius: 12px;
  overflow: hidden;
}

.product-image {
  position: relative;
  border: none;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
  aspect-ratio: 2 / 3;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-body {
  text-align: center;
  padding: 16px 14px 22px;
  display: grid;
  gap: 8px;
}

.product-title {
  font-size: 17px;
  line-height: 1.35;
  margin: 0;
  color: #6e321f;
  font-weight: 400;
}

.product-title-link {
  text-decoration: none;
  color: inherit;
}
.product-title-link:hover .product-title {
  color: var(--brand);
  transition: color .18s;
}

.price {
  font-size: 20px;
  font-weight: 400;
  color: #1e2327;
}

.badge {
  position: absolute;
  top: 12px;
  inset-inline-start: 12px;
  background: #f4d54d;
  color: #222;
  border-radius: 4px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
  z-index: 1;
}

.badge.soldout {
  background: var(--danger);
  color: #fff;
}

.product-footer {
  margin-top: auto;
  display: grid;
  gap: 0;
  justify-items: center;
}

.qty-row {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 8px;
}

.product-footer .qty-row,
.product-footer .button.subtle {
  display: none;
}

.quick-add {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: rgba(35, 35, 35, .88);
  color: #fff;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  font-size: 21px;
  opacity: 0;
  cursor: pointer;
  transition: opacity .18s ease;
}

.product-card:hover .quick-add,
.quick-add:focus-visible {
  opacity: 1;
}

.info-band,
.content-section,
.order-card,
.checkout-form,
.admin-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  box-shadow: 0 8px 28px rgba(52, 35, 25, .06);
}

.category-section {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto 48px;
  text-align: center;
  background: transparent;
  padding: 0;
}

.category-section h2 {
  display: inline-block;
  margin: 0 0 28px;
  font-size: 15px;
  color: #1d2931;
  border-bottom: 3px solid #49a8dc;
  padding-bottom: 7px;
  font-weight: 400;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.category-card {
  position: relative;
  height: 165px;
  border: 1px solid rgba(122, 99, 82, .36);
  border-radius: 6px;
  overflow: hidden;
  background: #a89482;
  display: block;
}

.category-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.category-card span {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  background: rgba(245, 245, 245, .9);
  color: #23313a;
  padding: 7px 12px;
  border-radius: 5px;
  font-size: 15px;
  white-space: nowrap;
}

.trust-block {
  width: min(480px, calc(100% - 32px));
  margin: 10px auto 42px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 18px;
  text-align: right;
}

.trust-logo {
  width: 145px;
  height: auto;
}

.trust-block h2 {
  font-size: 18px;
  margin: 0 0 4px;
}

.trust-block p {
  margin: 0;
  color: #6d625a;
}

.info-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-footer {
  width: 100%;
  min-height: 78px;
  margin: 0;
  color: #fff;
  background: #303030;
  display: grid;
  place-items: center;
  gap: 6px;
  border-top: 0;
  padding: 15px 20px;
  font-size: 13px;
}

.payment-icons {
  display: flex;
  justify-content: center;
  gap: 6px;
  direction: ltr;
}

.payment-icons span {
  background: #fff;
  color: #1d2931;
  border-radius: 2px;
  min-width: 44px;
  padding: 5px 6px;
  font-size: 10px;
  font-weight: 800;
  text-align: center;
}

.cart-drawer {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(25, 18, 14, .42);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}

.cart-drawer.open {
  opacity: 1;
  pointer-events: auto;
}

.cart-panel {
  width: min(420px, 92vw);
  height: 100%;
  margin-right: auto;
  background: var(--panel);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transform: translateX(-100%);
  transition: transform .2s ease;
}

.cart-drawer.open .cart-panel { transform: translateX(0); }

.cart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.icon-button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 7px;
  cursor: pointer;
  font-size: 26px;
  line-height: 1;
}

.cart-items,
.checkout-items {
  display: grid;
  gap: 12px;
}

.cart-items {
  overflow: auto;
  flex: 1;
}

.cart-line {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.cart-line img {
  width: 64px;
  height: 82px;
  object-fit: cover;
  border-radius: 6px;
  background: #eadfd4;
}

.cart-line h3 {
  margin: 0 0 4px;
  font-size: 15px;
  line-height: 1.3;
}

.cart-line p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.remove-line {
  border: 0;
  background: #f8e5e8;
  color: var(--danger);
  border-radius: 6px;
  padding: 8px 10px;
  cursor: pointer;
}

.cart-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  font-size: 18px;
}

.checkout-layout {
  width: min(1180px, calc(100% - 32px));
  margin: 30px auto;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 20px;
  align-items: start;
}

.payment-intro {
  color: var(--muted, #666);
  margin-bottom: 16px;
  line-height: 1.6;
}

.payment-status {
  padding: 14px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
}

.payment-status.success {
  background: #ecfdf5;
  border-color: #6ee7b7;
  color: #065f46;
}

.payment-bank-card p {
  margin-bottom: 8px;
}

.otp-hint {
  color: var(--muted, #666);
  font-size: 0.95rem;
  margin-bottom: 12px;
}

form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  font-weight: 700;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

legend {
  padding: 0 8px;
  font-weight: 800;
}

.radio-row,
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.radio-row input,
.checkbox-row input {
  width: auto;
}

.admin-layout {
  width: min(1180px, calc(100% - 32px));
  margin: 30px auto;
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
  align-items: start;
}

.admin-panel.wide {
  grid-column: 1 / -1;
}

.admin-list,
.orders-list {
  display: grid;
  gap: 12px;
}

.admin-item,
.order-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fffdfb;
  display: grid;
  gap: 8px;
}

.admin-item-head,
.order-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-item-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.empty {
  color: var(--muted);
  background: #fffdfb;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
}

.toast {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 80;
  max-width: min(380px, calc(100% - 36px));
  background: var(--brand-dark);
  color: #fff;
  border-radius: 8px;
  padding: 12px 16px;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: .2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .checkout-layout,
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .brand-band {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 14px 0;
  }

  .brand,
  .service-links {
    grid-column: auto;
  }

  .service-links {
    justify-content: center;
    flex-wrap: wrap;
    order: 2;
  }

  .category-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}


/* =========================================
   PRODUCT DETAIL PAGE (PDP)
   ========================================= */

/* Make product images clickable */
.product-image a {
  display: block;
  width: 100%;
  height: 100%;
}
.product-image a img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Breadcrumb */
.pdp-breadcrumb {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 14px 0 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
  direction: rtl;
}
.pdp-breadcrumb a {
  color: var(--brand);
  text-decoration: none;
}
.pdp-breadcrumb a:hover {
  text-decoration: underline;
}

/* Title Banner */
.pdp-title-banner {
  width: 100%;
  background: var(--brand-dark);
  padding: 28px 40px;
  margin-bottom: 0;
  text-align: center;
}
.pdp-title-banner h1 {
  margin: 0;
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* Layout */
.pdp-layout {
  width: min(1280px, calc(100% - 32px));
  margin: 30px auto 40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
  direction: rtl; 
}

/* Gallery */
.pdp-gallery {
  order: 1; /* Forces gallery to the Right side in RTL */
  position: sticky;
  top: 20px;
}
.pdp-badge-wrap {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: #eadfd4;
}
.pdp-main-image {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  display: block;
  transition: opacity .3s ease;
}
.pdp-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--danger);
  color: #fff;
  padding: 6px 16px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 700;
  z-index: 2;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  letter-spacing: 2px;
}
.pdp-thumbnails {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.pdp-thumb {
  width: 72px;
  height: 90px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color .2s, transform .2s;
  flex-shrink: 0;
}
.pdp-thumb:hover,
.pdp-thumb.active {
  border-color: var(--brand);
  transform: scale(1.05);
}
.pdp-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Info Panel */
.pdp-info {
  order: 2; /* Forces info to the Left side in RTL */
  direction: rtl;
  text-align: right;
}
.pdp-section-heading {
  font-size: 20px;
  font-weight: 700;
  color: #222;
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--brand);
  display: inline-block;
}
.pdp-description {
  font-size: 16px;
  line-height: 1.8;
  color: var(--muted);
}

.pdp-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 15px;
}
.pdp-meta-label {
  color: var(--muted);
}
.pdp-meta-value {
  font-weight: 600;
  color: #222;
}

/* Price */
.pdp-price {
  font-size: 24px;
  font-weight: 700;
  color: var(--brand-dark);
}

/* Fields */
.pdp-field {
  margin-bottom: 18px;
}
.pdp-field-label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #222;
  margin-bottom: 8px;
}
.pdp-notes-input {
  width: 100%;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 14px;
  color: #555;
  background: #fff;
  text-align: right;
}
.pdp-notes-input::placeholder {
  color: #aaa;
}

/* Size Buttons */
.pdp-sizes {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  direction: ltr;
}
.pdp-size-btn {
  min-width: 44px;
  height: 38px;
  border: 1px solid #bbb;
  border-radius: 4px;
  background: #fff;
  color: #333;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .18s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
}
.pdp-size-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
}
.pdp-size-btn.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
/* Color Select */
.pdp-color-select {
  position: relative;
  max-width: 320px;
}
.pdp-color-select select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 10px 40px 10px 14px;
  font-size: 14px;
  color: #555;
  background: #fff;
  cursor: pointer;
  text-align: right;
  direction: rtl;
}
.pdp-select-arrow {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: #888;
  font-size: 14px;
}

/* Actions */
.pdp-actions {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: auto;
}
.pdp-qty-wrap {
  flex-shrink: 0;
}
.pdp-qty-input {
  width: 60px;
  height: 100%;
  min-height: 50px;
  border: 1px solid #ccc;
  border-radius: 6px 0 0 6px;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  background: #fff;
  padding: 0;
}
.pdp-add-cart {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  border: none;
  background: var(--brand);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background .18s;
  padding: 0 20px;
}
.pdp-add-cart:hover {
  background: var(--brand-dark);
}
.pdp-cart-icon {
  display: flex;
  align-items: center;
}
.pdp-buy-now {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 50px;
  border: none;
  background: #fcd74d; /* Matches the top header cart button highlight */
  color: #222;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background .18s;
  border-radius: 0 6px 6px 0;
  padding: 0 18px;
  white-space: nowrap;
}
.pdp-buy-now:hover {
  background: #e5c345;
}

/* Related Products */
.pdp-related-section {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto 40px;
}
.pdp-related-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.pdp-related-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: #222;
  margin: 0;
}
.pdp-nav-arrows {
  display: flex;
  gap: 6px;
}
.pdp-arrow {
  width: 32px;
  height: 32px;
  border: 1px solid var(--brand);
  border-radius: 4px;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 16px;
  transition: background .18s;
}
.pdp-arrow:hover {
  background: var(--brand-dark);
}
.pdp-related-track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--brand) transparent;
}
.pdp-related-track::-webkit-scrollbar {
  height: 6px;
}
.pdp-related-track::-webkit-scrollbar-thumb {
  background: var(--brand);
  border-radius: 3px;
}

.pdp-related-card {
  flex: 0 0 180px;
  background: var(--panel);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
  text-decoration: none;
  color: inherit;
}
.pdp-related-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
.pdp-related-card-img {
  position: relative;
  aspect-ratio: 2/3;
  overflow: hidden;
}
.pdp-related-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pdp-related-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #4a8f3f;
  color: #fff;
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
}
.pdp-related-badge.soldout {
  background: var(--danger);
}
.pdp-related-card-body {
  padding: 10px 12px 14px;
  text-align: center;
}
.pdp-related-card-body h3 {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 400;
  color: #6e321f;
  line-height: 1.4;
}
.pdp-related-card-body .price {
  font-size: 16px;
  font-weight: 600;
}

/* PDP Responsive */
@media (max-width: 980px) {
  .pdp-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .pdp-gallery {
    order: 1; /* Image stays on top on mobile */
    position: relative;
    top: 0;
  }
  .pdp-info {
    order: 2; /* Details stack below */
  }
}


/* =========================================
   REVISED IMAGE-BASED CATEGORY LAYOUT
   ========================================= */

.cat-main-layout {
  width: min(1280px, calc(100% - 32px));
  margin: 32px auto 64px;
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 30px;
  direction: rtl;
}

/* Sidebar Styling Component */
.cat-sidebar-filter {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.filter-box {
  background: var(--panel, #f2ede4);
  border: 1px solid var(--line, #ddd);
  border-radius: 8px;
  padding: 20px;
}

.filter-title {
  margin: 0 0 14px 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--brand-dark, #786255);
  border-bottom: 1px solid var(--line, #ddd);
  padding-bottom: 8px;
}

.cat-sub-vertical-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
/* =========================================
   CATEGORY PAGE
   ========================================= */

/* Hero Banner */
.cat-hero {
  width: 100%;
  max-height: 240px;
  overflow: hidden;
  background: #c5b4a4;
  margin-bottom: 0;
}
.cat-hero-img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  object-position: center 25%;
  display: block;
}

/* Sub-categories */
.cat-sub-wrap {
  width: min(1280px, calc(100% - 32px));
  margin: 32px auto 16px;
}
.cat-sub-grid {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}
.cat-sub-card {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  padding: 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.5);
  transition: all 0.2s ease;
}
.cat-sub-card:hover {
  transform: translateY(-4px);
}
.cat-sub-card:hover, 
.cat-sub-card.active {
  background: var(--brand, #6b4d3d);
  color: #fff;
}

.cat-sub-card-img {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
}
.cat-sub-card:hover .cat-sub-card-img,
.cat-sub-card.active .cat-sub-card-img {
  border-color: var(--brand);
}
.cat-sub-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cat-sub-card span {
  font-size: 14px;
  font-weight: 600;
}

.cat-products-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
/* Products section */
.cat-products-section {
  width: min(1280px, calc(100% - 32px));
  margin: 24px auto 48px;
}
.cat-products-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--line);
}
.cat-products-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #222;
}
.cat-sort {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--muted);
}
.cat-sort select {
  width: auto;
  padding: 7px 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  color: #333;
  background: #fff;
  cursor: pointer;
}

.cat-products-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 20px;
}

.cat-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
  font-size: 16px;
  background: #fffdfb;
  border: 1px dashed var(--line);
  border-radius: 10px;
}

@media (max-width: 980px) {
  .cat-main-layout {
    grid-template-columns: 1fr;
  }
  .cat-products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}


/* Product Page Layout */
.pdp-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  max-width: 1200px;
  margin: 40px auto;
  padding: 32px;
  background-color: var(--panel);
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

@media (max-width: 768px) {
  .pdp-container {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 16px;
  }
}

/* Gallery & Imagery */
.pdp-gallery img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--line);
  object-fit: cover;
}

/* Product Information & Typography */


.pdp-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}

/* تنسيق الحاوية الرئيسية للقسمين بجانب بعضهما */
.pdp-combined-related {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto 40px;
  direction: rtl;
}

/* كل عمود */
.pdp-related-col {
  background: transparent;
  border-radius: 12px;
  overflow: hidden;
}

/* رأس القسم بدون أزرار تمرير */
.pdp-related-col .pdp-related-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line, #ddd);
  padding-bottom: 8px;
}

.pdp-related-col .pdp-related-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: #222;
  margin: 0;
}

/* شبكة المنتجات (3 بطاقات داخل كل عمود) */
.pdp-related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

/* تنسيق البطاقة كما هو موجود مسبقاً، مع تعديلات بسيطة */
.pdp-related-col .pdp-related-card {
  background: var(--panel, #f2ede4);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
  display: block;
}

.pdp-related-col .pdp-related-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.pdp-related-col .pdp-related-card-img {
  aspect-ratio: 2/3;
  overflow: hidden;
}

.pdp-related-col .pdp-related-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pdp-related-col .pdp-related-card-body {
  padding: 10px 12px 14px;
  text-align: center;
}

.pdp-related-col .pdp-related-card-body h3 {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 400;
  color: #6e321f;
  line-height: 1.4;
}

.pdp-related-col .pdp-related-card-body .price {
  font-size: 16px;
  font-weight: 600;
  color: #1e2327;
}

/* استجابة للشاشات المتوسطة */
@media (max-width: 900px) {
  .pdp-combined-related {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .pdp-related-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 680px) {
  .top-strip {
    flex-wrap: nowrap;
    padding: 10px 14px;
    background: #F5EDE4;
  }
  .top-strip-links {
    display: none;
  }
  .top-strip-meta {
    transform: none;
    gap: 12px;
    order: 2;
  }


  .brand-band {
    padding: 10px 14px;
    justify-content: space-between;
    background: #F5EDE4;
  }
  .brand {
    margin: 0;
    order: 2;
  }
  .brand-logo {
    height: 34px;
  }
  .service-links {
    margin: 0;
    order: 1;
    gap: 14px;
  }
  .service-text {
    display: none;
  }
  .service-icon {
    border: 0;
    width: auto;
    height: auto;
  }
  .service-icon svg {
    width: 26px;
    height: 26px;
  }

  .main-nav {
    display: none;
  }
}

@media (max-width: 680px) {
  .top-strip {
    overflow-x: auto;
    justify-content: flex-start;
    white-space: nowrap;
  }

  .main-nav {
    min-height: auto;
    padding: 10px 16px;
    flex-wrap: wrap;
    direction:ltr;
  }

  .info-band,
  .site-footer {
    display: grid;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .category-card.full-width-mobile {
    grid-column: 1 / -1;
    width: 60%;
    margin: 0 auto;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
  }

  .product-title {
    font-size: 14px;
  }

  .price {
    font-size: 16px;
  }

  .header-search {
    order: 3;
    flex-basis: 100%;
    min-width: 0;
  }

  .category-card {
    height: 220px;
  }

  .trust-block {
    grid-template-columns: 1fr;
    text-align: center;
    justify-items: center;
  }

  .cart-line {
    grid-template-columns: 56px 1fr;
  }

  .remove-line {
    grid-column: 1 / -1;
  }
}
@media (max-width: 480px) {
  .cat-products-grid {
    grid-template-columns: 1fr !important;
  }
}

/* --- Mobile header icons (hidden on desktop) --- */
.mobile-header-icons {
  display: none; /* hidden by default (desktop) */
  align-items: center;
  gap: 12px;
}

.mobile-header-icons .cart-button {
  /* reuse existing cart button styles */
  background: #fcd74d !important;
  border: none;
  border-radius: 4px;
  height: 30px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.mobile-header-icons .cart-button strong {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #e83262;
  color: #fff;
  font-size: 9px;
  min-width: 14px;
  height: 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-toggle {
  background: transparent;
  border: none;
  color: #222;
  cursor: pointer;
  padding: 4px;
}

/* --- Desktop vs Mobile visibility helpers --- */
.mobile-only { display: none !important; }
.desktop-only { display: flex !important; }

@media (max-width: 680px) {
  .mobile-only { display: flex !important; }
  .desktop-only { display: none !important; }

  /* 1. Top Strip Container Setup */
  .top-strip {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    padding: 4px 16px;
    background: #F5EDE4; /* Light layout matching the image */
    border-bottom: 1px solid rgba(0,0,0,0.05);
    border-bottom: none !important; 
  }

  .top-strip-user-links {
    display: flex;
    gap: 14px;
    direction: rtl;
  }

  .top-meta-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #222;
    font-size: 11px;
    font-weight: 500;
  }

  .top-strip-meta {
    transform: none !important; /* Reset desktop positioning shifts */
    display: flex;
    gap: 12px;
    direction: rtl;
  }

  .top-meta {
    font-size: 11px;
    color: #222;
  }

  /* 2. Main Brand Band Setup */
  .brand-band {
    display: flex;
    align-items: center;
    padding: 4px 16px;
    background: #F5EDE4;
    direction: ltr;
    margin-top: 0 !important; /* Forces layout boxes to touch seamlessly */
    border-bottom: none !important; /* REMOVED: Deletes the border line between strips */
  }

  .brand {
    margin: 0 !important;
    order: 2; /* Forces logo to align perfectly to the right */
  }

  .brand-logo {
    height: 34px;
    width: auto;
  }

  /* 3. Action Icon Group (Left Side Arrangement) */
  .mobile-header-icons {
    display: flex !important;
    align-items: center;
    gap: 16px;
    order: 1; /* Forces row to align completely to the left side */
    direction: ltr; /* Keeps [Cart - Search - Wishlist] sorting flow */
  }

  .mobile-icon-btn {
    position: relative;
    background: transparent;
    border: none;
    padding: 4px;
    color: #222;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-icon-btn .icon-wrapper {
    display: flex;
    align-items: center;
  }

  .mobile-icon-btn svg {
    width: 24px;
    height: 24px;
    stroke-width: 1.75;
  }

  /* Red Badges for Cart and Wishlist */
  .mobile-icon-btn .badge-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #e83262;
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    min-width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: sans-serif;
  }

  /* Global page grid adjustments for mobile layouts */
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
  }
  .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
}
/* =========================================
   PRODUCT SLIDER (database-driven, swipeable)
   ========================================= */
.product-slider-section {
  width: min(1280px, calc(100% - 32px));
  margin: 28px auto 8px;
}

.product-slider-title {
  font-size: 20px;
  font-weight: 700;
  color: #222;
  margin: 0 0 16px;
  text-align: center;
}

.product-slider {
  position: relative;
}

.product-slider-track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 4px 2px 10px;
}
.product-slider-track::-webkit-scrollbar { display: none; }

.product-slider-track .product-card {
  flex: 0 0 240px;
  scroll-snap-align: start;
}

.product-slider-arrow {
  position: absolute;
  top: 40%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border: 1px solid var(--brand);
  border-radius: 50%;
  background: #fff;
  color: var(--brand);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  z-index: 2;
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
}
.product-slider-arrow:hover { background: var(--brand); color: #fff; }
.product-slider-arrow.prev { left: -10px; }
.product-slider-arrow.next { right: -10px; }

@media (max-width: 680px) {
  .product-slider-track {
    scroll-snap-type: x mandatory;
  }
  .product-slider-track .product-card {
    flex: 0 0 calc(50% - 8px);
    scroll-snap-align: start;
  }
  .product-slider-arrow { display: none; }
}

/* =========================================
   MOBILE BOTTOM NAVIGATION BAR
   ========================================= */
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 680px) {
  body {
    padding-bottom: 0;
  }

  .mobile-bottom-nav {
    display: none !important;
  }

  .bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
  }

  .bottom-nav-item svg {
    stroke: var(--muted);
  }

  .bottom-nav-item.active,
  .bottom-nav-item.active svg {
    color: var(--brand);
    stroke: var(--brand);
  }

  .bottom-nav-icon-wrap {
    position: relative;
    display: flex;
  }

  .bottom-nav-badge {
    position: absolute;
    top: -6px;
    right: -8px;
    background: #e83262;
    color: #fff;
    font-size: 9px;
    font-weight: bold;
    min-width: 14px;
    height: 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}
@media (max-width: 680px) {
  .site-footer {
    padding: 20px 16px;
    font-size: 12px;
    min-height: 60px;
  }
  .payment-icons {
    flex-wrap: wrap;
    gap: 4px;
  }
  .payment-icons span {
    min-width: 36px;
    font-size: 9px;
    padding: 4px 6px;
  }
}@media (max-width: 480px) {
  .site-footer {
    padding: 20px 16px;
    font-size: 12px;
    min-height: 60px;
  }
  .payment-icons {
    flex-wrap: wrap;
    gap: 4px;
  }
  .payment-icons span {
    min-width: 36px;
    font-size: 9px;
    padding: 4px 6px;
  }
}