:root {
  --crocco: #e34518;
  --crocco-btn: #e04112;
  --crocco-deep: #c2491c;
  --cream: #fbf9f5;
  --card: #ffffff;
  --soft: #f0f1f5;
  --ink: #464953;
  --gold: #e5bb61;
  --cream-text: #f9eecc;
  --border: #d9d9d9;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  width: 100%;
}

body {
  margin: 0;
  width: 100%;
  min-height: 100vh;
  font-family: 'Tajawal', 'Cairo', sans-serif;
  background: var(--cream);
  color: var(--ink);
  direction: rtl;
  overflow-x: hidden;
  padding-bottom: calc(24px + var(--safe-b));
}

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

button {
  font-family: inherit;
}

body.cart-open {
  padding-bottom: calc(150px + var(--safe-b));
}

body.cart-open.cart-expanded {
  padding-bottom: calc(55vh + var(--safe-b));
}

.whatsapp-fab {
  position: fixed;
  right: max(14px, env(safe-area-inset-right, 0px));
  bottom: calc(18px + var(--safe-b));
  z-index: 1500;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 22px rgba(37, 211, 102, 0.45);
  text-decoration: none;
  transition: bottom 0.2s ease, transform 0.15s ease, background 0.15s ease;
}

.whatsapp-fab::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(37, 211, 102, 0.55);
  animation: whatsapp-pulse 2s ease-out infinite;
  pointer-events: none;
}

.whatsapp-fab:hover,
.whatsapp-fab:focus-visible {
  background: #1ebe57;
  color: #fff;
  transform: scale(1.06);
}

.whatsapp-fab svg {
  display: block;
}

body.cart-open .whatsapp-fab {
  bottom: calc(196px + var(--safe-b));
}

body.cart-open.cart-expanded .whatsapp-fab {
  bottom: calc(18px + var(--safe-b));
}

@keyframes whatsapp-pulse {
  0% { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(1.35); opacity: 0; }
}

/* ========== HERO ========== */
.hero {
  position: relative;
  width: 100%;
  height: 180px;
  background: var(--crocco);
  overflow: hidden;
}

.hero-sunburst {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 160%;
  max-width: none;
  transform: translate(-50%, -50%);
  opacity: 0.4;
  pointer-events: none;
  z-index: 0;
}

.hero-chicken {
  position: absolute;
  z-index: 1;
  width: 32%;
  height: auto;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  opacity: 0.92;
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.25));
}

.hero-chicken.left {
  left: -8%;
  top: 52%;
  transform: translateY(-50%) rotate(28deg);
}

.hero-chicken.right {
  right: -10%;
  top: 50%;
  transform: translateY(-50%) scaleY(-1) rotate(119deg);
}

.hero-center {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  padding: 0 16%;
}

.hero-bubble {
  width: 42%;
  max-width: 160px;
  margin-bottom: -2px;
  animation: bubbleFloat 2.4s ease-in-out infinite;
  transform-origin: center bottom;
  will-change: transform;
}

@keyframes bubbleFloat {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-6px) scale(1.03);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-bubble {
    animation: none;
  }
}

.hero-logo {
  width: 70%;
  max-width: 280px;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.2));
}

/* ========== MENU TOP ========== */
.menu-top {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 12px 8px;
}

.menu-title {
  margin: 0 0 12px;
  font-family: 'Lalezar', 'Tajawal', sans-serif;
  font-size: 1.5rem;
  color: var(--ink);
  position: relative;
  display: inline-block;
  padding-bottom: 8px;
}

.menu-title::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: 0;
  width: 70px;
  height: 7px;
  background: var(--crocco);
}

.nav-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
  width: 100%;
}

.nav-tabs::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

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

/* ========== GRID / CARDS ========== */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 8px 12px 24px;
}

.menu-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  width: 100%;
}

.item-card {
  width: 100%;
  background: var(--card);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.item-media {
  width: 100%;
  height: 160px;
  background: var(--soft);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 10px;
}

.item-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.item-name {
  margin: 0 0 10px;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--ink);
  text-align: right;
}

.size-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}

.size-label {
  flex: 1;
  min-width: 0;
  height: 42px;
  background: var(--crocco-btn);
  color: #fff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0 8px;
  unicode-bidi: isolate;
  white-space: nowrap;
}

.qty-box {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.qty-btn {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--crocco);
  background: #fff;
  color: var(--crocco-deep);
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

.qty-btn.minus {
  color: var(--ink);
  border-color: #ccc;
}

.qty-val {
  min-width: 20px;
  text-align: center;
  font-weight: 800;
  color: var(--crocco-deep);
  font-size: 1.05rem;
}

.empty-state {
  text-align: center;
  padding: 40px 16px;
  color: #888;
}

/* ========== CART ========== */
.cart-panel {
  display: none;
  position: fixed;
  left: 8px;
  right: 8px;
  bottom: calc(8px + var(--safe-b));
  width: auto;
  max-width: none;
  transform: none;
  z-index: 1000;
}

.cart-panel.show {
  display: block;
}

.cart-inner {
  position: relative;
  background: var(--crocco);
  border-radius: 18px;
  padding: 10px;
  color: var(--cream-text);
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.cart-watermark {
  position: absolute;
  inset: 0;
  background: url('img/crocco/product.png') center / cover no-repeat;
  opacity: 0.06;
  mix-blend-mode: luminosity;
  pointer-events: none;
}

.cart-bar {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 8px;
}

.cart-close {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.cart-toggle {
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.cart-bar-total {
  grid-column: 1 / -1;
  font-family: 'Lalezar', 'Tajawal', sans-serif;
  font-size: 1.35rem;
  text-align: center;
  padding: 4px 0;
}

.confirm-btn {
  grid-column: 1 / -1;
  width: 100%;
  border: none;
  background: var(--gold);
  color: var(--cream-text);
  font-family: 'Lalezar', 'Tajawal', sans-serif;
  font-size: 1.25rem;
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
}

.cart-details {
  display: none;
  position: relative;
  z-index: 1;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.35);
}

.cart-panel.expanded .cart-details {
  display: block;
}

.cart-head {
  font-family: 'Lalezar', 'Tajawal', sans-serif;
  font-size: 1.05rem;
  text-align: center;
  margin-bottom: 8px;
  color: #fff;
}

.cart-lines {
  max-height: 38vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cart-line {
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  padding: 10px 12px;
}

.cart-line-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.cart-line .name {
  font-weight: 800;
  font-size: 1.05rem;
  color: #fff;
  line-height: 1.3;
}

.cart-remove {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
  flex-shrink: 0;
  line-height: 1;
}

.cart-line-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.meta-item {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.meta-item.meta-qty {
  grid-column: 1 / -1;
}

.meta-label {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 700;
  white-space: nowrap;
}

.meta-value {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
}

.cart-size-select {
  max-width: 70%;
  min-width: 0;
  height: 34px;
  padding: 4px 8px;
  border: none;
  border-radius: 8px;
  background: #fff;
  color: var(--crocco-deep, var(--crocco));
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
}

.cart-qty {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cart-qty button {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: none;
  background: #fff;
  color: var(--crocco);
  font-weight: 800;
  font-size: 1.15rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.cart-qty .qty-num {
  min-width: 22px;
  text-align: center;
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
}

/* ========== MODAL ========== */
.order-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.order-modal.show {
  display: flex;
}

.order-box {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: min(92vh, 820px);
  overflow-y: auto;
  background: #fff;
  border-radius: 18px;
  padding: 20px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-close {
  position: absolute;
  top: 8px;
  left: 10px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: #f1f1f1;
  font-size: 1.4rem;
  cursor: pointer;
}

.order-box h3 {
  margin: 0;
  padding-left: 36px;
  font-family: 'Lalezar', sans-serif;
  font-size: 1.4rem;
  color: var(--crocco);
}

.order-box input,
.order-box select,
.order-box textarea {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #eadfd6;
  background: #fbf6f2;
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
}

.order-box textarea {
  resize: vertical;
  min-height: 72px;
}

.order-field-label {
  display: block;
  margin: 4px 0 6px;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--ink);
}

.order-type-pills {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.type-pill {
  border: 1px solid #e8ddd4;
  background: #fff;
  color: var(--ink);
  border-radius: 12px;
  padding: 10px 6px;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
}

.type-pill.active {
  border-color: var(--crocco);
  background: #fff4ef;
  color: var(--crocco);
}

.order-extra-fields[hidden] {
  display: none;
}

.order-items-preview {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.preview-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.preview-item-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-weight: 800;
  font-size: 0.92rem;
}

.preview-item-top .price {
  white-space: nowrap;
  color: var(--ink);
}

.discount-box {
  background: #fff3ec;
  border: 1px solid #f3d9cc;
  border-radius: 14px;
  padding: 10px;
}

.discount-box-title {
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--ink);
}

.discount-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-items: center;
}

.discount-row select,
.discount-row input {
  margin: 0;
  background: #fff;
}

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

.order-actions button {
  flex: 1;
  border: none;
  border-radius: 10px;
  padding: 12px;
  font-weight: 800;
  cursor: pointer;
}

.btn-cancel { background: #eee; color: var(--ink); }
.btn-ok { background: var(--crocco); color: #fff; }

/* ========== TABLET ≥768 ========== */
@media (min-width: 768px) {
  .hero {
    height: 240px;
  }

  .hero-chicken.left,
  .hero-chicken.right {
    width: 34%;
  }

  .hero-logo {
    width: 40%;
    max-width: 300px;
  }

  .menu-top {
    padding: 20px 20px 10px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .menu-title {
    margin: 0;
    font-size: 1.8rem;
  }

  .nav-tabs {
    flex: 1;
    flex-wrap: wrap;
    overflow: visible;
    justify-content: flex-start;
  }

  .container {
    padding: 12px 20px 32px;
  }

  .menu-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .item-media {
    height: 170px;
  }

  .cart-panel {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(720px, calc(100% - 24px));
  }

  .cart-bar {
    grid-template-columns: 40px 1fr auto auto;
    align-items: center;
  }

  .cart-bar-total,
  .confirm-btn {
    grid-column: auto;
  }

  .confirm-btn {
    width: auto;
    padding: 10px 18px;
    font-size: 1.2rem;
  }

  .cart-line-meta {
    grid-template-columns: 1fr 1fr 1.2fr;
  }

  .meta-item.meta-qty {
    grid-column: auto;
  }
}

/* ========== DESKTOP ≥1024 ========== */
@media (min-width: 1024px) {
  .hero {
    height: 300px;
  }

  .hero-chicken.left {
    left: -6%;
    width: 32%;
  }

  .hero-chicken.right {
    right: -7%;
    width: 30%;
  }

  .hero-logo {
    max-width: 340px;
  }

  .menu-top,
  .container {
    padding-left: 28px;
    padding-right: 28px;
  }

  .menu-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }

  .item-card {
    padding: 16px;
  }

  .item-media {
    height: 170px;
  }

  .cart-panel {
    width: min(900px, calc(100% - 32px));
  }

  body.cart-open {
    padding-bottom: calc(120px + var(--safe-b));
  }

  body.cart-open .whatsapp-fab {
    bottom: calc(196px + var(--safe-b));
  }
}

/* ========== LARGE DESKTOP ≥1400 ========== */
@media (min-width: 1400px) {
  .hero {
    height: 340px;
  }

  .menu-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
