/* ==========================================================================
   RED SHARK STOREFRONT — LUXURY MODERN RETAIL THEME
   Crisp Pearl Canvas, Midnight Sapphire Header, Big Category Grid
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --bg-primary: #edf2f7;
  --bg-secondary: #e2e8f0;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --border-color: #cbd5e1;
  --border-hover: #94a3b8;
  --border-focus: #059669;
  
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-subtle: #64748b;
  
  --brand-primary: #059669;
  --brand-primary-hover: #047857;
  --brand-light: #ecfdf5;
  --brand-accent: #2563eb;
  
  --header-bg: #09101d;
  --header-text: #ffffff;
  --header-border: #1e293b;
  
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --success: #059669;
  
  --shadow-sm: 0 2px 6px -1px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 6px 20px -3px rgba(15, 23, 42, 0.10), 0 3px 8px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 16px 32px -4px rgba(15, 23, 42, 0.12);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 9999px;
  
  --font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-ar: 'Cairo', system-ui, sans-serif;
}

[data-theme="dark"] {
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-surface: #161f30;
  --bg-card: #161f30;
  --border-color: #243046;
  --border-hover: #374151;
  --border-focus: #10b981;
  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --text-subtle: #94a3b8;
  --brand-primary: #10b981;
  --brand-primary-hover: #059669;
  --brand-light: rgba(16, 185, 129, 0.15);
  --brand-accent: #38bdf8;
  --header-bg: #070a12;
  --header-text: #ffffff;
  --header-border: #1f293d;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  transition: background-color 0.25s ease, color 0.25s ease;
}

body[dir="rtl"] {
  font-family: var(--font-ar);
}

/* ── HEADER & INTEGRATED TOP SHOP INFO ── */
.store-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  color: var(--header-text);
  border-bottom: 1px solid var(--header-border);
  box-shadow: 0 4px 20px rgba(0,0,0,0.22);
}

.header-main-bar {
  max-width: 1400px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #ffffff;
}

.brand-logo {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #059669, #0284c7);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 900;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.35);
  overflow: hidden;
  flex-shrink: 0;
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-info h1 {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.2;
  color: #ffffff;
  letter-spacing: -0.02em;
}

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

.icon-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  text-decoration: none;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.header-info-subbar {
  background: rgba(15, 23, 42, 0.7);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px 20px;
  backdrop-filter: blur(8px);
}

.header-info-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.header-info-pills {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.header-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 700;
}

.header-pill.open-now {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.header-pill.pos-live {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.35);
  color: #7dd3fc;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #34d399;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.header-desc-text {
  font-size: 0.8rem;
  color: #94a3b8;
  max-width: 520px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── MULTI-OFFER SCROLLING CAROUSEL ── */
.carousel-wrapper {
  max-width: 1400px;
  margin: 16px auto 0;
  padding: 0 20px;
  position: relative;
}

.carousel-container {
  overflow: hidden;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  position: relative;
  background: #0f172a;
}

.carousel-track {
  display: flex;
  transition: transform 0.45s cubic-bezier(0.25, 1, 0.5, 1);
  width: 100%;
  direction: ltr !important;
}

.carousel-slide {
  min-width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 32px;
  background: linear-gradient(135deg, #064e3b 0%, #047857 55%, #0284c7 100%);
  color: #ffffff;
  position: relative;
  gap: 20px;
  min-height: 150px;
}

.carousel-slide.has-image {
  background-size: cover;
  background-position: center;
}

.slide-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 650px;
  z-index: 2;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.slide-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(8px);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 800;
  align-self: flex-start;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.slide-title {
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1.25;
}

.slide-sub {
  font-size: 0.9rem;
  opacity: 0.92;
  font-weight: 500;
}

.slide-image-side {
  max-width: 220px;
  max-height: 130px;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  flex-shrink: 0;
  z-index: 2;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.slide-image-side img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.65);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s;
  font-size: 1.2rem;
  backdrop-filter: blur(4px);
}

.carousel-btn:hover {
  background: rgba(15, 23, 42, 0.9);
  transform: translateY(-50%) scale(1.08);
}

.carousel-btn.prev { inset-inline-start: 12px; }
.carousel-btn.next { inset-inline-end: 12px; }

.carousel-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: all 0.25s;
  border: 1px solid rgba(0,0,0,0.2);
}

.carousel-dot.active {
  width: 24px;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 0 8px rgba(255,255,255,0.8);
}

/* ── 2-COLUMN MAIN LAYOUT ── */
.storefront-container {
  max-width: 1400px;
  margin: 16px auto 40px;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  align-items: start;
}

@media (max-width: 1024px) {
  .storefront-container {
    grid-template-columns: 1fr;
  }
  .side-cart-col {
    display: none;
  }
  .mobile-cart-bar {
    display: flex !important;
  }
}

.catalog-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Search Box */
.search-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}

.search-box:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--brand-light);
}

.search-icon {
  font-size: 1.15rem;
  color: var(--text-subtle);
}

.search-input {
  border: none;
  background: none;
  width: 100%;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text-main);
  outline: none;
  font-weight: 600;
}

.search-input::placeholder {
  color: var(--text-subtle);
  font-weight: 500;
}

/* Categories Chips */
.categories-slider {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px;
  scrollbar-width: none;
}

.categories-slider::-webkit-scrollbar {
  display: none;
}

.cat-chip {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

.cat-chip:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  transform: translateY(-1px);
}

.cat-chip.active {
  background: var(--brand-primary);
  color: #ffffff;
  border-color: var(--brand-primary);
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.35);
}

/* ── BIG CATEGORY CARDS GRID (FEATURED ON OPEN) ── */
.categories-big-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 18px;
}

@media (max-width: 640px) {
  .categories-big-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

.category-big-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  color: inherit;
  position: relative;
}

.category-big-card:hover {
  transform: translateY(-4px);
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-md);
}

.cat-big-img-wrap {
  width: 100%;
  aspect-ratio: 16 / 11;
  position: relative;
  overflow: hidden;
  background: var(--bg-secondary);
}

.cat-big-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.category-big-card:hover .cat-big-img-wrap img {
  transform: scale(1.08);
}

.cat-big-info {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cat-big-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.3;
}

.cat-big-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-subtle);
}

.cat-big-pill {
  background: var(--bg-secondary);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.cat-back-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  box-shadow: var(--shadow-sm);
}

.btn-back-categories {
  background: var(--brand-light);
  color: var(--brand-primary);
  border: 1px solid rgba(5, 150, 105, 0.3);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-back-categories:hover {
  background: var(--brand-primary);
  color: #ffffff;
}

/* ── GROUPED CATEGORIES & PRODUCTS GRID ── */
.category-group-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.category-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--bg-secondary);
}

.category-group-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.category-group-count {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-subtle);
  background: var(--bg-secondary);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

@media (max-width: 640px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

.product-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.25s ease;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.product-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}

.product-card.has-cart {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 1.5px var(--brand-primary);
}

.product-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 2.4rem;
}

.product-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.product-card:hover .product-img-wrap img {
  transform: scale(1.06);
}

.badge-stock {
  position: absolute;
  top: 8px;
  inset-inline-start: 8px;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

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

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

.badge-stock.out-of-stock {
  background: #fee2e2;
  color: #991b1b;
}

.product-info {
  padding: 12px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.product-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.35;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-footer {
  margin-top: auto;
  padding: 0 12px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.product-price {
  display: flex;
  flex-direction: column;
}

.price-usd {
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--brand-primary);
  line-height: 1;
}

.price-lbp {
  font-size: 0.72rem;
  color: var(--text-subtle);
  font-weight: 700;
  margin-top: 2px;
}

.btn-add-cart {
  background: var(--brand-light);
  color: var(--brand-primary);
  border: 1px solid rgba(5, 150, 105, 0.25);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}

.btn-add-cart:hover {
  background: var(--brand-primary);
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-add-cart:disabled {
  background: var(--bg-secondary);
  color: var(--text-subtle);
  border-color: var(--border-color);
  cursor: not-allowed;
  transform: none;
}

.card-qty-stepper {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--brand-light);
  border: 1px solid var(--brand-primary);
  border-radius: var(--radius-md);
  padding: 2px 4px;
}

.card-qty-stepper button {
  background: #ffffff;
  border: 1px solid rgba(5, 150, 105, 0.25);
  color: var(--brand-primary);
  width: 26px;
  height: 26px;
  border-radius: 6px;
  font-weight: 900;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.card-qty-stepper button:hover {
  background: var(--brand-primary);
  color: #ffffff;
}

.card-qty-stepper span {
  font-weight: 900;
  font-size: 0.95rem;
  color: var(--brand-primary);
  min-width: 20px;
  text-align: center;
}

/* ── SIDE CART COLUMN (DESKTOP) ── */
.side-cart-col {
  position: sticky;
  top: 100px;
}

.side-cart-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1.5px solid var(--bg-secondary);
}

.cart-header h3 {
  font-size: 1.15rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-clear-cart {
  background: none;
  border: none;
  color: var(--danger);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
}

.btn-clear-cart:hover {
  background: var(--danger-light);
}

.cart-items-wrapper {
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-inline-end: 4px;
}

.cart-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  gap: 8px;
}

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

.cart-item-name {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-price {
  font-size: 0.78rem;
  color: var(--brand-primary);
  font-weight: 800;
}

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

.btn-delete-item {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  padding: 4px;
  font-size: 0.85rem;
  border-radius: 4px;
}

.btn-delete-item:hover {
  background: var(--danger-light);
}

.cart-summary {
  background: var(--bg-secondary);
  padding: 12px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.cart-summary-row.total {
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--text-main);
  padding-top: 6px;
  border-top: 1px dashed var(--border-color);
  margin-top: 2px;
}

.checkout-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 2px;
}

.field-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-family: inherit;
  color: var(--text-main);
  background: #f8fafc;
  outline: none;
}

.field-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px var(--brand-light);
}

.btn-checkout-primary {
  background: var(--brand-primary);
  color: #ffffff;
  border: none;
  padding: 12px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.35);
  transition: all 0.2s;
}

.btn-checkout-primary:hover {
  background: var(--brand-primary-hover);
  transform: translateY(-1px);
}

.btn-checkout-whatsapp {
  background: #25d366;
  color: #ffffff;
  border: none;
  padding: 10px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn-checkout-whatsapp:hover {
  background: #1ebd5a;
  transform: translateY(-1px);
}

/* ── MOBILE STICKY CART BAR ── */
.mobile-cart-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--header-bg);
  color: #ffffff;
  padding: 12px 20px;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.25);
  z-index: 90;
  align-items: center;
  justify-content: space-between;
}

.mobile-cart-info {
  display: flex;
  flex-direction: column;
}

/* ── MODALS ── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

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

.modal-sheet {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  border: 1px solid var(--border-color);
}

.modal-header {
  padding: 14px 18px;
  border-bottom: 1.5px solid var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body {
  padding: 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ── ADMIN SPECIFIC STYLES ── */
.admin-container {
  max-width: 1200px;
  margin: 24px auto 60px;
  padding: 0 20px;
}

.admin-nav-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 8px;
  overflow-x: auto;
}

.nav-tab-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  white-space: nowrap;
}

.nav-tab-btn.active {
  background: var(--brand-primary);
  color: #ffffff;
  border-color: var(--brand-primary);
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

.admin-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1.5px solid var(--bg-secondary);
  flex-wrap: wrap;
  gap: 12px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.upload-field-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn-upload-file {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-upload-file:hover {
  background: var(--border-hover);
}

.img-preview-thumb {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border-color);
  display: none;
}

.slide-editor-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.save-alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  font-weight: 800;
  font-size: 0.9rem;
  display: none;
}

.save-alert.success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.save-alert.error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.pin-security-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(12px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.pin-security-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

/* ── CATALOG TABLE ACTIONS & EDIT STYLES ── */
.table-btn-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-edit-item {
  background: var(--brand-light);
  color: var(--brand-primary);
  border: 1px solid rgba(5, 150, 105, 0.3);
  padding: 5px 10px;
  border-radius: 6px;
  font-weight: 800;
  font-size: 0.8rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}

.btn-edit-item:hover {
  background: var(--brand-primary);
  color: #ffffff;
}

.table-img-clickable {
  position: relative;
  cursor: pointer;
  display: inline-block;
}

.table-img-clickable:hover::after {
  content: '📷';
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #fff;
}

.cat-cover-thumb {
  width: 60px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  display: block;
}


/* ==========================================================================
   MOBILE & LAPTOP RESPONSIVE PERFECTION (RedShark Storefront)
   ========================================================================== */

/* Header App Button */
.header-app-btn {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #10b981 !important;
  border: 1px solid rgba(16, 185, 129, 0.35) !important;
  font-weight: 800 !important;
  padding: 6px 12px !important;
  border-radius: 9999px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  transition: all 0.2s !important;
}

.header-app-btn:hover {
  background: #10b981 !important;
  color: #ffffff !important;
}

/* Categories Header Bar */
.categories-view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  gap: 10px;
}

.section-title {
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--text-main);
  margin: 0;
}

.section-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.btn-view-all-pill {
  background: var(--brand-primary);
  color: #ffffff;
  border: none;
  border-radius: 9999px;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  transition: all 0.2s;
}

.btn-view-all-pill:hover {
  background: var(--brand-hover);
  transform: translateY(-1px);
}

/* Category Big Grid - Responsive 2 Columns on Mobile, 4-5 on Laptop */
.categories-big-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)) !important;
  gap: 16px !important;
}

.category-big-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
  text-decoration: none;
  color: inherit;
}

.category-big-card:hover {
  transform: translateY(-3px);
  border-color: var(--brand-primary);
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.cat-big-img-wrap {
  width: 100%;
  height: 130px;
  position: relative;
  overflow: hidden;
  background: #f1f5f9;
}

.cat-big-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.category-big-card:hover .cat-big-img {
  transform: scale(1.05);
}

.cat-big-info {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cat-big-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cat-big-count {
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* Search Input */
.search-input {
  border-radius: 9999px !important;
  padding: 12px 20px 12px 42px !important;
  background-color: #ffffff !important;
  border: 1.5px solid var(--border-color) !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03) !important;
  font-size: 0.92rem !important;
}

/* MOBILE VIEWPORT SPECIFIC OVERRIDES (<= 640px) */
@media (max-width: 640px) {
  .store-header {
    position: sticky;
    top: 0;
    z-index: 100;
  }

  .header-main-bar {
    padding: 8px 12px !important;
  }

  .brand-logo {
    width: 36px !important;
    height: 36px !important;
    font-size: 1.25rem !important;
  }

  #store-name {
    font-size: 1rem !important;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .header-actions {
    gap: 6px !important;
  }

  .header-actions .icon-btn {
    padding: 5px 8px !important;
    font-size: 0.78rem !important;
  }

  /* Compact Subbar on Mobile */
  .header-info-subbar {
    padding: 6px 12px !important;
    gap: 6px !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    scrollbar-width: none !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .header-info-subbar::-webkit-scrollbar {
    display: none;
  }

  .info-badge-pill {
    padding: 3px 8px !important;
    font-size: 0.72rem !important;
  }

  .header-store-desc {
    display: none !important;
  }

  /* Carousel Banner on Mobile */
  .carousel-container {
    border-radius: 12px !important;
    margin: 10px 0 !important;
  }

  .carousel-slide {
    padding: 14px 16px !important;
    flex-direction: column-reverse !important;
    gap: 10px !important;
    min-height: unset !important;
  }

  .slide-media {
    width: 100% !important;
    max-height: 110px !important;
    border-radius: 8px !important;
  }

  .slide-content {
    max-width: 100% !important;
    gap: 4px !important;
    text-align: center !important;
  }

  .slide-badge {
    align-self: center !important;
    font-size: 0.68rem !important;
    padding: 2px 7px !important;
  }

  .slide-title {
    font-size: 0.92rem !important;
    line-height: 1.3 !important;
    text-align: center !important;
  }

  .slide-subtitle {
    font-size: 0.74rem !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-align: center !important;
  }

  .carousel-btn {
    width: 28px !important;
    height: 28px !important;
    font-size: 0.8rem !important;
  }

  /* 2-Column Category Grid on Mobile */
  .categories-big-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  .cat-big-img-wrap {
    height: 105px !important;
  }

  .cat-big-info {
    padding: 8px 10px !important;
  }

  .cat-big-title {
    font-size: 0.84rem !important;
  }

  .cat-big-count {
    font-size: 0.7rem !important;
  }

  /* Products Grid: 2 Columns on Mobile */
  .products-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  .product-card {
    padding: 10px !important;
    border-radius: 12px !important;
  }

  .product-img-wrap {
    height: 115px !important;
  }

  .product-name {
    font-size: 0.82rem !important;
  }

  .product-price-current {
    font-size: 0.95rem !important;
  }
}


/* FORCED MOBILE GRID & CAROUSEL LAYOUT */
@media screen and (max-width: 640px) {
  #categories-big-grid.categories-big-grid,
  .categories-big-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    padding: 0 !important;
  }

  .category-big-card {
    border-radius: 12px !important;
    overflow: hidden !important;
  }

  .cat-big-img-wrap {
    height: 105px !important;
    max-height: 105px !important;
  }

  .cat-big-img {
    height: 105px !important;
    width: 100% !important;
    object-fit: cover !important;
  }

  .cat-big-info {
    padding: 8px 10px !important;
  }

  .cat-big-title {
    font-size: 0.85rem !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .cat-big-count {
    font-size: 0.72rem !important;
  }
}
