.agent-order-layout .btn.active {
  background: #111827;
  color: #fff;
  border-color: #111827;
}

.agent-order-layout .agent-product-card {
  cursor: default;
}
* {
  box-sizing: border-box;
}
:root[data-theme="dark"] {
  --bg: #0a0b0f;
  --surface: #11131a;
  --panel: #161a24;
  --accent: #d6b25e;
  --accent-2: #8f6b23;
  --text: #f8f5ef;
  --muted: #b9ad98;
  --border: #2b2f3a;
}
:root[data-theme="light"] {
  --bg: #f8f4ee;
  --surface: #fffdf7;
  --panel: #f2ece2;
  --accent: #b8872b;
  --accent-2: #e2c27b;
  --text: #1d1a16;
  --muted: #7b6f5c;
  --border: #e1d6c6;
}
body {
  margin: 0;
  font-family: "Cairo", "Segoe UI", Tahoma, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
html.site-loading,
body.site-loading {
  overflow: hidden;
}
.site-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
.site-loader iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: var(--bg);
}
.site-loader__fallback {
  position: absolute;
  bottom: 28px;
  left: 0;
  right: 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
  letter-spacing: 0.3px;
}
html.site-loaded .site-loader,
body.site-loaded .site-loader {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
a {
  color: inherit;
}
.main-search-bar {
  padding: 18px 0 10px;
}
.main-search-bar form {
  margin: 0 auto;
  width: min(760px, 92%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}
[data-theme="dark"] .main-search-bar form {
  background: linear-gradient(180deg, #14161b, #0f1113);
}
.main-search-bar .search-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
}
.main-search-bar input[type="text"] {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 1rem;
  padding: 10px 6px;
  outline: none;
}
.main-search-bar button {
  border: none;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #0f0d0a;
  font-weight: 700;
  padding: 10px 22px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.main-search-bar button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

/* Search results animations */
.search-results {
  animation: pageFadeUp 0.6s ease both;
}
.search-results section {
  margin-top: 18px;
}
.search-results .search-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.search-results .search-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 10px 24px rgba(2, 8, 20, 0.08);
  animation: cardReveal 0.6s ease both;
}
.search-results .search-list li:nth-child(1) { animation-delay: 0.04s; }
.search-results .search-list li:nth-child(2) { animation-delay: 0.08s; }
.search-results .search-list li:nth-child(3) { animation-delay: 0.12s; }
.search-results .search-list li:nth-child(4) { animation-delay: 0.16s; }
.search-results .search-list li:nth-child(5) { animation-delay: 0.2s; }

.search-results .search-list li a {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}
.search-results .search-result-img {
  width: 70px;
  height: 70px;
  object-fit: contain;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  padding: 6px;
  box-shadow: 0 8px 18px rgba(2, 8, 20, 0.08);
  transform: scale(0.98);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.search-results .search-list li:hover .search-result-img {
  transform: scale(1.04);
  box-shadow: 0 14px 28px rgba(2, 8, 20, 0.14);
}
.search-results .search-list li:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(2, 8, 20, 0.12);
}

@keyframes pageFadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes cardReveal {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Product cards animations */
.product-card {
  animation: cardReveal 0.6s ease both;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.product-card:nth-child(1) { animation-delay: 0.04s; }
.product-card:nth-child(2) { animation-delay: 0.08s; }
.product-card:nth-child(3) { animation-delay: 0.12s; }
.product-card:nth-child(4) { animation-delay: 0.16s; }
.product-card:nth-child(5) { animation-delay: 0.2s; }
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 36px rgba(2, 8, 20, 0.16);
}
.product-card img {
  transition: transform 0.25s ease, filter 0.25s ease;
}
.product-card:hover img {
  transform: scale(1.03);
  filter: saturate(1.05);
}

/* Product page animations */
.product-container {
  animation: pageFadeUp 0.6s ease both;
}
.product-container .product-image,
.product-container .banner-card {
  animation: cardReveal 0.6s ease both;
}
.product-container .product-meta {
  animation: cardReveal 0.7s ease 0.05s both;
}
.product-container .product-thumbs {
  animation: cardReveal 0.7s ease 0.1s both;
}
.product-container .spec-list .spec-row {
  animation: cardReveal 0.5s ease both;
}

/* Compatible devices table (base) */
:root {
  --compatible-selected-start: #7fbcec;
  --compatible-selected-end: #4fa6e0;
  --compatible-row-bg: transparent;
  --compatible-row-text: var(--text);
  --compatible-input-bg: var(--surface);
  --compatible-input-border: var(--border);
}
@media (prefers-color-scheme: dark) {
  :root {
    --compatible-selected-start: #145b8a;
    --compatible-selected-end: #0d4a70;
    --compatible-row-bg: rgba(255, 255, 255, 0.02);
    --compatible-row-text: var(--text);
    --compatible-input-bg: var(--panel);
    --compatible-input-border: rgba(255, 255, 255, 0.06);
  }
}
.compatible-devices-section {
  width: 100%;
  margin-top: 16px;
}
.compatible-devices-wrap {
  margin-top: 8px;
}
.compatible-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--compatible-row-bg);
}
.compatible-table thead th {
  background: transparent;
  color: var(--muted);
  text-align: right;
  padding: 6px 8px;
  font-weight: 700;
}
.compatible-table tbody tr {
  background: transparent;
  color: var(--compatible-row-text);
}
.compatible-table tbody tr.selected {
  background: linear-gradient(90deg, var(--compatible-selected-start), var(--compatible-selected-end));
  color: #fff;
  border-color: transparent;
}
.compatible-table tbody td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
.compatible-table input.compatible-qty {
  font-size: 14px;
  color: var(--text);
  background: var(--compatible-input-bg);
  border: 1px solid var(--compatible-input-border);
  padding: 6px;
  border-radius: 6px;
  text-align: center;
}
.compatible-name {
  font-weight: 600;
}
.qty-control .qty-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
}
.qty-control .qty-btn:active {
  transform: translateY(1px);
}
.btn-outline {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 6px 10px;
  border-radius: 8px;
}

/* Login modal animations */
.auth-backdrop {
  opacity: 0;
  transition: opacity 0.35s ease;
}
.auth-dialog {
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.auth-modal.active .auth-backdrop {
  opacity: 1;
}
.auth-modal.active .auth-dialog {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.container {
  width: min(1200px, 92%);
  margin: 0 auto;
}
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
}
.nav-toggle {
  display: none;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
}
.nav-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.logo {
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0.5px;
  color: var(--accent);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.brand {
  font-weight: 800;
  font-size: 20px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  min-width: 0;
}
.header-bar {
  position: relative;
}
.header-left,
.header-right {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.header-social {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.social-link {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}
.social-link:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  color: var(--accent);
}
.social-link svg {
  display: block;
}
.site-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  white-space: nowrap;
}
.site-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 46vw;
}

/* Animated site name (header) */
.site-header .site-name {
  background-image: linear-gradient(
    90deg,
    var(--text) 0%,
    var(--accent) 18%,
    var(--accent-2) 36%,
    var(--accent) 54%,
    var(--text) 72%,
    var(--text) 100%
  );
  background-size: 220% 100%;
  background-position: 0% 50%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: 0.2px;
  animation: siteNameWave 3.6s ease-in-out infinite;
  text-shadow: 0 0 18px color-mix(in srgb, var(--accent) 22%, transparent);
  position: relative;
}

.site-header .site-name::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--accent) 70%, transparent),
    color-mix(in srgb, var(--accent-2) 70%, transparent),
    color-mix(in srgb, var(--accent) 70%, transparent),
    transparent
  );
  background-size: 220% 100%;
  background-position: 0% 50%;
  opacity: 0.55;
  animation: siteNameUnderline 3.6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes siteNameWave {
  0% {
    background-position: 0% 50%;
    filter: saturate(115%);
  }
  50% {
    background-position: 100% 50%;
    filter: saturate(140%);
  }
  100% {
    background-position: 0% 50%;
    filter: saturate(115%);
  }
}

@keyframes siteNameUnderline {
  0% {
    background-position: 0% 50%;
    opacity: 0.4;
  }
  50% {
    background-position: 100% 50%;
    opacity: 0.75;
  }
  100% {
    background-position: 0% 50%;
    opacity: 0.4;
  }
}

.site-header .brand:hover .site-name {
  text-shadow: 0 0 24px color-mix(in srgb, var(--accent) 30%, transparent);
}

.site-header .brand:hover .site-name::after {
  opacity: 0.85;
}

@media (prefers-reduced-motion: reduce) {
  .site-header .site-name {
    animation: none;
    filter: none;
    background-image: none;
    color: var(--text);
    text-shadow: none;
  }
  .site-header .site-name::after {
    animation: none;
    opacity: 0.4;
  }
}
.site-logo {
  width: 22px;
  height: 22px;
  object-fit: contain;
  display: block;
}

/* Animated logo (header) */
.site-header .site-logo {
  transform-origin: center;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.24))
    drop-shadow(0 0 14px color-mix(in srgb, var(--accent) 22%, transparent));
  animation:
    logoFloat 3.4s ease-in-out infinite,
    logoGlow 4.8s ease-in-out infinite;
  will-change: transform, filter;
}

@keyframes logoFloat {
  0% {
    transform: translateY(0) scale(1) rotate(0deg);
  }
  50% {
    transform: translateY(-2px) scale(1.03) rotate(-0.6deg);
  }
  100% {
    transform: translateY(0) scale(1) rotate(0deg);
  }
}

@keyframes logoGlow {
  0% {
    filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.24))
      drop-shadow(0 0 10px color-mix(in srgb, var(--accent) 18%, transparent))
      saturate(112%);
  }
  50% {
    filter: drop-shadow(0 12px 26px rgba(0, 0, 0, 0.26))
      drop-shadow(0 0 18px color-mix(in srgb, var(--accent-2) 28%, transparent))
      saturate(135%);
  }
  100% {
    filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.24))
      drop-shadow(0 0 10px color-mix(in srgb, var(--accent) 18%, transparent))
      saturate(112%);
  }
}

.site-header .brand:hover .site-logo {
  filter: drop-shadow(0 14px 30px rgba(0, 0, 0, 0.28))
    drop-shadow(0 0 22px color-mix(in srgb, var(--accent) 28%, transparent));
}

@media (prefers-reduced-motion: reduce) {
  .site-header .site-logo {
    animation: none;
    filter: none;
    transform: none;
  }
}
.nav .nav-close {
  display: none;
}
@media (min-width: 1200px) {
  .site-logo {
    width: 80px;
    height: 80px;
  }
  .site-title {
    font-size: 0.95rem;
  }
  .site-name {
    font-size: 0.95rem;
    max-width: none;
  }
}
.nav {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.nav a {
  text-decoration: none;
  font-size: 14px;
  color: var(--text);
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}
.nav a:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.nav a.nav-icon-link {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.nav a.nav-icon-link svg {
  width: 18px;
  height: 18px;
  display: block;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.auth-open {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}
.auth-open:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.auth-open.outline {
  border-color: var(--accent);
  color: var(--accent);
}
.theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    transform 0.2s ease;
}
.theme-toggle:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}
.theme-toggle__icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  transition: color 0.2s ease;
}
html[data-theme="dark"] .theme-toggle {
  background: #0f1115;
  border-color: #2a2f3a;
}
html[data-theme="dark"] .theme-toggle__icon::before {
  content: "☀";
  color: #ffffff;
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.6);
}
html[data-theme="light"] .theme-toggle {
  background: #f7f7f7;
  border-color: #d7dbe3;
}
html[data-theme="light"] .theme-toggle__icon::before {
  content: "☾";
  color: #0b0b0f;
}

@media (min-width: 481px) {
  .theme-toggle {
    position: fixed;
    top: 10px;
    inset-inline-end: 10px;
    z-index: 9999;
  }
}
.site-footer {
  margin-top: 40px;
  padding: 24px 0;
  background: var(--panel);
  color: var(--muted);
  text-align: center;
  border-top: 1px solid var(--border);
}
.site-footer .footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.site-footer .footer-copy {
  flex: 1 1 auto;
}
.footer-social {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.social-link.social-whatsapp {
  color: #25d366;
}
.social-link.social-facebook {
  color: #1877f2;
}
.social-link.social-instagram {
  color: #e1306c;
}

.hero {
  background: linear-gradient(
    135deg,
    rgba(212, 175, 55, 0.12),
    rgba(10, 10, 15, 0.9)
  );
  border: 1px solid var(--border);
  padding: 36px;
  border-radius: 18px;
  margin: 24px 0;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}
.hero h1 {
  margin-top: 0;
  font-size: 32px;
}
.hero .actions {
  margin-top: 18px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.pill {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 12px;
  margin-bottom: 8px;
}

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.banner-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.banner-card {
  position: relative;
  display: block;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  text-decoration: none;
}
.banner-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}
.banner-title {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
}
.category-icons {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.category-icon {
  display: grid;
  gap: 10px;
  align-content: center;
  justify-items: center;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}
.category-icon:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}
.cat-icon {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 22px;
  color: #111;
  background: transparent;
  border: 1px solid var(--border);
  box-shadow: none;
  padding: 6px;
}
.cat-icon img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: contain;
  display: block;
  background: transparent;
}
.cat-name {
  font-weight: 700;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  height: 100%;
}
.card img {
  width: 100%;
  height: 190px;
  object-fit: contain;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}
.card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  margin-top: auto;
}
.badge {
  position: absolute;
  margin: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(212, 175, 55, 0.2);
  color: var(--accent);
  font-size: 12px;
  border: 1px solid var(--accent);
}
.card {
  position: relative;
}

.product {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr 1fr;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 20px;
  border-radius: 18px;
}
.product img {
  width: 100%;
  border-radius: 12px;
}
.product-image-wrap {
  background: var(--panel);
  border-radius: 12px;
  padding: 6px;
}
.product-main-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  cursor: pointer;
  background: var(--panel);
}
.product-image-wrap.expanded .product-main-image {
  aspect-ratio: auto;
  height: auto;
  max-height: none;
}
.product-gallery {
  margin-top: 10px;
}
.gallery-thumb {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  cursor: pointer;
}
.gallery-thumb img {
  width: 100%;
  height: 70px;
  object-fit: cover;
  border-radius: 8px;
}
.gallery-thumb.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent);
}

.btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #111;
  padding: 10px 16px;
  border-radius: 12px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  display: inline-block;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}
.btn.disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}
.btn:active {
  transform: translateY(0);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
}
.btn.small {
  padding: 6px 10px;
  font-size: 13px;
}
.btn.outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.link {
  color: var(--accent);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
}
.link.danger {
  color: #ef4444;
}
.drag-handle {
  cursor: grab;
  color: var(--muted);
  font-size: 16px;
  display: inline-flex;
  align-items: center;
}
tr.dragging {
  opacity: 0.6;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.table th,
.table td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  text-align: right;
}
.table th {
  background: var(--panel);
  color: var(--text);
  font-weight: 700;
}
.table tr:hover td {
  background: color-mix(in srgb, var(--panel) 70%, transparent);
}
.table-variant th,
.table-variant td {
  padding: 6px 8px;
  font-size: 13px;
}
.table-variant th {
  font-weight: 600;
}

.form,
.checkout {
  background: var(--surface);
  padding: 16px;
  border-radius: 12px;
  display: grid;
  gap: 10px;
  border: 1px solid var(--border);
  align-items: start;
}

.checkout {
  grid-template-columns: 1fr;
}
.form.inline {
  display: flex;
  gap: 10px;
  align-items: center;
}
.form label {
  font-weight: 600;
  font-size: 14px;
  color: var(--muted);
}
.form input,
.form textarea,
.form select,
.checkout input,
.checkout textarea {
  padding: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  font-size: 14px;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}
.form input:focus,
.form textarea:focus,
.form select:focus,
.checkout input:focus,
.checkout textarea:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 70%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
  background: var(--surface);
}

.summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  flex-wrap: wrap;
}
.summary .actions {
  display: flex;
  gap: 8px;
}

.summary-box {
  background: var(--surface);
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  align-self: start;
}
.payment-options {
  display: grid;
  gap: 10px;
  margin-top: 6px;
}
.payment-option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}
.payment-option input {
  margin-top: 4px;
}
.payment-option:hover {
  border-color: var(--accent);
}
.payment-option input:checked + div .payment-title,
.payment-option input:checked + div .muted {
  color: var(--text);
}
.payment-option input:checked + div {
  font-weight: 600;
}
.payment-title {
  font-weight: 700;
  margin-bottom: 2px;
}
.payment-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-left: 6px;
  font-size: 18px;
}
.checkout-product-image {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
}
.summary-box .row {
  display: flex;
  justify-content: space-between;
  margin: 6px 0;
}
.summary-box .row.total {
  font-weight: 700;
}

.section {
  margin: 26px 0;
}
.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}
.feature-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}
.split {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
}
.lux-list {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
}
.lux-list li {
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
  color: var(--muted);
}
.stat-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  text-align: center;
}
.stat {
  font-size: 28px;
  font-weight: 800;
  color: var(--accent);
}
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.stats-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 14px;
}
.cta {
  background: linear-gradient(
    120deg,
    rgba(212, 175, 55, 0.2),
    rgba(18, 18, 26, 0.9)
  );
  border: 1px solid var(--border);
  padding: 20px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.cta h3 {
  margin: 0;
}
.contact-card {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
}
.whatsapp {
  position: fixed;
  bottom: max(16px, env(safe-area-inset-bottom));
  left: max(16px, env(safe-area-inset-left));
  right: auto;
  top: auto;
  z-index: 5200;
  background: #25d366;
  color: #111;
  padding: 12px 16px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

/* Floating WhatsApp icon button (preferred) */
.whatsapp-float{
  position: fixed;
  bottom: max(16px, env(safe-area-inset-bottom));
  left: max(16px, env(safe-area-inset-left));
  right: auto;
  top: auto;
  z-index: 5200;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: #25d366;
  color: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  text-decoration: none;
}
.whatsapp-float svg{width:28px;height:28px;display:block}
.whatsapp-float:hover{filter:brightness(1.02)}
.whatsapp-float:active{transform:translateY(1px)}

.invoice {
  background: var(--surface);
  padding: 20px;
  border-radius: 14px;
  border: 1px solid var(--border);
  max-width: 920px;
  margin: 16px auto;
  width: 100%;
}
.invoice-shell {
  background: var(--bg);
}
.invoice-shell .container {
  width: min(980px, 96%);
  margin: 20px auto;
}
.invoice-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  gap: 16px;
  flex-wrap: wrap;
}
.invoice-header {
  justify-content: center;
  text-align: center;
}
.invoice-meta {
  text-align: left;
  margin-right: auto;
}
.invoice-brand {
  display: grid;
  gap: 4px;
  text-align: center;
  align-items: center;
  margin: 0 auto;
}
.invoice-site-name {
  font-weight: 800;
  font-size: 20px;
  text-align: center;
}
.invoice-meta {
  display: grid;
  gap: 4px;
  text-align: right;
  font-size: 13px;
}
.invoice .table {
  width: 100%;
}
.invoice .table th,
.invoice .table td {
  text-align: center;
}
.invoice .table td:last-child,
.invoice .table th:last-child {
  text-align: right;
}
.invoice-section-title {
  margin: 12px 0 8px;
  font-size: 15px;
}
.invoice-customer {
  background: var(--surface);
  padding: 12px;
  display: grid;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.invoice-summary {
  margin-top: 12px;
  display: grid;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  max-width: 360px;
  margin-right: auto;
}
.invoice-summary-title {
  font-weight: 700;
  margin-bottom: 4px;
}
.invoice-summary .total {
  font-weight: 700;
  color: var(--accent);
}

.orders-table {
  width: 100%;
  table-layout: fixed;
  font-size: 13px;
}
.orders-table th,
.orders-table td {
  word-break: break-word;
  overflow-wrap: anywhere;
  vertical-align: top;
  padding: 8px 10px;
}

.orders-table td[data-label="تفاصيل المتغيرات"] ul,
.orders-table td[data-label="تفاصيل المتغيرات"] li {
  word-break: break-word;
  overflow-wrap: anywhere;
}

@media print {
  @page {
    size: A4;
    margin: 12mm;
  }
  html,
  body {
    font-size: 13.5px;
    line-height: 1.4;
  }
  body {
    background: #fff !important;
    color: #000 !important;
  }
  .site-header,
  .main-search-bar,
  .nav,
  .header-actions,
  .whatsapp-float,
  .actions,
  .footer,
  .auth-modal {
    display: none !important;
  }
  .admin-sidebar,
  .admin-topbar,
  .admin-actions,
  .admin-logout,
  .sidebar-toggle {
    display: none !important;
  }
  .admin-wrapper {
    display: block !important;
    grid-template-columns: 1fr !important;
  }
  .admin-wrapper,
  .admin-content,
  .admin-main {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .admin-content,
  .admin-main {
    width: 100% !important;
  }
  body.admin-shell * {
    visibility: hidden;
  }
  body.admin-shell .invoice,
  body.admin-shell .invoice * {
    visibility: visible;
  }
  body.admin-shell .invoice {
    position: relative;
  }
  body.admin-shell .invoice,
  body.admin-shell .invoice * {
    color: #000 !important;
    background: transparent !important;
  }
  .container {
    max-width: none !important;
    padding: 0 !important;
  }
  .invoice {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 auto !important;
  }
  .invoice-header {
    margin-bottom: 10px !important;
    gap: 8px !important;
  }
  .invoice-section-title {
    margin: 8px 0 6px !important;
    font-size: 13px !important;
  }
  .invoice-customer,
  .invoice-summary {
    padding: 8px !important;
    gap: 4px !important;
  }
  .invoice .table {
    table-layout: fixed;
    width: 100% !important;
  }
  .invoice .table th,
  .invoice .table td {
    padding: 6px 8px !important;
    font-size: 12px !important;
  }
  .invoice .table td {
    word-break: break-word;
    overflow-wrap: anywhere;
  }
  .invoice,
  .invoice-header,
  .invoice-customer,
  .invoice-summary,
  .invoice .table {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .table th,
  .table td {
    border: 1px solid #000 !important;
  }
  .table {
    border-collapse: collapse;
  }
  .btn,
  button {
    display: none !important;
  }
}

.muted {
  color: var(--muted);
  font-size: 13px;
}
.price {
  font-weight: 700;
  margin-top: 6px;
  color: var(--accent);
}
.alert {
  background: #3b0b0b;
  color: #fecaca;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #7f1d1d;
}
.admin-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.actions {
  margin-bottom: 12px;
  display: flex;
  gap: 8px;
}
.inline {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.color-input {
  display: flex;
  align-items: center;
  gap: 8px;
}
.color-input input {
  flex: 1;
}
.color-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid #111827;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}
.option-editor {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 12px;
}
.option-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.option-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 13px;
}
.option-chip button {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
}
.option-chip .link {
  color: var(--accent);
}
.option-chip .danger {
  color: #f87171;
}
.option-add {
  display: flex;
  gap: 8px;
  align-items: center;
}
.option-add input {
  flex: 1;
}
.save-note {
  margin-top: 6px;
  font-size: 12px;
  color: #22c55e;
}
.option-group {
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  margin-bottom: 14px;
  background: rgba(255, 255, 255, 0.02);
}
.option-group__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}
.option-group__header h4 {
  margin: 0;
}
.option-group__body {
  display: none;
}
.option-group.open .option-group__body {
  display: block;
}
.location-map {
  display: grid;
  gap: 12px;
}
.location-map__area,
.location-map__city {
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 10px;
  display: grid;
  gap: 8px;
}
.location-map__area-header,
.location-map__city-header {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.location-map__area-header input,
.location-map__city-header input {
  flex: 1;
  min-width: 180px;
}
.location-map__cities,
.location-map__villages {
  display: grid;
  gap: 8px;
}
.location-map__village {
  display: flex;
  gap: 8px;
  align-items: center;
}
.location-map__village input {
  flex: 1;
  min-width: 160px;
}
.inline-field {
  display: grid;
  grid-template-columns: 120px 1fr;
  align-items: center;
  gap: 10px;
}
.inline-field textarea,
.inline-field input,
.inline-field select {
  width: 100%;
}
.select-search {
  position: relative;
}
.input-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
  max-height: 220px;
  overflow: auto;
  padding: 6px;
  display: none;
  z-index: 30;
}
.input-list.open {
  display: block;
}
.input-list button {
  width: 100%;
  text-align: right;
  border: none;
  background: transparent;
  color: inherit;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.input-list button:hover {
  background: rgba(255, 255, 255, 0.08);
}
.list-compact {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}
.list-compact li {
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
  padding-bottom: 6px;
}
.list-compact li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.account-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 20px;
  align-items: start;
}
.account-menu {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: grid;
  gap: 10px;
}
.account-menu__title {
  font-weight: 700;
  font-size: 18px;
}
.account-menu__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(214, 178, 94, 0.2);
  color: var(--accent);
  width: fit-content;
}
.account-menu__link {
  text-decoration: none;
  color: var(--text);
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}
.account-menu__link:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.account-menu__link.active {
  background: rgba(214, 178, 94, 0.15);
  border-color: var(--accent);
  color: var(--accent);
}
.account-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
}
@media (max-width: 900px) {
  .account-layout {
    grid-template-columns: 1fr;
  }
}
.qty {
  width: 70px;
}
.qty-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 6px 10px;
}
.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
}
.qty-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.qty-value {
  min-width: 24px;
  text-align: center;
  font-weight: 600;
}
.cart-product {
  display: flex;
  align-items: center;
  gap: 12px;
}
.cart-thumb {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--surface);
}
.cart-name {
  font-weight: 600;
}
.gallery {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  margin-top: 10px;
}
.gallery img {
  width: 100%;
  height: 70px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.gallery-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
}
.gallery-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
}
.specs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin: 10px 0;
}
.review-list {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}
.review-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}
.review-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.rating {
  color: var(--accent);
}
.badge {
  display: inline-block;
}

.agent-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1.2;
  border: 1px solid hsl(var(--agent-h, 220) 60% 45%);
  background: hsl(var(--agent-h, 220) 70% 92%);
  color: hsl(var(--agent-h, 220) 65% 28%);
  margin-inline-start: 6px;
  white-space: nowrap;
}

.timeline {
  margin-top: 12px;
  display: grid;
  gap: 12px;
}
.timeline-item {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 10px;
  align-items: start;
}
.timeline-item .dot {
  width: 10px;
  height: 10px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.6);
}
.timeline-item .status {
  font-weight: 700;
  color: var(--accent);
}

.auth-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.auth-modal.active {
  display: flex;
}
.auth-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
}
.auth-dialog {
  position: relative;
  width: min(520px, 92%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  z-index: 1;
}
.auth-close {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.auth-close:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.auth-tab {
  flex: 1;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
}
.auth-tab.active {
  border-color: var(--accent);
  color: #111;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.auth-panel {
  display: none;
}
.auth-panel.active {
  display: block;
}
.auth-panel h2 {
  margin-top: 0;
}
.tree-label {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px dashed var(--border);
}
.tree-label[data-level="1"] {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}

/* Admin polish */
.admin-page .site-header {
  background: var(--panel);
}
.admin-page main.container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  margin-top: 18px;
  padding: 18px;
}
.admin-page .page-header h1 {
  font-size: 26px;
}
.admin-page .stats-grid .stat-card {
  background: linear-gradient(
    135deg,
    rgba(212, 175, 55, 0.14),
    rgba(18, 18, 26, 0.95)
  );
}
.admin-page .table {
  background: var(--surface);
}
.admin-page .table tr:hover {
  background: rgba(212, 175, 55, 0.06);
}
.admin-page .table th {
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.6px;
}
.admin-page .form,
.admin-page .checkout {
  background: var(--surface);
}
.admin-page .actions .btn {
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}
.admin-page .admin-links .btn {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
}
.admin-page .admin-links .btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.admin-shell {
  background: var(--bg);
  color: var(--text);
}
.admin-wrapper {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}
.admin-sidebar {
  background: var(--surface);
  border-left: 1px solid var(--border);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.08);
}
.admin-brand {
  font-weight: 800;
  color: var(--accent);
  font-size: 18px;
}
.admin-nav {
  display: grid;
  gap: 8px;
}
.admin-nav a {
  text-decoration: none;
  color: var(--text);
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--panel);
  transition: all 0.2s ease;
}
.admin-nav a:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.admin-nav a.active {
  border-color: var(--accent);
  color: #111;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.admin-logout {
  margin-top: auto;
  text-decoration: none;
  color: #fca5a5;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #7f1d1d;
  text-align: center;
}
.admin-content {
  padding: 16px;
}
.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 14px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.08);
}
.row-highlight {
  background: rgba(250, 204, 21, 0.18);
  box-shadow: inset 0 0 0 2px rgba(250, 204, 21, 0.45);
}
.row-highlight td {
  background: transparent;
}
.admin-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.admin-notify {
  position: relative;
}
.notify-btn {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px 10px;
  cursor: pointer;
  position: relative;
}
.notify-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.notify-badge {
  position: absolute;
  top: -6px;
  left: -6px;
  background: #ef4444;
  color: #fff;
  border-radius: 999px;
  font-size: 11px;
  padding: 2px 6px;
  border: 2px solid var(--surface);
}
.notify-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 320px;
  max-width: 80vw;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
  display: none;
  z-index: 1010;
}
.admin-notify.open .notify-panel {
  display: block;
}
.notify-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
}
.notify-counts {
  font-weight: 400;
  font-size: 12px;
  color: var(--muted);
}
.notify-empty {
  padding: 16px 12px;
  color: var(--muted);
}
.notify-list {
  list-style: none;
  margin: 0;
  padding: 8px;
  display: grid;
  gap: 8px;
  max-height: 320px;
  overflow: auto;
}
.notify-item a {
  display: block;
  text-decoration: none;
  color: var(--text);
  background: var(--panel);
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px;
}
.notify-item.is-read a {
  background: transparent;
  border-color: var(--border);
  opacity: 0.65;
}
.notify-item.is-read .notify-title {
  color: var(--muted);
}
.notify-item a:hover {
  border-color: var(--accent);
}
.notify-title {
  font-weight: 600;
}
.notify-item.notify-stock .notify-title {
  color: #f59e0b;
}
.notify-item.notify-order .notify-title {
  color: #22c55e;
}
.notify-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 8px 12px 12px;
  border-top: 1px solid var(--border);
}
.notify-footer a {
  text-decoration: none;
  text-align: center;
  padding: 8px;
  border-radius: 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
}
.notify-footer a:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.admin-title {
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-toggle {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 10px;
  cursor: pointer;
}
.sidebar-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.admin-main {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
}

body.admin-shell[data-sidebar="closed"] .admin-wrapper {
  grid-template-columns: 0 1fr;
}
body.admin-shell[data-sidebar="closed"] .admin-sidebar {
  width: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
}

.admin-login {
  background: radial-gradient(
    circle at top,
    color-mix(in srgb, var(--accent) 25%, transparent),
    var(--bg) 60%
  );
  min-height: 100vh;
  display: grid;
  place-items: center;
}
.admin-login-card {
  width: min(420px, 92%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.admin-login-card .admin-brand {
  text-align: center;
  margin-bottom: 12px;
}

@media (max-width: 980px) {
  .admin-wrapper {
    grid-template-columns: 1fr;
  }
  .admin-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 280px;
    max-width: 80%;
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.3);
  }
  body.admin-shell[data-sidebar="open"] .admin-sidebar {
    transform: translateX(0);
  }
  body.admin-shell[data-sidebar="closed"] .admin-sidebar {
    transform: translateX(100%);
  }
  body.admin-shell[data-sidebar="closed"] .admin-wrapper {
    grid-template-columns: 1fr;
  }
  .admin-content {
    padding: 8px;
  }
  .admin-topbar {
    padding: 8px 12px;
    margin-bottom: 10px;
    position: sticky;
    top: 0;
    z-index: 1005;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .admin-main {
    padding: 12px;
  }
  .admin-title {
    font-size: 14px;
    gap: 8px;
  }
  .admin-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    width: 100%;
    justify-content: flex-end;
  }
  .notify-panel {
    left: auto;
    right: 0;
    width: min(320px, 90vw);
  }
  .admin-actions .muted {
    display: none;
  }
  .sidebar-toggle {
    padding: 8px 12px;
    font-size: 18px;
    position: relative;
    z-index: 1006;
    box-shadow: none;
    pointer-events: auto;
  }
  /* Overlay للخلفية عند فتح السايدبار */
  body.admin-shell[data-sidebar="open"]::before {
    content: "";
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
  }
}

@media (max-width: 1400px) {
  .orders-table thead {
    display: none;
  }
  .orders-table tr {
    display: block;
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--surface);
  }
  .orders-table td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px dashed var(--border);
    flex-wrap: wrap;
    word-break: break-word;
  }
  .orders-table td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--muted);
    min-width: 80px;
  }
  .orders-table td:last-child {
    border-bottom: 0;
  }
  .orders-table td form {
    width: 100%;
  }
  .orders-table td input,
  .orders-table td select {
    max-width: 100%;
  }
  .orders-table td[data-label="الإجراءات"] {
    align-items: center;
  }
}

@media (max-width: 768px) {
  /* Admin Panel Mobile Styles */
  .admin-sidebar {
    width: 260px;
    max-width: 85%;
  }
  .admin-nav a {
    padding: 12px 14px;
    font-size: 15px;
  }
  .admin-topbar {
    padding: 6px 10px;
    border-radius: 10px;
  }
  .admin-title {
    font-size: 13px;
  }
  .admin-actions .theme-toggle {
    width: 32px;
    height: 32px;
  }
  .theme-toggle {
    display: none;
  }
  .admin-main {
    padding: 10px;
    border-radius: 12px;
  }
  /* جداول البيانات responsive */
  .admin-main table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .admin-main .actions {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .admin-main .actions .btn,
  .admin-main .actions .btn.outline,
  .admin-main .actions .btn.secondary {
    width: 100%;
  }
  .admin-main .table thead {
    display: none;
  }
  .admin-main .table tr {
    display: block;
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--surface);
  }
  .admin-main .table td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px dashed var(--border);
  }
  .admin-main .table td,
  .responsive-table td {
    flex-wrap: wrap;
    word-break: break-word;
  }
  .admin-main .table td > *,
  .responsive-table td > * {
    max-width: 100%;
  }
  .admin-main .table td form,
  .responsive-table td form {
    width: 100%;
  }
  .admin-main .table td input,
  .admin-main .table td select,
  .responsive-table td input,
  .responsive-table td select {
    max-width: 100%;
  }
  .admin-main .table td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--muted);
    min-width: 80px;
  }
  .admin-main .table td:last-child {
    border-bottom: 0;
  }
  .admin-main .actions {
    flex-direction: column;
    align-items: stretch;
  }
  .admin-main .actions .btn,
  .admin-main .actions .btn.outline {
    width: 100%;
  }
  .responsive-table thead {
    display: none;
  }
  .responsive-table tr {
    display: block;
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--surface);
  }
  .responsive-table td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px dashed var(--border);
  }
  .responsive-table td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--muted);
    min-width: 80px;
  }
  .responsive-table td:last-child {
    border-bottom: 0;
  }
  .responsive-table td[data-label="الإجراءات"] {
    align-items: center;
  }
  .admin-main .btn {
    font-size: 13px;
    padding: 8px 12px;
  }
  /* Form responsive */
  .form label {
    font-size: 13px;
  }
  .form input,
  .form textarea,
  .form select {
    font-size: 15px;
    padding: 10px 8px;
  }
  .form > div {
    flex-direction: column;
    gap: 6px;
  }
  .form > div[style*="display:flex"] {
    flex-direction: row !important;
  }
  .admin-main .form.inline {
    flex-direction: column;
    align-items: stretch;
  }
  .admin-main .form.inline input,
  .admin-main .form.inline select,
  .admin-main .form.inline button {
    width: 100%;
  }
  .admin-main .order-filters {
    display: block;
  }
  .admin-main .order-filters > div {
    width: 100%;
  }
  .admin-main .order-filters input,
  .admin-main .order-filters select,
  .admin-main .order-filters button,
  .admin-main .order-filters a.btn {
    width: 100%;
  }
  .admin-main .order-filters a.btn {
    display: inline-flex;
    justify-content: center;
  }
  .admin-main .order-filters .btn,
  .admin-main .order-filters .btn.outline,
  .admin-main .order-filters .btn.secondary {
    font-size: 12px;
    padding: 6px 10px;
  }
  .admin-main .order-filter-actions {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }
  .admin-main .order-filter-actions .btn,
  .admin-main .order-filter-actions .btn.outline,
  .admin-main .order-filter-actions .btn.secondary {
    width: 100% !important;
    justify-content: center;
    font-size: 11px;
    padding: 6px 6px;
  }
  .form .btn {
    width: 100%;
    justify-content: center;
  }
  /* جداول المتغيرات responsive */
  .form table.table {
    font-size: 13px;
  }
  .form table.table input {
    min-width: 60px;
    padding: 6px;
  }
  .form table.table th,
  .form table.table td {
    padding: 6px 4px;
  }
  /* Front-end Mobile Styles */
  .product {
    grid-template-columns: 1fr;
  }
  .site-header .container {
    align-items: center;
    gap: 10px;
  }
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .nav {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 12px;
    display: none;
    flex-direction: column;
    gap: 10px;
  }
  .nav.open {
    display: flex;
  }
  .nav a,
  .auth-open {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
  .theme-toggle {
    width: 36px;
    height: 36px;
    margin-inline: auto;
  }
  .hero {
    padding: 22px;
    border-radius: 14px;
  }
  .hero h1 {
    font-size: 24px;
  }
  .hero .actions {
    width: 100%;
  }
  .card img {
    height: 160px;
  }
  .grid {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  }
  .banner-card img {
    height: 140px;
  }
  .cta {
    align-items: flex-start;
  }
  .btn {
    width: 100%;
    text-align: center;
  }
  .actions {
    width: 100%;
    flex-direction: column;
  }
  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .split {
    grid-template-columns: 1fr;
  }
}

/* شاشات الجوال الصغيرة جداً */
@media (max-width: 480px) {
  .admin-sidebar {
    width: 100%;
    max-width: 100%;
  }
  .admin-content {
    padding: 6px;
  }
  .admin-topbar {
    padding: 6px 8px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .admin-title {
    font-size: 12px;
  }
  .admin-actions {
    gap: 6px;
  }
  .admin-actions .theme-toggle {
    width: 32px;
    height: 32px;
  }
  .admin-main {
    padding: 8px;
  }
  .admin-nav a {
    padding: 10px 12px;
    font-size: 14px;
  }
  .admin-brand {
    font-size: 16px;
  }
  .sidebar-toggle {
    padding: 6px 10px;
  }
  /* تحسينات للجداول والنماذج */
  .admin-main input,
  .admin-main select,
  .admin-main textarea {
    font-size: 16px; /* منع الزوم التلقائي في iOS */
  }
  .admin-main .btn {
    font-size: 13px;
    padding: 8px 14px;
    white-space: nowrap;
  }
  .form > div[style*="display:flex"] .btn {
    min-width: auto;
    flex-shrink: 0;
  }
  /* تحسين أزرار النموذج للجوال الصغير */
  .form > .btn {
    width: 100%;
    text-align: center;
  }
  .form .actions,
  .form > div.actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }
  .form .actions .btn,
  .form > div.actions .btn {
    width: 100%;
  }
}

@media print {
  .site-header,
  .site-footer,
  .actions,
  .nav {
    display: none !important;
  }
  body {
    background: #fff;
    color: #111;
  }
}
