/* ── Tokens ──────────────────────────────────────────── */
:root {
  --primary: #916c4f;
  --primary-hover: rgb(123, 91, 67);
  --primary-light: rgba(145, 108, 79, 0.08);
  --primary-dark: rgb(123, 91, 67);

  
  
  
  

  --bg-body: #f7f9fc;
  --bg-card: #ffffff;
  --bg-surface: #ffffff;
  --bg-hover: #f1f5f9;
  --border-color: #e2e8f0;
  --border-focus: #916c4f;

  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  
  
  
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);

  --transition: 0.2s ease-in-out;
  --font-main: 'Cairo', system-ui, -apple-system, sans-serif;

  --sidebar-w: 240px;
}

/* ── Shimmer Loading ────────────────────────────────── */
.shimmer {
  background: #f6f7f8;
  background-image: linear-gradient(to right, #f6f7f8 0%, #edeef1 20%, #f6f7f8 40%, #f6f7f8 100%);
  background-repeat: no-repeat;
  background-size: 800px 104px;
  display: inline-block;
  position: relative;
  animation-duration: 1.2s;
  animation-fill-mode: forwards;
  animation-iteration-count: infinite;
  animation-name: shimmer;
  animation-timing-function: linear;
  border-radius: 4px;
}

@keyframes shimmer {
  0% {
    background-position: -468px 0;
  }

  100% {
    background-position: 468px 0;
  }
}

.is-loading .loading-hide {
  visibility: hidden;
}

.is-loading .loading-shimmer {
  position: relative;
  overflow: hidden;
}

.is-loading .loading-shimmer::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #f6f7f8;
  background-image: linear-gradient(to right, #f6f7f8 0%, #edeef1 20%, #f6f7f8 40%, #f6f7f8 100%);
  background-repeat: no-repeat;
  animation: shimmer 1.2s linear infinite;
  z-index: 10;
}

/* ── Reset ───────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

input, button, select, textarea {
  font-family: inherit;
}

body {
  font-family: var(--font-main);
  background: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}

/*a:hover {
  color: var(--primary-hover);
}*/

img {
  max-width: 100%;
  display: block;
}

/* ── Layout ──────────────────────────────────────────── */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.checkout-grid {
  margin-bottom: 30px;
}

.page-content {
  flex: 1;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 600px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

.grid-2-always {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ── Phone Input UI ── */
.phone-input-wrapper {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #fff;
  overflow: hidden;
  direction: ltr;
  transition: border-color 0.2s, box-shadow 0.2s;
  height: 44px;
}

.phone-input-wrapper:focus-within {
  border-color: var(--primary, var(--primary));
  box-shadow: 0 0 0 3px rgba(145, 108, 79, 0.1);
}

.phone-input-flag {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  background: #f8fafc;
  border-right: 1px solid var(--border-color);
  height: 100%;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  flex-shrink: 0;
  user-select: none;
}

.phone-input-flag img {
  width: 20px;
  height: 14px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.phone-input-wrapper input {
  flex: 1;
  border: none !important;
  outline: none;
  background: transparent;
  padding: 0 14px;
  height: 100%;
  font-size: 1rem;
  color: var(--text-main);
  font-family: inherit;
  text-align: left;
}

/* ── Store Header ────────────────────────────────────── */
.store-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.store-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.store-logo {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.store-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.store-nav a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
}

.store-nav a:hover,
.store-nav a.active {
  color: var(--text-main);
}

.cart-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-body);
  padding: 7px 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  color: var(--text-main) !important;
}

.cart-badge:hover {
  background: var(--border-color);
}

.cart-count {
  background: var(--primary);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

/* ── Typography ──────────────────────────────────────── */
h1,
h2,
h3,
h4 {
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}

.page-title {
  font-size: 1.9rem;
  margin-bottom: 6px;
  padding-top: 10px;
}

.page-subtitle {
  color: var(--text-muted);
  margin-bottom: 28px;
  font-size: 1rem;
}

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-family: var(--font-main);
  font-size: 0.92rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  line-height: 1.4;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border: 1px solid var(--primary);
}

/*.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}*/

.btn-secondary {
  background: var(--bg-surface);
  border-color: var(--border-color);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: var(--bg-hover);
}

.btn-danger {
  background: #fee2e2;
  color: var(--danger);
  border-color: #fca5a5;
}

.btn-danger:hover {
  background: #fecaca;
}

.btn-success {
  background: #d1fae5;
  color: #065f46;
  border-color: #6ee7b7;
}

.btn-sm {
  padding: 5px 11px;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ── Forms ────────────────────────────────────────────── */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 7px;
  color: var(--text-main);
}

.form-control {
  width: 100%;
  padding: 10px 13px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.93rem;
  transition: border var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-control::placeholder {
  color: var(--text-light);
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

select.form-control {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 34px;
}

[dir="rtl"] select.form-control {
  background-position: left 13px center;
  padding-right: 13px;
  padding-left: 34px;
}

/* ── Product Card (Storefront) ───────────────────────── */
.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow var(--transition);
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  box-shadow: var(--shadow-lg);
}

.product-img {
  width: 100%;
  height: 280px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
}

.product-info {
  padding: 18px;
  text-align: center;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-title {
  font-size: 1.05rem;
  margin-bottom: 6px;
}

.product-price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 14px;
}

.product-desc {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 18px;
  flex: 1;
}

.product-options {
  text-align: right;
  margin-bottom: 18px;
}

[dir="ltr"] .product-options {
  text-align: left;
}

/* ── Radio Options ───────────────────────────────────── */
.option-group {
  margin-bottom: 14px;
}

.option-group-title {
  font-size: 0.87rem;
  font-weight: 600;
  margin-bottom: 7px;
  color: var(--text-main);
}

.radio-options {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.radio-option input[type="radio"] {
  display: none;
}

.radio-option label {
  display: inline-flex;
  padding: 5px 11px;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.83rem;
  color: var(--text-muted);
  background: var(--bg-surface);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  user-select: none;
}

.radio-option input[type="radio"]:checked+label {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  font-weight: 500;
}

.option-price {
  font-size: 0.78rem;
  margin-right: 3px;
  opacity: 0.8;
}

/* ── Cart Items ──────────────────────────────────────── */
.cart-item {
  display: flex;
  gap: 16px;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  align-items: center;
  margin-bottom: 10px;
}

.cart-item-img {
  width: 68px;
  height: 68px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: #ffffff;
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}

.cart-item-info {
  flex: 1;
  min-width: 0;
}

.cart-item-name {
  font-weight: 500;
  margin-bottom: 3px;
  color: var(--text-main);
}

.cart-item-options {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.cart-item-price {
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}

.cart-item-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.qty-control {
  display: inline-flex;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.qty-btn {
  width: 36px;
  height: 36px;
  background: var(--bg-surface);
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.qty-btn:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

.qty-value {
  width: 40px;
  text-align: center;
  line-height: 36px;
  font-size: 1rem;
  border-left: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
}

/* ── Checkout & Summary ──────────────────────────────── */
.checkout-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 36px;
}

.summary-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  position: sticky;
  top: 80px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  color: var(--text-muted);
  font-size: 0.93rem;
}

.summary-row.total {
  border-top: 1px solid var(--border-color);
  padding-top: 14px;
  margin-top: 14px;
  font-weight: 700;
  color: var(--text-main);
  font-size: 1.15rem;
}

/* ── Grid ────────────────────────────────────────────── */
.grid {
  display: grid;
  gap: 20px;
  grid-auto-rows: 1fr;
}

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

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

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

/* ── Admin Layout ────────────────────────────────────── */
.admin-layout {
  display: flex;
  min-height: 100vh;
  background: var(--bg-body);
}

.admin-sidebar {
  width: var(--sidebar-w);
  background: var(--bg-card);
  border-left: 1px solid var(--border-color);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

[dir="ltr"] .admin-sidebar {
  border-left: none;
  border-right: 1px solid var(--border-color);
}

.admin-brand-header {
  margin-bottom: 24px;
  padding: 0 4px;
}

.admin-brand-sub {
  font-size: 0.85rem;
  color: #64748b;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.admin-brand-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 12px;
  text-align: left;
  direction: ltr;
}

.admin-store-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 8px;
  border: 1px solid var(--primary);
  border-radius: 20px;
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 600;
  background: none;
  cursor: pointer;
  transition: 0.2s;
  text-decoration: none;
}

.admin-store-preview:hover {
  background: var(--primary-light);
}

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-main);
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.admin-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 4px;
  color: #475569;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.15s;
  position: relative;
  text-decoration: none;
}

.admin-nav a svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  flex-shrink: 0;
}

.admin-nav a:hover {
  color: #0f172a;
}

.admin-nav a.active {
  background: #e6f6f4;
  color: var(--primary);
}

.admin-nav a.active::after {
  content: '';
  position: absolute;
  right: -16px;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--primary);
  border-radius: 4px 0 0 4px;
}

.admin-nav a.logout {
  color: var(--danger);
  margin-top: auto;
}

.admin-nav a.logout:hover {
  background: #fee2e2;
}

.admin-main {
  flex: 1;
  padding: 32px 28px;
  overflow-y: auto;
  min-width: 0;
}

/* ── Admin Cards & Tables ────────────────────────────── */
.admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
}

.admin-card.mb-24 {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  margin-bottom: 24px;
  overflow: hidden;
}

.table-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  background: var(--bg-body);
  padding: 12px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
  text-align: right;
}

[dir="ltr"] th {
  text-align: left;
}

td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.92rem;
  text-align: right;
}

[dir="ltr"] td {
  text-align: left;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: #fafbfc;
}

/* ── Badges ──────────────────────────────────────────── */
.badge {
  display: inline-flex;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 0.73rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-success {
  background: #d1fae5;
  color: #065f46;
}

.badge-warning {
  background: #fef3c7;
  color: #92400e;
}

.badge-info {
  background: #e0e7ff;
  color: #3730a3;
}

.badge-danger {
  background: #fee2e2;
  color: #991b1b;
}

/* ── Modal ───────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
  animation: fadeIn 0.15s;
}

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

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.2s;
}

.modal-box {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.2s;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 1.15rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.6rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}

.modal-close:hover {
  color: var(--text-main);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* ── Toast ───────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

[dir="ltr"] .toast-container {
  left: auto;
  right: 20px;
}

.toast {
  background: var(--text-main);
  color: #fff;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow);
  animation: slideUp 0.25s;
  max-width: 320px;
}

.toast.error {
  background: var(--danger);
}

.toast.success {
  background: var(--success);
}

.toast-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0;
}

/* ── Loading ─────────────────────────────────────────── */
.spinner {
  width: 30px;
  height: 30px;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  margin: 36px auto;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* ── Utilities ───────────────────────────────────────── */
.flex {
  display: flex;
}

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

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

.gap-8 {
  gap: 8px;
}

.gap-12 {
  gap: 12px;
}

.gap-16 {
  gap: 16px;
}

.gap-24 {
  gap: 24px;
}

.mt-8 {
  margin-top: 8px;
}

.mt-16 {
  margin-top: 16px;
}

.mt-24 {
  margin-top: 24px;
}

.mb-8 {
  margin-bottom: 8px;
}

.mb-16 {
  margin-bottom: 16px;
}

.mb-24 {
  margin: 24px 0;
}

.text-center {
  text-align: center;
}

.text-muted {
  color: var(--text-muted);
}

.text-sm {
  font-size: 0.83rem;
}

.text-danger {
  color: var(--danger);
}

.hidden {
  display: none !important;
}

/* ── Global Number Input Spinner Fix ─────────────────── */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type=number] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.no-animation {
  transition: none !important;
}


/* ── Slide-Out Cart (Storefront) ─────────────────────── */
.slide-cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s;
}

.slide-cart-overlay.open {
  opacity: 1;
  visibility: visible;
}

.slide-cart {
  position: fixed;
  top: 0;
  left: -420px;
  width: 75%;
  max-width: 400px;
  height: 100%;
  height: 100dvh;
  background: #fff;
  z-index: 1001;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

[dir="ltr"] .slide-cart {
  left: auto;
  right: -420px;
}

.slide-cart.open {
  left: 0;
}

[dir="ltr"] .slide-cart.open {
  left: auto;
  right: 0;
}

/* ── Slide Menu (Categories) ─────────────────────────── */
.slide-menu {
  position: fixed;
  top: 0;
  right: -420px;
  width: 30%;
  min-width: 280px;
  max-width: 320px;
  height: 100%;
  height: 100dvh;
  background: #fff;
  z-index: 1001;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

[dir="ltr"] .slide-menu {
  right: auto;
  left: -420px;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
}

.slide-menu.open {
  right: 0;
}

[dir="ltr"] .slide-menu.open {
  right: auto;
  left: 0;
}

.slide-menu-header {
  padding: 14px 16px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
}

.slide-menu-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 0;
}

.slide-menu-item {
  display: block;
  padding: 14px 20px;
  color: #111827;
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 600;
  border-bottom: 1px solid #f9fafb;
}

.slide-menu-item:hover {
  background: #f3f4f6;
}

.slide-cart-header {
  padding: 14px 16px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
}

.slide-cart-back {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #374151;
}

.slide-cart-back:hover {
  background: #f3f4f6;
}

.slide-cart-back svg {
  stroke-width: 2.5;
  width: 22px;
  height: 22px;
}

.slide-cart-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

.slide-cart-footer {
  padding: 14px 16px 18px;
  border-top: 1px solid #f0f0f0;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.slide-cart-subtotal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1rem;
  padding: 4px 0 10px;
}

.slide-cart-subtotal-label,
.slide-cart-subtotal-value {
  font-weight: 700;
  font-size: 15px;
  color: #111827;
}

.slide-cart-checkout-btn {
  background: var(--primary) !important;
  color: #fff !important;
  border-radius: 2px !important;
  padding: 7px !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
  text-align: center;
  display: block;
  text-decoration: none;
}

.slide-cart-view-btn {
  background: transparent !important;
  color: var(--primary) !important;
  border: 1.5px solid var(--primary) !important;
  border-radius: 2px !important;
  padding: 7px !important;
  font-size: 0.92rem !important;
  text-align: center;
  display: block;
  text-decoration: none;
}

/* SC Item */
.sc-item {
  padding: 12px 14px;
  border-bottom: 1px solid #f3f4f6;
}

.sc-item-top {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
}

.sc-item-img {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  object-fit: cover;
  background: #ffffff;
  flex-shrink: 0;
  border: 1px solid #f0f0f0;
}

.sc-item-img-placeholder {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  background: #f3f4f6;
  flex-shrink: 0;
}

.sc-item-info {
  flex: 1;
  min-width: 0;
}

.sc-item-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 3px;
  line-height: 1.35;
  white-space: normal;
  word-break: break-word;
}

.sc-item-opts {
  font-size: 0.78rem;
  color: #6b7280;
  margin-bottom: 4px;
}

.sc-item-price {
  font-size: 0.88rem;
  color: #6b7280;
}

.sc-delete-btn {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid #fee2e2;
  background: #fff5f5;
  color: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-top: 2px;
}

.sc-delete-btn:hover {
  background: #fee2e2;
}

.sc-item-qty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sc-qty-control {
  display: flex;
  align-items: center;
  border: 1.5px solid #e5e7eb;
  border-radius: 0;
  overflow: hidden;
  height: 34px;
}

.sc-qty-btn {
  width: 34px;
  height: 34px;
  border: none;
  background: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  color: #374151;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sc-qty-btn:hover:not(:disabled) {
  background: #f9fafb;
}

.sc-qty-value {
  min-width: 32px;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 600;
  color: #111827;
}

.sc-item-total {
  font-weight: 700;
  font-size: 14px;
  color: #111827;
}


/* ── Mobile Sidebar Toggle ───────────────────────────── */
.sidebar-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--text-main);
}

.admin-sidebar-header {
  display: none;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 960px) {
  .checkout-layout {
    grid-template-columns: 1fr;
  }

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

  /* Admin layout stays row but sidebar becomes fixed overlay */
  .admin-layout {
    flex-direction: column;
  }

  /* Mobile Top Bar */
  .admin-sidebar {
    width: 100%;
    height: 70px;
    border-left: none;
    border-bottom: 1px solid var(--border-color);
    padding: 0 16px;
    position: sticky;
    top: 0;
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    align-items: center;
    overflow: visible;
    z-index: 1000;
    background: #fff;
    max-height: none !important;
  }

  .admin-brand-header {
    width: auto;
    flex: none !important;
    display: flex;
    justify-content: center;
    margin-bottom: 0;
    padding: 0;
  }

  .admin-store-preview {
    width: auto;
    padding: 8px 16px;
    justify-content: center;
    margin: 0;
  }

  .admin-brand-title,
  .admin-brand-sub {
    display: none;
  }

  .sidebar-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--text-main);
    z-index: 10000;
    position: absolute !important;
    left: 16px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    transition: opacity 0.2s;
  }

  .admin-sidebar.open .sidebar-toggle {
    opacity: 0;
    pointer-events: none;
  }

  /* Slide-in Drawer Menu (Left side) */
  .admin-nav {
    position: fixed;
    top: 0;
    left: -280px;
    width: 260px;
    height: 100vh;
    background: #fff;
    flex-direction: column;
    flex-wrap: nowrap;
    padding: 20px;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2000;
    margin-top: 0;
    border-top: none;
    overflow-y: auto;
  }

  /* Drawer open state */
  .admin-sidebar.open .admin-nav {
    left: 0;
  }

  /* Drawer overlay background */
  .admin-sidebar::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1500;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

  .admin-sidebar.open::before {
    opacity: 1;
    visibility: visible;
  }

  .admin-nav a {
    padding: 14px 16px;
    font-size: 1.05rem;
    border-bottom: 1px solid #f1f5f9;
    width: 100%;
  }

  .admin-nav a.logout {
    margin-top: auto;
    border-bottom: none;
    color: #ef4444;
  }

  .admin-main {
    padding: 20px 16px;
  }

  /* Order details layout */
  .order-details-layout {
    grid-template-columns: 1fr !important;
  }

  .order-create-layout {
    grid-template-columns: 1fr !important;
  }

  /* Tables scroll on mobile */
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table-wrapper table {
    min-width: 600px;
  }
}

@media (max-width: 768px) {
  .page-title {
    font-size: 1.5rem;
  }

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

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .modal {
    padding: 20px;
  }

  /* Modals full width on tablet */
  .modal-overlay .modal-box {
    width: 95% !important;
    max-width: 95% !important;
  }
}

@media (max-width: 600px) {
  .container {
    padding: 0 14px;
  }

  .grid-2,
  .grid-3,
  .grid-4,
  .grid-2-always {
    grid-template-columns: 1fr !important;
  }

  .cart-item {
    flex-wrap: wrap;
  }

  .cart-item-actions {
    width: 100%;
    justify-content: space-between;
  }

  .slide-cart {
    max-width: 100%;
  }

  .admin-main {
    padding: 16px 12px;
  }

  .page-title {
    font-size: 1.3rem;
    margin-bottom: 8px;
  }

  .flex-between {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 12px;
  }

  .flex-between>div {
    width: 100%;
  }

  .flex-between .btn {
    width: 100%;
    justify-content: center;
  }

  .admin-card {
    padding: 16px;
    margin-bottom: 16px;
  }

  /* Product card actions wrap on phone */
  .product-card-item>div:last-child {
    flex-wrap: wrap !important;
  }

  /* Order summary sticky off on mobile */
  .order-summary-card {
    position: static !important;
  }

  /* Modal full width */
  .modal-overlay .modal-box {
    width: 96% !important;
    max-width: 96% !important;
    max-height: 90vh;
  }

  .modal-overlay .modal-body .grid-2 {
    grid-template-columns: 1fr !important;
  }

  /* Modal footers */
  .modal-footer {
    flex-direction: row !important;
    gap: 10px !important;
  }

  .modal-footer .btn {
    flex: 1 !important;
    margin: 0 !important;
    justify-content: center;
  }

  /* Section header wrapping */
  .section-header {
    flex-wrap: wrap;
  }

  /* Info card responsive */
  .info-card {
    margin-bottom: 16px;
  }

  /* Tables */
  th,
  td {
    padding: 10px 8px;
    font-size: 0.85rem;
  }

  .table-wrapper table {
    min-width: 500px;
  }

  /* Form groups */
  .form-group {
    margin-bottom: 14px;
  }

  /* Product Form image preview */
  #img-preview-el {
    width: 100%;
    object-fit: cover;
  }

  /* Admin header actions */
  .header-actions {
    flex-direction: column;
    align-items: stretch !important;
  }

  /* Bulk actions bar wrap */
  #bulk-actions-bar {
    flex-wrap: wrap;
  }

  /* Admin card overflow */
  .admin-card {
    overflow-x: auto;
  }
}

/* ── Category / Collections Grid ─────────────────────── */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  direction: rtl;
  max-width: 100%;
  padding: 16px;
  margin: 0 auto;
  box-sizing: border-box;
}

.cat-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  display: block;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.cat-item img {
  width: 100%;
  height: 100%;
  object-fit: initial;
  display: block;
}

.cat-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.93);
  padding: 6px 10px;
  font-size: 15px;
  font-weight: 700;
  color: #1d2939;
  font-family: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.5;
}

@media (max-width: 768px) {
  .cat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 10px;
  }

  .cat-label {
    font-size: 13px;
    padding: 5px 8px;
  }
}

/* Tablet adjustments */
@media (max-width: 768px) and (min-width: 601px) {
  .admin-main {
    padding: 20px;
  }

  .table-wrapper table {
    min-width: 500px;
  }
}

/* ── Move Icon to the Left & Text to the Right (RTL Support) ── */
button:has(svg):has(span),
.btn:has(svg):has(span),
.detail-add-btn,
.copy-btn,
.btn-copy-payment {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-direction: row-reverse !important;
  gap: 8px !important;
}

button:has(svg):has(span) svg,
.btn:has(svg):has(span) svg,
.detail-add-btn svg,
.copy-btn svg,
.btn-copy-payment svg {
  margin: 0 !important;
  flex-shrink: 0 !important;
}

/* Prevent any scale/shrink transition when clicking buttons */
.btn:active,
button:active,
.radio-option label:active {
  transform: none !important;
  transition: none !important;
}