/* ══════════════════════════════════════════════════════════════════════════
   /templates — the templates landing (2026-10-05). Page-specific styles only:
   the base (hm-h2, hm-gold, hm-sub, hm-sec, hm-btn, hm-w rise…) comes from
   home.css, loaded first. Landing em-* system; gold leads; neutral depth;
   logical properties (LTR mirrors); everything stops under reduced motion.
   ══════════════════════════════════════════════════════════════════════════ */

/* ── hero ── */
.tp-hero{ position:relative; overflow:hidden; padding-block:clamp(48px,6vw,96px) clamp(40px,5vw,72px); }
.tp-hero__grid{ display:grid; grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr); gap:clamp(28px,4vw,64px); align-items:center; }
@media (max-width:980px){ .tp-hero__grid{ grid-template-columns:minmax(0,1fr); } }
.tp-h1{ margin:0; font-size:clamp(31.5px,4.14vw,60px); font-weight:800; line-height:1.12; letter-spacing:-.02em; }
.tp-h1 .hm-w{ animation:hm-rise .9s cubic-bezier(.2,.8,.2,1) backwards; }
.tp-h1 .hm-w:nth-of-type(2){ animation-delay:.06s; } .tp-h1 .hm-w:nth-of-type(3){ animation-delay:.12s; } .tp-h1 .hm-gold .hm-w{ animation-delay:.2s; }
.tp-h1 .hm-w:nth-of-type(4){ animation-delay:.26s; } .tp-h1 .hm-w:nth-of-type(5){ animation-delay:.32s; }
.tp-actions{ justify-content:flex-start; }
.tp-down{ transform:rotate(90deg); } [dir=rtl] .tp-down{ transform:rotate(90deg) scaleY(-1); }
.tp-facts{ list-style:none; margin:26px 0 0; padding:0; display:flex; flex-wrap:wrap; gap:10px; }
.tp-facts li{ padding:8px 14px; border-radius:99px; font-size:13.5px; font-weight:600; color:var(--em-muted); background:var(--hm-card); border:1px solid var(--hm-line); }
.tp-facts b{ color:var(--hm-gold); font-size:14px; }

/* the fan: the real previews, stacked in 3D; templates.js rotates data-pos */
.tp-fan{ position:relative; aspect-ratio:1/.82; perspective:1800px; }
.tp-fan__card{ position:absolute; inset-block-start:8%; inset-inline-start:8%; width:76%; border-radius:18px; overflow:hidden; background:var(--hm-card);
    border:1px solid var(--hm-line); box-shadow:0 40px 80px -40px rgba(0,0,0,.65); transform-origin:50% 120%;
    transition:transform 1s cubic-bezier(.2,.8,.2,1), opacity 1s, filter 1s; }
.tp-fan__bar{ display:flex; align-items:center; gap:6px; height:34px; padding-inline:12px; border-bottom:1px solid var(--hm-line); }
.tp-fan__bar i{ width:9px; height:9px; border-radius:50%; background:var(--hm-line); }
.tp-fan__bar em{ margin-inline-start:8px; font-style:normal; font-size:12px; font-weight:700; color:var(--em-muted); }
.tp-fan__card img{ display:block; width:100%; aspect-ratio:3/2; object-fit:cover; object-position:top; }
.tp-fan__card[data-pos="0"]{ z-index:5; transform:translateZ(0) rotate(0); }
.tp-fan__card[data-pos="1"]{ z-index:4; transform:translateZ(-80px) rotate(var(--tp-r1,-7deg)) translateX(var(--tp-x1,-9%)); opacity:.85; filter:brightness(.8); }
.tp-fan__card[data-pos="2"]{ z-index:3; transform:translateZ(-160px) rotate(var(--tp-r2,-13deg)) translateX(var(--tp-x2,-16%)); opacity:.6; filter:brightness(.65); }
.tp-fan__card[data-pos="3"]{ z-index:2; transform:translateZ(-160px) rotate(var(--tp-r3,7deg)) translateX(var(--tp-x3,10%)); opacity:.55; filter:brightness(.6); }
.tp-fan__card[data-pos="4"]{ z-index:1; transform:translateZ(-240px) rotate(var(--tp-r4,13deg)) translateX(var(--tp-x4,18%)); opacity:.35; filter:brightness(.5); }
[dir=rtl] .tp-fan{ --tp-r1:7deg; --tp-x1:9%; --tp-r2:13deg; --tp-x2:16%; --tp-r3:-7deg; --tp-x3:-10%; --tp-r4:-13deg; --tp-x4:-18%; }
/* Narrower screens (<1024): the full spread pushed the back cards up to 66px past the screen
   edge and cut the «قالب فيلورا» label at 700–900px. A tighter fan, same five cards. (2026-10-05) */
@media (max-width:1023.98px){
  .tp-fan{ --tp-r1:-5deg; --tp-x1:-4%; --tp-r2:-8deg; --tp-x2:-5%; --tp-r3:5deg; --tp-x3:5%; --tp-r4:9deg; --tp-x4:8%; }
  [dir=rtl] .tp-fan{ --tp-r1:5deg; --tp-x1:4%; --tp-r2:8deg; --tp-x2:5%; --tp-r3:-5deg; --tp-x3:-5%; --tp-r4:-9deg; --tp-x4:-8%; }
  .tp-fan__card{ inset-inline-start:11%; width:69%; }
}
.tp-badge{ position:absolute; z-index:6; display:inline-flex; align-items:center; gap:8px; padding:10px 16px; border-radius:16px; font-size:13.5px; font-weight:700;
    background:var(--hm-card); border:1px solid var(--hm-line); box-shadow:0 18px 36px -20px rgba(0,0,0,.55); animation:hm-float 7s ease-in-out infinite; }
.tp-badge svg{ width:18px; height:18px; padding:3px; border-radius:50%; color:var(--hm-good); background:color-mix(in srgb,var(--hm-good) 15%,transparent); }
.tp-badge--a{ inset-block-start:0; inset-inline-end:0; }
.tp-badge--b{ inset-block-end:12%; inset-inline-end:-2%; animation-delay:-2.5s; }
.tp-badge--c{ inset-block-end:0; inset-inline-start:4%; animation-delay:-4.5s; }
.tp-badge--c b{ display:grid; place-items:center; width:24px; height:24px; border-radius:8px; color:var(--hm-gold); background:color-mix(in srgb,var(--hm-gold) 15%,transparent); }
.tp-mode{ position:relative; width:34px; height:20px; border-radius:99px; background:var(--hm-card-2); border:1px solid var(--hm-line); }
.tp-mode i{ position:absolute; inset-block-start:2px; inset-inline-start:2px; width:14px; height:14px; border-radius:50%; background:var(--hm-gold); animation:tp-toggle 4s ease-in-out infinite; }
@keyframes tp-toggle{ 0%,40%{ translate:0 0; } 50%,90%{ translate:calc(14px * var(--tp-dir,1)) 0; background:#5b6170; } 100%{ translate:0 0; } }
[dir=rtl] .tp-mode{ --tp-dir:-1; }

/* ── filter chips ── */
.tp-chips{ display:flex; flex-wrap:wrap; justify-content:center; gap:10px; margin:-12px 0 clamp(28px,4vw,44px); }
.tp-chip{ display:inline-flex; align-items:center; gap:8px; padding:10px 20px; border-radius:99px; font-size:14px; font-weight:700; text-decoration:none;
    color:var(--em-text); background:var(--hm-card); border:1px solid var(--hm-line); transition:border-color .25s, background-color .25s, transform .25s; }
.tp-chip:hover{ transform:translateY(-2px); border-color:color-mix(in srgb,var(--hm-gold) 50%,var(--hm-line)); }
.tp-chip.is-on{ color:var(--em-gold-ink); background:var(--hm-gold); border-color:var(--hm-gold); }
.tp-chip b{ font-size:12px; padding:1px 8px; border-radius:99px; background:color-mix(in srgb,currentColor 14%,transparent); }

/* ── showcase ── */
.tp-shot{ position:relative; display:block; border-radius:20px; overflow:hidden; background:var(--hm-card); border:1px solid var(--hm-line); text-decoration:none;
    box-shadow:0 30px 70px -40px rgba(0,0,0,.6); }
.tp-shot__bar{ display:flex; align-items:center; gap:6px; height:36px; padding-inline:14px; border-bottom:1px solid var(--hm-line); }
.tp-shot__bar i{ width:9px; height:9px; border-radius:50%; background:var(--hm-line); }
.tp-shot__bar em{ margin-inline-start:10px; padding:2px 12px; border-radius:99px; font-style:normal; font-size:11.5px; color:var(--em-muted); background:var(--hm-card-2); direction:ltr; }
.tp-shot img{ display:block; width:100%; aspect-ratio:3/2; object-fit:cover; object-position:top; transition:transform 1.2s cubic-bezier(.2,.8,.2,1); }
.tp-shot:hover img{ transform:scale(1.05); }
.tp-shot__go{ position:absolute; inset-block-end:14px; inset-inline-start:50%; translate:-50% 10px; display:inline-flex; align-items:center; gap:8px; padding:10px 18px;
    border-radius:99px; font-size:13.5px; font-weight:700; color:var(--em-gold-ink); background:var(--hm-gold); opacity:0; transition:opacity .3s, translate .35s cubic-bezier(.2,.8,.2,1); }
[dir=rtl] .tp-shot__go{ translate:50% 10px; }
.tp-shot__go svg{ width:15px; height:15px; }
.tp-shot:hover .tp-shot__go, .tp-shot:focus-visible .tp-shot__go{ opacity:1; translate:-50% 0; }
[dir=rtl] .tp-shot:hover .tp-shot__go, [dir=rtl] .tp-shot:focus-visible .tp-shot__go{ translate:50% 0; }
.tp-new{ position:absolute; inset-block-start:48px; inset-inline-end:12px; padding:4px 12px; border-radius:99px; font-size:12px; font-weight:800; color:var(--success-foreground); background:var(--hm-good); }
.tp-cat{ display:inline-block; padding:4px 12px; border-radius:99px; font-size:12px; font-weight:700; color:var(--hm-gold); background:color-mix(in srgb,var(--hm-gold) 13%,transparent); }

/* the first template, large */
.tp-feature{ display:grid; grid-template-columns:minmax(0,1.35fr) minmax(0,1fr); gap:clamp(24px,4vw,56px); align-items:center; padding:clamp(18px,2.5vw,28px);
    border-radius:32px; border:1px solid var(--hm-line);
    background:linear-gradient(135deg, var(--hm-card) 40%, color-mix(in srgb,var(--hm-gold) 9%,var(--hm-card))); }
@media (max-width:900px){ .tp-feature{ grid-template-columns:minmax(0,1fr); } }
.tp-feature__name{ margin:14px 0 0; font-size:clamp(21.5px,2.48vw,33px); font-weight:800; }
.tp-feature__desc{ margin:12px 0 0; font-size:14.5px; line-height:1.9; color:var(--em-muted); }
.tp-caps{ list-style:none; margin:18px 0 0; padding:0; display:flex; flex-wrap:wrap; gap:8px 16px; }
.tp-caps li{ display:inline-flex; align-items:center; gap:7px; font-size:13.5px; font-weight:600; }
.tp-caps svg{ width:16px; height:16px; padding:2px; border-radius:50%; color:var(--hm-good); background:color-mix(in srgb,var(--hm-good) 14%,transparent); }
.tp-price{ display:flex; align-items:baseline; gap:12px; margin-top:22px; padding-top:18px; border-top:1px dashed var(--hm-line); }
.tp-price span{ font-size:13px; color:var(--em-muted); } .tp-price b{ font-size:23px; font-weight:800; color:var(--hm-gold); }
.tp-price.is-free b{ color:var(--hm-good); }
.tp-btns{ display:flex; flex-wrap:wrap; gap:12px; margin-top:22px; }

/* the rest, in a grid */
.tp-grid{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:clamp(18px,2.5vw,28px); margin-top:clamp(18px,2.5vw,28px); }
@media (max-width:760px){ .tp-grid{ grid-template-columns:minmax(0,1fr); } }
.tp-card{ display:flex; flex-direction:column; border-radius:28px; padding:14px; background:var(--hm-card); border:1px solid var(--hm-line);
    transition:transform .4s cubic-bezier(.2,.8,.2,1), border-color .3s; }
.tp-card:hover{ transform:translateY(-6px); border-color:color-mix(in srgb,var(--hm-gold) 45%,var(--hm-line)); }
.tp-card .tp-shot{ box-shadow:none; }
.tp-card__body{ flex:1; display:flex; flex-direction:column; gap:10px; padding:16px 8px 6px; }   /* fills the card → the actions sit at the bottom of every card */
.tp-card__head{ display:flex; align-items:center; justify-content:space-between; gap:12px; }
.tp-card__head h3{ margin:0; font-size:16.5px; font-weight:800; }
.tp-card__body .tp-cat{ align-self:flex-start; }
/* two lines, always — so a short description does not make a shorter card */
.tp-card__body p{ margin:0; min-height:calc(2 * 1.85em); font-size:14px; line-height:1.85; color:var(--em-muted);
    display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.tp-price-pill{ flex:none; padding:5px 14px; border-radius:99px; font-size:13.5px; font-weight:800; color:var(--hm-gold); background:color-mix(in srgb,var(--hm-gold) 13%,transparent); }
.tp-price-pill.is-free{ color:color-mix(in srgb,var(--hm-good) 78%,var(--em-text)); background:color-mix(in srgb,var(--hm-good) 14%,transparent); }
/* the two actions — equal buttons pinned to the bottom (owner, 2026-10-05: «الجزء ده عاوز يتظبط والارتفاع متساوي») */
.tp-card__foot{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-top:auto; padding-top:14px; border-top:1px dashed var(--hm-line); }
.tp-link{ display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:46px; padding:0 14px; border-radius:14px;
    font-size:14px; font-weight:800; text-decoration:none; white-space:nowrap;
    color:var(--em-gold-ink); background:var(--hm-gold); border:1px solid var(--hm-gold);
    transition:transform .2s, background-color .2s, border-color .2s, color .2s; }
.tp-link:hover{ transform:translateY(-2px); background:color-mix(in srgb,var(--hm-gold) 88%,var(--em-text)); }
.tp-link svg{ width:15px; height:15px; flex:none; }
.tp-link--muted{ color:var(--em-text); background:transparent; border-color:var(--hm-line); }
.tp-link--muted:hover{ background:transparent; border-color:var(--hm-gold); color:var(--hm-gold); }
[dir=rtl] .tp-arr{ transform:scaleX(-1); }
.tp-empty{ text-align:center; padding:56px 20px; border-radius:28px; border:1px dashed var(--hm-line); }
.tp-empty h3{ margin:0; } .tp-empty p{ color:var(--em-muted); }

/* ── what every template includes ── */
.tp-inc__grid{ list-style:none; margin:0; padding:0; display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; }
@media (max-width:980px){ .tp-inc__grid{ grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:480px){ .tp-inc__grid{ grid-template-columns:minmax(0,1fr); } }
.tp-inc__item{ display:grid; gap:6px; padding:22px; border-radius:22px; background:var(--hm-card); border:1px solid var(--hm-line);
    transition:transform .35s cubic-bezier(.2,.8,.2,1), border-color .3s; }
.tp-inc__item:hover{ transform:translateY(-4px); border-color:color-mix(in srgb,var(--hm-gold) 45%,var(--hm-line)); }
.tp-inc__ico{ width:48px; height:48px; display:grid; place-items:center; margin-bottom:8px; border-radius:15px; color:var(--hm-gold);
    background:color-mix(in srgb,var(--hm-gold) 13%,transparent); animation:tp-ico 9s ease-in-out infinite; }
.tp-inc__item:nth-child(2) .tp-inc__ico{ animation-delay:1s; } .tp-inc__item:nth-child(3) .tp-inc__ico{ animation-delay:2s; } .tp-inc__item:nth-child(4) .tp-inc__ico{ animation-delay:3s; }
.tp-inc__item:nth-child(5) .tp-inc__ico{ animation-delay:4s; } .tp-inc__item:nth-child(6) .tp-inc__ico{ animation-delay:5s; } .tp-inc__item:nth-child(7) .tp-inc__ico{ animation-delay:6s; }
.tp-inc__item:nth-child(8) .tp-inc__ico{ animation-delay:7s; }
@keyframes tp-ico{ 0%,8%,100%{ transform:none; background:color-mix(in srgb,var(--hm-gold) 13%,transparent); color:var(--hm-gold); }
    3%,5%{ transform:translateY(-4px) rotate(-8deg); background:var(--hm-gold); color:var(--em-gold-ink); } }
.tp-inc__ico svg{ width:22px; height:22px; }
.tp-inc__item b{ font-size:14px; } .tp-inc__item small{ font-size:13.5px; line-height:1.7; color:var(--em-muted); }

/* ── customise: a drawn store recolours itself as swatches are picked ── */
.tp-cz__grid{ display:grid; grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr); gap:clamp(28px,5vw,72px); align-items:center; }
@media (max-width:900px){ .tp-cz__grid{ grid-template-columns:minmax(0,1fr); } }
.tp-cz__copy .hm-sub{ margin-inline:0; }
.tp-cz__stage{ display:grid; grid-template-columns:150px minmax(0,1fr); gap:16px; padding:18px; border-radius:30px; background:var(--hm-card); border:1px solid var(--hm-line);
    box-shadow:0 40px 80px -44px rgba(0,0,0,.6); }
@media (max-width:480px){ .tp-cz__stage{ grid-template-columns:minmax(0,1fr); } }
.tp-cz__panel{ display:grid; gap:10px; align-content:start; padding:14px; border-radius:18px; background:var(--hm-card-2); border:1px solid var(--hm-line); font-size:12.5px; }
.tp-cz__panel b{ color:var(--em-muted); font-weight:700; }
.tp-cz__sw{ display:flex; gap:8px; } .tp-cz__sw i{ width:24px; height:24px; border-radius:50%; outline:2px solid transparent; outline-offset:2px; transition:outline-color .3s, transform .3s; }
.tp-cz__sw i.is-on{ outline-color:var(--em-text); transform:scale(1.1); }
.tp-cz__sw [data-c=gold]{ background:#c9a24b; } .tp-cz__sw [data-c=blue]{ background:#3b82f6; } .tp-cz__sw [data-c=good]{ background:#22a06b; } .tp-cz__sw [data-c=rose]{ background:#e0577a; }
.tp-cz__fonts{ display:flex; gap:8px; } .tp-cz__fonts span{ flex:1; text-align:center; padding:6px; border-radius:10px; border:1px solid var(--hm-line); font-weight:800; }
.tp-cz__fonts span:last-child{ font-family:Georgia, serif; } .tp-cz__fonts span.is-on{ border-color:var(--em-text); }
.tp-cz__secs{ display:grid; gap:6px; } .tp-cz__secs i{ height:16px; border-radius:6px; background:var(--hm-line); }
.tp-cz__store{ --c:#c9a24b; display:grid; gap:12px; padding:14px; border-radius:18px; background:#f7f5f1; }
.tp-cz__store[data-c=blue]{ --c:#3b82f6; } .tp-cz__store[data-c=good]{ --c:#22a06b; } .tp-cz__store[data-c=rose]{ --c:#e0577a; }
.tp-cz__nav{ display:flex; align-items:center; gap:8px; } .tp-cz__nav i{ width:26px; height:26px; border-radius:8px; background:var(--c); transition:background-color .6s; }
.tp-cz__nav span{ width:40px; height:8px; border-radius:99px; background:#d8d4cc; } .tp-cz__nav span:first-of-type{ margin-inline-start:auto; }
.tp-cz__hero{ display:grid; gap:8px; align-content:center; min-height:130px; padding:18px; border-radius:14px; transition:background .6s;
    background:linear-gradient(120deg, color-mix(in srgb,var(--c) 22%,#fff), #fff 70%); }
.tp-cz__hero span{ width:62%; height:14px; border-radius:99px; background:#2a2620; } .tp-cz__hero span.is-short{ width:40%; height:9px; background:#9b958a; }
.tp-cz__hero em{ width:84px; height:26px; margin-top:6px; border-radius:99px; background:var(--c); transition:background-color .6s; }
.tp-cz__prods{ display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
.tp-cz__prods i{ aspect-ratio:1; border-radius:12px; background:#ebe7df; position:relative; }
.tp-cz__prods i::after{ content:''; position:absolute; inset-block-end:8px; inset-inline-start:8px; width:40%; height:7px; border-radius:99px; background:var(--c); transition:background-color .6s; }

@media (prefers-reduced-motion: reduce){
    .tp *, .tp *::before, .tp *::after{ animation:none !important; transition:none !important; }
}
