/* home.css — country selector (/ and /ar/) + 404 page. Wave 2, 2026-11-13. */
:root {
  --primary: #1a1a2e;
  --accent: #C1272D;
  --bg: #f3f4f6;
  --card: #ffffff;
  --line: #e5e7eb;
  --text: #1a1a2e;
  --muted: #6b7280;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); line-height: 1.5; }
[lang^="ar"] body, body[dir="rtl"] { font-family: 'Segoe UI', Tahoma, 'Noto Sans Arabic', system-ui, sans-serif; }
a { color: inherit; text-decoration: none; }

/* Header */
.hm-header { background: var(--primary); position: sticky; top: 0; z-index: 50; box-shadow: 0 2px 12px rgba(0,0,0,.15); }
.hm-header-inner { max-width: 1100px; margin: 0 auto; padding: 0 16px; height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hm-logo { display: flex; align-items: center; gap: 9px; color: #fff; font-weight: 800; font-size: 1.12rem; letter-spacing: -.02em; }
.hm-logo img { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); padding: 5px; }
.hm-logo-t { color: #fff; }
.hm-logo-t span { color: var(--accent); }
.hm-nav { display: flex; align-items: center; gap: 6px; }
.hm-pill { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 20px; font-size: .8rem; font-weight: 700;
  color: rgba(255,255,255,.88); background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); }
.hm-pill:hover { background: rgba(255,255,255,.18); color: #fff; }
.hm-pill img { width: 18px; height: 13px; border-radius: 2px; object-fit: cover; }
.hm-lang { color: #fff; border-color: rgba(255,255,255,.35); }
@media (max-width: 600px) { .hm-pill .cc { display: none; } .hm-pill { padding: 6px 8px; } }
@media (max-width: 480px) { .hm-nav .hm-pill:not(.hm-lang) { display: none; } }

/* Hero */
.hm-hero { max-width: 760px; margin: 0 auto; padding: 44px 16px 8px; text-align: center; }
.hm-hero h1 { font-size: clamp(1.45rem, 3.6vw, 2.1rem); font-weight: 800; line-height: 1.25; margin-bottom: 10px; }
.hm-sub { color: var(--muted); font-size: 1rem; }
.hm-search { max-width: 460px; margin: 22px auto 0; position: relative; }
.hm-search input { width: 100%; height: 48px; border: 1px solid var(--line); border-radius: 999px; background: var(--card);
  padding: 0 22px; font: inherit; font-size: .98rem; color: var(--text); outline: none; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.hm-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(193,39,45,.12); }

/* Country cards */
.hm-grid-wrap { max-width: 1100px; margin: 0 auto; padding: 28px 16px 44px; }
.hm-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; list-style: none; }
.hm-card { display: block; height: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px;
  transition: border-color .15s ease, box-shadow .15s ease; }
.hm-card:hover, .hm-card:focus-visible { border-color: var(--accent); box-shadow: 0 6px 18px rgba(26,26,46,.08); outline: none; }
.hm-flag { display: block; width: 40px; height: 28px; border-radius: 4px; object-fit: cover; object-position: 0 50%;
  box-shadow: 0 0 0 1px rgba(0,0,0,.08); margin-bottom: 14px; }
.hm-name { display: block; font-weight: 800; font-size: 1.05rem; line-height: 1.3; }
.hm-alt { display: block; color: var(--muted); font-size: .9rem; margin-top: 2px; }
.hm-stats { display: block; color: var(--muted); font-size: .84rem; margin-top: 12px; }
.hm-stats span { white-space: nowrap; }
.hm-empty { text-align: center; color: var(--muted); padding: 20px 0 0; }
@media (max-width: 900px) { .hm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }
@media (max-width: 420px) { .hm-card { padding: 14px; } .hm-name { font-size: .98rem; } }

/* Content + FAQ */
.hm-content { max-width: 820px; margin: 0 auto; padding: 8px 16px 40px; }
.hm-content h2, .hm-faq h2 { font-size: 1.25rem; font-weight: 800; margin-bottom: 12px; }
.hm-content p { color: #4b5563; font-size: .95rem; line-height: 1.8; margin-bottom: 12px; }
.hm-faq { max-width: 1100px; margin: 0 auto; padding: 0 16px 56px; }
.hm-faq h2 { text-align: center; margin-bottom: 22px; }
.hm-faq-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; }
.hm-faq details { border-bottom: 1px solid var(--line); }
.hm-faq summary { cursor: pointer; list-style: none; padding: 13px 2px; font-size: .92rem; font-weight: 700; display: flex; justify-content: space-between; gap: 10px; }
.hm-faq summary::-webkit-details-marker { display: none; }
.hm-faq summary::after { content: '+'; color: var(--accent); font-weight: 400; font-size: 1.1rem; }
.hm-faq details[open] summary::after { content: '−'; }
.hm-faq details p { padding: 0 2px 14px; color: #4b5563; font-size: .88rem; line-height: 1.7; }
@media (max-width: 760px) { .hm-faq-cols { grid-template-columns: 1fr; } }

/* 404 */
.nf-stores { max-width: 1100px; margin: 0 auto; padding: 0 16px 48px; }
.nf-stores h2 { font-size: 1.1rem; font-weight: 800; margin-bottom: 14px; }
.nf-store-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; list-style: none; }
.nf-store-list a { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: .9rem; font-weight: 600; }
.nf-store-list a:hover { border-color: var(--accent); }

/* Footer */
.hm-footer { background: var(--primary); color: rgba(255,255,255,.6); padding: 32px 16px 20px; }
.hm-footer-grid { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 26px; padding-bottom: 22px; }
.hm-footer p { font-size: .84rem; line-height: 1.7; }
.hm-footer h4 { color: #fff; font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 10px; }
.hm-footer ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.hm-footer a { font-size: .86rem; color: rgba(255,255,255,.7); }
.hm-footer a:hover { color: #fff; }
.hm-footer-bottom { max-width: 1100px; margin: 0 auto; border-top: 1px solid rgba(255,255,255,.12); padding-top: 14px; font-size: .78rem; text-align: center; }
@media (max-width: 700px) { .hm-footer-grid { grid-template-columns: 1fr; gap: 18px; } }

/* ── Home v2 (2026-11-14): hero stats, latest flyers, popular stores, steps ── */
.hm-hero { padding-top: 40px; }
.hm-stats-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; list-style: none; margin: 20px 0 0; }
.hm-stats-row li { display: flex; align-items: baseline; gap: 6px; background: var(--card); border: 1px solid var(--line);
  border-radius: 999px; padding: 7px 16px; font-size: .9rem; color: var(--muted); }
.hm-stats-row strong { color: var(--accent); font-size: 1.12rem; font-weight: 800; }

.hm-card { display: flex; flex-direction: column; }
.hm-go { display: block; margin-top: auto; padding-top: 12px; font-size: .84rem; font-weight: 700; color: var(--accent); }
.hm-card:hover .hm-go { text-decoration: underline; }

.hm-sec { max-width: 1100px; margin: 0 auto; padding: 0 16px 44px; }
.hm-sec-head { margin-bottom: 16px; }
.hm-sec-head h2 { font-size: 1.3rem; font-weight: 800; line-height: 1.3; }
.hm-sec-head p { color: var(--muted); font-size: .92rem; margin-top: 4px; }

/* Latest flyers */
.hm-flyers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; list-style: none; }
.hm-flyer { display: flex; flex-direction: column; height: 100%; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; overflow: hidden; transition: border-color .15s ease, box-shadow .15s ease; }
.hm-flyer:hover, .hm-flyer:focus-visible { border-color: var(--accent); box-shadow: 0 6px 18px rgba(26,26,46,.08); outline: none; }
.hm-flyer-img { position: relative; display: block; aspect-ratio: 4 / 5; background: #eef0f3; overflow: hidden; }
.hm-flyer-img > img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.hm-flyer-cc { position: absolute; top: 8px; inset-inline-start: 8px; display: flex; align-items: center; gap: 5px;
  background: rgba(26,26,46,.82); color: #fff; font-size: .72rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; }
.hm-flyer-cc img { width: 18px; height: 13px; border-radius: 2px; object-fit: cover; }
.hm-flyer-body { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px 12px; }
.hm-flyer-store { font-size: .78rem; font-weight: 800; color: var(--accent); text-transform: uppercase; letter-spacing: .02em; }
[dir="rtl"] .hm-flyer-store { text-transform: none; letter-spacing: 0; }
.hm-flyer-title { font-size: .9rem; font-weight: 700; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; }
.hm-flyer-dates { font-size: .78rem; color: var(--muted); }

/* Popular stores */
.hm-pop { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.hm-pop-cc { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.hm-pop-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.hm-pop-head h3 { display: flex; align-items: center; gap: 8px; font-size: 1rem; font-weight: 800; }
.hm-pop-head h3 img { width: 22px; height: 16px; border-radius: 3px; object-fit: cover; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
.hm-pop-head a { font-size: .82rem; font-weight: 700; color: var(--accent); white-space: nowrap; }
.hm-pop-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; list-style: none; }
.hm-pop-list a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 6px; border: 1px solid var(--line);
  border-radius: 10px; transition: border-color .15s ease; }
.hm-pop-list a:hover, .hm-pop-list a:focus-visible { border-color: var(--accent); outline: none; }
.hm-pop-logo { display: flex; align-items: center; justify-content: center; width: 100%; height: 44px; }
.hm-pop-logo img { max-width: 96px; width: 100%; height: 44px; object-fit: contain; }
.hm-pop-name { max-width: 100%; font-size: .76rem; font-weight: 600; color: var(--text); text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* How it works */
.hm-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; list-style: none; counter-reset: hmstep; }
.hm-steps li { counter-increment: hmstep; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.hm-steps li::before { content: counter(hmstep); display: flex; align-items: center; justify-content: center; width: 32px; height: 32px;
  border-radius: 50%; background: var(--accent); color: #fff; font-weight: 800; margin-bottom: 10px; }
.hm-steps strong { display: block; font-size: 1rem; margin-bottom: 4px; }
.hm-steps p { color: var(--muted); font-size: .88rem; line-height: 1.6; }

@media (max-width: 900px) {
  .hm-flyers { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .hm-pop { grid-template-columns: 1fr; gap: 12px; }
}
@media (max-width: 640px) {
  .hm-steps { grid-template-columns: 1fr; gap: 10px; }
  .hm-steps li { display: grid; grid-template-columns: 32px 1fr; column-gap: 12px; padding: 14px; }
  .hm-steps li::before { grid-row: span 2; margin: 0; }
  .hm-sec { padding-bottom: 36px; }
  .hm-sec-head h2 { font-size: 1.15rem; }
}
@media (max-width: 420px) {
  .hm-flyer-body { padding: 8px 10px 10px; }
  .hm-flyer-title { font-size: .84rem; }
  .hm-stats-row li { padding: 6px 12px; font-size: .84rem; }
}

/* ── Country panels (2026-11-14): country cards in the Popular-stores style ── */
.hm-panels { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.hm-panel { height: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.hm-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.hm-panel-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.hm-panel-title:hover .hm-name { color: var(--accent); }
.hm-panel-flag { flex: 0 0 auto; width: 34px; height: 24px; border-radius: 4px; object-fit: cover; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
.hm-panel .hm-name { font-size: 1.05rem; }
.hm-panel .hm-alt { font-size: .85rem; margin-top: 0; }
.hm-panel-all { flex: 0 0 auto; font-size: .82rem; font-weight: 700; color: var(--accent); white-space: nowrap; padding-top: 3px; }
.hm-panel-all:hover { text-decoration: underline; }
.hm-panel .hm-stats { margin: 8px 0 12px; }
.hm-panel .hm-pop-list a { height: 100%; }
@media (max-width: 760px) {
  .hm-panels { grid-template-columns: 1fr; gap: 12px; }
  .hm-panel { padding: 14px 12px; }
}
@media (max-width: 420px) {
  .hm-panel .hm-pop-list { gap: 6px; }
  .hm-panel .hm-pop-list a { padding: 6px 4px; }
  .hm-panel .hm-pop-logo, .hm-panel .hm-pop-logo img { height: 36px; }
  .hm-panel .hm-pop-name { font-size: .72rem; }
}

/* Home search results (2026-11-17): stores + current flyers under the box */
.hm-results { position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 60; background: var(--card);
  border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 14px 40px rgba(26,26,46,.16);
  max-height: min(70vh, 460px); overflow-y: auto; text-align: start; padding: 6px 0; }
.hm-results[hidden] { display: none; }
.hm-res-head { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 10px 16px 4px; }
.hm-res { display: flex; align-items: center; gap: 12px; padding: 8px 16px; color: var(--text); }
.hm-res:hover, .hm-res.is-focus { background: var(--bg); }
.hm-res-logo { width: 40px; height: 40px; flex: none; border-radius: 10px; object-fit: contain; background: #fff; border: 1px solid var(--line); }
.hm-res-initial { display: flex; align-items: center; justify-content: center; font-weight: 800; color: var(--accent); }
.hm-res-cover { width: 36px; height: 48px; flex: none; border-radius: 6px; object-fit: cover; background: var(--bg); border: 1px solid var(--line); }
.hm-res-body { min-width: 0; display: flex; flex-direction: column; }
.hm-res-title { font-weight: 700; font-size: .93rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-res-sub { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-res-flag { width: 18px; height: 13px; border-radius: 2px; object-fit: cover; flex: none; }
.hm-res-none { padding: 18px 16px; color: var(--muted); text-align: center; font-size: .92rem; }
@media (max-width: 480px) { .hm-results { max-height: 60vh; } .hm-res { padding: 8px 12px; } }
