/* ===== Reset / Base ===== */
*,
*::before,
*::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

.section { scroll-margin-top: 140px; }

:root {
  --footer-height: 80px;
}

@font-face {
  font-family: "BahijSans";
  src: url("assets/Bahij_TheSansArabic-Bold.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

body {
  font-family: "Poppins", sans-serif;
  background: linear-gradient(135deg, #fffaf3, #fff5e6);
  color: #1a1a1a;
  line-height: 1.6;
  padding-bottom: var(--footer-height);
}

body[dir="rtl"] {
  font-family: "BahijSans", sans-serif;
}

body::after {
  content: "";
  display: block;
  height: 80px;
}

/* ===== Header ===== */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: linear-gradient(90deg, #ff1a1a, #ffcc00);
  color: #fff;
  box-shadow: 0 4px 15px rgba(0,0,0,.12);
}

/* Logo + Title */
header .logo-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
header .logo-title img {
  width: clamp(32px, 6vw, 55px);
  max-height: 55px;
  object-fit: contain;
  border-radius: 6px;
}
header .logo-title h1 {
  margin: 0;
  font-size: clamp(16px, 2.5vw, 22px);
  font-weight: 700;
  letter-spacing: .5px;
  text-shadow: 1px 1px 3px rgba(0,0,0,.25);
}

/* ===== Globe Button ===== */
.lang-switch {
  position: relative;
}
.lang-btn {
  background: #fff;
  border: none;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #ff1a1a;
  cursor: pointer;
  transition: background .25s ease, transform .25s ease;
}
.lang-btn:hover {
  background: #ffeed0;
  transform: scale(1.1) rotate(8deg);
}

/* ===== Dropdown Menu ===== */
.lang-menu {
  position: absolute;
  top: 50px;
  right: 0;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,.2);
  list-style: none;
  padding: 6px 0;
  margin: 0;
  display: none;
  min-width: 140px;
  z-index: 2000;

  /* Animation */
  opacity: 0;
  transform: translateY(-10px) scale(0.95);
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.lang-menu li {
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 600;
  color: #333;
  transition: background .25s ease, color .25s ease;
}
.lang-menu li:hover {
  background: #ffeed0;
  color: #b80000;
}
.lang-switch.active .lang-menu {
  display: block;
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* ===== Mobile tweaks ===== */
@media (max-width: 600px) {
  header { padding: 10px 14px; }
  header .logo-title img { width: 30px; max-height: 40px; }
  header .logo-title h1 { font-size: 15px; }
  .lang-btn { width: 34px; height: 34px; font-size: 16px; }
}

/* ===== Sections ===== */
.section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 14px;
}
.section h2 {
  font-size: 24px;
  font-weight: 800;
  color: #ff1a1a;
  margin: 0 0 16px;
  display: inline-block;
  position: relative;
  padding-bottom: 6px;
}
.section h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 4px;
  width: 100px;
  background: linear-gradient(90deg, #ff1a1a, #ffcc00);
  border-radius: 2px;
}
[dir="rtl"] .section h2::after {
  left: auto;
  right: 0;
}

/* ===== Cards grid ===== */
.cards {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 768px) {
  .cards { grid-template-columns: repeat(3, 1fr); gap: 18px; }
}
@media (min-width: 1200px) {
  .cards { grid-template-columns: repeat(4, 1fr); gap: 22px; }
  header h1 { font-size: 24px; }
}

/* ===== Card ===== */
.card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
  display: flex;
  flex-direction: column;
  transition: transform .25s ease, box-shadow .25s ease;
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 28px rgba(0,0,0,.16);
}
.card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  transition: transform .35s ease;
}
@media (min-width: 768px) {
  .card img { height: 200px; }
}
.card:hover img { transform: scale(1.05); }

.card-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #fff, #fff8f2);
}
.card-body h3 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
  color: #222;
}
@media (min-width: 768px) {
  .card-body h3 { font-size: 18px; }
}
.card-body p {
  margin: 0 0 10px;
  font-size: 13px;
  color: #555;
  flex: 1;
}
@media (min-width: 768px) {
  .card-body p { font-size: 14px; }
}
.price {
  align-self: flex-end;
  font-size: 14px;
  font-weight: 800;
  color: #b80000;
  background: #ffe6e6;
  padding: 5px 10px;
  border-radius: 8px;
  box-shadow: inset 0 0 0 2px rgba(255,26,26,.08);
}
@media (min-width: 768px) {
  .price { font-size: 16px; padding: 6px 12px; }
}

/* ===== Footer ===== */
footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: var(--footer-height);
  background: linear-gradient(90deg, #ff1a1a, #ffcc00);
  color: #fff;
  text-align: center;
  padding: 14px;
  font-weight: 600;
  box-shadow: 0 -3px 12px rgba(0,0,0,.2);
  z-index: 1000;
}
footer span {
  background: #fff;
  color: #ff1a1a;
  padding: 6px 14px;
  border-radius: 30px;
  font-weight: 800;
  margin-left: 10px;
  display: inline-block;
  transition: background .25s ease, color .25s ease, transform .1s ease;
}
footer span:hover {
  background: #ffcc00;
  color: #1a1a1a;
}
footer span:active {
  transform: scale(.98);
}

/* ===== Category Navbar ===== */
.navbar {
  position: sticky;
  top: 60px;
  z-index: 999;
  display: flex;
  overflow-x: auto;
  gap: 12px;
  background: #fff;
  padding: 10px 14px;
  border-bottom: 2px solid #ffcc00;
  scrollbar-width: none;
}
.navbar::-webkit-scrollbar { display: none; }
.nav-item {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 14px;
  background: #fff8f2;
  border-radius: 12px;
  color: #ff1a1a;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: all .25s ease;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.nav-item i { font-size: 20px; margin-bottom: 4px; }
.nav-item:hover {
  background: #ff1a1a;
  color: #fff;
  transform: translateY(-2px);
}
.nav-item:focus { outline: none; box-shadow: none; }
