/* ================================
   WP Meal Cards — THEME COLORS (scoped)
   ================================ */

/* --- dynamic heights for sticky offset --- */
:root {
  /* height of your Elementor sticky header (logo + nav) */
  --site-header-height: 110px;
}

/* logged-in: desktop admin bar (fallback if WP var missing) */
body.admin-bar {
  --wpmc-adminbar-height: var(--wp-admin--admin-bar--height, 150px);
}

/* logged-in: mobile admin bar (fallback 110px) */
@media (max-width: 782px) {
  body.admin-bar {
    --wpmc-adminbar-height: var(--wp-admin--admin-bar--height, 110px);
  }
}

/* not logged-in: no admin bar */
body:not(.admin-bar) {
  --wpmc-adminbar-height: 0px;
}

/* ---- scope ---- */
.wpmc,
.wpmc * {
  box-sizing: border-box;
}
.wpmc img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* palette */
.wpmc {
  --wpmc-gap: 20px;
  --wpmc-radius: 14px;
  --wpmc-card: #000000;
  --wpmc-card-2: #000000;
  --wpmc-ring: rgba(148, 163, 184, 0.14);
  --wpmc-border: rgba(15, 23, 42, 0.85);
  --wpmc-text: #e2e8f0;
  --wpmc-text-dim: #9fb0c7;
  --wpmc-price: #fdde30; /* yellow */
  --wpmc-badge: #f43f5e;
  --wpmc-sea-1: #22d3ee; /* cyan */
  --wpmc-sea-2: #fdde30; /* yellow */
  --wpmc-accent: var(--wpmc-sea-2);
  --wpmc-pill-text: #0b1220; /* dark text on yellow */
  --wpmc-bg: #0b1320;
  --wpmc-sticky-top: 0px; /* extra offset if you need */
  color: var(--wpmc-text);
  font-family: "Tajawal", system-ui, -apple-system, Segoe UI, Roboto, Arial,
    sans-serif;
}

/* enforce RTL when dir="rtl" is set */
.wpmc[dir="rtl"] {
  direction: rtl;
}

.wpmc .wpmc-inner {
  max-width: 1180px;
  margin-inline: auto;
  padding: 10px;
}

/* ---------------------------------
   Heading (current category)
   --------------------------------- */
.wpmc .wpmc-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: clamp(22px, 3.5vw, 32px);
  font-weight: 800;
  margin: 6px 0 14px;
  color: #e7eefc; /* improved contrast on dark background */
  padding-top: 20px;
  padding-bottom: 20px;
  line-height: 1.2;
  word-break: break-word;
}

/* the line */
.wpmc .wpmc-heading::after {
  content: "";
  height: 3px;
  border-radius: 2px;
  flex: 1 1 auto;
  background: linear-gradient(
    90deg,
    var(--wpmc-accent),
    rgba(253, 222, 48, 0)
  );
  opacity: 0.95;
}

/* flip gradient on RTL */
.wpmc[dir="rtl"] .wpmc-heading::after {
  background: linear-gradient(
    90deg,
    rgba(253, 222, 48, 0),
    var(--wpmc-accent)
  );
}

/* ---------------------------------
   Category Bar (sticky + scrollable)
   --------------------------------- */

/* supports either .wpmc-catbar or .wpmc-category-bar */
.wpmc .wpmc-catbar,
.wpmc .wpmc-category-bar {
  position: sticky;
  top: calc(
    var(--wpmc-sticky-top, 0px)
    + var(--wpmc-adminbar-height, 0px)
    + var(--site-header-height, 0px)
  );
  z-index: 40;
  background: #111;
  border: 1px solid var(--wpmc-border);
  border-radius: 16px;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
  padding: 0.75rem;
  margin: 10px 0 18px;
  max-height: 16rem;
  overscroll-behavior: contain;

  /* base flex layout; horizontal overrides come later */
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;

  justify-content: flex-start;
}

/* (optional) list area when a wrapper exists */
.wpmc .wpmc-catbar .wpmc-cats,
.wpmc .wpmc-category-bar .wpmc-cats {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
  max-height: 3.2rem; /* collapsed */
  overflow: hidden;
  transition: max-height 0.2s ease;
}

.wpmc .wpmc-catbar.is-open .wpmc-cats,
.wpmc .wpmc-category-bar.is-open .wpmc-cats {
  max-height: 16rem; /* expanded */
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-block-end: 0.25rem;
}

/* toggle button (More) */
.wpmc .wpmc-category-toggle {
  margin-inline-start: auto;
  appearance: none;
  border: 2px solid var(--wpmc-border);
  background: #0f172a;
  color: var(--wpmc-text);
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
}
.wpmc .wpmc-category-toggle:focus-visible {
  outline: 3px solid var(--wpmc-sea-1);
  outline-offset: 2px;
}

/* Pills (buttons) */
.wpmc .wpmc-catbar button,
.wpmc .wpmc-category-bar .wpmc-cat-pill {
  appearance: none;
  cursor: pointer;
  line-height: 1.1;
  border: 2px solid var(--wpmc-border);
  color: var(--wpmc-text);
  background: #111; /* unselected pill */
  padding: 12px 20px;
  border-radius: 9999px;
  font-weight: 800;
  font-size: 18px;
  min-height: 44px;
  min-width: 44px;
  letter-spacing: 0.2px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
  text-align: start; /* left in LTR, right in RTL */
}

.wpmc .wpmc-catbar button:focus-visible,
.wpmc .wpmc-category-bar .wpmc-cat-pill:focus-visible {
  outline: 3px solid var(--wpmc-sea-1);
  outline-offset: 2px;
}

/* Selected (high-contrast yellow) */
.wpmc .wpmc-catbar button[aria-selected="true"],
.wpmc .wpmc-category-bar .wpmc-cat-pill[aria-current="true"],
.wpmc .wpmc-category-bar .wpmc-cat-pill.is-active {
  border-color: #c6b21e;
  background: var(--wpmc-accent);
  color: var(--wpmc-pill-text);
  box-shadow: 0 10px 22px rgba(255, 217, 0, 0.76);
}

/* Hover (unselected) */
.wpmc .wpmc-catbar button[aria-selected="false"]:hover,
.wpmc .wpmc-category-bar .wpmc-cat-pill:not([aria-current="true"]):hover {
  transform: translateY(-2px);
  border-color: var(--wpmc-accent);
  background: #161616;
  color: var(--wpmc-text);
}

/* Make pill text align naturally in both directions */
.wpmc .wpmc-catbar button {
  text-align: start;
}

/* ---------------------------------
   Grid + Sections
   --------------------------------- */

.wpmc .wpmc-grid {
  display: grid;
  gap: var(--wpmc-gap);
}
.wpmc[data-cols-desktop="3"] .wpmc-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.wpmc[data-cols-desktop="2"] .wpmc-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.wpmc[data-cols-desktop="4"] .wpmc-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 900px) {
  .wpmc[data-cols-tablet="2"] .wpmc-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .wpmc[data-cols-tablet="1"] .wpmc-grid {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
}
@media (max-width: 600px) {
  .wpmc[data-cols-mobile="1"] .wpmc-grid {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
  .wpmc[data-cols-mobile="2"] .wpmc-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Section wrapper/title (when using category sections) */
.wpmc .wpmc-section {
  margin-block: 8px 24px;
}
.wpmc .wpmc-section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 6px 0 14px;
  padding-block: 14px 10px;
  font-weight: 800;
  font-size: clamp(18px, 2.4vw, 24px);
  line-height: 1.2;
  color: #000000;
  word-break: break-word;
  text-align: start; /* RTL/LTR friendly */
}

/* gold line beside title */
.wpmc .wpmc-section-title::after {
  content: "";
  height: 3px;
  border-radius: 2px;
  flex: 1 1 auto;
  background: linear-gradient(
    90deg,
    var(--wpmc-accent),
    rgba(253, 222, 48, 0)
  );
  opacity: 0.95;
}

/* In RTL: make the line appear on the other side (and flip gradient) */
.wpmc[dir="rtl"] .wpmc-section-title {
  flex-direction: row;
}
.wpmc[dir="rtl"] .wpmc-section-title::after {
  background: linear-gradient(
    90deg,
    rgba(253, 222, 48, 0),
    var(--wpmc-accent)
  );
}

/* --- If you still use the big heading, make it RTL-correct too --- */
.wpmc[dir="rtl"] .wpmc-heading {
  flex-direction: row-reverse;
}

/* ---------------------------------
   Card
   --------------------------------- */
.wpmc .wpmc-card {
  position: relative;
  background: linear-gradient(180deg, var(--wpmc-card), var(--wpmc-card-2));
  border-radius: var(--wpmc-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--wpmc-border);
  box-shadow:
    inset 0 0 0 1px var(--wpmc-ring),
    0 10px 30px rgba(2, 6, 23, 0.45);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
  cursor: pointer;
  outline: none;
}
.wpmc .wpmc-card:hover {
  transform: translateY(-3px);
  box-shadow:
    inset 0 0 0 1px var(--wpmc-ring),
    0 16px 36px rgba(2, 6, 23, 0.55);
}
.wpmc .wpmc-card:focus-visible {
  box-shadow:
    inset 0 0 0 2px var(--wpmc-sea-1),
    0 16px 36px rgba(2, 6, 23, 0.55);
}

.wpmc .wpmc-card-media {
  position: relative;
  overflow: hidden;
}
.wpmc .wpmc-thumb {
  width: 100%;
  aspect-ratio: 16 / 11;
  object-fit: cover;
  background: #0b1320;
  transition: transform 0.25s ease;
}
.wpmc .wpmc-card:hover .wpmc-thumb {
  transform: scale(1.035);
}

/* Badge */
.wpmc .wpmc-badge {
  position: absolute;
  top: 10px;
  inset-inline-end: 10px;
  z-index: 2;
  font-size: 11px;
  line-height: 1;
  padding: 6px 8px;
  border-radius: 999px;
  color: #0b1220;
  background: var(--wpmc-badge, #fdde30);
  border: 1px solid rgba(0, 0, 0, 0.15);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.wpmc {
  --wpmc-badge-new: #22c55e;
  --wpmc-badge-special: #f43f5e;
}
.wpmc .wpmc-badge.is-new {
  background: var(--wpmc-badge-new);
  color: #000;
  border-color: rgba(0, 0, 0, 0.18);
}
.wpmc .wpmc-badge.is-special {
  background: var(--wpmc-badge-special);
  color: #0b1220;
  border-color: rgba(0, 0, 0, 0.18);
}

/* body */
.wpmc .wpmc-body {
  padding: 14px 16px 16px;
}
.wpmc .wpmc-title {
  margin: 2px 0 6px;
  font-size: 18px;
  font-weight: 800;
  color: #e7eefc;
}
.wpmc .wpmc-excerpt {
  color: var(--wpmc-text-dim);
  font-size: 14px;
  line-height: 1.55;
  margin: 0;
}
.wpmc .wpmc-price {
  color: var(--wpmc-price);
  font-weight: 700;
  margin-top: 10px;
  font-size: 15px;
}

/* empty message */
.wpmc .wpmc-empty {
  margin: 6px 0 6px;
  color: #94a3b8;
  font-size: 14px;
}
.wpmc .wpmc-card[hidden] {
  display: none !important;
}

/* ---------------------------------
   Modal (popup details)
   --------------------------------- */
.wpmc .wpmc-modal[hidden] {
  display: none;
}
.wpmc .wpmc-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
}
.wpmc .wpmc-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
}
.wpmc .wpmc-modal__panel {
  position: relative;
  margin: 5vh auto;
  width: min(92vw, 520px);
  background: #0f172a;
  color: var(--wpmc-text);
  border-radius: 16px;
  border: 1px solid var(--wpmc-border);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
}
.wpmc .wpmc-modal__close {
  position: absolute;
  inset-inline-end: 0.5rem;
  inset-block-start: 0.5rem;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--wpmc-border);
  background: var(--wpmc-accent);
  color: var(--wpmc-pill-text);
  display: grid;
  place-items: center;
  font-size: 20px;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}
.wpmc .wpmc-modal__media img {
  display: block;
  width: 100%;
  height: auto;
  background: #0b1320;
}
.wpmc .wpmc-modal__body {
  padding: 1rem 1.25rem 1.25rem;
}
.wpmc .wpmc-modal__title {
  margin: 0.25rem 0 0.5rem;
  font-size: 1.25rem;
  color: #e7eefc;
  text-align: start;
}
.wpmc .wpmc-modal__desc {
  color: var(--wpmc-text-dim);
  margin: 0 0 0.75rem;
  text-align: start;
}
.wpmc .wpmc-modal__price {
  font-weight: 700;
  color: var(--wpmc-price);
  text-align: start;
}

/* =========================================
   Horizontal scroll for category bar (LTR + RTL)
   ========================================= */

/* make the nav itself the scroll container */
.wpmc .wpmc-catbar {
  display: flex;
  flex-wrap: nowrap;              /* keep in one row */
  align-items: center;
  gap: 0.75rem;

  overflow-x: auto;               /* scroll left/right */
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch; /* smooth on mobile */

  padding-inline: 0.75rem;        /* breathing room at edges */
}

/* each tab should size to its content and stay in one row */
.wpmc .wpmc-catbar .wpmc-tab,
.wpmc .wpmc-catbar button {
  flex: 0 0 auto;                 /* no flex-growing, just content width */
  white-space: nowrap;            /* text on a single line */
}

/* LTR: first tab on the LEFT */
.wpmc:not([dir="rtl"]) .wpmc-catbar {
  direction: ltr;
  justify-content: flex-start;
}

/* RTL: first tab on the RIGHT */
.wpmc[dir="rtl"] .wpmc-catbar {
  direction: rtl;
  justify-content: flex-start;    /* start = right in RTL */
}

/* Hide scrollbar but keep scrolling */
.wpmc .wpmc-catbar {
  scrollbar-width: none;          /* Firefox */
  -ms-overflow-style: none;       /* IE / old Edge */
}

.wpmc .wpmc-catbar::-webkit-scrollbar {
  display: none;                  /* Chrome, Safari, new Edge */
}
