/* ═══════════════════════════════════════════════════════
   FARES MARKET — Global Stylesheet
   Colors from logo: cyan-1 #00e5ff  cyan-2 #00bcd4
                     teal  #006b8f   teal-dark #004d66
   ═══════════════════════════════════════════════════════ */

/* ── Variables ──────────────────────────────────────────── */
:root {
  --cyan-1:    #00e5ff;
  --cyan-2:    #00bcd4;
  --teal:      #006b8f;
  --teal-dark: #004d66;
  --white:     #ffffff;
  --gray-50:   #f8fafc;
  --gray-100:  #f1f5f9;
  --gray-200:  #e2e8f0;
  --gray-400:  #94a3b8;
  --gray-600:  #475569;
  --gray-800:  #1e293b;
  --success:   #10b981;
  --danger:    #ef4444;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,107,143,0.12);
  --shadow-lg: 0 8px 32px rgba(0,107,143,0.18);
  --radius:    14px;
  --radius-sm: 8px;
  --cart-width: 380px;
  --ease: cubic-bezier(0.4,0,0.2,1);
}

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

body {
  font-family: 'Cairo', 'Inter', sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  min-height: 100vh;
  overflow-x: hidden;
}
body.lang-en { font-family: 'Inter', 'Cairo', sans-serif; }

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

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: var(--cyan-2); border-radius: 99px; }

/* ── Header ──────────────────────────────────────────────── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 2px solid var(--cyan-2);
  box-shadow: var(--shadow-md);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  height: 68px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo { display: flex; align-items: center; flex-shrink: 0; }
.logo img { height: 90px; width: auto; }

/* Search */
.search-wrap {
  flex: 1;
  max-width: 480px;
  position: relative;
}

.search-wrap input {
  width: 100%;
  height: 42px;
  border: 2px solid var(--gray-200);
  border-radius: 99px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s var(--ease);
  background: var(--gray-50);
  color: var(--gray-800);
}

html[dir="rtl"] .search-wrap input { padding: 0 16px 0 44px; }
html[dir="ltr"] .search-wrap input { padding: 0 44px 0 16px; }

.search-wrap input:focus { border-color: var(--cyan-2); background: var(--white); }
.search-wrap input::placeholder { color: var(--gray-400); }

.search-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  pointer-events: none;
}
html[dir="rtl"] .search-icon { left: 14px; }
html[dir="ltr"] .search-icon { right: 14px; }

/* Header actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-inline-start: auto;
  flex-shrink: 0;
}

.lang-btn {
  height: 36px;
  padding: 0 14px;
  border-radius: 99px;
  border: 2px solid var(--cyan-2);
  background: transparent;
  color: var(--teal);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  font-family: inherit;
  display: flex;
  align-items: center;
}
.lang-btn:hover { background: var(--cyan-2); color: var(--white); }

.cart-btn {
  position: relative;
  height: 42px;
  padding: 0 18px;
  border-radius: 99px;
  border: none;
  background: linear-gradient(135deg, var(--cyan-1), var(--cyan-2));
  color: var(--white);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s var(--ease);
  box-shadow: 0 2px 12px rgba(0,188,212,0.4);
  font-family: inherit;
}
.cart-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(0,188,212,0.5); }

.cart-badge {
  position: absolute;
  top: -6px;
  inset-inline-end: -6px;
  width: 20px;
  height: 20px;
  background: var(--teal-dark);
  color: var(--white);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
  display: none;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--white);
}
.cart-badge.visible { display: flex; }

/* ── Layout ──────────────────────────────────────────────── */
.page-layout {
  max-width: 1400px;
  margin: 0 auto;
  padding: 28px 24px;
}

/* ── Section Label ───────────────────────────────────────── */
.section-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-400);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

/* ── Categories ──────────────────────────────────────────── */
.categories-section { margin-bottom: 28px; }

.category-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.cat-tab {
  height: 36px;
  padding: 0 16px;
  border-radius: 99px;
  border: 2px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-600);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  white-space: nowrap;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 6px;
}
.cat-tab:hover { border-color: var(--cyan-2); color: var(--teal); }
.cat-tab.active {
  background: linear-gradient(135deg, var(--cyan-1), var(--cyan-2));
  border-color: transparent;
  color: var(--white);
  box-shadow: 0 2px 10px rgba(0,188,212,0.4);
}
.cat-icon { font-size: 16px; }

/* Offers tab — red accent */
.cat-tab--offers {
  border-color: #fecaca;
  color: #ef4444;
}
.cat-tab--offers:hover {
  border-color: #ef4444;
  color: #ef4444;
}
.cat-tab--offers.active {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 2px 10px rgba(239,68,68,0.35);
}

/* Count bubble on the offers tab */
.offers-count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: #ef4444;
  color: #fff;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}
.cat-tab--offers.active .offers-count-pill {
  background: rgba(255,255,255,0.3);
}

/* ── Home Landing ─────────────────────────────────────── */
.home-landing {
  padding: 16px 0 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.home-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--gray-800);
  margin-bottom: 20px;
  text-align: center;
}
.home-cat-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols, 5), 190px);
  gap: 16px;
  justify-content: center;
}
.home-cat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px 16px;
  border-radius: 16px;
  background: #fff;
  border: 2px solid #e0f7fa;
  text-decoration: none;
  color: var(--gray-800);
  font-weight: 700;
  font-size: 15px;
  text-align: center;
  transition: all .2s;
  box-shadow: 0 2px 8px rgba(0,188,212,.08);
  min-height: 130px;
}
.home-cat-card:hover {
  border-color: var(--cyan-2);
  background: linear-gradient(135deg, #e0f7fa, #fff);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,188,212,.18);
}
.home-cat-card--offers {
  border-color: #fecaca;
  background: linear-gradient(135deg, #fff5f5, #fff);
  color: #dc2626;
}
.home-cat-card--offers:hover {
  border-color: #ef4444;
  background: linear-gradient(135deg, #fee2e2, #fff);
}
.home-cat-card--special {
  border-color: #fde68a;
  background: linear-gradient(135deg, #fffbeb, #fff);
  color: #92400e;
}
.home-cat-card--special:hover {
  border-color: #f59e0b;
  background: linear-gradient(135deg, #fef3c7, #fff);
}
.home-cat-special-badge {
  font-size: 18px;
  color: #f59e0b;
  line-height: 1;
}
.home-cat-icon { font-size: 32px; line-height: 1; }
.home-cat-name { font-size: 15px; font-weight: 800; }
.home-cat-count {
  font-size: 11px;
  font-weight: 600;
  color: #ef4444;
  background: #fee2e2;
  padding: 2px 8px;
  border-radius: 10px;
}
.home-cat-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: center;
}
.home-cat-prod-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-600);
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 10px;
}
.home-cat-sub-hint {
  font-size: 11px;
  font-weight: 500;
  color: var(--cyan-2);
  background: #e0f7fa;
  padding: 2px 8px;
  border-radius: 10px;
}

/* ── Browse top bar (back btn + tabs) ─────────────────── */
.browse-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.back-to-home {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 700;
  color: var(--cyan-2);
  text-decoration: none;
  white-space: nowrap;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1.5px solid var(--cyan-2);
  background: #fff;
  flex-shrink: 0;
  transition: all .18s;
}
.back-to-home:hover {
  background: var(--cyan-2);
  color: #fff;
}
.browse-topbar .category-tabs {
  flex: 1;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
}

/* Sub-category row */
.subcategory-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 0 4px;
  border-top: 1px dashed var(--cyan-1);
  margin-top: 4px;
}
.subcat-tab {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1.5px solid var(--cyan-2);
  color: var(--cyan-2);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: all .18s;
  background: #fff;
}
.subcat-tab:hover {
  background: var(--cyan-1);
  color: #fff;
  border-color: var(--cyan-1);
}
.subcat-tab.active {
  background: var(--cyan-2);
  color: #fff;
  border-color: var(--cyan-2);
}

/* Category breadcrumb badge */
.badge-parent { opacity: .7; }
.badge-sep    { opacity: .5; }

/* Sub-arrow indicator on parent tab */
.cat-has-sub {
  font-size: 10px;
  margin-inline-start: 2px;
  opacity: .6;
}

/* ── Products Header ─────────────────────────────────────── */
.products-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}
.products-header h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--teal-dark);
}
.products-meta {
  font-size: 13px;
  color: var(--gray-400);
}

/* ── Empty / Error States ────────────────────────────────── */
.state-empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--gray-400);
}
.state-empty .empty-icon { font-size: 56px; margin-bottom: 12px; display: block; }
.state-empty p { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.state-empty span { font-size: 13px; }

/* ── Products Grid ───────────────────────────────────────── */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

/* ── Product Card ────────────────────────────────────────── */
.product-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 2px solid transparent;
  transition: all 0.22s var(--ease);
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  border-color: var(--cyan-2);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.product-img-wrap {
  height: 160px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.product-img-wrap img {
  width: 70%;
  height: 70%;
  object-fit: contain;
}
.product-img-placeholder {
  font-size: 52px;
  opacity: 0.5;
}

/* Out of stock */
.product-card.out-of-stock {
  opacity: 0.72;
}
.product-card.out-of-stock .product-img-wrap img {
  filter: grayscale(60%);
}
.product-oos-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.38);
  display: flex;
  align-items: center;
  justify-content: center;
}
.product-oos-overlay span {
  background: #1e293b;
  color: #f1f5f9;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 20px;
  letter-spacing: 0.3px;
}
.oos-footer-msg {
  text-align: center;
  font-size: 12px;
  color: #94a3b8;
  padding: 10px 0 4px;
  font-weight: 600;
}

/* Discount badge — top-end corner of image */
.product-offer-badge {
  position: absolute;
  top: 10px;
  inset-inline-end: 10px;
  height: 26px;
  padding: 0 10px;
  background: #ef4444;
  color: #fff;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  box-shadow: 0 2px 8px rgba(239,68,68,0.4);
}

/* Original (crossed-out) price under the offer price */
.product-original-price {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}
.original-price-label {
  font-size: 11px;
  color: #ef4444;
  font-weight: 700;
}
.original-price-value {
  font-size: 12px;
  color: #ef4444;
  font-weight: 700;
  text-decoration: line-through;
}

/* Cart inline discount elements */
.cart-offer-badge {
  display: inline-block;
  padding: 1px 7px;
  background: #fef2f2;
  color: #ef4444;
  border: 1px solid #fecaca;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 800;
  vertical-align: middle;
  margin-inline-start: 4px;
}
.cart-original-price {
  font-size: 11px;
  color: var(--gray-400);
  text-decoration: line-through;
  margin: 0 2px;
}

.product-category-badge {
  position: absolute;
  bottom: 8px;
  inset-inline-start: 0;
  inset-inline-end: 0;
  text-align: center;
  height: 22px;
  padding: 0 10px;
  background: rgba(0,107,143,0.82);
  color: var(--white);
  border-radius: 0;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  backdrop-filter: blur(4px);
}

.product-body {
  padding: 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.product-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-800);
  line-height: 1.4;
}
.product-name-en {
  font-size: 12px;
  color: var(--gray-400);
  font-weight: 400;
}

.product-price-row {
  display: flex;
  align-items: baseline;
  gap: 3px;
  margin-top: 4px;
}
.product-price {
  font-size: 20px;
  font-weight: 800;
  color: var(--teal);
}
.product-currency {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-400);
}
.product-unit {
  font-size: 11px;
  color: var(--gray-400);
  margin-inline-start: 2px;
}

/* Product Footer */
.product-footer { padding: 0 14px 14px; }

/* Quick kg buttons */
.quick-qty-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}

.quick-qty-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 4px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--cyan-2);
  background: #e0f7fa;
  color: var(--teal-dark);
  cursor: pointer;
  transition: all 0.18s var(--ease);
  font-family: inherit;
  line-height: 1.2;
}
.quick-qty-btn:hover {
  background: var(--cyan-2);
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0,188,212,0.35);
}
.quick-qty-btn:active { transform: translateY(0); }

.quick-qty-frac {
  font-size: 16px;
  font-weight: 800;
}
.quick-qty-unit {
  font-size: 10px;
  font-weight: 600;
  opacity: 0.75;
}

.qty-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.qty-label {
  font-size: 12px;
  color: var(--gray-600);
  font-weight: 600;
  white-space: nowrap;
}

.qty-controls {
  display: flex;
  align-items: center;
  border: 2px solid var(--gray-200);
  border-radius: 8px;
  overflow: hidden;
  flex: 1;
}
.qty-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--gray-100);
  color: var(--teal);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.qty-btn:hover { background: var(--cyan-2); color: var(--white); }

.qty-input {
  flex: 1;
  border: none;
  outline: none;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-800);
  font-family: inherit;
  height: 32px;
  background: var(--white);
  min-width: 0;
}
/* hide number arrows */
.qty-input::-webkit-inner-spin-button,
.qty-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.qty-input[type=number] { -moz-appearance: textfield; }

.qty-unit-label {
  font-size: 11px;
  color: var(--gray-400);
  padding: 0 6px;
  background: var(--gray-100);
  height: 32px;
  display: flex;
  align-items: center;
  border-inline-start: 2px solid var(--gray-200);
  flex-shrink: 0;
}

.add-to-calc-btn {
  width: 100%;
  height: 38px;
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  color: var(--white);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.add-to-calc-btn:hover {
  background: linear-gradient(135deg, var(--cyan-2), var(--teal));
  transform: translateY(-1px);
}
.add-to-calc-btn.added {
  background: linear-gradient(135deg, var(--success), #059669);
}

/* ── Pagination ──────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 40px;
  flex-wrap: wrap;
}
.page-btn {
  min-width: 38px;
  height: 38px;
  padding: 0 8px;
  border-radius: 8px;
  border: 2px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-600);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.page-btn:hover:not(.disabled):not(.active) { border-color: var(--cyan-2); color: var(--teal); }
.page-btn.active {
  background: var(--cyan-2);
  border-color: var(--cyan-2);
  color: var(--white);
}
.page-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}
.page-btn.wide { padding: 0 14px; }

/* ── Cart Overlay ────────────────────────────────────────── */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease);
  backdrop-filter: blur(2px);
}
.cart-overlay.open { opacity: 1; pointer-events: all; }

/* ── Cart Sidebar ────────────────────────────────────────── */
.cart-sidebar {
  position: fixed;
  top: 0;
  height: 100vh;
  width: var(--cart-width);
  max-width: 95vw;
  background: var(--white);
  z-index: 210;
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 40px rgba(0,0,0,0.15);
  transition: transform 0.33s var(--ease);
}

html[dir="rtl"] .cart-sidebar {
  left: 0;
  right: auto;
  transform: translateX(-110%);
}
html[dir="ltr"] .cart-sidebar {
  right: 0;
  left: auto;
  transform: translateX(110%);
}
.cart-sidebar.open { transform: translateX(0) !important; }

.cart-header {
  padding: 20px 20px 16px;
  border-bottom: 2px solid var(--gray-100);
  background: linear-gradient(135deg, var(--teal-dark), var(--teal));
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.cart-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cart-title h3 { font-size: 18px; font-weight: 800; }
.cart-title span { font-size: 22px; }

.cart-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.3);
  background: transparent;
  color: var(--white);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s var(--ease);
}
.cart-close:hover { background: rgba(255,255,255,0.2); }

.cart-notice {
  margin: 16px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #e0f7fa, #b2ebf2);
  border-radius: var(--radius-sm);
  border-inline-start: 4px solid var(--cyan-2);
  font-size: 13px;
  color: var(--teal-dark);
  font-weight: 600;
  line-height: 1.5;
  flex-shrink: 0;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px;
  min-height: 0;
}

.cart-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-400);
}
.cart-empty .empty-icon { font-size: 48px; display: block; margin-bottom: 12px; }
.cart-empty p { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.cart-empty span { font-size: 12px; }

/* Cart Item */
.cart-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--gray-100);
}
.cart-item-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #e0f7fa, #b2ebf2);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cart-item-details {
  font-size: 12px;
  color: var(--gray-400);
  margin-top: 2px;
}
.cart-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}
.cart-item-subtotal {
  font-size: 14px;
  font-weight: 800;
  color: var(--teal);
  white-space: nowrap;
  margin-top: 2px;
}

.cart-qty-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1.5px solid var(--gray-200);
  background: var(--white);
  color: var(--teal);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.cart-qty-btn:hover { background: var(--cyan-2); border-color: var(--cyan-2); color: var(--white); }
.cart-qty-btn.remove { color: var(--danger); }
.cart-qty-btn.remove:hover { background: var(--danger); border-color: var(--danger); color: var(--white); }
.cart-qty-display {
  font-size: 13px;
  font-weight: 700;
  min-width: 24px;
  text-align: center;
}

/* Cart Footer */
.cart-footer {
  padding: 16px;
  border-top: 2px solid var(--gray-100);
  flex-shrink: 0;
}
.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.cart-total-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-600);
}
.cart-total-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--teal-dark);
}
.cart-total-currency {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-400);
}
.cart-items-count {
  font-size: 12px;
  color: var(--gray-400);
  margin-bottom: 14px;
}

.cart-cta {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius);
  border: none;
  background: linear-gradient(135deg, var(--cyan-1), var(--cyan-2));
  color: var(--white);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s var(--ease);
  box-shadow: 0 4px 16px rgba(0,188,212,0.4);
  line-height: 1.4;
  text-align: center;
  display: block;
}
.cart-cta:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(0,188,212,0.5); }
.cta-sub {
  display: block;
  font-size: 11px;
  font-weight: 400;
  opacity: 0.85;
  margin-top: 3px;
}

.cart-clear-btn {
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--gray-200);
  background: transparent;
  color: var(--gray-600);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s var(--ease);
}
.cart-clear-btn:hover { border-color: var(--danger); color: var(--danger); }

/* ── Toast ───────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  inset-inline-end: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--gray-800);
  color: var(--white);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.28s ease forwards;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: all;
  min-width: 220px;
}
.toast.success { background: var(--success); }
.toast.info    { background: var(--teal); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Footer ──────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 32px 24px;
  margin-top: 40px;
  border-top: 2px solid var(--gray-100);
  color: var(--gray-400);
  font-size: 13px;
}
.footer-logo {
  height: 240px;
  width: auto;
  margin-bottom: 10px;
  opacity: 1;
}
footer p { margin-top: 6px; }

/* ── Skeleton Loading ────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 700px) {

  /* Header: 2-row layout on mobile */
  header { padding: 0; }
  .header-inner {
    height: auto;
    flex-wrap: wrap;
    padding: 10px 14px 10px;
    gap: 8px;
  }
  .logo img { height: 52px; }
  .header-actions { margin-inline-start: auto; }

  /* Cart button: icon only on small screens */
  .cart-btn span:first-of-type { display: none; }
  .cart-btn { padding: 0 14px; }

  /* Search: full width second row */
  .search-wrap {
    order: 3;
    flex: 0 0 100%;
    max-width: 100%;
    margin-top: 4px;
    margin-bottom: 4px;
  }
  .search-wrap input { height: 38px; font-size: 14px; }

  /* Lang button hidden */
  .lang-btn { display: none; }

  /* Page layout */
  .page-layout { padding: 20px 12px 24px; }

  /* Home category grid: 2 columns on mobile */
  .home-cat-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px;
  }
  .home-cat-card {
    min-height: 100px;
    padding: 18px 10px;
    font-size: 13px;
  }
  .home-cat-name { font-size: 14px; }
  .home-title    { font-size: 17px; margin-bottom: 14px; }

  /* Browse topbar: back btn full width, tabs scroll horizontally */
  .browse-topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .back-to-home { width: 100%; justify-content: center; }
  .browse-topbar .category-tabs {
    width: 100%;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 6px;
    padding-bottom: 4px;
  }
  .cat-tab {
    flex-shrink: 0;
    padding: 6px 12px;
    font-size: 12px;
  }
  .subcategory-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }
  .subcat-tab { flex-shrink: 0; }

  /* Products grid: single col on very small, 2 col otherwise */
  .products-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }

  /* Product card mobile */
  .product-card { font-size: 13px; }
  .product-name { font-size: 13px; line-height: 1.3; }
  .product-img-wrap { height: 120px; }

  /* Quick kg buttons: smaller, don't overflow */
  .quick-qty-row {
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
  }
  .quick-qty-btn { padding: 5px 8px; font-size: 11px; flex: 1; text-align: center; }

  /* Qty row compact */
  .qty-row { gap: 6px; }
  .qty-controls { gap: 4px; }
  .qty-input { width: 40px; font-size: 13px; }
  .qty-btn   { width: 28px; height: 28px; font-size: 15px; }

  /* Add to cart button full width */
  .add-to-calc-btn { font-size: 13px; padding: 10px; }

  /* Products header */
  .products-header h2 { font-size: 18px; }
  .products-meta     { font-size: 12px; }

  /* Cart sidebar full width */
  .cart-sidebar { width: 100%; max-width: 100%; }

  /* Pagination */
  .pagination { gap: 4px; flex-wrap: wrap; }
  .page-btn   { padding: 6px 10px; font-size: 13px; }
}
