/* ============================================
   MADAI SHIVUK CATALOG — Design System v3
   Brand: Magenta #D1208A
   ============================================ */

/* ── CSS Variables ───────────────────────────────────────────────── */
:root {
  --primary:        #D1208A;
  --primary-hover:  #B01A75;
  --bg:             #FFFFFF;
  --bg-section:     #F8F9FA;
  --text-primary:   #333333;
  --text-secondary: #777777;
  --border:         #E8E8E8;
  --shadow:         0 2px 12px rgba(0,0,0,0.08);
  --shadow-hover:   0 8px 24px rgba(0,0,0,0.14);
  --radius-card:    12px;
  --radius-btn:     8px;
  --radius-input:   50px;
  --shadow-sm:      0 2px 8px rgba(0,0,0,0.06);
  --shadow-md:      0 2px 10px rgba(0,0,0,0.08);
  --shadow-lg:      0 8px 32px rgba(0,0,0,0.18);
  --gradient-primary: linear-gradient(135deg, #D1208A 0%, #8B0A5A 100%);
}

/* ── Reset & Base ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  background: var(--bg);
  font-family: 'Assistant', 'Heebo', Arial, sans-serif;
  color: var(--text-primary);
  direction: rtl;
}

/* ── Header — Top Bar ────────────────────────────────────────────── */
.catalog-topbar {
  height: 38px;
  background: #111111;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  position: sticky;
  top: 0;
  z-index: 101;
}

/* ── Header — Main ───────────────────────────────────────────────── */
.catalog-header {
  background: var(--bg);
  border-bottom: 2px solid #D1208A;
  position: sticky;
  top: 38px;
  z-index: 100;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.catalog-logo-area {
  display: flex;
  align-items: center;
  gap: 10px;
}
.catalog-logo-img {
  height: 40px;
  width: 40px;
  object-fit: contain;
  background: #000;
  border-radius: 8px;
}
.catalog-logo-text {
  font-size: 17px;
  font-weight: 800;
  color: #111111;
}

.catalog-user-info {
  flex: 1;
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.catalog-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Cart button */
.catalog-cart-btn {
  position: relative;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-btn);
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  font-family: inherit;
  transition: background 0.2s;
}
.catalog-cart-btn:hover { background: var(--primary-hover); }

#cart-count {
  background: #fff;
  color: var(--primary);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 2px;
}

#cart-count-mobile {
  background: #FFFFFF;
  color: #D1208A;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
  min-width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}

/* Logout button */
.catalog-logout-btn {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
  border-radius: var(--radius-btn);
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  min-height: 40px;
  font-family: inherit;
  transition: background 0.2s, color 0.2s;
}
.catalog-logout-btn:hover { background: var(--primary); color: #fff; }

/* ── Search Bar ──────────────────────────────────────────────────── */
.catalog-search-bar {
  padding: 12px 16px;
  background: var(--bg);
  position: sticky;
  top: 86px;
  z-index: 90;
  border-bottom: 1px solid var(--border);
}
.catalog-search-bar input {
  width: 100%;
  max-width: 600px;
  display: block;
  margin: 0 auto;
  height: 46px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: #f5f5f5;
  font-size: 15px;
  font-family: inherit;
  color: var(--text-primary);
  padding: 0 20px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  direction: rtl;
}
.catalog-search-bar input::placeholder { color: var(--text-secondary); }
.catalog-search-bar input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(209,32,138,0.15);
  background: var(--bg);
}

/* ── Category Tabs ───────────────────────────────────────────────── */
.catalog-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.catalog-tab {
  border-radius: 8px;
  padding: 7px 18px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid #e5e5e5;
  color: #444444;
  background: #f5f5f5;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  white-space: nowrap;
}
.catalog-tab:hover:not(.active) {
  border-color: var(--primary);
  color: var(--primary);
}
.catalog-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ── Catalog Page & Grid ─────────────────────────────────────────── */
.catalog-page {
  max-width: 1340px;
  margin: 0 auto;
  padding: 16px 16px 60px;
}

.catalog-section { margin-bottom: 32px; }

.catalog-cat-title {
  font-size: 17px;
  font-weight: 800;
  color: #111111;
  border-right: 3px solid #D1208A;
  padding-right: 10px;
  margin: 16px 0 12px;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

/* ── Product Card ────────────────────────────────────────────────── */
.catalog-card {
  background: var(--bg);
  border: 1px solid #eeeeee;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}
.catalog-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
}

/* Image area */
.catalog-card-img {
  height: 160px;
  background: var(--bg-section);
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  position: relative;
}
.catalog-card-img img {
  max-height: 90%;
  max-width: 90%;
  object-fit: contain;
}
.catalog-card-noimg {
  font-size: 48px;
  color: var(--border);
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-section);
  border-bottom: 1px solid var(--border);
  position: relative;
}

/* Card body */
.catalog-card-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.catalog-sku {
  font-size: 11px;
  color: #aaaaaa;
  margin-bottom: 2px;
}
.catalog-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
}
.catalog-desc {
  font-size: 14px;
  color: #555555;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.catalog-price {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 10px;
}

/* Quantity row */
.catalog-add-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
}
.catalog-qty {
  display: flex;
  align-items: center;
  gap: 8px;
}
.catalog-qty-btn {
  min-width: 32px;
  min-height: 32px;
  border: 1.5px solid #D1208A;
  color: var(--primary);
  background: var(--bg);
  border-radius: 6px;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  transition: background 0.2s, color 0.2s;
  line-height: 1;
}
.catalog-qty-btn:hover { background: var(--primary); color: #fff; }

.catalog-qty-input {
  width: 48px;
  text-align: center;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: inherit;
  padding: 4px 0;
}
.catalog-qty-input::-webkit-inner-spin-button,
.catalog-qty-input::-webkit-outer-spin-button { -webkit-appearance: none; }

/* Add to cart button */
.catalog-add-btn {
  width: 100%;
  padding: 9px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
}
.catalog-add-btn:hover { background: var(--primary-hover); }
.catalog-add-btn.added { background: #28a745; }
.catalog-add-btn:disabled { background: #cccccc !important; opacity: 1; cursor: not-allowed; }
.catalog-card.out-of-stock .catalog-qty-btn { opacity: 0.35; pointer-events: none; }

/* ── Loading & Error States ──────────────────────────────────────── */
#catalog-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}
.catalog-spinner-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.catalog-spinner-ring {
  width: 48px;
  height: 48px;
  border: 4px solid #F8F9FA;
  border-top: 4px solid #D1208A;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.catalog-spinner-text {
  color: #777777;
  font-size: 14px;
  font-family: 'Heebo', Arial, sans-serif;
}
@keyframes spin { to { transform: rotate(360deg); } }

#catalog-load-error {
  background: #FFF0F5;
  border: 1px solid #F9C0D9;
  color: var(--primary);
  padding: 16px 20px;
  border-radius: 12px;
  margin: 24px 0;
  font-size: 14px;
  font-weight: 500;
}

/* ── Cart Sidebar ────────────────────────────────────────────────── */
.catalog-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 200;
}
.catalog-cart-sidebar {
  position: fixed;
  top: 0;
  right: -100%;
  width: 340px;
  height: 100%;
  background: var(--bg);
  border-left: 1px solid var(--border);
  box-shadow: -4px 0 20px rgba(0,0,0,0.1);
  z-index: 210;
  display: flex;
  flex-direction: column;
  transition: right 0.3s ease;
}
.catalog-cart-sidebar.open { right: 0; }

.cart-head {
  background: var(--primary);
  color: #fff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.cart-head h3 { font-size: 17px; font-weight: 700; margin: 0; }
.cart-head button {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-secondary);
  padding: 40px;
  gap: 12px;
  text-align: center;
}
.cart-empty-icon { font-size: 40px; }

.cart-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.cart-item-img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.cart-item-noimg {
  width: 56px;
  height: 56px;
  background: var(--bg-section);
  border-radius: 8px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.cart-item-subtotal { font-size: 12px; color: var(--text-secondary); }

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.ci-qty-btn {
  width: 28px;
  height: 28px;
  border: 1.5px solid var(--primary);
  background: var(--bg);
  color: var(--primary);
  border-radius: 6px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  line-height: 1;
  transition: background 0.15s, color 0.15s;
}
.ci-qty-btn:hover { background: var(--primary); color: #fff; }
.ci-qty {
  font-size: 14px;
  font-weight: 700;
  min-width: 20px;
  text-align: center;
}
.ci-remove {
  width: 26px;
  height: 26px;
  background: transparent;
  border: none;
  color: #ccc;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: color 0.15s, background 0.15s;
}
.ci-remove:hover { color: var(--primary); background: #FFF0F5; }

.cart-foot {
  padding: 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
}
#cart-total { font-size: 20px; font-weight: 800; color: var(--primary); }

.catalog-checkout-btn {
  width: 100%;
  height: 50px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
}
.catalog-checkout-btn:hover:not(:disabled) { background: var(--primary-hover); }
.catalog-checkout-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── Order Modal ─────────────────────────────────────────────────── */
.catalog-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.catalog-modal-box {
  background: #fff;
  border-radius: 24px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.catalog-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 1;
}
.catalog-modal-head h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}
.catalog-modal-head button {
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-secondary);
  line-height: 1;
  padding: 0;
}

.cof-summary {
  display: none;
}
.cof-summary strong { color: var(--text-primary); }

#catalog-order-form {
  padding: 20px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.cof-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.cof-field label {
  font-size: 13px;
  font-weight: 700;
  color: #333333;
}
.cof-field input,
.cof-field textarea {
  width: 100%;
  min-height: 48px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 16px;
  font-family: inherit;
  color: var(--text-primary);
  padding: 10px 16px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: var(--bg);
  direction: rtl;
}
.cof-field input[readonly] {
  background: var(--bg-section);
  color: var(--text-secondary);
}
.cof-field input:focus,
.cof-field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(209,32,138,0.12);
}
.cof-field textarea { min-height: 88px; resize: vertical; }

#cof-submit {
  width: 100%;
  height: 50px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-btn);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
  margin-top: 4px;
}
#cof-submit:hover { background: var(--primary-hover); }
#cof-submit:disabled { opacity: 0.5; cursor: not-allowed; }

.cof-error {
  background: #FFF0F5;
  border: 1px solid #F9C0D9;
  color: var(--primary);
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  margin: 0 24px;
}
.cof-success {
  background: #F0FFF4;
  border: 1px solid #B7EBD0;
  color: #1E7B44;
  padding: 16px 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  margin: 0 24px;
  line-height: 1.6;
}

/* ── Login Page ──────────────────────────────────────────────────── */
.clg-wrap {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background-color: #8B0A5A;
  background-image: url('img/bg-login.png');
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center center;
  background-attachment: fixed;
}
.clg-box {
  background: #FFFFFF;
  border-radius: 24px;
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 8px 40px rgba(209,32,138,0.15);
  border: 1px solid rgba(209,32,138,0.1);
}
.clg-logo {
  text-align: center;
  margin-bottom: 28px;
}
.clg-logo-icon { display: flex; justify-content: center; margin-bottom: 12px; }
.clg-logo h2 {
  font-size: 54px;
  font-weight: 800;
  color: var(--primary);
  margin: 0 0 4px;
}
.clg-subtitle {
  font-size: 18px;
  font-weight: 700;
  color: #D1208A;
  margin: 0 0 8px;
}
.clg-logo p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}
.clg-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.clg-field label {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-secondary);
}
.clg-field input {
  height: 50px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-input);
  font-size: 16px;
  font-family: inherit;
  color: var(--text-primary);
  padding: 0 20px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  direction: ltr;
  text-align: center;
}
.clg-field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(209,32,138,0.15);
}
#clg-form button[type="submit"] {
  width: 100%;
  height: 50px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-btn);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
  margin-top: 4px;
}
#clg-form button[type="submit"]:hover { background: var(--primary-hover); }
#clg-form button[type="submit"]:disabled { opacity: 0.5; cursor: not-allowed; }
.clg-error {
  background: #FFF0F5;
  border: 1px solid #F9C0D9;
  color: var(--primary);
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 12px;
}

/* ── Scroll to Top ───────────────────────────────────────────────── */
#scroll-top-btn {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 44px;
  height: 44px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  box-shadow: var(--shadow);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 150;
  transition: background 0.2s, transform 0.2s;
}
#scroll-top-btn:hover { background: var(--primary-hover); transform: translateY(-2px); }
#scroll-top-btn.visible { display: flex; }

/* Mobile header zones — hidden on desktop */
.mobile-header-right,
.mobile-header-center,
.mobile-header-left { display: none; }

.mobile-hamburger {
  width: 44px;
  height: 44px;
  background: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0;
  border-radius: 8px;
}
.mobile-hamburger span {
  display: block;
  width: 22px;
  height: 2.5px;
  background: #D1208A;
  border-radius: 2px;
}

.mobile-cart-btn {
  padding: 6px 10px !important;
  font-size: 16px !important;
  min-height: 40px !important;
  min-width: 50px !important;
}

.mobile-user-avatar {
  width: 36px;
  height: 36px;
  background: #FFFFFF;
  border: 2px solid #D1208A;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.2s;
}
.mobile-user-avatar:hover {
  background: #FFF0F9;
}

.desktop-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 2px solid #D1208A;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
}
.desktop-user-avatar:hover { background: #FFF0F9; }

/* Mobile Avatar Popup */
.mobile-avatar-popup {
  position: absolute;
  top: 100%;
  left: 0;
  right: auto;
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  padding: 16px;
  z-index: 105;
  min-width: 200px;
  max-width: calc(100vw - 24px);
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.mobile-avatar-popup.open {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}
.map-name {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 4px;
  color: var(--text-primary);
}
.map-company {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 2px;
}
.map-email {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}
.map-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 8px 0;
}
.map-logout {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  width: 100%;
  font-family: inherit;
  transition: color 0.2s;
}
.map-logout:hover {
  color: var(--primary-hover);
}
.map-logout span {
  font-size: 16px;
}


/* ── Mobile Categories Sidebar ───────────────────────────────────── */
.catalog-cats-btn {
  display: none;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-btn);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  min-height: 40px;
}
.catalog-cats-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 198;
}
.catalog-cats-sidebar {
  position: fixed;
  top: 0;
  right: -100%;
  width: 80%;
  max-width: 300px;
  height: 100%;
  background: #fff;
  box-shadow: -4px 0 20px rgba(0,0,0,0.15);
  z-index: 199;
  display: flex;
  flex-direction: column;
  transition: right 0.3s ease;
}
.catalog-cats-sidebar.open { right: 0; }
.cats-head {
  background: var(--primary);
  color: #fff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 17px;
  font-weight: 700;
}
.cats-head button {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}
.cats-list {
  list-style: none;
  flex: 1;
  overflow-y: auto;
}
.cats-list li {
  padding: 14px 20px;
  border-bottom: 1px solid #F0F0F0;
  font-size: 16px;
  font-weight: 600;
  color: #333;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.cats-list li:hover { background: #FFF0F9; color: var(--primary); }
.cats-list li.active { color: var(--primary); background: #FFF0F9; }

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .catalog-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .catalog-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .catalog-card-img, .catalog-card-noimg { height: 140px; }
  .catalog-title { font-size: 15px; }
  .catalog-desc  { font-size: 13px; }
  .catalog-price { font-size: 18px; }
  .catalog-qty-btn { min-width: 30px; min-height: 30px; }
  .catalog-cart-sidebar {
    width: 85%;
    max-width: 320px;
    height: 70vh;
    top: 15vh;
    right: -100%;
    border-radius: 16px 0 0 16px;
    display: flex;
    flex-direction: column;
  }
  .catalog-checkout-btn {
    width: 100%;
    height: 52px;
    border-radius: 0;
  }
  .cart-items {
    overflow-y: auto;
    flex: 1;
  }
  .catalog-modal-box {
    max-width: 100%;
    max-height: 60vh;
    height: auto;
    overflow-y: auto;
    border-radius: 0;
  }
  /* Order confirmation — compact on mobile */
  #cof-success {
    padding: 12px !important;
  }
  #cof-success div {
    padding: 12px 0 !important;
  }
  #cof-success div > div:first-child {
    font-size: 40px !important;
    margin-bottom: 10px !important;
  }
  #cof-success h3 {
    font-size: 18px !important;
  }
  #cof-success p {
    font-size: 13px !important;
    margin-bottom: 4px !important;
  }
  #cof-success button {
    min-height: 42px !important;
  }
  .catalog-user-info { max-width: 100px; font-size: 12px; }
  .catalog-cat-title { font-size: 16px; }
  .catalog-topbar { font-size: 12px; padding: 0 8px; }
  /* Search */
  .catalog-search-bar input {
    font-size: 16px;
    min-height: 46px;
  }
  /* Buttons minimum tap target */
  .catalog-qty-btn {
    min-width: 44px;
    min-height: 44px;
  }
  .catalog-add-btn {
    width: 100%;
    min-height: 44px;
  }
  /* Scroll to top */
  #scroll-top-btn {
    width: 44px;
    height: 44px;
    bottom: 16px;
    left: 16px;
  }
  /* Card overflow guard */
  .catalog-title {
    word-break: break-word;
  }
  /* Mobile categories button */
  .catalog-cats-btn { display: flex; align-items: center; gap: 4px; }

  /* Show mobile header zones, hide desktop zones */
  .catalog-logo-area,
  .catalog-user-info,
  .catalog-header-actions { display: none !important; }

  .mobile-header-right,
  .mobile-header-center,
  .mobile-header-left { display: flex; align-items: center; gap: 8px; }

  .catalog-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    padding: 8px 12px;
    gap: 8px;
  }
  .mobile-header-center { justify-content: center; }
  .mobile-brand {
    font-size: 16px;
    font-weight: 800;
    color: #D1208A;
  }
  .catalog-tabs { display: none; }
}

@media (max-width: 480px) {
  .catalog-header { padding: 8px 10px; gap: 6px; }
  .catalog-cart-btn { padding: 6px 10px; font-size: 13px; }
  .catalog-logout-btn { padding: 6px 10px; font-size: 12px; }
  .catalog-grid { gap: 8px; }
  .catalog-page { padding: 12px 10px 60px; }
  .clg-box { padding: 32px 20px; }
}

/* ── Quick View ─────────────────────────────────────────────── */
.qv-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 500;
  align-items: flex-end;
  justify-content: center;
}
.qv-overlay.open { display: flex; }
@media (min-width: 769px) {
  .qv-overlay { align-items: center; }
}
.qv-card {
  background: #fff;
  border-radius: 24px 24px 0 0;
  padding: 24px;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: slideUp 0.25s ease;
}
@media (min-width: 769px) {
  .qv-card { border-radius: 24px; animation: fadeIn 0.2s ease; }
}
@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}
.qv-close {
  position: absolute;
  top: 16px;
  left: 16px;
  background: none;
  border: none;
  font-size: 24px;
  color: #777;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
}
.qv-image {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  border-radius: 12px;
  margin-bottom: 16px;
}
.qv-name {
  font-size: 20px;
  font-weight: 800;
  color: #333;
  margin: 0 0 4px;
}
.qv-sku { font-size: 13px; color: #777; margin-bottom: 8px; }
.qv-description { font-size: 15px; color: #555; margin-bottom: 12px; line-height: 1.5; }
.qv-price { font-size: 28px; font-weight: 800; color: #D1208A; margin-bottom: 16px; }
.qv-qty-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  direction: ltr;
}
.qv-qty-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #ddd;
  background: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qv-qty-input {
  width: 60px;
  text-align: center;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 6px;
  font-size: 16px;
}
.qv-add-to-cart {
  width: 100%;
  height: 50px;
  background: #D1208A;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
}
.qv-add-to-cart:hover { background: #B01A75; }
.catalog-card { position: relative; }
.qv-eye-btn {
  display: none;
  position: absolute;
  top: 8px;
  right: 8px;
  left: auto;
  width: 36px;
  height: 36px;
  background: #fff;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  z-index: 10;
  transition: transform 0.15s;
}
.qv-eye-btn:hover { transform: scale(1.1); }
@media (min-width: 769px) {
  .catalog-card:hover .qv-eye-btn { display: flex; }
}

/* ── Orders History ────────────────────────────────────────────── */
.map-orders {
  background: none;
  border: none;
  color: #D1208A;
  font-weight: bold;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  width: 100%;
  font-family: inherit;
}
.map-orders:hover { opacity: 0.8; }
.orders-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 600;
  align-items: flex-end;
  justify-content: center;
}
.orders-overlay.open { display: flex; }
@media (min-width: 769px) {
  .orders-overlay { align-items: center; }
}
.orders-card {
  background: #fff;
  border-radius: 24px 24px 0 0;
  padding: 24px;
  width: 100%;
  max-width: 500px;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  animation: slideUp 0.25s ease;
}
@media (min-width: 769px) {
  .orders-card { border-radius: 24px; animation: fadeIn 0.2s ease; }
}
.orders-close {
  position: absolute;
  top: 16px;
  left: 16px;
  background: none;
  border: none;
  font-size: 24px;
  color: #777;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}
.orders-title {
  font-size: 20px;
  font-weight: 800;
  color: #D1208A;
  margin: 0 0 20px;
  text-align: center;
}
.order-item {
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
}
.order-item-row1 {
  display: flex;
  justify-content: space-between;
  font-weight: bold;
  font-size: 14px;
  margin-bottom: 6px;
}
.order-item-row2 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #555;
}
.order-reorder-btn {
  background: #D1208A;
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
  flex-shrink: 0;
}
.order-reorder-btn:hover { background: #B01A75; }
.orders-empty {
  text-align: center;
  color: #777;
  padding: 40px 0;
  font-size: 15px;
}
.orders-spinner {
  text-align: center;
  padding: 40px 0;
  color: #D1208A;
  font-size: 14px;
}

/* ── Promo Popup ───────────────────────────────────────────────── */
.promo-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 9000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.promo-overlay.open { display: flex; }
.promo-card {
  background: #fff;
  border-radius: 24px;
  max-width: 380px;
  max-height: 85vh;
  overflow-y: auto;
  width: 100%;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  animation: promoSlideUp 0.35s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes promoSlideUp {
  from { opacity: 0; transform: translateY(40px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.promo-close {
  position: absolute;
  top: 12px;
  left: 12px;
  background: #fff;
  border: none;
  color: #D1208A;
  font-size: 18px;
  font-weight: 700;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transition: background 0.2s, transform 0.15s;
  line-height: 1;
}
.promo-close:hover { background: #FFF0F7; transform: scale(1.1); }
.promo-top-bar {
  background: #D1208A;
  color: #fff;
  text-align: center;
  font-size: 18px;
  font-weight: 800;
  padding: 16px 16px 14px;
  letter-spacing: 0.3px;
}
.promo-top-sub {
  display: block;
  font-size: 13px;
  font-weight: 400;
  opacity: 0.9;
  margin-top: 4px;
}
.promo-image-wrap {
  background: #F8F9FA;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid #F0F0F0;
}
.promo-image {
  max-width: 100%;
  height: 200px;
  object-fit: contain;
}
.promo-body {
  padding: 20px;
  text-align: center;
  direction: rtl;
}
.promo-title {
  font-size: 20px;
  font-weight: 800;
  color: #333333;
  margin: 0 0 4px;
  line-height: 1.3;
}
.promo-desc {
  font-size: 14px;
  color: #777777;
  margin: 0 0 16px;
  line-height: 1.6;
}
.promo-prices {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.promo-price-new {
  font-size: 32px;
  font-weight: 800;
  color: #D1208A;
  background: #FFF0F7;
  padding: 8px 20px;
  border-radius: 50px;
  display: inline-block;
}
.promo-price-orig {
  font-size: 16px;
  color: #999999;
  text-decoration: line-through;
}
.promo-add-btn {
  width: 100%;
  height: 50px;
  background: #D1208A;
  color: #fff;
  border: none;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s, transform 0.15s;
}
.promo-add-btn:hover { background: #B01A75; transform: translateY(-1px); }
.promo-add-btn:active { transform: translateY(0); }
.promo-urgency {
  font-size: 12px;
  color: #999999;
  text-align: center;
  margin: 8px 0 0;
}

/* ── Order Submit Spinner ──────────────────────────────────────── */
.order-spinner-circle {
  width: 48px;
  height: 48px;
  border: 4px solid #F8F9FA;
  border-top: 4px solid #D1208A;
  border-radius: 50%;
  animation: catalogSpin 0.8s linear infinite;
  margin: 0 auto 16px;
}
@keyframes catalogSpin {
  to { transform: rotate(360deg); }
}
.order-spinner-text {
  color: #D1208A;
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

/* ── PWA Install Button ──────────────────────────────────────────────────── */
.map-install-btn {
  background: none;
  border: none;
  color: #D1208A;
  font-weight: bold;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  width: 100%;
  font-family: inherit;
  text-align: right;
}
.map-install-btn:hover { opacity: 0.8; }

/* ── iOS Install Modal ───────────────────────────────────────────────────── */
.ios-install-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 20px;
}
.ios-install-card {
  background: #FFFFFF;
  border-radius: 20px 20px 16px 16px;
  padding: 24px 20px 20px;
  max-width: 340px;
  width: 92%;
  text-align: right;
  direction: rtl;
  box-shadow: 0 8px 40px rgba(0,0,0,0.25);
}
.ios-install-title {
  font-size: 18px;
  font-weight: 800;
  color: #333333;
  margin: 0 0 18px;
  text-align: center;
}
.ios-step {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #F8F9FA;
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 10px;
  direction: rtl;
}
.ios-step-num {
  min-width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #D1208A;
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ios-step-icon {
  font-size: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.ios-step-text {
  font-size: 14px;
  color: #333;
  font-weight: 500;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ios-step-note {
  color: #D1208A;
  font-weight: 700;
  font-size: 13px;
}
.ios-install-ok {
  width: 100%;
  height: 46px;
  background: #D1208A;
  color: #FFFFFF;
  border: none;
  border-radius: 50px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  margin-top: 14px;
  transition: opacity 0.2s;
}
.ios-install-ok:hover { opacity: 0.88; }

/* ── Micro-animations ─────────────────────────────────────────────────── */
button:active { transform: scale(0.97); transition: transform 0.15s; }
.catalog-card { transition: transform 0.25s ease, box-shadow 0.25s ease; }
.catalog-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); border-color: #D1208A; }
.catalog-tab { transition: background 0.2s ease, color 0.2s ease; }
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Skeleton Loading ─────────────────────────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}
.skeleton-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.skeleton-img {
  width: 100%;
  height: 200px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
.skeleton-line {
  height: 14px;
  margin: 10px 12px 0;
  border-radius: 6px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
.skeleton-line.short   { width: 60%; }
.skeleton-line.shorter { width: 40%; margin-bottom: 12px; }

/* ── Search Counter ───────────────────────────────────────────────────── */
.search-counter { text-align: center; font-size: 13px; color: #888; padding: 4px 0 0; min-height: 20px; }

/* ── Stock Badge ──────────────────────────────────────────────────────── */
.stock-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 10;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  display: inline-block;
}
.stock-badge.in-stock     { display: none !important; }
.stock-badge.out-of-stock { background-color: #D1208A !important; color: #FFFFFF !important; }

/* ── Profile Modal ───────────────────────────────────────────────────── */
.profile-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.25s ease;
}
.profile-card {
  background: #fff;
  border-radius: 20px;
  padding: 28px 24px;
  max-width: 360px;
  width: 92%;
  box-shadow: var(--shadow-lg);
  position: relative;
  direction: rtl;
}
.profile-close {
  position: absolute;
  top: 12px;
  left: 14px;
  background: none;
  border: none;
  font-size: 22px;
  color: #999;
  cursor: pointer;
}
.profile-title { font-size: 18px; font-weight: 800; color: #333; margin: 0 0 18px; }
.profile-field { margin-bottom: 14px; }
.profile-field label {
  display: block;
  font-size: 13px;
  color: #555;
  margin-bottom: 5px;
  font-weight: 600;
}
.profile-field input {
  width: 100%;
  height: 44px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 0 12px;
  font-size: 15px;
  font-family: inherit;
  box-sizing: border-box;
  direction: rtl;
}
.profile-field input:focus { outline: none; border-color: #D1208A; }
.profile-save {
  width: 100%;
  height: 46px;
  background: var(--gradient-primary);
  color: #fff;
  border: none;
  border-radius: 50px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  margin-top: 8px;
  transition: opacity 0.2s;
}
.profile-save:hover { opacity: 0.88; }

.catalog-logo-img { height: 36px; object-fit: contain; display: block; }
