/* =========================================================================
   style.css — PrintInnovate (عربي RTL)
   الألوان معرّفة كمتغيرات في الأعلى لتسهيل إعادة الاستعمال في النسخة الفرنسية.
   ========================================================================= */

:root {
  --navy-900: #081a56;
  --navy-800: #0b2270;
  --blue-600: #1b4bc4;
  --blue-100: #e8eefc;
  --blue-50:  #f3f6ff;
  --yellow:   #ffc61a;
  --yellow-d: #f5a800;
  --white:    #ffffff;
  --ink:      #0b1a4a;
  --muted:    #4a5c8f;
  --line:     #d6e0f7;
  --danger:   #c62828;

  --radius: 18px;
  --font: "Cairo", "Segoe UI", Tahoma, Arial, sans-serif;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 76px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--blue-50);
  -webkit-text-size-adjust: 100%;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--blue-600); outline-offset: 3px; }

/* أرقام ورموز لاتينية داخل نص عربي: تُعرض دائماً بترتيب صحيح (99 DH وليس DH 99) */
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 18px; }
.wrap--form { max-width: 640px; }

/* ---------- الأزرار ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 10px 28px;
  border: 0; border-radius: 999px;
  font: 800 18px/1.2 var(--font);
  text-decoration: none; cursor: pointer;
  transition: background-color .15s, transform .15s;
}
.btn--yellow { background: var(--yellow); color: var(--navy-900); }
.btn--yellow:hover { background: var(--yellow-d); }
.btn--navy { background: var(--navy-800); color: var(--white); }
.btn--navy:hover { background: var(--blue-600); }
.btn--sm { min-height: 44px; padding: 8px 18px; font-size: 16px; }
.btn--block { width: 100%; min-height: 58px; font-size: 20px; }
.btn:active { transform: translateY(1px); }

/* ---------- الشريط العلوي ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 8px; padding-bottom: 8px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.brand__logo { width: 52px; height: 52px; flex: none; }   /* نسب الشعار محفوظة: مربع 1:1 */
.brand__text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand__name { font-weight: 900; font-size: 19px; color: var(--navy-800); direction: ltr; text-align: right; }
.brand__tag { font-weight: 600; font-size: 14px; color: var(--muted); }

/* ---------- الواجهة الرئيسية ---------- */
.hero {
  background: linear-gradient(135deg, var(--navy-900) 0%, var(--navy-800) 45%, var(--blue-600) 100%);
  color: var(--white);
  border-radius: 0 0 40px 40px;
  padding: 36px 0 44px;
}
.hero__inner { display: flex; flex-direction: column; gap: 24px; }
.hero__text { max-width: 640px; }
.hero__title { margin: 0 0 12px; font-weight: 900; font-size: clamp(42px, 11vw, 76px); line-height: 1.15; }
.hero__title span { display: block; }
.hero__title-accent { color: var(--yellow); }
.hero__desc { margin: 0 0 24px; max-width: 30em; font-size: clamp(18px, 4.6vw, 22px); font-weight: 600; color: #e6ecff; }


/* ---------- الأقسام ---------- */
.section { padding: 40px 0 8px; }
.section__title { margin: 0 0 20px; font-weight: 900; font-size: clamp(26px, 6vw, 36px); color: var(--navy-800); line-height: 1.25; }

/* ---------- بطاقات المنتجات ---------- */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }

.card {
  display: flex; flex-direction: column;
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 10px 12px;
}
/* ---------- معرض صور المنتج ---------- */
.gallery { position: relative; border-radius: 12px; overflow: hidden; background: var(--blue-100); }
.gallery__track {
  display: flex; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain; scrollbar-width: none;
}
.gallery__track::-webkit-scrollbar { display: none; }
.gallery__slide { flex: 0 0 100%; width: 100%; scroll-snap-align: start; scroll-snap-stop: always; }
.gallery__img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: contain; }
.gallery__btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .85); color: var(--navy-800);
  box-shadow: 0 1px 6px rgba(8, 26, 86, .28); cursor: pointer;
  transition: opacity .15s, background-color .15s;
}
.gallery__btn:hover { background: var(--white); }
.gallery__btn svg { width: 18px; height: 18px; }
.gallery__btn--prev { right: 4px; }
.gallery__btn--next { left: 4px; }
.gallery__btn--prev svg { transform: scaleX(-1); }
.gallery__btn[disabled] { opacity: .35; cursor: default; }
.gallery__btn[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .gallery__track { scroll-behavior: auto; } }
.card__body { flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 12px 2px 4px; }
.card__group { margin: 0; font-size: 14px; font-weight: 600; color: var(--muted); }
.card__name { margin: 0; font-size: 21px; font-weight: 900; color: var(--navy-800); line-height: 1.3; }
.card__size { margin: 2px 0 10px; font-size: 15px; font-weight: 600; color: var(--muted); }
.card__detail { margin: -6px 0 10px; font-size: 14px; font-weight: 600; color: var(--muted); }
.card__price {
  margin-top: auto; margin-bottom: 12px;
  padding: 2px 18px; border-radius: 12px;
  background: linear-gradient(180deg, #ffd23d, var(--yellow-d));
  color: var(--navy-900); font-weight: 900; font-size: 30px; line-height: 1.35;
}
.card__price small { font-size: 17px; font-weight: 800; }
.card .btn { width: 100%; min-height: 46px; font-size: 16px; padding: 8px 10px; }

.card--custom { grid-column: 1 / -1; }
.card--custom .card__body { padding-top: 12px; }
.card__desc { margin: 4px 0 14px; font-size: 16px; color: var(--muted); font-weight: 600; max-width: 28em; }

.note { margin: 16px 0 0; padding: 12px 16px; font-size: 15px; font-weight: 600; color: var(--navy-800); background: var(--blue-100); border-radius: 12px; }

/* ---------- التوصيل ---------- */
.delivery {
  margin-top: 16px; padding: 16px 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--navy-800); color: var(--white);
  border-radius: var(--radius);
}
.delivery__title { margin: 0; font-size: 19px; font-weight: 800; }
.delivery__note { margin: 2px 0 0; font-size: 15px; color: #d8e2ff; font-weight: 600; }
.delivery__price { flex: none; font-size: 28px; font-weight: 900; color: var(--yellow); }

/* ---------- نموذج الطلب ---------- */
.section--order { padding-bottom: 48px; }
.form {
  background: var(--white); border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 20px 16px 22px;
}
.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 6px; font-weight: 800; font-size: 16px; color: var(--navy-800); }

input[type="text"], input[type="number"], select, textarea {
  width: 100%; min-height: 50px; padding: 10px 14px;
  font: 600 17px/1.4 var(--font); color: var(--ink);
  background: var(--white);
  border: 2px solid var(--line); border-radius: 12px;
}
textarea { resize: vertical; min-height: 110px; }
input:focus, select:focus, textarea:focus { border-color: var(--blue-600); outline: none; box-shadow: 0 0 0 3px rgba(27, 75, 196, .2); }
.is-invalid { border-color: var(--danger) !important; }
.field-error { margin: 6px 0 0; color: var(--danger); font-size: 14px; font-weight: 700; }

.field__hint { margin: 6px 0 0; font-size: 14px; font-weight: 600; color: var(--muted); }

.qty { display: flex; align-items: stretch; gap: 8px; }
.qty input { text-align: center; direction: ltr; flex: 1; }
.qty__btn {
  flex: none; width: 52px; border: 2px solid var(--line); border-radius: 12px;
  background: var(--blue-100); color: var(--navy-800); font: 900 26px/1 var(--font); cursor: pointer;
}
.qty__btn:hover { background: var(--line); }

.summary { margin: 22px 0 16px; padding: 14px 16px; border-radius: 14px; background: var(--blue-50); border: 1.5px solid var(--line); }
.summary__row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 0; font-weight: 600; }
.summary__row strong { font-weight: 800; }
.summary__row--total {
  margin-top: 8px; padding-top: 12px; border-top: 2px dashed var(--line);
  font-size: 20px; font-weight: 900; color: var(--navy-800);
}
.summary__row--total strong { font-size: 26px; font-weight: 900; }
.summary__note { margin: 8px 0 0; font-size: 15px; font-weight: 700; color: var(--navy-800); }

.check {
  display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; padding: 14px;
  background: #fff8e1; border: 2px solid var(--yellow); border-radius: 14px;
  font-weight: 800; cursor: pointer;
}
.check input { flex: none; width: 26px; height: 26px; margin: 2px 0 0; accent-color: var(--navy-800); cursor: pointer; }
.check.is-invalid { border-color: var(--danger); }

.hint { margin: 12px 0 0; font-size: 14px; color: var(--muted); font-weight: 600; text-align: center; }
.legal { margin: 14px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); font-weight: 600; }

/* ---------- التذييل ---------- */
.footer { background: var(--navy-900); color: var(--white); padding: 28px 0 32px; }
.footer__inner { display: flex; align-items: center; gap: 16px; }
.footer__logo { width: 64px; height: 64px; flex: none; }
.footer__name { display: block; font-size: 22px; font-weight: 900; margin-bottom: 2px; }
.footer__info p { margin: 0; font-size: 16px; font-weight: 600; color: #d8e2ff; }
.footer__info a { color: var(--white); font-weight: 800; text-decoration: none; }
.footer__info a:hover { text-decoration: underline; }

/* ---------- شاشات أكبر ---------- */
@media (min-width: 640px) {
  body { font-size: 18px; }
  .grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .card { padding: 12px 12px 14px; }
  .card__name { font-size: 23px; }
  .form { padding: 28px 28px 30px; }
  .gallery__btn { width: 40px; height: 40px; }
  .gallery__btn svg { width: 22px; height: 22px; }
}

@media (min-width: 860px) {
  .hero { padding: 56px 0 64px; border-radius: 0 0 56px 56px; }
  .section { padding-top: 56px; }
  .card--custom { flex-direction: row; align-items: center; gap: 20px; }
  .card--custom .gallery { width: 280px; flex: none; }
  .card--custom .card__body { align-items: flex-start; text-align: right; }
  .card--custom .btn { width: auto; min-width: 240px; }
}

@media (max-width: 380px) {
  .brand__tag { display: none; }
  .btn--sm { padding: 8px 14px; font-size: 15px; }
  .card__price { font-size: 26px; }
}
