:root {
  --k-primary: #C9A96E;
  --k-secondary: #1A1A2E;
  --k-accent: #E8D5B7;
  --k-bg: #0F0F1A;
  --k-surface: #141426;
  --k-text: #F3F0EA;
  --k-muted: rgba(243, 240, 234, 0.70);
  --k-bleed-gutter: clamp(10px, 2.5vw, 22px);
}

html, body {
  height: 100%;
  background: var(--k-bg);
  color: var(--k-text);
  font-family: Cairo, Poppins, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

a {
  color: var(--k-accent);
  text-decoration: none;
}

a:hover {
  color: var(--k-primary);
}

.k-muted {
  color: var(--k-muted);
}

.k-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  border: 1px solid rgba(201, 169, 110, 0.18);
  border-radius: 16px;
  box-shadow: 0 18px 55px rgba(0,0,0,0.35);
}

.btn-kadoh {
  background: var(--k-primary);
  border: 1px solid rgba(201, 169, 110, 0.55);
  color: #0F0F1A;
  font-weight: 700;
  border-radius: 12px;
  padding: 10px 16px;
}

.btn-kadoh:hover {
  background: #d8bb83;
  color: #0F0F1A;
}

.btn-kadoh-outline {
  background: transparent;
  border: 1px solid rgba(201, 169, 110, 0.55);
  color: var(--k-primary);
  border-radius: 12px;
}

/* ========== LAYOUT ========== */
.app-layout {
    display: flex;
    flex-direction: row-reverse; /* RTL: sidebar on right */
    direction: ltr;
    min-height: 100vh;
    background: #0F0F1A;
    transition: all 0.3s ease;
}

/* ========== CUSTOMER LAYOUT (TOP MENU) ========== */
.customer-layout {
  min-height: 100vh;
  background: var(--k-bg);
  direction: rtl;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(15, 15, 26, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(201, 169, 110, 0.18);
}

.topbar-start {
  justify-self: start; /* RTL start = right, but grid start respects direction */
  display: flex;
  align-items: center;
}

.topbar-center {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 14px;
  white-space: nowrap;
  overflow-x: auto;
  padding: 2px 0;
}

.topbar-end {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.topbar-brand {
  color: var(--k-primary);
  font-weight: 900;
  font-size: 22px;
  font-family: Cairo, Poppins, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  white-space: nowrap;
  display: inline-flex;
  align-items: center; 
}

.topbar-brand-text {
  color: var(--k-primary);
  font-weight: 900;
  letter-spacing: 0.02em;
}

.topbar-brand-logo {
  width: 52px;
  height: 52px;
  background-color: var(--k-primary);
  -webkit-mask-image: url("/imgs/new%20K%20logo.png");
  mask-image: url("/imgs/new%20K%20logo.png");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  filter: drop-shadow(0 8px 22px rgba(201, 169, 110, 0.18));
}

.topbar-nav-link {
  color: rgba(232, 213, 183, 0.92);
  font-weight: 700;
  font-size: 0.98rem;
  padding: 6px 4px;
  border-bottom: 2px solid transparent;
}

.topbar-nav-link:hover {
  color: var(--k-primary);
  border-bottom-color: rgba(201, 169, 110, 0.55);
}

.topbar-cart {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(201, 169, 110, 0.18);
  background: rgba(18, 18, 31, 0.55);
  color: rgba(232, 213, 183, 0.95);
  font-weight: 800;
}

.topbar-cart:hover {
  color: var(--k-primary);
  background: rgba(201, 169, 110, 0.12);
  border-color: rgba(201, 169, 110, 0.28);
}

.topbar-cart-icon { font-size: 1.05rem; }
.topbar-cart-count { color: rgba(232, 213, 183, 0.85); }

.topbar-wishlist {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(201, 169, 110, 0.18);
  background: rgba(18, 18, 31, 0.55);
  color: rgba(232, 213, 183, 0.95);
  font-weight: 800;
  text-decoration: none;
}

.topbar-wishlist:hover {
  color: var(--k-primary);
  background: rgba(201, 169, 110, 0.12);
  border-color: rgba(201, 169, 110, 0.28);
}

.topbar-wishlist-icon {
  flex-shrink: 0;
  opacity: 0.95;
}

.topbar-user-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(201, 169, 110, 0.18);
  background: rgba(18, 18, 31, 0.55);
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(201, 169, 110, 0.18);
  background: rgba(18, 18, 31, 0.55);
}

.topbar-user-name {
  color: rgba(232, 213, 183, 0.9);
  font-weight: 800;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid rgba(201, 169, 110, 0.35);
  background: rgba(18, 18, 31, 0.55);
  color: var(--k-primary);
  cursor: pointer;
  flex-shrink: 0;
}

.topbar-menu-icon {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor;
}

.topbar-mobile-backdrop {
  display: none;
}

.topbar-mobile-nav {
  display: none;
}

@media (max-width: 991px) {
  .topbar-mobile-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 80;
    border: none;
    padding: 0;
    margin: 0;
    background: rgba(0, 0, 0, 0.55);
    cursor: pointer;
  }

  /* Slide from physical right; works for both RTL and LTR */
  .topbar-mobile-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: fixed;
    top: 0;
    right: 0;
    left: auto;
    bottom: 0;
    width: min(300px, 88vw);
    z-index: 90;
    padding: calc(72px + env(safe-area-inset-top, 0px)) 16px 24px;
    background: rgba(18, 18, 31, 0.98);
    border-left: 1px solid rgba(201, 169, 110, 0.22);
    box-shadow: -12px 0 40px rgba(0, 0, 0, 0.45);
    overflow-y: auto;
    transform: translate3d(100%, 0, 0);
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.25s ease, visibility 0.25s ease;
  }

  .topbar-mobile-nav.is-open {
    transform: translate3d(0, 0, 0);
    visibility: visible;
    pointer-events: auto;
  }
}

.topbar-mobile-link {
  display: block;
  padding: 12px 10px;
  border-radius: 10px;
  color: rgba(232, 213, 183, 0.95);
  font-weight: 800;
  text-decoration: none;
}

.topbar-mobile-link:hover {
  background: rgba(201, 169, 110, 0.12);
  color: var(--k-primary);
}

.customer-layout.mobile-nav-open {
  overflow: hidden;
}

.topbar-start {
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 991px) {
  .topbar {
    grid-template-columns: 1fr auto;
    padding: 10px 12px;
    gap: 8px;
  }
  .topbar-center { display: none; }
  .topbar-menu-btn { display: inline-flex; }
  .topbar-start { justify-self: start; }
  .topbar-end {
    justify-self: end;
    flex-wrap: wrap;
    gap: 6px;
    max-width: 100%;
  }
  .topbar-brand-text { font-size: 18px; }
  .topbar-brand-logo { width: 42px; height: 42px; }
  .topbar-nav-link:not(.topbar-cart) { display: none; }
  .topbar-cart-text { display: none; }
  .topbar-wishlist-text { display: none; }
  .topbar-user-inline .topbar-user-name,
  .topbar-user-menu .topbar-user-name { display: none; }
  .topbar-end .btn-sm { padding: 6px 10px; font-size: 0.85rem; }
}

@media (max-width: 480px) {
  .topbar-end .btn-kadoh:not(.topbar-cart) { display: none; }
}

.topbar-user-menu {
  position: relative;
  z-index: 40;
}

.topbar-user-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(201, 169, 110, 0.18);
  background: rgba(18, 18, 31, 0.55);
  color: rgba(232, 213, 183, 0.92);
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
}

.topbar-user-trigger:hover {
  border-color: rgba(201, 169, 110, 0.35);
  color: var(--k-primary);
}

.topbar-user-caret {
  font-size: 0.65rem;
  opacity: 0.75;
  margin-inline-start: 2px;
}

.topbar-user-menu.is-open .topbar-user-caret {
  transform: rotate(180deg);
  display: inline-block;
}

.topbar-user-dropdown {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 8px);
  min-width: 260px;
  padding: 10px 0;
  border-radius: 12px;
  border: 1px solid rgba(201, 169, 110, 0.22);
  background: rgba(18, 18, 31, 0.98);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.topbar-user-dropdown-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px 10px;
  direction: rtl;
}

.user-avatar-lg {
  flex-shrink: 0;
}

.topbar-user-dropdown-meta {
  min-width: 0;
}

.topbar-user-dropdown-name {
  font-weight: 900;
  color: rgba(232, 213, 183, 0.96);
  font-size: 0.98rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-user-dropdown-email {
  font-size: 0.82rem;
  color: rgba(232, 213, 183, 0.62);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-user-dropdown-divider {
  height: 1px;
  margin: 6px 0;
  background: rgba(201, 169, 110, 0.14);
}

.topbar-user-dropdown-item {
  display: block;
  width: 100%;
  padding: 10px 16px;
  text-align: right;
  color: rgba(232, 213, 183, 0.92);
  font-weight: 700;
  text-decoration: none;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
}

.topbar-user-dropdown-item:hover {
  background: rgba(201, 169, 110, 0.1);
  color: var(--k-primary);
}

.topbar-user-dropdown-form {
  margin: 0;
}

.topbar-user-dropdown-logout {
  color: rgba(248, 113, 113, 0.95);
}

.topbar-user-dropdown-logout:hover {
  background: rgba(248, 113, 113, 0.12);
  color: #f87171;
}

@media (min-width: 769px) {
  .topbar-user-menu .topbar-user-name { display: inline; }
}

.customer-main {
  direction: rtl;
}

/* ========== HOME HERO (NEW) ========== */
.home-hero-bleed {
  width: 100vw;
  margin-right: calc(50% - 50vw);
  margin-left: calc(50% - 50vw);
  padding-right: var(--k-bleed-gutter);
  padding-left: var(--k-bleed-gutter);
}

.home-bleed {
  width: 100vw;
  margin-right: calc(50% - 50vw);
  margin-left: calc(50% - 50vw);
  padding-right: var(--k-bleed-gutter);
  padding-left: var(--k-bleed-gutter);
}

/* ========== FOOTER ========== */
.google-ad-wrap {
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(201, 169, 110, 0.12);
  background: rgba(15, 15, 26, 0.55);
  min-height: 90px;
}

.google-ad-footer {
  margin-top: 8px;
}

.google-ad-footer-unit {
  max-width: 100%;
}

.google-ad-products-unit {
  max-width: 100%;
  min-height: 100px;
}

.site-footer {
  border-top: 1px solid rgba(201, 169, 110, 0.18);
  background: rgba(15, 15, 26, 0.85);
  backdrop-filter: blur(10px);
}

.footer-links {
  display: inline-flex;
  gap: 10px;
  align-items: center;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(201, 169, 110, 0.18);
  background: rgba(18, 18, 31, 0.55);
  color: rgba(232, 213, 183, 0.95);
  font-weight: 800;
}

.footer-link:hover {
  color: var(--k-primary);
  background: rgba(201, 169, 110, 0.12);
  border-color: rgba(201, 169, 110, 0.28);
}

.home-hero {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(201, 169, 110, 0.18);
  background: radial-gradient(1200px 500px at 20% 30%, rgba(201, 169, 110, 0.10), transparent 55%),
              radial-gradient(900px 450px at 70% 40%, rgba(255, 255, 255, 0.05), transparent 60%),
              rgba(18, 18, 31, 0.45);
  padding: 22px;
}

.home-hero-glow {
  position: absolute;
  inset: -120px;
  background: radial-gradient(circle at 20% 35%, rgba(201, 169, 110, 0.14), transparent 55%);
  filter: blur(12px);
  pointer-events: none;
}

.home-hero-media {
  position: relative;
  min-height: 360px;
  display: grid;
  place-items: center;
}

.home-hero-card {
  width: min(320px, 100%);
  border-radius: 18px;
  border: 1px solid rgba(201, 169, 110, 0.18);
  background: rgba(15, 15, 26, 0.55);
  box-shadow: 0 30px 90px rgba(0,0,0,0.45);
  position: relative;
  overflow: hidden;
}

.home-hero-card-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(201, 169, 110, 0.95);
  color: #0F0F1A;
  font-weight: 900;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.85rem;
}

.home-hero-card-body {
  padding: 36px 18px 22px;
  text-align: center;
}

.home-hero-product {
  display: block;
  text-decoration: none;
}

.home-hero-product-img-wrap {
  position: relative;
  width: fit-content;
  margin: 0 auto 10px;
}

.home-hero-product-img-wrap .product-discount-badge {
  top: 4px;
  inset-inline-start: 4px;
  font-size: 0.7rem;
}

.home-hero-product-img {
  width: 96px;
  height: 96px;
  border-radius: 18px;
  object-fit: cover;
  display: block;
  border: 1px solid rgba(201, 169, 110, 0.22);
  background: rgba(201, 169, 110, 0.10);
}

.home-hero-product-name {
  font-weight: 950;
  color: rgba(232, 213, 183, 0.96);
}

.home-hero-product-price {
  margin-top: 4px;
  color: var(--k-primary);
  font-weight: 950;
}

.gift-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  border: 1px solid rgba(201, 169, 110, 0.22);
  background: rgba(201, 169, 110, 0.10);
  display: grid;
  place-items: center;
  font-size: 34px;
  margin: 0 auto;
}

.home-hero-chip {
  position: absolute;
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 800;
  font-size: 0.9rem;
  border: 1px solid rgba(201, 169, 110, 0.18);
  background: rgba(18, 18, 31, 0.65);
  color: rgba(232, 213, 183, 0.95);
}

.home-hero-chip.chip-top { top: 18px; right: 18px; }
.home-hero-chip.chip-bottom { bottom: 18px; left: 18px; }
.home-hero-chip.chip-rating { top: 18px; left: 18px; display: inline-flex; gap: 6px; align-items: center; }
.home-hero-chip .star { color: var(--k-primary); }

.home-hero-copy { position: relative; }

.home-hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(201, 169, 110, 0.18);
  background: rgba(15, 15, 26, 0.45);
  color: rgba(232, 213, 183, 0.95);
  font-weight: 800;
  margin-bottom: 10px;
}

.home-hero-title {
  font-weight: 950;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.05;
  margin: 0 0 12px;
  color: rgba(243, 240, 234, 0.98);
}

.home-hero-title .accent { color: var(--k-primary); }

.home-hero-sub {
  color: rgba(243, 240, 234, 0.72);
  margin: 0;
  font-size: 1.02rem;
}

.home-hero-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.home-hero-metrics .metric {
  min-width: 120px;
  border-radius: 14px;
  border: 1px solid rgba(201, 169, 110, 0.16);
  background: rgba(18, 18, 31, 0.45);
  padding: 10px 12px;
}

.home-hero-metrics .metric-value {
  color: var(--k-primary);
  font-weight: 950;
}

.home-hero-metrics .metric-label {
  color: rgba(243, 240, 234, 0.70);
  font-size: 0.85rem;
}

.home-hero .btn {
  border-radius: 999px;
  padding: 10px 16px;
}

.home-hero .btn-kadoh-outline {
  background: rgba(15, 15, 26, 0.35);
}

.home-hero .btn-kadoh-outline:hover {
  background: rgba(201, 169, 110, 0.10);
}

/* ========== HOME SECTIONS (SCREENSHOT STYLE) ========== */
.section-title {
  font-size: 20px;
  font-weight: 950;
  color: rgba(243, 240, 234, 0.95);
}

.section-kicker {
  font-size: 0.9rem;
  color: rgba(201, 169, 110, 0.85);
  font-weight: 800;
}

.home-category-tile {
  display: block;
  border-radius: 16px;
  border: 1px solid rgba(201, 169, 110, 0.14);
  background: rgba(18, 18, 31, 0.45);
  padding: 16px;
  min-height: 110px;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.home-category-tile:hover {
  transform: translateY(-2px);
  border-color: rgba(201, 169, 110, 0.28);
  background: rgba(18, 18, 31, 0.55);
}

.home-category-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(201, 169, 110, 0.18);
  background: rgba(201, 169, 110, 0.10);
  display: grid;
  place-items: center;
  overflow: hidden;
  margin-bottom: 10px;
}

.home-category-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.home-category-name {
  font-weight: 950;
  color: rgba(232, 213, 183, 0.96);
}

.home-category-sub {
  font-size: 0.85rem;
}

.home-feature-card {
  border-radius: 18px;
  border: 1px solid rgba(201, 169, 110, 0.14);
  background: rgba(18, 18, 31, 0.45);
  overflow: hidden;
}

.home-feature-media {
  position: relative;
  height: 170px;
  background: rgba(201, 169, 110, 0.06);
}

.home-feature-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.95);
}

.home-feature-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(201, 169, 110, 0.18);
  border: 1px solid rgba(201, 169, 110, 0.22);
  color: rgba(232, 213, 183, 0.95);
  font-weight: 900;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.82rem;
}

.home-feature-add {
  position: absolute;
  bottom: 12px;
  left: 12px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(201, 169, 110, 0.35);
  background: rgba(15, 15, 26, 0.75);
  color: var(--k-primary);
  font-size: 20px;
  line-height: 1;
  display: grid;
  place-items: center;
}

.home-feature-add:hover {
  background: rgba(201, 169, 110, 0.12);
}

.home-feature-body {
  padding: 14px 14px 16px;
}

.home-feature-title {
  font-weight: 950;
  color: rgba(232, 213, 183, 0.96);
  margin-bottom: 6px;
}

.home-feature-sub {
  font-size: 0.9rem;
}

/* ========== HOME CATEGORY SLIDER ========== */
.category-slider {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 6px 2px 10px;
  scroll-snap-type: x mandatory;
}

.category-chip {
  flex: 0 0 auto;
  width: 180px;
  scroll-snap-align: start;
}

.category-card {
  display: block;
  border-radius: 16px;
  border: 1px solid rgba(201, 169, 110, 0.18);
  background: rgba(18, 18, 31, 0.65);
  overflow: hidden;
}

.category-card-img {
  width: 100%;
  height: 92px;
  object-fit: cover;
  display: block;
  background: rgba(201, 169, 110, 0.08);
}

.category-card-body {
  padding: 10px 12px 12px;
}

.category-card-title {
  color: var(--k-primary);
  font-weight: 900;
}

/* ========== PRODUCT CARD ========== */
.product-card {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.product-card-media {
  position: relative;
  display: block;
  flex: 0 0 200px;
  height: 200px;
  overflow: hidden;
  background: rgba(201, 169, 110, 0.08);
}

.product-discount-badge {
  position: absolute;
  top: 10px;
  inset-inline-start: 10px;
  z-index: 2;
  background: rgba(200, 48, 64, 0.95);
  color: #fff;
  font-weight: 900;
  font-size: 0.78rem;
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1.2;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.product-price-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}

.product-price-sale {
  color: var(--k-primary);
  font-weight: 900;
}

.product-price-original {
  color: rgba(232, 213, 183, 0.55);
  text-decoration: line-through;
  font-size: 0.92em;
  font-weight: 700;
}

.product-card-price-block .product-price-sale {
  color: var(--k-primary);
  font-weight: 900;
}

.product-card-img {
  width: 100%;
  height: 100%;
  max-height: 200px;
  object-fit: cover;
  object-position: center;
  display: block;
}

.product-card-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.product-card-name {
  font-weight: 900;
  color: rgba(232, 213, 183, 0.95);
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.35;
  min-height: 2.7em;
}

.product-card-price {
  color: var(--k-primary);
  font-weight: 900;
}

.product-card-actions {
  margin-top: auto;
  padding-top: 12px;
}

/* ========== PRODUCT SHARE ========== */
.product-share {
  position: relative;
  display: inline-flex;
}

.product-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.product-share-icon {
  flex-shrink: 0;
}

.product-share--compact .product-share-btn {
  padding: 6px 10px;
  min-width: 40px;
  justify-content: center;
}

.product-share-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  border: none;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: default;
}

.product-share-menu {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  z-index: 130;
  min-width: 200px;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid rgba(201, 169, 110, 0.22);
  background: rgba(18, 18, 31, 0.98);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

[dir="ltr"] .product-share-menu {
  inset-inline-end: auto;
  inset-inline-start: 0;
}

.product-share-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: rgba(232, 213, 183, 0.95);
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
  text-align: start;
  cursor: pointer;
  font-family: inherit;
}

.product-share-item:hover {
  background: rgba(201, 169, 110, 0.12);
  color: var(--k-primary);
}

.product-share-item-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 900;
  background: rgba(201, 169, 110, 0.12);
  flex-shrink: 0;
}

.product-share-item-icon--wa { background: rgba(37, 211, 102, 0.2); color: #25d366; }
.product-share-item-icon--fb { background: rgba(24, 119, 242, 0.2); color: #1877f2; }
.product-share-item-icon--x { background: rgba(255, 255, 255, 0.12); color: #e8d5b7; }
.product-share-item-icon--tg { background: rgba(34, 158, 217, 0.2); color: #229ed9; }

/* ========== PRODUCT GALLERY (DETAIL) ========== */
.product-gallery-main {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(201, 169, 110, 0.18);
  background: rgba(18, 18, 31, 0.65);
}

.product-gallery-img {
  width: 100%;
  height: 360px;
  object-fit: cover;
  display: block;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(201, 169, 110, 0.25);
  background: rgba(15, 15, 26, 0.7);
  color: var(--k-primary);
  font-size: 26px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-nav.prev { left: 10px; }
.gallery-nav.next { right: 10px; }
.gallery-nav:hover { background: rgba(201, 169, 110, 0.15); }

.product-gallery-thumbs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 10px 2px 2px;
}

.product-gallery-thumbs .thumb {
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(201, 169, 110, 0.18);
  background: rgba(18, 18, 31, 0.65);
  padding: 0;
}

.product-gallery-thumbs .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-gallery-thumbs .thumb.active {
  border-color: rgba(201, 169, 110, 0.65);
  box-shadow: 0 0 0 2px rgba(201, 169, 110, 0.22);
}

@media (max-width: 768px) {
  .product-gallery-img { height: 260px; }
}

/* ========== SIDEBAR ========== */
.sidebar {
    width: 260px;
    min-height: 100vh;
    background: #12121F;
    border-left: 1px solid #C9A96E33;
    display: flex;
    flex-direction: column;
    padding: 1rem 0;
    transition: width 0.3s ease;
    position: relative;
    flex-shrink: 0;
    z-index: 2; /* toggle uses left:-16px over main; stay above .main-content for hit-testing */
    /* NO position:fixed — sidebar pushes content, never overlaps */
}

.sidebar.collapsed {
    width: 64px;
}

/* Toggle Button */
.sidebar-toggle {
    position: absolute;
    top: 1rem;
    left: -16px;  /* sticks out to the left of sidebar */
    width: 32px;
    height: 32px;
    background: #C9A96E;
    color: #0F0F1A;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    box-shadow: 0 2px 8px #C9A96E55;
    transition: background 0.2s;
}
.sidebar-toggle:hover { background: #e0bb80; }

/* Logo */
.sidebar-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1rem 1.5rem;
    border-bottom: 1px solid #C9A96E22;
    text-align: center;
}
.logo-ar {
    font-family: 'Cairo', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    color: #C9A96E;
    letter-spacing: 1px;
}
.logo-icon {
    font-family: 'Cairo', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    color: #C9A96E;
}
.logo-sub {
    font-size: 0.7rem;
    color: #E8D5B7AA;
    margin-top: 0.25rem;
}

/* User */
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    margin: 0.75rem 0.75rem 0;
    border-radius: 12px;
    border: 1px solid #C9A96E22;
    background: #0F0F1A;
}
.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid #C9A96E33;
}
.user-meta { min-width: 0; }
.user-name {
    color: #E8D5B7;
    font-weight: 800;
    font-size: 0.95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-sub {
    color: #E8D5B7AA;
    font-size: 0.75rem;
}

/* Nav */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem 0.5rem;
    direction: rtl;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    color: #E8D5B7CC;
    text-decoration: none;
    font-family: 'Cairo', sans-serif;
    font-size: 0.95rem;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
    overflow: hidden;
}
.nav-item:hover {
    background: #C9A96E22;
    color: #C9A96E;
}
.nav-item.active {
    background: #C9A96E33;
    color: #C9A96E;
    font-weight: 700;
    border-right: 3px solid #C9A96E;
}
.nav-icon { font-size: 1.1rem; flex-shrink: 0; }
.nav-label { transition: opacity 0.2s; }
.sidebar.collapsed .nav-label { opacity: 0; width: 0; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 0.75rem; }

.nav-item-button {
    padding: 0;
    background: transparent;
    border: none;
}
.nav-item-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    background: transparent;
    border: none;
    color: #E8D5B7CC;
    font-family: 'Cairo', sans-serif;
    font-size: 0.95rem;
    text-align: right;
}
.nav-item-btn:hover {
    background: #C9A96E22;
    color: #C9A96E;
}

/* ========== MAIN CONTENT ========== */
.main-content {
    flex: 1;
    min-height: 100vh;
    overflow-x: hidden;
    direction: rtl;
    position: relative;
    z-index: 1;
}

/* ========== REMOVE any purple/gradient from old sidebar ========== */
.sidebar, .sidebar * {
    background-image: none !important;
}
/* Remove old nav-menu styles if they conflict */
.nav-menu { display: none !important; }

.admin-sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2990;
  border: none;
  padding: 0;
  margin: 0;
  background: rgba(0, 0, 0, 0.55);
  cursor: pointer;
}

.admin-mobile-nav-btn {
  display: none;
  position: fixed;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  inset-inline-start: calc(16px + env(safe-area-inset-left, 0px));
  z-index: 2500;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(201, 169, 110, 0.45);
  background: #C9A96E;
  color: #0F0F1A;
  font-size: 1.25rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

@media (max-width: 991px) {
  .admin-mobile-nav-btn { display: flex; align-items: center; justify-content: center; }
  .app-layout .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    inset-inline-end: 0;
    width: 260px !important;
    min-height: 100vh;
    z-index: 3000;
    transform: translateX(100%);
    transition: transform 0.25s ease;
  }
  .app-layout .sidebar.mobile-open {
    transform: translateX(0);
  }
  .app-layout .sidebar.collapsed {
    width: 260px !important;
  }
  .app-layout .sidebar .nav-label,
  .app-layout .sidebar .logo-sub {
    display: inline !important;
    opacity: 1 !important;
    width: auto !important;
  }
  .app-layout .sidebar.collapsed .nav-label { display: inline !important; opacity: 1 !important; width: auto !important; }
  .app-layout .main-content {
    width: 100%;
    padding: 12px 12px 72px;
  }
  .app-layout .main-content article {
    padding: 0 4px;
  }
}

@media (min-width: 992px) {
  .admin-mobile-nav-btn,
  .admin-sidebar-backdrop { display: none !important; }
}

/* ========== Form validation ========== */
.validation-message,
div[class*="validation-message"],
.field-validation-error {
  color: #e03535;
  font-size: 0.82rem;
  margin-top: 4px;
  display: block;
}

.input-validation-error,
.form-control.invalid,
.form-control:invalid {
  border-color: #e03535 !important;
  box-shadow: 0 0 0 2px rgba(224, 53, 53, 0.15) !important;
}

.alert-danger {
  background: rgba(224, 53, 53, 0.12);
  border: 1px solid rgba(224, 53, 53, 0.35);
  color: #e03535;
  border-radius: 8px;
}

.alert-success {
    background: rgba(25, 135, 84, 0.12);
    border: 1px solid rgba(25, 135, 84, 0.35);
    color: #198754;
    border-radius: 8px;
    padding: 10px 14px;
}

/* Admin analytics: constrain Chart.js canvas so legend/axes don't overlap tables below */
.analytics-chart-canvas-host {
    position: relative;
    width: 100%;
    height: 340px;
    max-height: min(340px, 50vh);
}

.analytics-chart-canvas-host canvas {
    display: block;
    max-width: 100%;
}

/* Admin error log detail */
.error-log-pre {
    margin: 0;
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(201, 169, 110, 0.15);
    color: rgba(243, 240, 234, 0.92);
    font-size: 0.78rem;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 420px;
    overflow: auto;
}

.lang-en {
  font-family: 'Segoe UI', system-ui, sans-serif;
}

.lang-ar {
  font-family: 'Segoe UI', 'Tahoma', system-ui, sans-serif;
}

[dir="rtl"] .flex-row-nav {
  flex-direction: row-reverse;
}

/* ========== RESPONSIVE (global) ========== */
.customer-main .container {
  max-width: 100%;
  padding-left: max(12px, var(--k-bleed-gutter));
  padding-right: max(12px, var(--k-bleed-gutter));
}

.customer-main article img:not(.product-card-img),
.main-content article img:not(.product-card-img) {
  max-width: 100%;
  height: auto;
}

.table-responsive {
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 991px) {
  .home-hero {
    padding: 16px;
  }
  .home-hero-media {
    min-height: 240px;
  }
  .home-hero-title {
    font-size: clamp(1.35rem, 5vw, 1.85rem);
  }
  .home-hero-metrics {
    flex-wrap: wrap;
    gap: 10px;
  }
  .home-hero-metrics .metric {
    min-width: calc(50% - 8px);
    flex: 1 1 calc(50% - 8px);
  }
  .category-chip {
    width: 150px;
  }
  .product-card-media {
    flex: 0 0 160px;
    height: 160px;
  }

  .product-card-img {
    max-height: 160px;
  }
  .k-card.p-4,
  .k-card.p-3 {
    padding: 1rem !important;
  }
}

@media (max-width: 575px) {
  .home-hero-chip.chip-top,
  .home-hero-chip.chip-rating {
    font-size: 0.75rem;
    padding: 4px 8px;
  }
  .gallery-nav {
    width: 36px;
    height: 36px;
    font-size: 20px;
  }
  .d-flex.gap-2.flex-wrap .btn {
    flex: 1 1 100%;
  }
}

.form-control,
.form-select,
textarea.form-control {
  max-width: 100%;
}

.product-qty-input {
  max-width: 120px;
}

@media (max-width: 575px) {
  .product-qty-input {
    max-width: 100%;
  }
}

