/* Helmy Beik (حلمي بيك) - Premium E-Commerce Multi-Theme Design System */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800;900&family=Tajawal:wght@400;500;700;800;900&display=swap');

/* ==========================================================================
   THEME 1 (DEFAULT): Helmi Royal Purple & Gold (الهوية الرسمية المعتمدة)
   Colors: #6A2EBB (Purple), #FFC107 (Gold), #1F2937 (Text), #F3F4F6 (Bg)
   Font: Tajawal
   ========================================================================== */
:root,
body[data-theme="purple_gold"],
html[data-theme="purple_gold"] body {
  --font-family: 'Tajawal', system-ui, -apple-system, sans-serif;
  --primary: #6A2EBB;
  --primary-hover: #58249C;
  --primary-light: #F5F3FF;
  --primary-dark: #4C1D95;
  --primary-gradient: linear-gradient(135deg, #6A2EBB 0%, #8B5CF6 100%);
  --secondary: #FFC107;
  --secondary-hover: #E0A800;
  --secondary-light: #FFF8E1;
  --accent: #FFC107;
  --accent-hover: #E0A800;
  --success: #16a34a;
  --danger: #dc2626;
  --text-main: #1F2937;
  --text-muted: #6B7280;
  --bg-page: #F8FAFC;
  --bg-card: #FFFFFF;
  --border-color: #E5E7EB;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius: 12px;

  /* Button styles matching brand identity sheet */
  --btn-cart-bg: #FFC107;
  --btn-cart-text: #1F2937;
  --btn-cart-hover: #FFA000;
  --btn-shop-bg: #6A2EBB;
  --btn-shop-text: #FFFFFF;
  --btn-fav-bg: #F5F3FF;
  --btn-fav-text: #6A2EBB;
}

/* ==========================================================================
   THEME 2 (OPTION): Classic Orange & Navy (الثيم السابق - الكلاسيكي)
   Colors: #f68b1e (Orange), #0f172a (Navy), #1e293b (Text), #f8fafc (Bg)
   Font: Cairo
   ========================================================================== */
body[data-theme="classic"],
html[data-theme="classic"] body {
  --font-family: 'Cairo', system-ui, -apple-system, sans-serif;
  --primary: #f68b1e;
  --primary-hover: #e07b14;
  --primary-light: #fff7ed;
  --primary-dark: #c25e00;
  --primary-gradient: linear-gradient(135deg, #f68b1e 0%, #ea580c 100%);
  --secondary: #0f172a;
  --secondary-hover: #1e293b;
  --secondary-light: #f1f5f9;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --success: #16a34a;
  --danger: #dc2626;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  --radius: 12px;

  --btn-cart-bg: #f68b1e;
  --btn-cart-text: #ffffff;
  --btn-cart-hover: #e07b14;
  --btn-shop-bg: #f68b1e;
  --btn-shop-text: #ffffff;
  --btn-fav-bg: #f1f5f9;
  --btn-fav-text: #64748b;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family, 'Tajawal', system-ui, sans-serif);
  background-color: var(--bg-page);
  color: var(--text-main);
  direction: rtl;
  text-align: right;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header & Navbar */
.top-bar {
  background-color: #0f172a;
  color: #94a3b8;
  font-size: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #1e293b;
}
.top-bar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.top-bar a:hover {
  color: #ffffff;
}

.main-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}
.header-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 0;
}
.logo-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 24px;
  font-weight: 900;
  color: var(--text-main, #0f172a);
  text-decoration: none;
}
.logo-badge {
  background: linear-gradient(135deg, var(--primary), #8B5CF6);
  color: white;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
body[data-theme="purple_gold"] .logo-brand,
:root .logo-brand {
  color: #1F2937;
}
body[data-theme="purple_gold"] .logo-badge,
:root .logo-badge {
  background: linear-gradient(135deg, #6A2EBB 0%, #8B5CF6 100%);
  color: #FFC107;
}
body[data-theme="classic"] .logo-brand {
  color: #0f172a;
}
body[data-theme="classic"] .logo-badge {
  background: linear-gradient(135deg, #f68b1e 0%, #ea580c 100%);
  color: white;
}

/* Search bar */
.search-box {
  flex: 1;
  max-width: 600px;
  position: relative;
}
.search-form {
  display: flex;
  align-items: center;
  background: #f1f5f9;
  border: 2px solid transparent;
  border-radius: 9999px;
  overflow: hidden;
  transition: all 0.2s ease;
}
.search-form:focus-within {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(246, 139, 30, 0.15);
}
.search-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 12px 20px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
}
.search-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  border-radius: 9999px;
  margin: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s;
}
.search-btn:hover {
  background: var(--primary-hover);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}
.action-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  color: #334155;
  transition: all 0.2s;
}
.action-link:hover {
  background: #f8fafc;
  color: var(--primary);
}
.cart-badge-wrap {
  position: relative;
}
.cart-count {
  position: absolute;
  top: -6px;
  right: -8px;
  background: var(--primary);
  color: white;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 9999px;
  min-width: 18px;
  text-align: center;
  border: 2px solid white;
}

/* Category Navigation Bar */
.cat-nav-bar {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 16px;
  overflow-x: auto;
  white-space: nowrap;
  padding: 8px 0;
  scrollbar-width: none;
}
.cat-nav-bar::-webkit-scrollbar {
  display: none;
}
.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  background: #f8fafc;
  transition: all 0.2s;
  border: 1px solid transparent;
}
.cat-pill:hover, .cat-pill.active {
  background: var(--primary-light);
  color: var(--primary-dark);
  border-color: rgba(246, 139, 30, 0.3);
}

/* Hero Section */
.hero-banner {
  margin-top: 20px;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, #2E1065 0%, #4C1D95 45%, #6A2EBB 100%);
  color: white;
  padding: 48px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
body[data-theme="classic"] .hero-banner {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0369a1 100%);
}
.hero-content {
  max-width: 580px;
  z-index: 2;
}
.hero-tag {
  display: inline-block;
  background: var(--secondary, #FFC107);
  color: #1F2937;
  font-size: 13px;
  font-weight: 900;
  padding: 5px 14px;
  border-radius: 9999px;
  margin-bottom: 16px;
  letter-spacing: -0.2px;
}
body[data-theme="classic"] .hero-tag {
  background: var(--primary);
  color: white;
}
.hero-title {
  font-size: 38px;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 16px;
}
.hero-subtitle {
  color: #EDE9FE;
  font-size: 16px;
  margin-bottom: 24px;
}
body[data-theme="classic"] .hero-subtitle {
  color: #cbd5e1;
}
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--secondary, #FFC107);
  color: #1F2937;
  padding: 12px 28px;
  border-radius: 10px;
  font-weight: 900;
  font-size: 16px;
  box-shadow: 0 4px 14px rgba(255, 193, 7, 0.4);
  transition: transform 0.2s, background 0.2s;
}
.hero-cta:hover {
  background: var(--secondary-hover, #FFA000);
  transform: translateY(-2px);
  color: #111827;
}
body[data-theme="classic"] .hero-cta {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 14px rgba(246, 139, 30, 0.4);
}
body[data-theme="classic"] .hero-cta:hover {
  background: var(--primary-hover);
  color: white;
}

/* Brand Button Styles matching design guidelines */
.btn-shop-now {
  background: var(--btn-shop-bg, #6A2EBB);
  color: var(--btn-shop-text, #FFFFFF);
  border: none;
  padding: 10px 22px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(106, 46, 187, 0.25);
}
.btn-shop-now:hover {
  background: var(--primary-hover, #58249C);
  color: #ffffff;
  transform: translateY(-1px);
}
.btn-fav {
  background: var(--btn-fav-bg, #F5F3FF);
  color: var(--btn-fav-text, #6A2EBB);
  border: 1px solid rgba(106, 46, 187, 0.15);
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-fav:hover {
  background: #EDE9FE;
  color: #4C1D95;
}

/* Features Strip */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 24px 0;
}
.feature-card {
  background: white;
  padding: 16px 20px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}
.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.feature-title {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}
.feature-desc {
  font-size: 12px;
  color: var(--text-muted);
}

/* Section Header */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 36px 0 20px;
}
.section-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-icon {
  width: 28px;
  height: 28px;
  color: var(--primary);
}
.section-title {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
}
.section-link {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 4px;
}
.section-link:hover {
  text-decoration: underline;
}

/* Category Grid */
.category-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 14px;
}
.category-bubble {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 16px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}
.category-bubble:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}
.category-bubble img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid #f1f5f9;
}
.category-bubble span {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Product Card */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
}
.product-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.25s ease;
  position: relative;
  box-shadow: var(--shadow-sm);
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px -10px rgba(0,0,0,0.12);
  border-color: #cbd5e1;
}
.product-thumb-wrap {
  position: relative;
  padding-top: 100%;
  background: #f8fafc;
  overflow: hidden;
}
.product-thumb-wrap img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 12px;
  transition: transform 0.3s ease;
}
.product-card:hover .product-thumb-wrap img {
  transform: scale(1.05);
}
.discount-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #e11d48;
  color: white;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  z-index: 2;
}
.express-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: #0f172a;
  color: #f8fafc;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 2;
}
.express-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
}

.product-info {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.product-brand {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.product-title {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 40px;
}
.product-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}
.star-rating {
  display: flex;
  align-items: center;
}
.product-rating-num {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
}

.product-pricing {
  margin-top: auto;
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
}
.current-price {
  font-size: 18px;
  font-weight: 900;
  color: #0f172a;
}
.old-price {
  font-size: 13px;
  color: #94a3b8;
  text-decoration: line-through;
}

.vendor-mini-tag {
  font-size: 11px;
  color: #0284c7;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 10px;
}

.btn-add-cart {
  width: 100%;
  background: var(--btn-cart-bg, #FFC107);
  color: var(--btn-cart-text, #1F2937);
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}
.btn-add-cart:hover {
  background: var(--btn-cart-hover, #FFA000);
  color: var(--btn-cart-text, #1F2937);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}
body[data-theme="classic"] .btn-add-cart {
  background: var(--primary-light);
  color: var(--primary-dark);
  border: 1px solid rgba(246, 139, 30, 0.4);
}
body[data-theme="classic"] .btn-add-cart:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Official Stores Grid */
.stores-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.store-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}
.store-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.store-logo {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid #f1f5f9;
}
.store-details {
  flex: 1;
}
.store-name {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 4px;
}
.verified-icon {
  width: 16px;
  height: 16px;
  color: #0284c7;
  fill: #0284c7;
}
.store-stats {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Flash Sales Banner Box */
.flash-sales-box {
  background: linear-gradient(135deg, #be123c, #9f1239);
  color: white;
  border-radius: var(--radius);
  padding: 20px;
  margin: 30px 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.flash-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 22px;
  font-weight: 900;
}
.countdown-timer {
  display: flex;
  align-items: center;
  gap: 8px;
}
.timer-unit {
  background: rgba(0,0,0,0.3);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 800;
  min-width: 44px;
  text-align: center;
}

/* Footer */
.site-footer {
  background: #0f172a;
  color: #94a3b8;
  margin-top: 60px;
  padding: 48px 0 24px;
  font-size: 14px;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
  margin-bottom: 40px;
}
.footer-col h4 {
  color: white;
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 16px;
}
.footer-col ul {
  list-style: none;
}
.footer-col li {
  margin-bottom: 10px;
}
.footer-col a:hover {
  color: var(--primary);
}
.footer-bottom {
  border-top: 1px solid #1e293b;
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: #0f172a;
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 700;
  animation: slideUp 0.3s ease;
  border-right: 4px solid var(--primary);
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   MOBILE-FIRST & RESPONSIVE DESIGN SYSTEM (حلمي بيك)
   Optimized for Smartphones, Tablets, and Mobile App Navigation
   ========================================================================== */

/* Anti-overflow & touch defaults */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
  -webkit-tap-highlight-color: transparent;
}

img {
  max-width: 100%;
  height: auto;
}

/* Tablets (1024px and below) */
@media (max-width: 1024px) {
  .container {
    padding: 0 16px;
  }
  .header-wrapper {
    gap: 16px;
  }
  .search-box {
    max-width: 480px;
  }
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
}

/* Mobile & Small Tablets (768px and below) */
@media (max-width: 768px) {
  /* Layout & Container */
  .container {
    padding: 0 12px !important;
  }

  /* Input zoom prevention on iOS Safari */
  input, select, textarea {
    font-size: 16px !important;
  }

  /* Top Announcement Bar */
  .top-bar {
    padding: 4px 0 !important;
    font-size: 11px !important;
  }
  .top-bar-container {
    justify-content: center !important;
    text-align: center !important;
  }
  .top-bar-announcement {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    width: 100% !important;
    overflow: hidden !important;
    white-space: nowrap !important;
  }
  .top-bar-links {
    display: none !important;
  }
  .top-bar-country-pill {
    padding: 1px 6px !important;
    font-size: 10px !important;
  }
  .announcement-sep {
    display: none !important;
  }
  .announcement-item:not(:first-of-type) {
    display: none !important;
  }

  /* Main Header */
  .main-header {
    padding: 0 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
  }
  .header-wrapper {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    padding: 8px 0 10px !important;
  }
  .logo-brand {
    order: 1 !important;
    font-size: 19px !important;
    gap: 6px !important;
  }
  .logo-badge {
    font-size: 10px !important;
    padding: 2px 6px !important;
    border-radius: 6px !important;
  }
  .header-actions {
    order: 2 !important;
    gap: 6px !important;
    align-items: center !important;
  }
  .mobile-hide {
    display: none !important;
  }
  .user-text-label {
    display: none !important;
  }
  .header-user-btn,
  .header-login-btn {
    padding: 6px 10px !important;
    border-radius: 9999px !important;
    min-height: 36px !important;
    justify-content: center !important;
    background: #ffffff !important;
    border: 1px solid var(--border-color) !important;
  }
  .header-country-selector {
    position: static !important;
  }
  #headerCountryBtn {
    padding: 5px 8px !important;
    font-size: 11px !important;
    gap: 4px !important;
    border-radius: 9999px !important;
  }
  .country-sub {
    display: none !important;
  }
  .country-main {
    font-size: 11px !important;
    font-weight: 800 !important;
  }
  .cart-badge-wrap {
    padding: 6px 10px !important;
    border-radius: 9999px !important;
    min-height: 36px !important;
  }
  .cart-count {
    top: -4px !important;
    right: -4px !important;
    font-size: 10px !important;
    min-width: 17px !important;
    height: 17px !important;
    line-height: 14px !important;
    padding: 0 4px !important;
  }

  /* Full-width Search Bar */
  .search-box {
    order: 3 !important;
    width: 100% !important;
    max-width: 100% !important;
    flex-basis: 100% !important;
    margin-top: 2px !important;
  }
  .search-form {
    background: #f1f5f9 !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 9999px !important;
    height: 40px !important;
    box-shadow: none !important;
  }
  .search-input {
    padding: 8px 14px !important;
    font-size: 13px !important;
  }
  .search-btn {
    padding: 6px 14px !important;
    margin: 2px !important;
    font-size: 12px !important;
    border-radius: 9999px !important;
  }
  .search-btn-text {
    display: none !important;
  }

  /* Country Modal (Responsive Bottom-Sheet / Popup) */
  #headerCountryModal {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 92% !important;
    max-width: 350px !important;
    max-height: 82vh !important;
    border-radius: 18px !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4) !important;
    z-index: 100000 !important;
    padding: 12px !important;
  }

  /* Category Horizontal Scroller */
  .cat-nav-bar {
    padding: 6px 0 !important;
    gap: 6px !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
  }
  .cat-nav-bar::-webkit-scrollbar {
    display: none !important;
  }
  .cat-pill {
    padding: 5px 12px !important;
    font-size: 12px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    border-radius: 9999px !important;
  }

  /* Active Marketplace Ribbon */
  .marketplace-ribbon {
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 12px 14px !important;
    gap: 10px !important;
    margin: 10px 0 14px !important;
    border-radius: 12px !important;
  }
  .marketplace-ribbon-btn {
    width: 100% !important;
    justify-content: center !important;
    padding: 9px 16px !important;
    font-size: 13px !important;
    border-radius: 8px !important;
  }

  /* Hero Section */
  .hero-banner {
    padding: 20px 16px !important;
    border-radius: 14px !important;
    margin-top: 10px !important;
    flex-direction: column !important;
    align-items: stretch !important;
    text-align: right !important;
    gap: 14px !important;
  }
  .hero-tag {
    font-size: 11px !important;
    padding: 3px 8px !important;
    display: inline-block !important;
  }
  .hero-title {
    font-size: 20px !important;
    line-height: 1.35 !important;
    margin: 8px 0 !important;
  }
  .hero-subtitle {
    font-size: 13px !important;
    line-height: 1.5 !important;
    margin-bottom: 14px !important;
  }
  .hero-content > div[style*="display: flex"] {
    flex-direction: column !important;
    gap: 8px !important;
    width: 100% !important;
  }
  .hero-cta,
  .btn-shop-now {
    width: 100% !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 11px 16px !important;
    font-size: 13px !important;
    border-radius: 8px !important;
  }

  /* Features & Trust Grid (2x2 on Mobile) */
  .features-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    margin: 14px 0 !important;
  }
  .feature-card {
    padding: 10px !important;
    gap: 8px !important;
    border-radius: 10px !important;
  }
  .feature-icon {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
  }
  .feature-icon svg {
    width: 18px !important;
    height: 18px !important;
  }
  .feature-title {
    font-size: 12px !important;
    font-weight: 800 !important;
  }
  .feature-desc {
    font-size: 10px !important;
    line-height: 1.25 !important;
  }

  /* Section Header */
  .section-header {
    margin-top: 22px !important;
    margin-bottom: 10px !important;
  }
  .section-title {
    font-size: 16px !important;
  }
  .section-icon {
    width: 18px !important;
    height: 18px !important;
  }

  /* Category Cards Grid (4 columns) */
  .category-cards-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 10px 4px !important;
  }
  .category-bubble {
    padding: 6px 2px !important;
  }
  .category-bubble img {
    width: 50px !important;
    height: 50px !important;
  }
  .category-bubble span {
    font-size: 11px !important;
    line-height: 1.2 !important;
    max-width: 68px !important;
  }

  /* Flash Sales Box */
  .flash-sales-box {
    padding: 12px 14px !important;
    margin: 18px 0 12px !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    border-radius: 12px !important;
  }
  .flash-title {
    font-size: 16px !important;
    justify-content: center !important;
  }
  .flash-title svg {
    width: 22px !important;
    height: 22px !important;
  }
  .countdown-timer {
    justify-content: center !important;
    font-size: 12px !important;
    gap: 4px !important;
  }
  .timer-unit {
    padding: 4px 8px !important;
    font-size: 14px !important;
    min-width: 36px !important;
    border-radius: 6px !important;
  }

  /* Products Grid (2 columns on mobile) */
  .products-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
  .product-card {
    border-radius: 12px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
  }
  .product-thumb-wrap {
    height: 150px !important;
    padding: 6px !important;
  }
  .product-info {
    padding: 8px 10px 10px !important;
  }
  .product-brand {
    font-size: 10px !important;
    margin-bottom: 2px !important;
  }
  .product-title {
    font-size: 12px !important;
    height: 32px !important;
    line-height: 1.35 !important;
    -webkit-line-clamp: 2 !important;
  }
  .product-meta {
    font-size: 10px !important;
    gap: 3px !important;
    margin-bottom: 4px !important;
  }
  .vendor-mini-tag {
    font-size: 9px !important;
    padding: 2px 6px !important;
  }
  .product-pricing {
    margin-top: 4px !important;
    gap: 6px !important;
  }
  .current-price {
    font-size: 14px !important;
    font-weight: 900 !important;
  }
  .old-price {
    font-size: 11px !important;
  }
  .btn-add-cart {
    padding: 8px 8px !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    gap: 4px !important;
    border-radius: 8px !important;
    width: 100% !important;
    justify-content: center !important;
    margin-top: 8px !important;
  }
  .btn-add-cart svg {
    width: 14px !important;
    height: 14px !important;
  }
  .discount-badge {
    top: 6px !important;
    right: 6px !important;
    font-size: 10px !important;
    padding: 2px 5px !important;
  }
  .express-badge {
    top: 6px !important;
    left: 6px !important;
    font-size: 9px !important;
    padding: 2px 5px !important;
  }

  /* Stores Grid */
  .stores-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
  .store-card {
    padding: 10px !important;
    gap: 8px !important;
    border-radius: 10px !important;
  }
  .store-logo {
    width: 42px !important;
    height: 42px !important;
  }
  .store-name {
    font-size: 12px !important;
  }
  .store-stats {
    font-size: 10px !important;
  }

  /* Product Details Page */
  .breadcrumb-wrap {
    margin-bottom: 12px !important;
    font-size: 12px !important;
  }
  .product-detail-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    padding: 14px !important;
    border-radius: 12px !important;
  }
  .product-gallery-box {
    padding: 12px !important;
  }
  #main-product-img {
    max-height: 250px !important;
  }
  .product-thumb-strip img {
    width: 52px !important;
    height: 52px !important;
  }
  .product-detail-actions {
    flex-direction: column !important;
    gap: 10px !important;
  }
  .btn-add-cart-main {
    width: 100% !important;
    padding: 12px 18px !important;
    font-size: 14px !important;
  }

  /* Cart Page */
  .cart-layout-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  .cart-item-row {
    flex-wrap: wrap !important;
    gap: 10px !important;
    padding: 12px 0 !important;
  }
  .cart-item-row img {
    width: 60px !important;
    height: 60px !important;
  }
  .cart-item-controls {
    width: 100% !important;
  }

  /* Category Page */
  .category-page-header {
    padding: 14px 16px !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }
  .category-page-header form {
    width: 100% !important;
    justify-content: space-between !important;
  }
  .category-page-header select {
    flex: 1 !important;
  }

  /* Site Footer */
  .site-footer {
    padding: 28px 0 16px !important;
    margin-top: 32px !important;
    font-size: 13px !important;
  }
  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
    margin-bottom: 20px !important;
  }
  .footer-col h4 {
    font-size: 15px !important;
    margin-bottom: 10px !important;
  }
  .footer-bottom {
    flex-direction: column !important;
    text-align: center !important;
    gap: 10px !important;
  }

  /* Mobile App Bottom Navigation Bar */
  .hb-mobile-nav {
    display: flex !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 58px !important;
    background: #ffffff !important;
    border-top: 1px solid #e2e8f0 !important;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.06) !important;
    z-index: 9999 !important;
    align-items: center !important;
    justify-content: space-around !important;
    padding: 4px 6px calc(4px + env(safe-area-inset-bottom, 0px)) !important;
  }
  body {
    padding-bottom: calc(65px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

/* Extra Small Phones (400px and below) */
@media (max-width: 400px) {
  .category-cards-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
  .stores-grid {
    grid-template-columns: 1fr !important;
  }
  .logo-brand {
    font-size: 17px !important;
  }
  .header-actions {
    gap: 4px !important;
  }
}

