:root {
  --navy: #14213d;
  --navy-light: #263a6b;
  --crimson: #d62839;
  --crimson-hover: #be1f2f;
  --whatsapp: #25d366;
  --canvas: #f4f5f8;
  --surface: #ffffff;
  --ink: #14213d;
  --muted: #5a6275;
  --line: #e6e8ee;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --shadow-sm: 0 2px 10px rgba(20, 33, 61, 0.05);
  --shadow-lg: 0 18px 40px rgba(20, 33, 61, 0.16);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-family: 'Cairo', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  background-color: var(--canvas);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 72px;
  line-height: 1.6;
}

@media (min-width: 768px) {
  body {
    padding-bottom: 0;
  }
}

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

button,
input,
textarea,
select {
  font-family: inherit;
}

button {
  cursor: pointer;
}

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

.hidden {
  display: none !important;
}

.container {
  width: 100%;
  max-width: 1152px;
  margin-inline: auto;
  padding-inline: 16px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 58px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  padding: 0;
  white-space: nowrap;
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  object-fit: contain;
  border: 1px solid var(--line);
  background: #fff;
}

.brand-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--navy);
}

.desktop-nav {
  display: none;
  align-items: center;
  gap: 24px;
}

@media (min-width: 768px) {
  .desktop-nav {
    display: flex;
  }
}

.nav-link {
  border: 0;
  background: transparent;
  padding: 6px 2px;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  transition: color 0.18s ease, border-color 0.18s ease;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--navy);
}

.nav-link.active {
  color: var(--navy);
  border-bottom-color: var(--crimson);
}

.header-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  background: var(--whatsapp);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

/* Main */
.site-main {
  flex: 1;
  padding-top: 16px;
  padding-bottom: 42px;
}

.view-stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Hero Banner */
.hero-banner {
  border-radius: var(--radius-xl);
  background: linear-gradient(270deg, var(--navy) 0%, var(--navy-light) 100%);
  color: #fff;
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

@media (min-width: 640px) {
  .hero-banner {
    padding: 32px;
  }
}

.hero-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@media (min-width: 768px) {
  .hero-layout {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.hero-sub {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.78);
}

.hero-title {
  margin: 6px 0 0;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.35;
}

@media (min-width: 640px) {
  .hero-title {
    font-size: 30px;
  }
}

.hero-desc {
  margin: 8px 0 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.88);
}

.hero-actions-row {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 12px;
  border: 0;
  font-size: 13px;
  font-weight: 800;
  transition: transform 0.12s ease, background-color 0.18s ease, opacity 0.18s ease;
  white-space: nowrap;
}

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

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-crimson {
  background: var(--crimson);
  color: #fff;
}

.btn-crimson:hover {
  background: var(--crimson-hover);
}

.btn-navy {
  background: var(--navy);
  color: #fff;
}

.btn-navy:hover {
  background: #1f3159;
}

.btn-whatsapp {
  background: var(--whatsapp);
  color: #fff;
}

.btn-glass {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
}

.btn-light {
  background: var(--canvas);
  border: 1px solid var(--line);
  color: var(--navy);
}

.hero-logo-mobile {
  width: 92px;
  height: 92px;
  flex-shrink: 0;
  border-radius: 16px;
  background: #fff;
  padding: 8px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-logo-desktop {
  display: none;
  width: 140px;
  height: 140px;
  flex-shrink: 0;
  border-radius: 22px;
  background: #fff;
  padding: 12px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
  align-items: center;
  justify-content: center;
}

.hero-logo-mobile img,
.hero-logo-desktop img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@media (min-width: 768px) {
  .hero-logo-mobile {
    display: none;
  }
  .hero-logo-desktop {
    display: flex;
  }
}

/* Ticker */
.ticker-wrap {
  overflow: hidden;
  border-radius: 12px;
  background: var(--navy);
  color: #fff;
  padding: 10px 0;
  font-size: 12px;
  font-weight: 700;
}

.ticker-track {
  display: flex;
  width: max-content;
  animation: marquee-rtl 26s linear infinite;
}

.ticker-track:hover {
  animation-play-state: paused;
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding-inline: 14px;
  white-space: nowrap;
}

.ticker-dot {
  color: rgba(255, 255, 255, 0.45);
}

@keyframes marquee-rtl {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(50%);
  }
}

/* Search & Categories */
.search-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.search-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (min-width: 640px) {
  .search-row {
    flex-direction: row;
  }
}

.search-box {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.search-input {
  width: 100%;
  min-height: 48px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 10px 44px;
  font-size: 14px;
  color: var(--navy);
  outline: none;
  box-shadow: var(--shadow-sm);
}

.search-input:focus {
  border-color: var(--navy);
}

.search-icon {
  position: absolute;
  right: 14px;
  color: var(--muted);
  pointer-events: none;
  font-size: 16px;
}

.search-clear {
  position: absolute;
  left: 10px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

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

.categories-row {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

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

.cat-btn {
  min-height: 42px;
  padding: 8px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.cat-btn.active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

/* Catalog Section & Grid */
.group-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.group-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--navy);
}

.group-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 14px;
}

@media (min-width: 560px) {
  .products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .products-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  .products-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.product-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(20, 33, 61, 0.08);
}

.product-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #fff;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.product-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--crimson);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 8px;
}

.wish-btn {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.95);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.wish-btn.saved {
  color: var(--crimson);
  border-color: rgba(214, 40, 57, 0.3);
  background: #fff1f2;
}

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

.product-title {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  color: var(--navy);
  cursor: pointer;
}

.product-desc {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.product-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 6px;
}

.product-actions .btn {
  min-height: 40px;
  font-size: 12px;
  padding: 6px 10px;
}

/* Generic Card */
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.empty-box {
  text-align: center;
  max-width: 540px;
  margin-inline: auto;
  padding: 32px 24px;
}

/* Reviews */
.reviews-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 768px) {
  .reviews-grid {
    grid-template-columns: 1fr 1.4fr;
  }
}

.review-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.review-item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
}

.review-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.stars {
  color: #f59e0b;
  letter-spacing: 2px;
}

/* Forms */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.field-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.field-control {
  width: 100%;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--canvas);
  padding: 10px 12px;
  font-size: 13px;
  color: var(--navy);
  outline: none;
}

.field-control:focus {
  border-color: var(--navy);
  background: #fff;
}

textarea.field-control {
  min-height: 88px;
  resize: vertical;
}

/* Chat */
.chat-shell {
  max-width: 820px;
  margin-inline: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 540px;
  box-shadow: var(--shadow-sm);
}

.chat-header {
  padding: 14px 18px;
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chat-messages {
  flex: 1;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  max-height: 60vh;
  background: #fafbfd;
}

.msg-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 88%;
}

.msg-row.user {
  align-self: flex-start;
}

.msg-row.assistant {
  align-self: flex-end;
}

.msg-bubble {
  padding: 12px 14px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.msg-row.user .msg-bubble {
  background: var(--navy);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.msg-row.assistant .msg-bubble {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--navy);
  border-bottom-left-radius: 4px;
}

.chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.chat-form {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.chat-form input {
  flex: 1;
}

.chat-products-mini {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
  margin-top: 6px;
}

.chat-mini-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.chat-mini-card img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 8px;
}

/* Account & Owner */
.two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 768px) {
  .two-col {
    grid-template-columns: 1fr 1fr;
  }
}

.tab-pills {
  display: inline-flex;
  gap: 8px;
  background: #fff;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid var(--line);
}

.owner-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

/* Footer */
.site-footer {
  background: var(--navy);
  color: #fff;
  margin-top: auto;
  padding: 32px 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  font-size: 13px;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: rgba(255, 255, 255, 0.85);
}

/* Mobile Bottom Nav */
.mobile-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 30;
  height: 64px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.mobile-nav.has-admin {
  grid-template-columns: repeat(4, 1fr);
}

@media (min-width: 768px) {
  .mobile-nav {
    display: none;
  }
}

.mobile-tab {
  border: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.mobile-tab.active {
  color: var(--crimson);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px;
}

@media (min-width: 640px) {
  .modal-backdrop {
    align-items: center;
  }
}

.modal-card {
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 24px;
  padding: 20px;
  box-shadow: var(--shadow-lg);
}

.toast {
  position: fixed;
  bottom: 78px;
  right: 16px;
  z-index: 60;
  background: var(--navy);
  color: #fff;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  box-shadow: var(--shadow-lg);
}

@media (min-width: 768px) {
  .toast {
    bottom: 24px;
  }
}

.scroll-top-btn {
  position: fixed;
  bottom: 78px;
  left: 16px;
  z-index: 30;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 0;
  background: var(--navy);
  color: #fff;
  font-size: 18px;
  box-shadow: var(--shadow-lg);
}

@media (min-width: 768px) {
  .scroll-top-btn {
    bottom: 24px;
  }
}
