/* Pyranext Commerce — Grocery storefront ("Fresh Market"). Scoped to .gr-* used only by the grocery render. RTL-aware. */
:root {
  --gr-accent: #2e7d46;
  --gr-accent-dark: #205a32;
  --gr-accent-soft: #e7f3ea;
  --gr-deal: #d9531e;
  --gr-ink: #1c2820;
  --gr-muted: #5f6f66;
  --gr-line: #e4eae5;
  --gr-surface: #ffffff;
  --gr-bg: #f6f8f4;
  --gr-radius: 16px;
  --gr-shadow: 0 10px 30px rgba(32, 90, 50, .08);
}

.gr-hero, .gr-departments, .gr-deals, .gr-popular, .gr-aisles, .gr-service {
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 40px);
}
.gr-hero { margin-block: clamp(20px, 4vw, 40px); }
.gr-departments, .gr-deals, .gr-popular, .gr-aisles { margin-block: clamp(28px, 5vw, 56px); }

.gr-eyebrow { display: inline-block; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gr-accent-dark); font-weight: 700; }
.gr-eyebrow--accent { font-size: 1.35rem; letter-spacing: 0; text-transform: none; color: var(--gr-ink); }

/* Hero */
.gr-hero { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(20px, 4vw, 48px); align-items: center; }
.gr-hero__copy h1 { font-family: "Manrope", "IBM Plex Sans Arabic", system-ui, sans-serif; font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.05; margin: .35em 0 .25em; color: var(--gr-ink); font-weight: 800; }
.gr-hero__copy p { color: var(--gr-muted); font-size: 1.05rem; max-width: 46ch; margin: 0 0 1.3em; }
.gr-search { display: flex; gap: 8px; background: var(--gr-surface); border: 1px solid var(--gr-line); border-radius: 999px; padding: 6px; box-shadow: var(--gr-shadow); max-width: 520px; }
.gr-search input[type="search"] { flex: 1; border: 0; background: transparent; padding: 12px 16px; font: inherit; color: var(--gr-ink); outline: none; }
.gr-search button { border: 0; background: var(--gr-accent); color: #fff; font-weight: 700; padding: 12px 22px; border-radius: 999px; cursor: pointer; transition: background .2s; }
.gr-search button:hover { background: var(--gr-accent-dark); }
.gr-hero__chips { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 16px; color: var(--gr-accent-dark); font-weight: 600; font-size: .95rem; }
.gr-hero__panel { position: relative; min-height: 320px; border-radius: 24px; background: var(--gr-accent-soft); overflow: hidden; border: 1px solid var(--gr-line); }
.gr-hero__panel::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255, 255, 255, 0) 48%, rgba(255, 255, 255, .5) 100%); pointer-events: none; }
.gr-hero__image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.gr-hero__delivery { position: absolute; z-index: 1; inset-block-end: 22px; inset-inline-end: 22px; background: #fff; border-radius: 14px; padding: 12px 16px; box-shadow: var(--gr-shadow); display: grid; }
.gr-hero__delivery strong { color: var(--gr-accent-dark); }
.gr-hero__delivery small { color: var(--gr-muted); }

/* Section heads */
.gr-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.gr-section-head h2 { font-family: "Manrope", "IBM Plex Sans Arabic", sans-serif; font-size: clamp(1.4rem, 3vw, 2rem); color: var(--gr-ink); margin: 0; font-weight: 800; }
.gr-section-head p { color: var(--gr-muted); margin: 4px 0 0; }
.gr-section-head a { color: var(--gr-accent-dark); font-weight: 700; text-decoration: none; white-space: nowrap; }
.gr-section-head a span { margin-inline-start: 6px; }

/* Departments */
.gr-dept-rail { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.gr-dept { min-width: 0; overflow: hidden; text-decoration: none; background: var(--gr-surface); border: 1px solid var(--gr-line); border-radius: var(--gr-radius); display: grid; transition: transform .18s, box-shadow .18s; }
.gr-dept:hover { transform: translateY(-3px); box-shadow: var(--gr-shadow); }
.gr-dept__image { width: 100%; aspect-ratio: 1.12 / 1; display: block; object-fit: cover; background: var(--gr-bg); }
.gr-dept__copy { display: grid; gap: 4px; padding: 14px; }
.gr-dept strong { color: var(--gr-ink); font-size: 1.02rem; }
.gr-dept small { color: var(--gr-muted); font-size: .85rem; }

/* Grids + cards */
.gr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.gr-grid--compact { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.gr-card { background: var(--gr-surface); border: 1px solid var(--gr-line); border-radius: var(--gr-radius); overflow: hidden; display: flex; flex-direction: column; transition: transform .18s, box-shadow .18s; }
.gr-card:hover { transform: translateY(-3px); box-shadow: var(--gr-shadow); }
.gr-card__media { position: relative; display: block; aspect-ratio: 1 / 1; background: var(--gr-bg); }
.gr-card__media img { width: 100%; height: 100%; object-fit: cover; }
.gr-card__badge { position: absolute; inset-block-start: 10px; inset-inline-start: 10px; background: var(--gr-deal); color: #fff; font-size: .72rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.gr-card__body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.gr-card__name { color: var(--gr-ink); font-weight: 600; text-decoration: none; line-height: 1.3; }
.gr-card__name:hover { color: var(--gr-accent-dark); }
.gr-card__unit { color: var(--gr-muted); font-size: .82rem; }
.gr-card__foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 8px; }
.gr-card__price strong { color: var(--gr-ink); font-size: 1.05rem; }
.gr-card__price del { color: var(--gr-muted); font-size: .82rem; margin-inline-start: 6px; }
.gr-add { width: 40px; height: 40px; border: 0; border-radius: 12px; background: var(--gr-accent); color: #fff; font-size: 1.4rem; line-height: 1; cursor: pointer; transition: background .2s, transform .1s; }
.gr-add:hover { background: var(--gr-accent-dark); }
.gr-add:active { transform: scale(.94); }

/* Aisles */
.gr-aisle { margin-top: 26px; }
.gr-aisle__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.gr-aisle__head h3 { margin: 0; color: var(--gr-ink); font-size: 1.2rem; }
.gr-aisle__head a { color: var(--gr-accent-dark); font-weight: 700; text-decoration: none; }

/* Service strip */
.gr-service { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; background: var(--gr-accent-soft); border-radius: 20px; padding: clamp(18px, 3vw, 28px); margin-block: clamp(28px, 5vw, 56px); }
.gr-service div { display: grid; gap: 2px; }
.gr-service strong { color: var(--gr-accent-dark); }
.gr-service small { color: var(--gr-muted); }
.gr-empty { color: var(--gr-muted); padding: 32px; text-align: center; border: 1px dashed var(--gr-line); border-radius: var(--gr-radius); }

/* Responsive */
@media (max-width: 900px) {
  .gr-hero { grid-template-columns: 1fr; }
  .gr-hero__panel { min-height: 220px; order: -1; }
  .gr-dept-rail { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .gr-service { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .gr-grid { grid-template-columns: repeat(2, 1fr); }
  .gr-dept-rail { display: flex; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; }
  .gr-dept { flex: 0 0 72vw; scroll-snap-align: start; }
  .gr-search { flex-wrap: wrap; }
}
