/* ==========================================================================
   EPN Computer Store - Apple Design Language (iOS / macOS / apple.com style)
   Clean, Minimal, High-Contrast Typography, Ultra-Refined Whitespace
   ========================================================================== */

:root {
  /* Apple Color System */
  --apple-bg: #ffffff;
  --apple-canvas: #f5f5f7;
  --apple-canvas-subtle: #fbfbfd;
  --apple-card: #ffffff;
  --apple-text: #1d1d1f;
  --apple-text-muted: #6e6e73;
  --apple-text-subtle: #86868b;
  --apple-blue: #0071e3;
  --apple-blue-hover: #0077ed;
  --apple-blue-active: #0068d1;
  --apple-blue-light: #eef5fc;
  --apple-terracotta: #bf4800;
  --apple-green: #107c41;
  --apple-green-light: #edf7f2;
  --apple-amber: #b25e00;
  --apple-amber-light: #fef7ed;
  --apple-red: #d70015;
  --apple-red-light: #fdf2f2;
  
  /* Borders & Dividers */
  --apple-border: rgba(0, 0, 0, 0.08);
  --apple-border-light: rgba(0, 0, 0, 0.04);
  --apple-border-strong: #d2d2d7;
  --apple-divider: #e5e5ea;

  /* Apple Corner Radii */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --radius-full: 980px;
  --radius-pill: 980px;

  /* Apple Shadows */
  --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.07);
  --shadow-card: 0 2px 14px rgba(0, 0, 0, 0.04);
  --shadow-card-hover: 0 14px 34px rgba(0, 0, 0, 0.08);

  /* Component Aliases for Compatibility */
  --bg-main: var(--apple-bg);
  --bg-subtle: var(--apple-canvas);
  --bg-card: var(--apple-card);
  --bg-card-subtle: var(--apple-canvas-subtle);
  --bg-elevated: var(--apple-bg);
  
  --text-main: var(--apple-text);
  --text-muted: var(--apple-text-muted);
  --text-light: var(--apple-text-subtle);
  
  --border-light: var(--apple-border);
  --border-subtle: var(--apple-border-light);
  --border-strong: var(--apple-border-strong);
  
  --primary: var(--apple-blue);
  --primary-hover: var(--apple-blue-hover);
  --primary-light: var(--apple-blue-light);
  --primary-glow: rgba(0, 113, 227, 0.15);
  
  --accent-cyan: #06b6d4;
  --accent-cyan-light: #ecfeff;
  --accent-emerald: var(--apple-green);
  --accent-emerald-light: var(--apple-green-light);
  
  --success: var(--apple-green);
  --warning: var(--apple-amber);
  --danger: var(--apple-red);
  
  --transition-fast: 0.15s cubic-bezier(0.25, 0.1, 0.25, 1);
  --transition-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);

  --font-base: 'Vazirmatn', -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  overflow-x: hidden !important;
  width: 100%;
  max-width: 100vw;
  font-size: 15px;
  scroll-behavior: smooth;
  direction: rtl;
}

body {
  overflow-x: hidden !important;
  width: 100%;
  max-width: 100vw;
  font-family: var(--font-base);
  background-color: var(--apple-bg);
  color: var(--apple-text);
  line-height: 1.6;
  min-height: 100vh;
  letter-spacing: -0.01em;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  transition: all var(--transition-fast);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  width: 100%;
  max-width: 1220px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.main-content {
  min-height: calc(100vh - 400px);
}

/* ==========================================================================
   Modal & Backdrop System (CRITICAL FIX: Hidden by default!)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop.active {
  display: flex !important;
}

.modal-box {
  background-color: #ffffff;
  border: 1px solid var(--apple-border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  max-width: 540px;
  width: 100%;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--apple-divider);
}

.modal-body {
  overflow-x: hidden;
  max-width: 100vw;
  font-size: 0.9rem;
}

/* ==========================================================================
   Top Announcement Bar & Header
   ========================================================================== */
.top-bar, .announcement-bar {
  background-color: var(--apple-canvas);
  border-bottom: 1px solid var(--apple-divider);
  padding: 0.45rem 0;
  font-size: 0.8rem;
  color: var(--apple-text-muted);
}

.top-bar-inner, .announcement-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.top-bar-contact {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.admin-switch-btn, .top-admin-btn {
  background-color: #ffffff;
  color: var(--apple-text);
  border: 1px solid var(--apple-border-strong);
  border-radius: var(--radius-pill);
  padding: 0.28rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.admin-switch-btn:hover, .top-admin-btn:hover {
  background-color: var(--apple-canvas);
  border-color: var(--apple-text);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--apple-border);
  transition: background-color var(--transition-normal);
}

.main-header, .header-main {
  padding: 0.75rem 0;
}

.header-row, .header-layout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

/* Logo */
.logo-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  cursor: pointer;
  flex-shrink: 0;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: var(--apple-text);
  color: #ffffff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.03em;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.logo-text h1, .logo-text h2 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--apple-text);
  line-height: 1.2;
}

.logo-text span {
  font-size: 0.72rem;
  color: var(--apple-text-muted);
  display: block;
}

/* Search Bar */
.search-container, .search-wrapper {
  flex: 1;
  max-width: 520px;
  position: relative;
}

.search-box {
  display: flex;
  align-items: center;
  background-color: var(--apple-canvas);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  padding: 0.35rem 0.5rem 0.35rem 1.1rem;
  transition: all var(--transition-fast);
}

.search-box:focus-within {
  background-color: #ffffff;
  border-color: var(--apple-blue);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15);
}

.search-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.35rem 0.6rem;
  font-size: 0.88rem;
  font-family: inherit;
  color: var(--apple-text);
  outline: none;
}

.search-input::placeholder {
  color: var(--apple-text-subtle);
}

.search-btn {
  background-color: var(--apple-blue);
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.search-btn:hover {
  background-color: var(--apple-blue-hover);
}

/* Search Dropdown */
.search-results-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  background: #ffffff;
  border: 1px solid var(--apple-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-height: 380px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
}

.search-results-dropdown.active {
  display: block;
}

.search-suggest-item, .search-result-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--apple-divider);
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.search-suggest-item:hover, .search-result-item:hover {
  background-color: var(--apple-canvas);
}

.search-suggest-thumb, .search-result-thumb {
  width: 44px;
  height: 44px;
  background: var(--apple-canvas);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.search-suggest-thumb img, .search-result-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.search-suggest-info, .search-result-info {
  flex: 1;
  min-width: 0;
}

.search-suggest-title, .search-result-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--apple-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-suggest-price, .search-result-price {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--apple-blue);
  margin-top: 0.15rem;
}

.search-result-meta {
  font-size: 0.75rem;
  color: var(--apple-text-muted);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-pill);
  background-color: transparent;
  color: var(--apple-text);
  font-size: 0.82rem;
  font-weight: 500;
  border: 1px solid transparent;
  position: relative;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.action-btn:hover {
  background-color: var(--apple-canvas);
  color: var(--apple-blue);
}

.action-btn.cart-btn {
  background-color: var(--apple-canvas);
  border: 1px solid var(--apple-border);
  color: var(--apple-text);
}

.action-btn.cart-btn:hover {
  background-color: var(--apple-blue);
  color: #ffffff;
  border-color: var(--apple-blue);
}

.action-text {
  font-size: 0.82rem;
}

.action-badge {
  position: absolute;
  top: -4px;
  left: -4px;
  background-color: var(--apple-blue);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid #ffffff;
}

.action-btn.cart-btn:hover .action-badge {
  background-color: var(--apple-text);
}

/* Category Navigation */
.category-nav {
  border-top: 1px solid var(--apple-border);
  background: rgba(255, 255, 255, 0.95);
  overflow-x: hidden;
  max-width: 100%;
}

.category-menu {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  overflow-x: auto;
  padding: 0.45rem 0;
  scrollbar-width: none;
}

.category-menu::-webkit-scrollbar {
  display: none;
}

.nav-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--apple-text-muted);
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.nav-item:hover {
  color: var(--apple-text);
  background-color: var(--apple-canvas);
}

.nav-item.active {
  color: var(--apple-text);
  background-color: var(--apple-canvas);
  font-weight: 700;
}

.nav-item-badge {
  background: var(--apple-amber-light);
  color: var(--apple-amber);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-pill);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
  padding: 2rem 0 2.5rem;
  background-color: var(--apple-bg);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.5rem;
}

@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
}

.hero-banner-main {
  background-color: var(--apple-canvas);
  border: 1px solid var(--apple-border);
  border-radius: var(--radius-xl);
  padding: 3rem 3.5rem;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  min-height: 420px;
}

@media (max-width: 768px) {
  .hero-banner-main {
    padding: 2rem 1.5rem;
    flex-direction: column;
    text-align: center;
  }
}

.hero-tag {
  display: inline-block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--apple-terracotta);
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--apple-text);
  line-height: 1.25;
  margin-bottom: 1rem;
  letter-spacing: -0.03em;
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 1.85rem;
  }
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--apple-text-muted);
  line-height: 1.6;
  margin-bottom: 2rem;
  max-width: 520px;
}

.hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--apple-blue);
  color: #ffffff;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-pill);
  font-size: 0.95rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.hero-btn:hover {
  background-color: var(--apple-blue-hover);
  transform: translateY(-1px);
}

.hero-illustration {
  width: 320px;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.hero-slider-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--apple-border);
  color: var(--apple-text);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: var(--shadow-sm);
  z-index: 10;
  opacity: 0.8;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.hero-slider-nav:hover {
  opacity: 1;
  background: #ffffff;
  transform: translateY(-50%) scale(1.05);
}

.hero-slider-nav.prev {
  right: 1rem;
}

.hero-slider-nav.next {
  left: 1rem;
}

.hero-dots-container {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
  z-index: 10;
}

.hero-dot {
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.2);
  border: none;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.hero-dot.active {
  width: 24px;
  background: var(--apple-text);
}

/* Side Banners */
.hero-side-banners {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.side-banner {
  background-color: var(--apple-canvas);
  border: 1px solid var(--apple-border);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.side-banner.b1, .side-banner.b2 {
  /* Class hooks */
}

.side-banner:hover {
  background-color: #ffffff;
  border-color: var(--apple-border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.side-banner h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--apple-text);
  margin-bottom: 0.35rem;
}

.side-banner p {
  font-size: 0.82rem;
  color: var(--apple-text-muted);
  line-height: 1.5;
  margin-bottom: 0.65rem;
}

.side-banner-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--apple-blue);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.side-banner-link:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Section Headers & Common
   ========================================================================== */
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--apple-divider);
}

.section-title {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.section-title h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--apple-text);
  letter-spacing: -0.02em;
}

.section-title-line {
  display: none;
}

.view-all-link {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--apple-blue);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.view-all-link:hover {
  text-decoration: underline;
}

.breadcrumb-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--apple-text-subtle);
  margin: 1.25rem 0 1.5rem;
}

.breadcrumb-nav a {
  color: var(--apple-text-muted);
}

.breadcrumb-nav a:hover {
  color: var(--apple-blue);
}

/* ==========================================================================
   Category Showcase Grid
   ========================================================================== */
.category-showcase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1.25rem;
  margin-bottom: 3.5rem;
}

.cat-showcase-card {
  background-color: var(--apple-canvas);
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  padding: 1.5rem 1rem;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  transition: all var(--transition-normal);
}

.cat-showcase-card:hover {
  background-color: #ffffff;
  border-color: var(--apple-border);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-3px);
}

.cat-icon-wrap {
  width: 56px;
  height: 56px;
  background-color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--apple-text);
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-fast);
}

.cat-showcase-card:hover .cat-icon-wrap {
  background-color: var(--apple-blue);
  color: #ffffff;
}

.cat-showcase-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--apple-text);
}

.cat-showcase-count {
  font-size: 0.75rem;
  color: var(--apple-text-subtle);
}

/* ==========================================================================
   Flash Deals Section
   ========================================================================== */
.flash-deals-wrapper {
  background-color: var(--apple-canvas);
  border: 1px solid var(--apple-border);
  border-radius: var(--radius-xl);
  padding: 2rem 2.25rem;
  margin-bottom: 3.5rem;
}

.flash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.flash-title-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.flash-badge {
  background-color: var(--apple-red-light);
  color: var(--apple-red);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-pill);
}

.flash-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--apple-text);
}

.countdown-box {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--apple-text-muted);
}

.time-digit {
  background-color: #ffffff;
  color: var(--apple-text);
  font-weight: 800;
  font-size: 0.95rem;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-xs);
  border: 1px solid var(--apple-border);
  min-width: 32px;
  text-align: center;
}

.time-sep {
  font-weight: 800;
  color: var(--apple-text-subtle);
}

.flash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

/* ==========================================================================
   Product Cards
   ========================================================================== */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.products-grid.list-view {
  grid-template-columns: 1fr;
}

.product-card {
  background-color: #ffffff;
  border: 1px solid var(--apple-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-normal);
}

.product-card:hover {
  border-color: var(--apple-border-strong);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-4px);
}

.product-badges {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  z-index: 2;
}

.badge-tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
}

.badge-tag.new {
  background-color: var(--apple-green-light);
  color: var(--apple-green);
}

.badge-tag.used {
  background-color: var(--apple-canvas);
  color: var(--apple-text-muted);
}

.badge-tag.discount {
  background-color: var(--apple-red-light);
  color: var(--apple-red);
}

.product-actions-top {
  position: absolute;
  top: 1rem;
  left: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  z-index: 2;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.product-card:hover .product-actions-top {
  opacity: 1;
}

.icon-btn {
  width: 32px;
  height: 32px;
  background-color: #ffffff;
  border: 1px solid var(--apple-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--apple-text-muted);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.icon-btn:hover, .icon-btn.active, .wish-btn.active {
  color: var(--apple-blue);
  border-color: var(--apple-blue);
}

.product-img-box {
  width: 100%;
  height: 190px;
  background-color: var(--apple-canvas-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 1rem;
  transition: background-color var(--transition-fast);
}

.product-card:hover .product-img-box {
  background-color: #ffffff;
}

.product-real-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform var(--transition-smooth);
}

.product-card:hover .product-real-img {
  transform: scale(1.05);
}

.product-meta-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--apple-text-subtle);
  margin-bottom: 0.4rem;
}

.product-rating {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  color: var(--apple-amber);
  font-weight: 600;
}

.product-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--apple-text);
  line-height: 1.45;
  height: 2.9em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin-bottom: 0.75rem;
  transition: color var(--transition-fast);
}

.product-title:hover {
  color: var(--apple-blue);
}

.product-specs-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1rem;
  min-height: 24px;
}

.spec-pill {
  font-size: 0.72rem;
  color: var(--apple-text-muted);
  background-color: var(--apple-canvas);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
}

.product-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  font-size: 0.78rem;
}

.product-stock {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
}

.stock-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.product-stock.available .stock-dot {
  background-color: var(--apple-green);
}

.product-stock.available {
  color: var(--apple-green);
}

.product-stock.out_of_stock .stock-dot {
  background-color: var(--apple-red);
}

.product-stock.out_of_stock {
  color: var(--apple-red);
}

.product-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--apple-divider);
}

.price-box {
  display: flex;
  flex-direction: column;
}

.old-price {
  font-size: 0.78rem;
  color: var(--apple-text-subtle);
  text-decoration: line-through;
}

.current-price {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--apple-text);
}

.currency {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--apple-text-muted);
}

.add-cart-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--apple-canvas);
  color: var(--apple-text);
  border: 1px solid var(--apple-border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.add-cart-btn:hover {
  background-color: var(--apple-blue);
  color: #ffffff;
  border-color: var(--apple-blue);
  transform: scale(1.05);
}

.add-cart-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* Product Card List View */
.product-card-list {
  background-color: #ffffff;
  border: 1px solid var(--apple-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: grid;
  grid-template-columns: 160px 1fr 220px;
  gap: 1.5rem;
  align-items: center;
  transition: all var(--transition-normal);
}

.product-card-list:hover {
  border-color: var(--apple-border-strong);
  box-shadow: var(--shadow-card-hover);
}

.product-body-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

@media (max-width: 768px) {
  .product-card-list {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

.stock-meter-wrap {
  margin: 0.75rem 0 0.5rem;
}

.stock-meter-bar {
  width: 100%;
  height: 5px;
  background-color: var(--apple-canvas);
  border-radius: 3px;
  overflow: hidden;
}

.stock-meter-fill {
  height: 100%;
  background-color: var(--apple-red);
  border-radius: 3px;
}

.stock-meter-text {
  font-size: 0.72rem;
  color: var(--apple-red);
  font-weight: 700;
  margin-top: 0.25rem;
}

/* ==========================================================================
   Catalog Page & Filters
   ========================================================================== */
.catalog-layout {
  display: grid;
  grid-template-columns: 270px 1fr;
  gap: 2rem;
  align-items: flex-start;
  margin: 2rem 0 4rem;
}

.catalog-main {
  flex: 1;
  min-width: 0;
}

@media (max-width: 900px) {
  .catalog-layout {
    grid-template-columns: 1fr;
  }
}

.catalog-sidebar {
  background-color: #ffffff;
  border: 1px solid var(--apple-border);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  position: sticky;
  top: 90px;
}

.filter-group {
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--apple-divider);
}

.filter-group:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.filter-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--apple-text);
  margin-bottom: 0.85rem;
}

.filter-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--apple-text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-option:hover {
  background-color: var(--apple-canvas);
  color: var(--apple-text);
}

.filter-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
}

.switch-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  cursor: pointer;
}

.switch-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.slider-toggle {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #d2d2d7;
  border-radius: 24px;
  transition: background-color 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.slider-toggle::before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.switch-toggle input:checked + .slider-toggle {
  background-color: #34c759;
}

.switch-toggle input:checked + .slider-toggle::before {
  transform: translateX(20px);
}

.filter-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--apple-text);
  cursor: pointer;
}

.custom-checkbox {
  width: 18px;
  height: 18px;
  border: 1px solid var(--apple-border-strong);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: #ffffff;
  background-color: #ffffff;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.filter-option:hover .custom-checkbox {
  border-color: var(--apple-blue);
}

.filter-checkbox-label input:checked ~ .custom-checkbox,
.custom-checkbox:not(:empty) {
  background-color: var(--apple-blue);
  border-color: var(--apple-blue);
  color: #ffffff;
}

.filter-badge-count {
  font-size: 0.72rem;
  color: var(--apple-text-subtle);
  background: var(--apple-canvas);
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-pill);
}

.price-range-inputs {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.price-input-box {
  flex: 1;
  border: 1px solid var(--apple-border-strong);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.6rem;
  font-size: 0.8rem;
  font-family: inherit;
  color: var(--apple-text);
  outline: none;
}

.price-input-box:focus {
  border-color: var(--apple-blue);
}

.catalog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--apple-canvas);
  border: 1px solid var(--apple-border);
  border-radius: var(--radius-lg);
  padding: 0.75rem 1.25rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.sort-options {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.sort-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--apple-text-muted);
}

.sort-btn {
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--apple-text-muted);
  background-color: transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sort-btn:hover {
  color: var(--apple-text);
}

.sort-btn.active {
  background-color: #ffffff;
  color: var(--apple-text);
  font-weight: 700;
  box-shadow: var(--shadow-xs);
}

.view-mode-buttons {
  display: flex;
  background-color: #ffffff;
  border: 1px solid var(--apple-border);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.view-btn {
  padding: 0.35rem 0.65rem;
  border-radius: 4px;
  color: var(--apple-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.view-btn.active {
  background-color: var(--apple-canvas);
  color: var(--apple-text);
}

.pagination-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin: 2.5rem 0;
}

.page-btn {
  min-width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--apple-border);
  background-color: #ffffff;
  color: var(--apple-text);
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.page-btn:hover {
  background-color: var(--apple-canvas);
}

.page-btn.active {
  background-color: var(--apple-text);
  color: #ffffff;
  border-color: var(--apple-text);
}

.page-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ==========================================================================
   Product Detail Page (PDP)
   ========================================================================== */
.product-detail-layout {
  display: grid;
  grid-template-columns: 1fr 440px;
  gap: 3rem;
  margin: 2.5rem 0 4rem;
}

@media (max-width: 900px) {
  .product-detail-layout {
    grid-template-columns: 1fr;
  }
}

.product-gallery {
  background-color: var(--apple-canvas);
  border: 1px solid var(--apple-border);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.gallery-main-img {
  width: 100%;
  max-height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-detail-real-img {
  max-width: 100%;
  max-height: 360px;
  object-fit: contain;
  transition: transform var(--transition-smooth);
}

.product-detail-real-img:hover {
  transform: scale(1.04);
}

.gallery-thumbs {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.gallery-thumb {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  border: 2px solid transparent;
  background: #ffffff;
  padding: 4px;
  cursor: pointer;
  overflow: hidden;
}

.gallery-thumb.active {
  border-color: var(--apple-blue);
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-info-col {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.product-main-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--apple-text);
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.product-buy-box {
  background-color: var(--apple-canvas);
  border: 1px solid var(--apple-border);
  border-radius: 20px;
  padding: 1.5rem;
}

.buy-box-price {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--apple-text);
  margin-bottom: 1.25rem;
}

.primary-buy-btn {
  background-color: var(--apple-blue);
  color: #ffffff;
  border-radius: var(--radius-pill);
  padding: 0.9rem 1.75rem;
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.primary-buy-btn:hover {
  background-color: var(--apple-blue-hover);
}

.product-quick-specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 1rem 0;
}

.quick-spec-item {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  padding: 0.65rem 0.85rem;
  font-size: 0.82rem;
}

.quick-spec-label {
  color: var(--apple-text-subtle);
  display: block;
  font-size: 0.72rem;
  margin-bottom: 0.2rem;
}

.quick-spec-val {
  font-weight: 700;
  color: var(--apple-text);
}

.product-tabs-wrapper {
  margin: 3rem 0;
}

.tabs-header, .tabs-nav {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--apple-divider);
  margin-bottom: 2rem;
}

.tab-btn {
  padding: 0.75rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--apple-text-muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tab-btn:hover {
  color: var(--apple-text);
}

.tab-btn.active {
  color: var(--apple-blue);
  border-bottom-color: var(--apple-blue);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.specs-table {
  width: 100%;
  border-collapse: collapse;
}

.specs-table tr {
  border-bottom: 1px solid var(--apple-divider);
}

.specs-table td {
  padding: 1rem 1.25rem;
  font-size: 0.88rem;
}

.spec-name {
  width: 220px;
  color: var(--apple-text-muted);
  font-weight: 600;
  background-color: var(--apple-canvas-subtle);
}

.spec-val {
  color: var(--apple-text);
  font-weight: 500;
}

/* ==========================================================================
   Comparison Table
   ========================================================================== */
.comparison-table-wrapper {
  background: #ffffff;
  border: 1px solid var(--apple-border);
  border-radius: var(--radius-xl);
  overflow-x: auto;
  box-shadow: var(--shadow-card);
  margin: 2rem 0;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
}

.comparison-table th, .comparison-table td {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--apple-divider);
  font-size: 0.9rem;
}

.comparison-table th {
  background-color: var(--apple-canvas);
  color: var(--apple-text);
  font-weight: 700;
}

.compare-card-cell {
  position: relative;
  text-align: center;
  min-width: 180px;
}

.compare-remove-btn {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  background: var(--apple-canvas);
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  color: var(--apple-text-muted);
}

.compare-remove-btn:hover {
  background: var(--apple-red-light);
  color: var(--apple-red);
}

.param-col {
  width: 220px;
  color: var(--apple-text-muted);
  font-weight: 600;
  background-color: var(--apple-canvas-subtle);
}

/* ==========================================================================
   Cart, Checkout & Steps
   ========================================================================== */
.cart-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 2rem;
  margin: 2rem 0 4rem;
}

@media (max-width: 900px) {
  .cart-layout {
    grid-template-columns: 1fr;
  }
}

.cart-items-card, .cart-summary-card {
  background: #ffffff;
  border: 1px solid var(--apple-border);
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
}

.cart-table {
  width: 100%;
  border-collapse: collapse;
}

.cart-row {
  border-bottom: 1px solid var(--apple-divider);
  padding: 1.25rem 0;
  display: grid;
  grid-template-columns: 80px 1fr 140px 140px 40px;
  align-items: center;
  gap: 1rem;
}

.cart-item-thumb {
  width: 75px;
  height: 75px;
  background: var(--apple-canvas);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0.5rem;
}

.cart-item-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.cart-item-info h4 {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--apple-text);
  margin-bottom: 0.25rem;
}

.quantity-control {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--apple-border-strong);
  border-radius: var(--radius-pill);
  overflow: hidden;
  background: #ffffff;
}

.qty-btn {
  width: 32px;
  height: 32px;
  background: #ffffff;
  border: none;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--apple-text);
}

.qty-btn:hover {
  background: var(--apple-canvas);
}

.qty-input {
  width: 40px;
  text-align: center;
  border: none;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--apple-text);
  background: transparent;
  outline: none;
}

.checkout-steps-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  margin: 2rem 0 3rem;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--apple-text-subtle);
  font-size: 0.9rem;
  font-weight: 600;
}

.step-item.active {
  color: var(--apple-blue);
  font-weight: 700;
}

.step-item.completed {
  color: var(--apple-green);
}

.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
}

/* ==========================================================================
   Features Grid & Brands Strip
   ========================================================================== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin: 3.5rem 0;
}

.feature-box {
  background-color: var(--apple-canvas);
  border: 1px solid var(--apple-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  transition: all var(--transition-normal);
}

.feature-box:hover {
  background-color: #ffffff;
  box-shadow: var(--shadow-card-hover);
  border-color: var(--apple-border-strong);
}

.feature-icon-box {
  width: 48px;
  height: 48px;
  background-color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--apple-text);
  box-shadow: var(--shadow-xs);
  flex-shrink: 0;
}

.feature-text h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--apple-text);
  margin-bottom: 0.35rem;
}

.feature-text p {
  font-size: 0.85rem;
  color: var(--apple-text-muted);
  line-height: 1.5;
}

.brand-strip-wrapper, .brands-showcase-strip {
  background-color: var(--apple-canvas);
  border-radius: var(--radius-xl);
  padding: 1.5rem 2rem;
  margin-bottom: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 1.5rem;
  opacity: 0.75;
}

.brand-item-logo {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--apple-text-muted);
  letter-spacing: 0.05em;
  transition: color var(--transition-fast);
}

.brand-item-logo:hover {
  color: var(--apple-text);
}

/* ==========================================================================
   Admin Panel (macOS Settings Style) & Complete RTL Architecture
   ========================================================================== */
.admin-body {
  direction: rtl;
  text-align: right;
  background-color: var(--apple-canvas);
  color: var(--apple-text);
  font-family: var(--font-main);
  min-height: 100vh;
}

.admin-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
  direction: rtl;
  position: relative;
}

.admin-sidebar {
  background-color: var(--apple-canvas);
  border-left: 1px solid var(--apple-divider);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  direction: rtl;
  text-align: right;
  z-index: 100;
}

.admin-sidebar-header {
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--apple-divider);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-sidebar-close-btn {
  display: none;
}

.admin-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  list-style: none;
  direction: rtl;
  text-align: right;
}

/* RTL Menu Link Styling: Icon and text grouped on right, badge on left */
.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.95rem;
  border-radius: var(--apple-radius-sm);
  color: var(--apple-text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  direction: rtl;
  text-align: right;
  justify-content: flex-start !important;
  text-decoration: none;
}

.admin-nav-link:hover {
  background-color: rgba(0, 0, 0, 0.04);
  color: var(--apple-text);
}

.admin-nav-link.active {
  background-color: #ffffff;
  color: var(--apple-blue);
  font-weight: 700;
  box-shadow: var(--shadow-xs);
}

.admin-nav-link > span:first-child {
  font-size: 1.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  flex-shrink: 0;
}

.admin-nav-badge {
  background: var(--apple-red);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-pill);
  margin-right: auto !important; /* In RTL, pushes the badge to the left end */
  margin-left: 0 !important;
  flex-shrink: 0;
}

.admin-sidebar-footer {
  padding-top: 1rem;
  border-top: 1px solid var(--apple-divider);
}

.admin-main-wrap {
  background-color: #ffffff;
  overflow-y: auto;
  overflow-x: hidden;
  direction: rtl;
  text-align: right;
  min-width: 0;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--apple-divider);
  background-color: #ffffff;
  direction: rtl;
  text-align: right;
  position: sticky;
  top: 0;
  z-index: 50;
}

#mobAdminToggle {
  display: none;
}

.admin-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1150;
  transition: opacity 0.25s ease;
}

.admin-backdrop.active {
  display: block;
}

.admin-content-inner {
  padding: 1.75rem 2rem;
  direction: rtl;
  text-align: right;
  max-width: 1400px;
  margin: 0 auto;
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: #ffffff;
  border: 1px solid var(--apple-border);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  box-shadow: var(--shadow-xs);
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.stat-icon.blue { background: var(--apple-blue-light); color: var(--apple-blue); }
.stat-icon.green { background: var(--apple-green-light); color: var(--apple-green); }
.stat-icon.orange { background: var(--apple-amber-light); color: var(--apple-amber); }
.stat-icon.red { background: var(--apple-red-light); color: var(--apple-red); }

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-num, .num {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--apple-text);
  margin-top: 0.25rem;
}

.data-card {
  background: #ffffff;
  border: 1px solid var(--apple-border);
  border-radius: 18px;
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  margin-bottom: 2rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

.data-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--apple-divider);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th, .admin-table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--apple-divider);
  text-align: right;
  font-size: 0.85rem;
}

.admin-table th {
  background-color: var(--apple-canvas);
  color: var(--apple-text-muted);
  font-weight: 600;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-pill);
}

.status-pill.success { background: var(--apple-green-light); color: var(--apple-green); }
.status-pill.warning { background: var(--apple-amber-light); color: var(--apple-amber); }
.status-pill.danger { background: var(--apple-red-light); color: var(--apple-red); }
.status-pill.info { background: var(--apple-blue-light); color: var(--apple-blue); }
.status-pill.neutral { background: var(--apple-canvas); color: var(--apple-text-muted); }

.prod-check {
  width: 16px;
  height: 16px;
  accent-color: var(--apple-blue);
  cursor: pointer;
}

/* ==========================================================================
   Forms & Controls
   ========================================================================== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--apple-text);
}

.form-control {
  border: 1px solid var(--apple-border-strong);
  border-radius: 12px;
  padding: 0.65rem 0.95rem;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--apple-text);
  background-color: #ffffff;
  outline: none;
  transition: all var(--transition-fast);
}

.form-control:focus {
  border-color: var(--apple-blue);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

/* ==========================================================================
   Site Footer
   ========================================================================== */
.site-footer {
  background-color: var(--apple-canvas);
  border-top: 1px solid var(--apple-divider);
  padding: 3.5rem 0 2rem;
  color: var(--apple-text-muted);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 3rem;
}

@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 500px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

.footer-col h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--apple-text);
  margin-bottom: 1.25rem;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.footer-col a {
  font-size: 0.85rem;
  color: var(--apple-text-muted);
  transition: color var(--transition-fast);
}

.footer-col a:hover {
  color: var(--apple-blue);
  text-decoration: underline;
}

.footer-bottom {
  border-top: 1px solid var(--apple-divider);
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--apple-text-subtle);
  flex-wrap: wrap;
  gap: 1rem;
}

/* ==========================================================================
   Mobile Bottom Navigation & Floating Elements
   ========================================================================== */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--apple-border);
  padding: 0.4rem 0.5rem;
  z-index: 990;
  justify-content: space-around;
  align-items: center;
}

@media (max-width: 768px) {
  .mobile-bottom-nav {
    display: flex;
  }
  body {
  overflow-x: hidden;
  max-width: 100vw;
    padding-bottom: 60px;
  }
}

.mob-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  color: var(--apple-text-muted);
  font-size: 0.72rem;
  position: relative;
}

.mob-nav-item.active {
  color: var(--apple-blue);
  font-weight: 700;
}

.back-to-top-floating {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--apple-text);
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  cursor: pointer;
  z-index: 800;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all var(--transition-fast);
}

.back-to-top-floating.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top-floating:hover {
  background-color: var(--apple-blue);
  transform: translateY(-3px);
}

.toast-container {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  z-index: 2200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast-message {
  background-color: var(--apple-text);
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  animation: toastFadeIn 0.3s ease;
}

@keyframes toastFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive Header Overhaul */
@media (max-width: 1100px) {
  .action-text {
    display: none !important;
  }
  .action-btn {
    padding: 0.5rem !important;
    min-width: 38px;
    height: 38px;
    justify-content: center;
  }
  .search-container {
    max-width: 300px;
  }
  .header-row {
    gap: 1rem;
  }
}

@media (max-width: 768px) {
  .top-bar {
    display: none;
  }
  .logo-text span {
    display: none;
  }
  .search-container {
    max-width: 200px;
  }
  .header-actions {
    gap: 0.35rem;
  }
}

/* ==========================================================================
   Admin Panel Responsive Engine (Tablet & Mobile Optimization)
   ========================================================================== */

/* Tablet & iPad screens (<= 1024px) */
@media (max-width: 1024px) {
  .admin-layout {
    display: block !important;
    width: 100% !important;
    min-height: 100vh;
  }

  .admin-sidebar {
    position: fixed !important;
    top: 0 !important;
    right: -310px !important;
    width: 285px !important;
    max-width: 85vw !important;
    height: 100vh !important;
    z-index: 1200 !important;
    box-shadow: -8px 0 35px rgba(0, 0, 0, 0.22) !important;
    transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    border-left: none !important;
    border-right: 1px solid var(--apple-border) !important;
    overflow-y: auto !important;
    background-color: var(--apple-canvas) !important;
  }

  .admin-sidebar.open {
    right: 0 !important;
  }

  .admin-sidebar-close-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: rgba(0, 0, 0, 0.05);
    color: var(--apple-text);
    cursor: pointer;
  }

  #mobAdminToggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--apple-radius-sm);
    border: 1px solid var(--apple-border);
    background: var(--apple-canvas);
    color: var(--apple-text);
    font-size: 1.15rem;
    cursor: pointer;
  }

  .admin-main-wrap {
    width: 100% !important;
  }

  .admin-topbar {
    padding: 0.85rem 1.25rem !important;
  }

  .admin-content-inner {
    padding: 1.25rem 1rem !important;
  }

  .admin-stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1rem !important;
  }

  .admin-grid-2-1 {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }
}

/* Mobile Phones (<= 768px) */
@media (max-width: 768px) {
  .admin-topbar {
    padding: 0.75rem 0.85rem !important;
  }

  .admin-topbar-title {
    font-size: 0.88rem !important;
  }

  .admin-topbar-user {
    display: none !important;
  }

  .admin-topbar .admin-switch-btn {
    font-size: 0.75rem !important;
    padding: 0.28rem 0.65rem !important;
  }

  .admin-content-inner {
    padding: 1rem 0.65rem !important;
  }

  .admin-stats-grid {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }

  .stat-card {
    padding: 1rem !important;
    gap: 0.85rem !important;
  }

  .stat-icon {
    width: 42px !important;
    height: 42px !important;
    font-size: 1.25rem !important;
  }

  .stat-num, .num {
    font-size: 1.25rem !important;
  }

  .data-card {
    padding: 1rem !important;
    border-radius: var(--apple-radius) !important;
    margin-bottom: 1.25rem !important;
  }

  .data-card-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.5rem !important;
  }

  .form-grid {
    grid-template-columns: 1fr !important;
    gap: 0.85rem !important;
  }

  /* Admin Header Actions on Mobile */
  .admin-header-actions, 
  #adminContent > div:first-child {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.75rem !important;
  }

  .admin-header-actions button,
  #adminContent > div:first-child button {
    width: 100% !important;
    justify-content: center !important;
  }

  /* Table responsiveness */
  .admin-table {
    min-width: 650px !important;
  }

  .admin-table th, .admin-table td {
    padding: 0.65rem 0.75rem !important;
    font-size: 0.8rem !important;
    white-space: nowrap !important;
  }
}

/* ==========================================================================
   Print & Official Invoice Styles
   ========================================================================== */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 11pt !important;
  }
  .site-header, .category-nav, .site-footer, .back-to-top-floating,
  .admin-sidebar, .admin-topbar, .checkout-steps-bar, .hero-slider,
  #mobileDrawerBackdrop, #userLoginModal, #productReviewModal,
  .modal-backdrop:not(#invoiceModal), .modal-header, button {
    display: none !important;
  }
  #invoiceModal {
    display: block !important;
    position: static !important;
    background: transparent !important;
    padding: 0 !important;
  }
  #invoiceModal .modal-box {
    box-shadow: none !important;
    border: none !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
  }
  .invoice-table th, .invoice-table td {
    border: 1px solid #333333 !important;
  }
}
