@charset "UTF-8";
/* Default Mobile Elements Hidden initially */
.desktop-header, .desktop-footer {
  display: none;
}

/* ═══════════════════════════════════════════════════
   RESET + BASE
═══════════════════════════════════════════════════ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

::view-transition-group(*),
::view-transition-old(*),
::view-transition-new(*) {
  animation-duration: 0.25s;
  animation-timing-function: cubic-bezier(0.19, 1, 0.22, 1);
}

:root {
  --primary: #085f6e;
  --primary-dark: #054a57;
  --primary-light: #e0f4f7;
  --bg: #ffffff;
  --surface: #f4f8f9;
  --surface2: #eaf1f2;
  --text: #054a57;
  --text2: #4a6a70;
  --text3: #759196;
  --border: rgba(8, 95, 110, 0.15);
  --border2: rgba(8, 95, 110, 0.08);
  --success: #22c55e;
  --success-bg: #e1f5ee;
  --success-text: #1c7a4a;
  --warn: #f59e0b;
  --danger: #ff3b30;
  --stars: #ff9500;
  --r6: 6px;
  --r10: 10px;
  --r12: 12px;
  --r14: 14px;
  --r20: 20px;
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Tajawal', sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Tajawal', sans-serif;
  --glass-bg: rgba(255, 255, 255, 0.94);
  --glass-bg-solid: rgba(255, 255, 255, 0.98);
}

:root[data-theme=dark] {
  --primary: #2eb4c6;
  --primary-dark: #1e9aab;
  --primary-light: #054a57;
  --bg: #0d1f23;
  --surface: #142d33;
  --surface2: #1c3c44;
  --text: #e0f4f7;
  --text2: #a5c7cc;
  --text3: #759196;
  --border: rgba(224, 244, 247, 0.12);
  --border2: rgba(224, 244, 247, 0.08);
  --glass-bg: rgba(13, 31, 35, 0.94);
  --glass-bg-solid: rgba(13, 31, 35, 0.98);
}

body {
  font-family: "Tajawal", var(--font);
  background: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

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

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  background: transparent;
}

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

#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  /* Desktop full width */
  max-width: 100%;
  margin: 0 auto;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.05); /* Optional desktop shadow */
}

/* Nav Bar */
.nbar {
  height: 56px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 0.5px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
}

.nbar-back {
  display: flex;
  align-items: center;
  gap: 2px;
  color: var(--primary);
  font-size: 16px;
}

.nbar-back i {
  font-size: 22px;
}

.nbar-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
  font-family: var(--font-display);
}

.nbar-actions {
  display: flex;
  gap: 8px;
}

.nbar-actions button {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--primary);
}

.nbar-actions button:active {
  background: var(--surface);
}

/* Scroll Area */
.scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 84px;
}

.scroll::-webkit-scrollbar {
  display: none;
}

/* Tab Bar (bottom) */
.tabbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--glass-bg-solid);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 0.5px solid var(--border);
  position: fixed;
  left: 0;
  width: 100%;
  bottom: 0;
  z-index: 50;
}

.tb-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  padding: 0 10px;
  min-width: 56px;
  transition: opacity 0.15s;
}

.tb-item i {
  font-size: 24px;
  color: var(--text3);
  transition: color 0.15s;
}

.tb-item span {
  font-size: 10px;
  color: var(--text3);
  font-weight: 500;
  transition: color 0.15s;
}

.tb-item.active i, .tb-item.active span, .tb-item.router-link-active i, .tb-item.router-link-active span {
  color: var(--primary);
}

.tb-badge {
  position: relative;
}

.tb-badge-dot {
  position: absolute;
  top: -2px;
  right: -4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  border: 1.5px solid #fff;
}

/* Toast */
.toast {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: rgba(0, 0, 0, 0.82);
  color: #fff;
  padding: 9px 18px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  transition: all 0.25s;
  z-index: 200;
  pointer-events: none;
  backdrop-filter: blur(10px);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Screen Pages */
.page {
  display: flex;
  flex-direction: column;
  flex: 1;
  height: 100%;
}

/* ═══════════════════════════════════════════════════
   SHARED COMPONENTS
═══════════════════════════════════════════════════ */
.sec-title {
  font-size: 19px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.4px;
  margin-bottom: 14px;
  font-family: var(--font-display);
}

.card {
  background: var(--bg);
  border: 0.5px solid var(--border);
  border-radius: var(--r14);
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: var(--r10);
  border: 1.5px solid var(--border2);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.14s;
}

.chip.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

.chip.out {
  opacity: 0.38;
  text-decoration: line-through;
  cursor: not-allowed;
}

.badge-sale {
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--r6);
}

.badge-save {
  background: var(--success-bg);
  color: var(--success-text);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--r6);
}

.divider {
  height: 0.5px;
  background: var(--border2);
  margin: 0 16px;
}

.stars {
  color: var(--stars);
}

.price-tag {
  font-size: 17px;
  font-weight: 700;
  color: var(--primary);
}

/* Product Card */
.pcard {
  background: var(--bg);
  border-radius: var(--r14);
  overflow: hidden;
  border: 0.5px solid var(--border);
  transition: all 0.2s;
  cursor: pointer;
}

.pcard:active {
  transform: scale(0.98);
}

.pcard-img {
  width: 100%;
  aspect-ratio: 1;
  background: var(--surface);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0;
}

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

.pcard:hover .pcard-img img {
  transform: scale(0.95);
}

.pcard:active .pcard-img img {
  transform: scale(1.04);
}

.pcard-body {
  padding: 10px 12px 12px;
}

.pcard-brand {
  font-size: 10px;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.pcard-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pcard-price {
  font-size: 15px;
  font-weight: 700;
  color: #000;
  margin-bottom: 8px;
}

.pcard-price span {
  font-size: 12px;
  color: var(--text3);
  text-decoration: line-through;
  margin-right: 4px;
  font-weight: 400;
}

.pcard-add {
  width: 100%;
  height: 32px;
  border-radius: var(--r6);
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: background 0.15s;
}

.pcard-add:active {
  background: var(--primary-dark);
}

/* Sticky CTA */
.sticky-cta {
  background: var(--glass-bg-solid);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 0.5px solid var(--border);
  padding: 10px 16px;
  display: flex;
  gap: 9px;
  align-items: center;
  flex-shrink: 0;
  position: fixed;
  width: 100%;
  left: 0;
  bottom: 0;
  z-index: 50;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
}

.qty-box {
  display: flex;
  align-items: center;
  background: var(--surface);
  border-radius: var(--r10);
  overflow: hidden;
  flex-shrink: 0;
}

.qty-box button {
  width: 36px;
  height: 44px;
  font-size: 22px;
  font-weight: 300;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.qty-box button:active {
  background: var(--primary-light);
}

.qty-box span {
  min-width: 28px;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  color: #000;
}

.btn-cart {
  flex: 1;
  height: 44px;
  border-radius: var(--r12);
  background: var(--primary);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: background 0.15s;
}

.btn-cart:active {
  background: var(--primary-dark);
}

.btn-buy {
  width: 44px;
  height: 44px;
  border-radius: var(--r12);
  background: #000;
  color: #fff;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Form inputs */
.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 5px;
}

.field input, .field select, .field textarea {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  background: var(--surface);
  border: 0.5px solid transparent;
  border-radius: var(--r12);
  font-size: 15px;
  font-family: inherit;
  color: #000;
  transition: border-color 0.15s;
  outline: none;
}

.field input:focus, .field select:focus {
  border-color: var(--primary);
}

.field textarea {
  height: 90px;
  padding: 12px 14px;
  resize: none;
}

/* Section block */
.sblock {
  padding: 16px 16px 0;
}

/* Home Hero */
.home-hero {
  margin: 14px 16px;
  border-radius: var(--r20);
  overflow: hidden;
  background: linear-gradient(135deg, #0a7d90 0%, #05505e 100%);
  padding: 22px 20px;
  position: relative;
  min-height: 150px;
}

.home-hero-tag {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.home-hero-title {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  line-height: 1.25;
  letter-spacing: -0.4px;
  margin-bottom: 4px;
}

.home-hero-sub {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 16px;
}

.home-hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 20px;
}

.hero-circle {
  position: absolute;
  right: -20px;
  bottom: -30px;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.hero-circle2 {
  position: absolute;
  right: 20px;
  bottom: 20px;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
}

/* Categories */
.home-cats {
  padding: 14px 16px 0;
}

.cats-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 10px;
  padding-top: 5px;
}

.cats-scroll::-webkit-scrollbar {
  display: none;
}

.cat-item {
  flex-shrink: 0;
  cursor: pointer;
}

.animated-card {
  position: relative;
  width: 105px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cat-card-inner {
  position: relative;
  width: 100%;
  height: 125px;
  background: var(--surface);
  border-radius: var(--r12);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s;
  border: 1px solid var(--border2);
}

.animated-card.sub-level {
  width: 85px;
}

.animated-card.sub-level .cat-card-inner {
  height: 95px;
  padding: 8px;
}

.cat-img {
  width: 50px;
  height: 50px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.animated-card.sub-level .cat-img {
  width: 35px;
  height: 35px;
  margin-bottom: 6px;
}

.cat-img img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.cat-img i {
  font-size: 28px;
  color: var(--primary);
}

.cat-name {
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
  line-height: 1.25;
  color: var(--text);
  z-index: 2;
}

.animated-card.sub-level .cat-name {
  font-size: 11px;
}

@keyframes spinBorder {
  100% {
    transform: rotate(360deg);
  }
}
.cat-card-inner::before {
  content: "";
  position: absolute;
  width: 150%;
  height: 150%;
  background: conic-gradient(transparent, transparent, transparent, var(--primary));
  animation: spinBorder 2s linear infinite;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 0;
}

.cat-card-inner::after {
  content: "";
  position: absolute;
  inset: 1.5px;
  background: var(--surface);
  border-radius: calc(var(--r12) - 1.5px);
  z-index: 1;
  transition: background 0.3s;
}

.animated-card:hover .cat-card-inner::before,
.cat-card-inner.active::before {
  opacity: 1;
}

.animated-card:hover .cat-card-inner::after,
.cat-card-inner.active::after {
  background: var(--bg);
}

.cat-card-inner.active {
  border-color: transparent;
}

.mt-3 {
  margin-top: 15px;
}

/* Offer Cards */
.home-offers {
  margin: 16px 16px 0;
}

.offers-row {
  display: flex;
  gap: 10px;
}

.offer-card {
  flex: 1;
  border-radius: var(--r12);
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 90px;
}

.offer-card.teal {
  background: var(--primary-light);
}

.offer-card.dark {
  background: #111;
}

.offer-label {
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 4px;
}

.offer-card.teal .offer-label {
  color: var(--primary);
}

.offer-card.dark .offer-label {
  color: rgba(255, 255, 255, 0.6);
}

.offer-title {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
}

.offer-card.teal .offer-title {
  color: #000;
}

.offer-card.dark .offer-title {
  color: #fff;
}

.offer-link {
  font-size: 11px;
  font-weight: 600;
  margin-top: 6px;
}

.offer-card.teal .offer-link {
  color: var(--primary);
}

.offer-card.dark .offer-link {
  color: var(--stars);
}

/* Products */
.home-prods {
  padding: 16px 16px 0;
}

.prods-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* Search Bar */
.search-bar-wrap {
  padding: 10px 16px 0;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--surface);
  border-radius: var(--r12);
  padding: 0 14px;
  height: 42px;
}

.search-bar i {
  font-size: 18px;
  color: var(--text3);
}

.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
}

.search-bar input::placeholder {
  color: var(--text3);
}

.filter-scroll {
  display: flex;
  gap: 7px;
  padding: 12px 16px 0;
  overflow-x: auto;
}

.filter-scroll::-webkit-scrollbar {
  display: none;
}

.sort-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px 0;
}

.sort-row span {
  font-size: 13px;
  color: var(--text2);
}

.sort-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--primary);
  font-weight: 500;
}

/* Fade Transitions for Vue Router */
.fade-enter-active, .fade-leave-active {
  transition: opacity 0.2s ease;
}

.fade-enter-from, .fade-leave-to {
  opacity: 0;
}

/* Desktop Responsive Styles */
@media (min-width: 768px) {
  .prods-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
  }
  .home-hero {
    height: 350px;
    margin: 30px 16px;
    border-radius: 20px;
  }
  .home-hero-title {
    font-size: 42px;
    line-height: 1.2;
    margin-bottom: 15px;
  }
  .home-hero-sub {
    font-size: 18px;
    margin-bottom: 30px;
  }
  .cats-scroll {
    overflow: hidden;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
  }
  .cat-item {
    width: 140px;
    flex-shrink: 0;
  }
  .cat-item.sub-level {
    width: 110px;
  }
  .cat-card-inner {
    height: 160px;
  }
  .cat-item.sub-level .cat-card-inner {
    height: 125px;
  }
  .cat-img {
    width: 75px;
    height: 75px;
  }
  .cat-item.sub-level .cat-img {
    width: 55px;
    height: 55px;
  }
  .cat-img i {
    font-size: 38px;
  }
  .cat-name {
    font-size: 14px;
  }
  .cat-item.sub-level .cat-name {
    font-size: 12.5px;
  }
  .home-prods {
    padding: 30px 16px 0;
  }
  .desktop-footer {
    display: block;
    background: var(--bg);
    border-top: 1px solid var(--border);
    padding: 40px 20px;
    text-align: center;
    color: var(--text2);
    margin-top: 60px;
    font-size: 14px;
  }
  /* Grid Adjustments for Desktop */
  .plist {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 20px !important;
  }
  .cats-row {
    justify-content: center !important;
    gap: 30px !important;
  }
  /* Constrain specific content instead of .scroll wrapper */
  .home-cats, .home-prods, .plist, .filters-bar, .profile-wrap, .search-bar, .s-history {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
  }
}
/* LTR Overrides */
[dir=ltr] .tb-badge-dot {
  right: auto;
  left: -4px;
}

[dir=ltr] .pcard-price span {
  margin-right: 0;
  margin-left: 4px;
}

[dir=ltr] .hero-circle {
  right: auto;
  left: -20px;
}

[dir=ltr] .hero-circle2 {
  right: auto;
  left: 20px;
}

[dir=ltr] .ti-arrow-left.rtl-flip {
  transform: scaleX(-1);
}

[dir=ltr] .pcard-add .ti-plus {
  margin-right: 5px;
  margin-left: 0;
}

[dir=ltr] .dh-search button {
  border-radius: 0 20px 20px 0;
}

[dir=ltr] .search-bar button {
  right: 10px;
  left: auto;
}

@media (min-width: 768px) {
  /* Hide mobile elements */
  .tabbar, .nbar {
    display: none !important;
  }
  /* Reset Mobile Page Wrappers */
  .page {
    height: auto !important;
    overflow: visible !important;
  }
  .scroll {
    height: auto !important;
    overflow: visible !important;
    padding-bottom: 40px !important;
  }
  /* App Wrapper */
  .app-wrapper {
    background-color: var(--surface);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: all 0.3s;
  }
  .desktop-layout {
    display: flex;
    flex: 1;
  }
  .desktop-sidebar-fixed {
    position: sticky;
    top: 0;
    height: calc(100vh - 120px); /* Approx header height */
    flex-shrink: 0;
    z-index: 100;
  }
  .app-main-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
  }
  /* Desktop Header */
  .desktop-header {
    display: block;
    background: var(--bg);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
  }
  .dh-top {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
  }
  .dh-bottom {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 30px;
    padding: 0 20px 10px 20px;
  }
  .dh-logo img {
    height: 40px;
    cursor: pointer;
  }
  .dh-search {
    flex: 1;
    max-width: 400px;
    position: relative;
    margin: 0 30px;
  }
  .dh-search input {
    width: 100%;
    padding: 10px 40px 10px 15px;
    border-radius: 20px;
    border: 1px solid transparent;
    background: var(--surface);
    font-family: inherit;
    outline: none;
    color: var(--text);
  }
  .dh-search button {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text2);
    cursor: pointer;
  }
  .dh-nav {
    display: flex;
    gap: 20px;
  }
  .dh-nav a {
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    transition: color 0.3s;
  }
  .dh-nav a:hover, .dh-nav a.router-link-active {
    color: var(--primary);
  }
  .dh-actions {
    display: flex;
    gap: 15px;
    align-items: center;
  }
  .dh-icon {
    font-size: 24px;
    color: var(--text);
    text-decoration: none;
    position: relative;
    cursor: pointer;
  }
  .dh-badge {
    position: absolute;
    top: -5px;
    right: -10px;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}
