/* Sea-inspired palette (fits your brand) */
:root {
  --coffee: #a2b6c5;        /* deep sea grey-blue */
  --creme: #ecf2f6;         /* soft mist */
  --cramil: #b4cbdb;        /* light ocean */
  --matcha: #f4ede8;        /* warm sand */
  --coffee-dark: #3d2b1f;   /* dark accents (rarely used) */
  --creme-light: #f4ede8;   /* sand tone */
  --matcha-green: #D4F6FF;  /* wave highlights */

  /* Derived tokens */
  --ink: #1b2a35;           /* text on sea tones */
  --muted: #5c6d78;
  --bg: var(--creme);
  --card: #f7fafc;
  --line: #d9e3ea;
  --brand: #3eaad9;         /* brand accent (can tweak) */
  --radius: 18px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(120% 120% at 50% -10%, #ffffff 0%, var(--bg) 65%),
    linear-gradient(0deg, var(--bg), var(--bg));
}
.page { max-width: 1100px; margin-inline: auto; padding: 16px 16px 0; }

/* Header (logo only) */
.header {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: saturate(1.1) blur(6px);
  background: rgba(255,255,255,0.5);
}
.brand__mark {
  max-width: 240px;
  height: auto;
  object-fit: contain;
}
@media (min-width: 1024px) {
  .brand__mark { max-width: 300px; }
}

/* Category (Stories) */
.stories { position: relative; display: flex; align-items: center; margin: 14px 0 6px; }
.stories__track {
  display: flex; gap: 18px; overflow-x: auto; scrollbar-width: none; padding: 8px 42px;
}
.stories__track::-webkit-scrollbar { display: none; }
.story {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-decoration: none; color: var(--ink); flex: 0 0 auto;
}
.story img {
  width: 76px; height: 76px; border-radius: 999px; object-fit: cover;
  border: 3px solid transparent; outline: 2px solid var(--line);
  box-shadow: 0 6px 14px rgba(0,0,0,.06);
  transition: transform .2s ease, border-color .2s ease;
  background: var(--creme);
}
.story span { font-size: 12px; opacity: .9; }
.story:hover img { transform: scale(1.04); }
.story.is-active img { border-color: var(--brand); }
.stories__nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; display: grid; place-items: center; cursor: pointer; opacity: .85;
}
.stories__nav.left { left: 4px; }
.stories__nav.right { right: 4px; }
.stories__nav:hover { opacity: 1; }

/* Section head */
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 12px 6px 8px; }
.section-head h3 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: .3px; }
.sep { display: inline-block; width: 46px; height: 3px; background: var(--cramil); border-radius: 6px; }

/* Sub-category pills */
.subcats { display: flex; gap: 10px; flex-wrap: wrap; padding: 6px 6px 2px; }
.subcat-pill {
  background: var(--creme);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: background .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.subcat-pill:hover { background: var(--matcha-green); }
.subcat-pill.is-active {
  background: var(--matcha-green);
  border-color: var(--brand);
  box-shadow: 0 4px 14px rgba(62,170,217,.18);
}

/* Products (image + name + desc + price only) */
.menu { display: grid; gap: 16px; margin-top: 10px; }
.menu.list { grid-template-columns: 1fr; }

/* Category sections for "All" view */
.category-section {
  margin-bottom: 32px;
}

.category-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 16px 0;
  padding: 12px 0 8px 0;
  border-bottom: 2px solid var(--cramil);
  position: relative;
}

.category-title::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 60px;
  height: 2px;
  background: var(--brand);
}

.category-products {
  display: grid;
  gap: 16px;
}

.item {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 14px;
  background: linear-gradient(180deg, #fff, var(--card) 180%);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  transition: transform .12s ease, box-shadow .12s ease;
  cursor: pointer;
}
.item:hover { 
  transform: translateY(-2px); 
  box-shadow: 0 6px 16px rgba(0,0,0,.06);
}
.item:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
}

/* Image */
.item__img {
  width: 120px;
  height: 120px;
  border-radius: 16px;
  object-fit: cover;
  background: var(--creme-light);
  display: block;            /* ensures predictable spacing */
  justify-self: center;      /* center horizontally in its grid cell */
  align-self: center;        /* center vertically in its grid cell */
}

/* Text */
.item__title { margin: 2px 0 6px; font-size: 20px; font-weight: 700; color: var(--ink); }
.item__desc  { margin: 0; color: var(--muted); font-size: 14px; }

/* Price */
.item__price { display: flex; align-items: flex-start; }
.price {
  background: var(--coffee); color: #fff; border-radius: 10px;
  padding: 8px 12px; font-weight: 700; min-width: 84px; text-align: center;
}

/* AS PER WEIGHT styling */
.price.as-per-weight {
  background: var(--brand);
  color: #fff;
  font-size: 12px;
  padding: 8px 10px;
  min-width: 100px;
}

/* Responsive */
@media (max-width: 720px) {
  .item {
    grid-template-columns: 90px 1fr;
    grid-template-areas:
      "img title"
      "img desc"
      "img price";
    align-items: center;          /* centers content vertically in rows */
    gap: 12px;
  }
  .item__img {
    grid-area: img;
    width: 90px;
    /* height: 90px; */
    border-radius: 12px;
    justify-self: center;         /* center image horizontally */
    align-self: center;           /* equal top/bottom spacing */
  }
  .item__title { grid-area: title; font-size: 18px; }
  .item__desc  { grid-area: desc; }
  .item__price { grid-area: price; margin-top: 8px; }
}
/* اجعلها بلوك تحت اللوغو */
.lang-switch {
  display: flex;
  justify-content: center; /* في الوسط */
  align-items: center;
  gap: 10px;
  margin-top: 8px; /* مسافة بين اللوغو واللغة */
}

.lang-switch button {
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-family: inherit;
  color: var(--muted);
  font-size: 14px;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color .2s ease, background .2s ease;
}

.lang-switch button:hover {
  background: var(--creme-light);
}

.lang-switch .is-active {
  color: var(--brand);
}

/* Loader Styles */
.loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--creme) 0%, var(--cramil) 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.8s ease-out, visibility 0.8s ease-out;
}

.loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-content {
  text-align: center;
  animation: loaderFadeIn 1s ease-out;
}

.loader-logo {
  margin-bottom: 2rem;
}

.loader-logo img {
  width: 300px;
  height: 300px;
  object-fit: contain;
  animation: logoPulse 2s ease-in-out infinite;
}

@keyframes loaderFadeIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes logoPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* Hero Section */
.hero-section {
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  overflow: hidden;
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 1.5s ease-out, transform 1.5s ease-out;
  z-index: 1000;
}

.hero-section.visible {
  opacity: 1;
  transform: translateY(0);
}

.hero-section.hidden {
  transform: translateY(-100%);
  transition: transform 1s ease-in-out;
}

.hero-content {
  text-align: center;
  z-index: 10;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
}

.hero-logo {
  width: 400px;
  height: 400px;
  object-fit: contain;
  animation: fadeInUp 1.5s ease-out 0.5s both;
  z-index: 1001;
  opacity: 0.9;
  display: block;
  margin: 0 auto;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Product Modal */
.product-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.product-modal.active {
  display: flex;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: #fff;
  border-radius: 20px;
  max-width: 90vw;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease-out;
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 40px;
  height: 40px;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10001;
  transition: background 0.2s ease;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 1);
}

.modal-close svg {
  width: 20px;
  height: 20px;
  color: var(--ink);
}

.modal-body {
  padding: 0;
}

.modal-image-container {
  width: 100%;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-product-image {
  width: 100%;
  height: auto;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 20px;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Responsive Modal */
@media (max-width: 768px) {
  .modal-content {
    max-width: 95vw;
    max-height: 95vh;
    border-radius: 15px;
  }
  
  .modal-close {
    top: 10px;
    right: 10px;
    width: 35px;
    height: 35px;
  }
  
  .modal-close svg {
    width: 18px;
    height: 18px;
  }
  
  .modal-product-image {
    border-radius: 15px;
  }
}
