@font-face {
  font-family: 'Noto Sans Arabic';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('NotoSansArabic-web.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200F, U+FB50-FDFF, U+FE70-FEFC;
}
:root {
  color-scheme: light;
  --paper: #fbfcf8;
  --white: #fff;
  --ink: #143731;
  --muted: #4b625a;
  --line: #d6e2d9;
  --wash: #edf3ec;
  --mint: #e5efdd;
  --lime: #d7ed9d;
  --accent: #265b4c;
  --title: Georgia, 'Times New Roman', serif;
  --sans: system-ui, -apple-system, 'Segoe UI', sans-serif;
  --arabic: 'Noto Sans Arabic', Tahoma, 'Geeza Pro', Arial, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 1rem/1.55 var(--sans); }
[lang=ar] { font-family: var(--arabic); }
[hidden] { display: none !important; }
a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid #39756a;
  outline-offset: 4px;
}
img { display: block; max-width: 100%; height: auto; }
figure, h1, h2, h3, p { margin: 0; }
.container { width: min(1210px, 100% - 64px); margin-inline: auto; }
.skip-link { position: fixed; z-index: 4; left: 12px; top: 12px; padding: 12px; background: white; transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
.masthead { border-bottom: 1px solid var(--line); }
.masthead-inner { min-height: 78px; display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.brand { display: inline-flex; gap: 10px; align-items: center; white-space: nowrap; text-decoration: none; font-weight: 800; font-size: 1.24rem; letter-spacing: -.04em; }
.brand > span:last-child > span { font-weight: 540; letter-spacing: -.035em; }
.brand-mark { width: 33px; height: 33px; display: grid; place-items: center; background: var(--accent); border-radius: 6px; }
.brand-mark::before { content: ''; width: 15px; height: 2px; border-radius: 1px; background: var(--lime); box-shadow: 0 -5px var(--lime), 0 5px var(--lime); }
.masthead nav { display: flex; align-items: center; gap: clamp(13px, 3vw, 37px); font-size: .93rem; font-weight: 650; }
.masthead nav a { text-decoration: none; }
.masthead nav a:hover { text-decoration: underline; text-underline-offset: .3em; }
.masthead nav a [lang=ar] { margin-left: 5px; }
.nav-bundle { border: 1px solid #8ca99b; border-radius: 6px; padding: 9px 14px; white-space: nowrap; }

.hero { display: grid; grid-template-columns: 1.06fr .94fr; align-items: center; gap: clamp(20px, 5vw, 78px); padding-block: 52px 64px; }
.hero h1, .detail-copy h1, .error-page h1 {
  font: 500 clamp(2.6rem, 5.1vw, 4.85rem)/1.02 var(--title);
  letter-spacing: -.055em;
}
.hero h1 [lang=ar], .detail-copy h1 [lang=ar] {
  display: block;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.5;
  margin-top: 14px;
  font-size: clamp(1.37rem, 2.5vw, 2rem);
  text-align: left;
}
.hero-copy > p { color: var(--muted); max-width: 515px; margin-top: 15px; }
.hero-copy .hero-ar { text-align: left; margin-top: 8px; }
.hero-copy .button { margin-top: 25px; }
.hero-art {
  position: relative;
  height: clamp(315px, 40vw, 450px);
  isolation: isolate;
  overflow: hidden;
  border-radius: 14px;
  background: radial-gradient(ellipse at 44% 62%, #dfebd8 0%, #d4e5d2 48%, #c5dac9 100%);
  border: 1px solid #c9dbcc;
}
.hero-art::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: .63;
  z-index: -1;
  background: linear-gradient(140deg, transparent 0 36%, #f5fbe9aa 37%, #f5fbe900 54%),
              repeating-linear-gradient(0deg, #406b4812 0 1px, transparent 1px 27px),
              repeating-linear-gradient(90deg, #406b4812 0 1px, transparent 1px 27px);
}
.hero-papers { position: absolute; inset: 0; }
.paper { position: absolute; width: 51%; border-radius: 2px; box-shadow: 2px 12px 25px #143c3442; }
.paper-1 { left: 9%; top: 29%; transform: rotate(-15deg); }
.paper-2 { right: 8%; top: 15%; transform: rotate(14deg); }
.paper-3 { left: 24%; top: 10%; width: 54%; transform: rotate(-4deg); }

.button {
  display: inline-flex; flex-direction: column; justify-content: center; align-items: center; gap: 1px;
  padding: 12px 20px; min-height: 58px;
  text-align: center; text-decoration: none; font-weight: 720; font-size: .95rem;
  border: 1px solid transparent; border-radius: 7px; line-height: 1.36;
  transition: background-color .15s, border-color .15s;
}
.button [lang=ar] { font-size: .9rem; font-weight: 570; line-height: 1.45; }
.button-free { background: var(--accent); color: white; }
.button-free:hover { background: var(--ink); }
.button-buy { background: var(--lime); color: var(--ink); border-color: #bad278; }
.button-buy:hover { background: #cce681; border-color: #9ab948; }
.checkout-status { display: none; margin-top: 14px; font-size: .91rem; }
.checkout-status:target { display: block; }
.checkout-status span { display: block; text-align: left; margin-top: 3px; }

.catalog { background: var(--wash); border-block: 1px solid var(--line); padding-block: 44px 62px; }
.section-title { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 22px; row-gap: 3px; }
.section-title h2, .bundle-panel h2 { font: 500 clamp(2rem, 4vw, 3.15rem)/1.12 var(--title); letter-spacing: -.045em; }
.section-title p { font-size: 1.15rem; color: var(--accent); }
.catalog-tools { margin-top: 25px; }
.catalog-tools label { display: block; font-weight: 700; margin-bottom: 7px; }
.catalog-tools label span { margin-left: 8px; color: var(--muted); }
#template-search {
  display: block; width: min(100%, 475px); padding: 11px 14px;
  border: 1px solid #a9c0b2; border-radius: 6px; color: var(--ink); background: var(--white);
  font: 1rem/1.4 var(--sans);
}
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.filters button {
  min-height: 44px; cursor: pointer; border: 1px solid #b4c9ba; border-radius: 6px;
  padding: 7px 12px; background: var(--paper); color: var(--ink); font: 650 .9rem/1.4 var(--sans);
}
.filters button:hover { border-color: var(--accent); }
.filters button[aria-pressed=true] { background: var(--accent); color: white; border-color: var(--accent); }
.filters button span { margin-left: 7px; font-weight: 500; }
.result-count { margin-block: 12px 4px; font-size: .875rem; color: var(--muted); }
.template-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-top: 19px; }
.template-card { min-width: 0; border: 1px solid var(--line); border-radius: 9px; background: white; overflow: hidden; }
.template-card:hover { border-color: #81a394; }
.template-card a { display: flex; height: 100%; flex-direction: column; text-decoration: none; }
.template-card a:focus-visible { outline-offset: -4px; }
.card-preview { height: clamp(130px, 16vw, 185px); background: #dce9de; position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.card-preview img { position: absolute; top: 13px; left: 12%; width: 76%; box-shadow: 0 1px 12px #17373529; border-radius: 2px; }
.card-body { display: flex; flex: 1; flex-direction: column; padding: 15px; }
.card-body h3 { font: 700 1.04rem/1.35 var(--sans); }
.card-body p { margin-top: 4px; color: var(--muted); text-align: left; font-size: .94rem; }
.card-meta { padding-top: 13px; margin-top: auto; font-size: .82rem; font-weight: 700; color: #34665a; }
.no-results { margin-top: 14px; color: var(--muted); }

.bundle { padding-block: 53px; }
.bundle-panel { padding: clamp(24px, 5vw, 48px); background: var(--ink); color: white; border-radius: 12px; display: grid; grid-template-columns: 1.2fr .8fr; gap: 28px; align-items: center; }
.bundle-panel p { margin-top: 8px; color: #e0ebdf; }
.bundle-panel p[lang=ar] { text-align: left; }
.bundle-panel .bundle-ar { font-size: 1.26rem; color: var(--lime); }
.bundle-action { justify-self: end; }
.site-footer { border-top: 1px solid var(--line); padding-block: 24px; }
.site-footer .container { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 13px; }
.site-footer p { color: var(--muted); font-size: .93rem; }
.site-footer p span { margin-left: 6px; }

.detail-page { padding-block: 27px 54px; }
.breadcrumb { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin-bottom: 23px; color: var(--muted); font-size: .94rem; }
.breadcrumb a { text-underline-offset: .25em; color: var(--accent); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .9fr); gap: clamp(23px, 6vw, 74px); align-items: start; }
.detail-copy { padding-top: 9px; }
.detail-copy h1 { font-size: clamp(2.6rem, 5.1vw, 4.5rem); }
.detail-copy h1 [lang=ar] { margin-top: 10px; }
.detail-lead { margin-top: 19px; color: var(--muted); font-size: 1.075rem; }
.detail-ar { margin-top: 8px; color: var(--muted); text-align: left; }
.specs { margin-top: 20px; padding-block: 11px; border-block: 1px solid var(--line); font-size: .94rem; font-weight: 650; }
.specs span { margin-left: 10px; }
.detail-actions { display: grid; align-items: stretch; grid-template-columns: minmax(139px,.76fr) minmax(0,1.24fr); gap: 10px; margin-top: 22px; }
.included { border-top: 1px solid var(--line); margin-top: 29px; padding-top: 15px; }
.included h2 { line-height: 1.3; font-size: 1.2rem; }
.included h2 span { margin-left: 10px; color: var(--accent); }
.included ul { display: flex; flex-wrap: wrap; gap: 7px; margin: 11px 0 0; padding: 0; list-style: none; }
.included li { border: 1px solid var(--line); background: #edf4ed; padding: 4px 8px; border-radius: 4px; color: var(--muted); font-size: .91rem; }
.included li span:not(:first-child) { margin-left: 6px; }
.form-note { margin-top: 13px; color: var(--muted); font-size: .94rem; }
.form-note span { display: block; text-align: left; }
.detail-preview { background: var(--mint); border: 1px solid #c9dbcc; border-radius: 10px; padding: min(3.1vw, 30px); }
.detail-preview img { width: 100%; box-shadow: 0 5px 20px #143c342e; border-radius: 2px; }
.detail-preview figcaption { color: var(--muted); margin-top: 12px; text-align: center; font-size: .87rem; }
.detail-preview figcaption span { margin-left: 5px; }
.related { border-top: 1px solid var(--line); margin-top: 39px; padding-top: 27px; }
.error-page { padding-block: 48px; }
.error-page p { text-align: left; margin-block: 14px 24px; }

@media (max-width: 1000px) {
  .detail-actions { grid-template-columns: 1fr; }
  .detail-actions .button { width: 100%; }
}
@media (max-width: 760px) {
  .container { width: min(100% - 36px, 590px); }
  .hero, .detail-grid, .bundle-panel { grid-template-columns: 1fr; }
  .hero { padding-block: 32px 34px; }
  .hero-art { height: clamp(265px, 65vw, 385px); }
  .hero h1, .detail-copy h1 { font-size: clamp(2.55rem, 8vw, 3.6rem); }
  .hero .button { margin-top: 18px; }
  .template-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .card-preview { height: clamp(100px, 29vw, 175px); }
  .card-body { padding: 10px; }
  .detail-preview { padding: 15px; }
  .bundle-action { justify-self: start; }
  .catalog { padding-block: 30px 40px; }
}
@media (max-width: 390px) {
  .masthead-inner { gap: 9px; }
  .masthead nav { gap: 9px; font-size: .85rem; }
  .masthead nav a:first-child { display: none; }
  .nav-bundle { padding-inline: 8px; }
  .filters button { font-size: .85rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
