/* =========================================================================
   Dondon Studio — Template preview ("actual template" demos)
   ---------------------------------------------------------------------------
   Everything here is scoped under .tpl-detail (the preview page chrome) or
   .tpl-doc (a single rendered template). The .tpl-doc reset deliberately
   neutralises the studio's global styles (uppercase headings, faint links,
   Haffer font) so each template can look like a real, standalone site.
   Add a new template's theme by appending one ".tpl-<name>" block at the end.
   ========================================================================= */

/* ─── Detail page chrome ────────────────────────────────────────────────── */
.tpl-detail-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.2rem;
  flex-wrap: wrap;
  margin-bottom: 1.6rem;
}
.tpl-detail-head .tpl-meta { max-width: 640px; }
.tpl-detail-head h1 { margin-bottom: 0.5rem; }
.tpl-persona {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-faint);
}
.tpl-actions { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; }
.tpl-price { font-size: 1.3rem; }

/* Device toggle */
.tpl-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.device-toggle { display: inline-flex; border: 1px solid var(--color-border-hover); }
.device-toggle button {
  background: transparent;
  border: 0;
  color: var(--color-faint);
  padding: 0.55rem 1rem;
  font-family: inherit;
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .2s var(--ease-tab), color .2s var(--ease-tab);
}
.device-toggle button + button { border-left: 1px solid var(--color-border-hover); }
.device-toggle button.is-active { background: var(--color-surface-elevated); color: var(--color-white); }

/* ─── Browser frame ─────────────────────────────────────────────────────── */
.browser-frame {
  border: 1px solid var(--color-border-hover);
  background: #fff;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}
.browser-top {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.7rem 1rem;
  background: #1b1b1d;
  border-bottom: 1px solid rgba(0, 0, 0, 0.5);
}
.browser-dots { display: flex; gap: 0.45rem; flex-shrink: 0; }
.browser-dots i { width: 11px; height: 11px; border-radius: 50%; display: block; }
.browser-dots i:nth-child(1) { background: #ff5f57; }
.browser-dots i:nth-child(2) { background: #febc2e; }
.browser-dots i:nth-child(3) { background: #28c840; }
.browser-url {
  flex: 1;
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: #c9c9cf;
  background: #2a2a2e;
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0.35rem 0.9rem;
  max-width: 420px;
  margin: 0 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.browser-view {
  max-height: 72vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transition: max-width .35s var(--ease-tab);
}
/* Mobile preview mode constrains the canvas like a phone. */
.browser-frame.is-mobile .browser-view {
  max-width: 390px;
  margin: 0 auto;
  border-left: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
}

/* ─── Shared template reset (neutralise studio globals) ─────────────────── */
.tpl-doc, .tpl-doc * { box-sizing: border-box; margin: 0; padding: 0; }
.tpl-doc {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  line-height: 1.6;
  text-align: left;
  color: #1a1a1a;
  -webkit-font-smoothing: antialiased;
}
.tpl-doc h1, .tpl-doc h2, .tpl-doc h3, .tpl-doc h4 {
  text-transform: none;
  letter-spacing: normal;
  font-weight: 700;
  line-height: 1.15;
}
.tpl-doc a { color: inherit; text-decoration: none; cursor: pointer; }
.tpl-doc ul { list-style: none; }
.tpl-doc p { margin: 0; }
.tpl-doc img, .tpl-doc svg { display: block; max-width: 100%; }

/* =========================================================================
   THEME 1 — Developer portfolio (freelancer-portfolio)
   ========================================================================= */
.tpl-portfolio {
  background: #0d0d10;
  color: #e9e9ee;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.tpl-portfolio .p-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.4rem clamp(1.4rem, 5vw, 4rem);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  position: sticky; top: 0; background: rgba(13, 13, 16, 0.85); backdrop-filter: blur(8px);
}
.tpl-portfolio .p-logo { font-weight: 800; font-size: 1.05rem; letter-spacing: 0.02em; }
.tpl-portfolio .p-logo span { color: #6c8cff; }
.tpl-portfolio .p-nav nav { display: flex; gap: 1.6rem; }
.tpl-portfolio .p-nav nav a { font-size: 0.82rem; color: #9a9aa6; }
.tpl-portfolio .p-nav nav a:hover { color: #fff; }
.tpl-portfolio .p-hero {
  padding: clamp(3rem, 9vw, 6rem) clamp(1.4rem, 5vw, 4rem) clamp(2.5rem, 6vw, 4rem);
  max-width: 900px;
}
.tpl-portfolio .p-eyebrow {
  font-size: 0.78rem; letter-spacing: 0.04em; color: #6c8cff; margin-bottom: 1rem;
  text-transform: uppercase;
}
.tpl-portfolio .p-hero h1 {
  font-size: clamp(2.6rem, 8vw, 5rem); line-height: 1.02; margin-bottom: 1.1rem;
  background: linear-gradient(120deg, #fff 30%, #8aa0ff); -webkit-background-clip: text;
  background-clip: text; color: transparent;
}
.tpl-portfolio .p-lead { font-size: clamp(1.05rem, 2.5vw, 1.4rem); color: #b6b6c2; max-width: 540px; }
.tpl-portfolio .p-cta { display: flex; gap: 0.8rem; flex-wrap: wrap; margin: 1.8rem 0 2rem; }
.tpl-portfolio .p-btn {
  display: inline-block; padding: 0.85rem 1.5rem; font-size: 0.9rem; font-weight: 600;
  background: #6c8cff; color: #0b0b12; border-radius: 8px;
}
.tpl-portfolio .p-btn.ghost { background: transparent; color: #e9e9ee; border: 1px solid rgba(255, 255, 255, 0.18); }
.tpl-portfolio .p-stack { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tpl-portfolio .p-stack li {
  font-size: 0.78rem; color: #c7c7d2; border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.3rem 0.7rem; border-radius: 999px;
}
.tpl-portfolio .p-work { padding: 2rem clamp(1.4rem, 5vw, 4rem) 1rem; }
.tpl-portfolio .p-work h2 { font-size: 1.6rem; margin-bottom: 1.4rem; }
.tpl-portfolio .p-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.1rem; }
.tpl-portfolio .p-proj {
  border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 12px; overflow: hidden;
  background: #15151b; transition: transform .25s ease, border-color .25s ease;
}
.tpl-portfolio .p-proj:hover { transform: translateY(-4px); border-color: rgba(108, 140, 255, 0.5); }
.tpl-portfolio .p-shot { height: 120px; }
.tpl-portfolio .p-shot.s1 { background: linear-gradient(135deg, #243b86, #4f6cf7); }
.tpl-portfolio .p-shot.s2 { background: linear-gradient(135deg, #3a2b6b, #8a5cf6); }
.tpl-portfolio .p-shot.s3 { background: linear-gradient(135deg, #0d5c4a, #2bd4a2); }
.tpl-portfolio .p-shot.s4 { background: linear-gradient(135deg, #6b3a2b, #f7a14f); }
.tpl-portfolio .p-proj h3 { font-size: 1.05rem; margin: 0.9rem 1rem 0.3rem; }
.tpl-portfolio .p-proj p { font-size: 0.82rem; color: #9a9aa6; margin: 0 1rem 1rem; }
.tpl-portfolio .p-contact {
  text-align: center; padding: clamp(3rem, 7vw, 5rem) 1.4rem; margin-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.tpl-portfolio .p-contact h2 { font-size: clamp(1.8rem, 5vw, 2.8rem); margin-bottom: 0.8rem; }
.tpl-portfolio .p-contact p { color: #8aa0ff; font-size: 1.05rem; margin-bottom: 1.4rem; }
.tpl-portfolio .p-foot { text-align: center; padding: 1.6rem; font-size: 0.78rem; color: #6c6c78; }

/* =========================================================================
   THEME 2 — Elegant wedding (wedding-elegant)
   ========================================================================= */
.tpl-wedding {
  background: #faf6f0;
  color: #3a352f;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  text-align: center;
}
.tpl-wedding h1, .tpl-wedding h2 { font-weight: 500; }
.tpl-wedding .w-hero { padding: clamp(3.5rem, 9vw, 6rem) 1.5rem clamp(2.5rem, 6vw, 4rem); }
.tpl-wedding .w-eyebrow {
  font-size: 0.8rem; letter-spacing: 0.35em; text-transform: uppercase; color: #b08d57;
  margin-bottom: 1.4rem;
}
.tpl-wedding .w-hero h1 { font-size: clamp(2.8rem, 10vw, 5.5rem); line-height: 1.05; color: #2c2620; }
.tpl-wedding .w-hero h1 span { display: inline-block; margin: 0 0.4rem; color: #b08d57; font-style: italic; }
.tpl-wedding .w-date { margin: 1.4rem 0 2rem; font-size: 1.05rem; letter-spacing: 0.04em; color: #6c655c; }
.tpl-wedding .w-btn {
  display: inline-block; padding: 0.85rem 2.4rem; font-size: 0.78rem; letter-spacing: 0.25em;
  text-transform: uppercase; color: #faf6f0; background: #b08d57;
}
.tpl-wedding .w-btn:hover { background: #9a7a47; }
.tpl-wedding .w-story, .tpl-wedding .w-schedule { padding: clamp(2.5rem, 6vw, 4rem) 1.5rem; max-width: 640px; margin: 0 auto; }
.tpl-wedding .w-story { border-top: 1px solid #e7ddd0; }
.tpl-wedding h2 { font-size: clamp(1.6rem, 4vw, 2.4rem); color: #2c2620; margin-bottom: 1.2rem; }
.tpl-wedding .w-story p { color: #6c655c; font-size: 1.1rem; line-height: 1.9; }
.tpl-wedding .w-schedule { border-top: 1px solid #e7ddd0; }
.tpl-wedding .w-schedule ul { display: inline-flex; flex-direction: column; gap: 0.9rem; text-align: left; }
.tpl-wedding .w-schedule li { font-size: 1.05rem; color: #4a443c; display: flex; gap: 1rem; }
.tpl-wedding .w-schedule li span { color: #b08d57; min-width: 5.5rem; font-variant-numeric: tabular-nums; }
.tpl-wedding .w-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; padding: 0.5rem; }
.tpl-wedding .w-shot { aspect-ratio: 3 / 4; }
.tpl-wedding .w-shot.g1 { background: linear-gradient(160deg, #e8d8c2, #cbb38c); }
.tpl-wedding .w-shot.g2 { background: linear-gradient(160deg, #d8c8be, #a98f7c); }
.tpl-wedding .w-shot.g3 { background: linear-gradient(160deg, #e3d3cf, #b89aa0); }
.tpl-wedding .w-foot { padding: 2.2rem 1.5rem; font-size: 0.82rem; letter-spacing: 0.08em; color: #8a8076; }

/* =========================================================================
   THEME 3 — Local business landing (local-business)
   ========================================================================= */
.tpl-business {
  background: #ffffff;
  color: #1f2933;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.tpl-business .b-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem clamp(1.4rem, 5vw, 3.5rem); border-bottom: 1px solid #e6ebf0;
  position: sticky; top: 0; background: #fff;
}
.tpl-business .b-logo { font-weight: 800; font-size: 1.1rem; color: #0f3d5c; }
.tpl-business .b-call { font-weight: 600; color: #0a7d4d; font-size: 0.92rem; }
.tpl-business .b-hero {
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 2rem; align-items: center;
  padding: clamp(2.5rem, 6vw, 4.5rem) clamp(1.4rem, 5vw, 3.5rem);
  background: linear-gradient(160deg, #f3f8fb, #ffffff);
}
.tpl-business .b-eyebrow {
  font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: #0a7d4d;
  font-weight: 700; margin-bottom: 0.8rem;
}
.tpl-business .b-hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); color: #0f3d5c; line-height: 1.1; margin-bottom: 1rem; }
.tpl-business .b-lead { font-size: 1.05rem; color: #52606d; max-width: 460px; margin-bottom: 1.6rem; }
.tpl-business .b-cta { display: flex; gap: 0.8rem; flex-wrap: wrap; }
.tpl-business .b-btn {
  display: inline-block; padding: 0.85rem 1.6rem; font-size: 0.92rem; font-weight: 700;
  background: #0a7d4d; color: #fff; border-radius: 6px;
}
.tpl-business .b-btn.ghost { background: transparent; color: #0f3d5c; border: 1px solid #c3d0da; }
.tpl-business .b-card { background: #fff; border: 1px solid #e6ebf0; border-radius: 12px; padding: 1.6rem; box-shadow: 0 18px 40px rgba(15, 61, 92, 0.08); }
.tpl-business .b-card h3 { color: #0f3d5c; font-size: 1.1rem; margin-bottom: 1rem; }
.tpl-business .b-card ul { display: flex; flex-direction: column; gap: 0.6rem; }
.tpl-business .b-card li { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.92rem; color: #3e4c59; }
.tpl-business .b-card li span { color: #0a7d4d; font-weight: 600; }
.tpl-business .b-addr { margin-top: 1rem; font-size: 0.85rem; color: #7b8794; }
.tpl-business .b-services { padding: clamp(2.5rem, 6vw, 4rem) clamp(1.4rem, 5vw, 3.5rem); }
.tpl-business .b-services h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); color: #0f3d5c; margin-bottom: 1.6rem; }
.tpl-business .b-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1rem; }
.tpl-business .b-svc { border: 1px solid #e6ebf0; border-radius: 10px; padding: 1.3rem; transition: transform .2s ease, box-shadow .2s ease; }
.tpl-business .b-svc:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(15, 61, 92, 0.1); }
.tpl-business .b-svc span { font-size: 1.6rem; }
.tpl-business .b-svc h3 { color: #0f3d5c; font-size: 1.05rem; margin: 0.6rem 0 0.3rem; }
.tpl-business .b-svc p { font-size: 0.88rem; color: #52606d; }
.tpl-business .b-foot { background: #0f3d5c; color: #cfe0ec; text-align: center; padding: 1.6rem; font-size: 0.85rem; }
.tpl-business .b-foot span { font-weight: 700; color: #fff; }

/* ─── Responsive: previews collapse gracefully (also used by mobile mode) ── */
@media (max-width: 760px) {
  .tpl-business .b-hero { grid-template-columns: 1fr; }
}
.browser-frame.is-mobile .tpl-business .b-hero { grid-template-columns: 1fr; }
.browser-frame.is-mobile .tpl-portfolio .p-nav nav,
.browser-frame.is-mobile .tpl-business .b-call { display: none; }
.browser-frame.is-mobile .tpl-wedding .w-gallery { grid-template-columns: 1fr 1fr; }

/* =========================================================================
   "What you get" deliverable panel (studio chrome on the detail page)
   ========================================================================= */
.tpl-deliverable {
  margin-top: 2.5rem;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  padding: clamp(1.5rem, 4vw, 2.4rem);
}
.tpl-deliverable-title { font-size: 1.3rem; margin-bottom: 1.4rem; }
.tpl-deliverable-list {
  list-style: none; padding: 0; margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 1.2rem;
}
.tpl-deliverable-list li { display: flex; gap: 0.8rem; align-items: flex-start; }
.tpl-deliverable-list .d-ic { font-size: 1.4rem; line-height: 1; flex-shrink: 0; }
.tpl-deliverable-list h3 {
  font-size: 0.95rem; text-transform: none; letter-spacing: 0;
  font-weight: 500; margin-bottom: 0.25rem;
}
.tpl-deliverable-list p { font-size: 0.85rem; color: var(--color-muted); font-weight: 300; margin: 0; }
.tpl-deliverable-note { margin: 1.6rem 0 0; font-size: 0.8rem; }

/* =========================================================================
   THEME 4 — Online store · add to cart (shop-storefront)
   ========================================================================= */
.tpl-shop {
  background: #ffffff; color: #1f2430;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  position: relative;
}
.tpl-shop .s-nav {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem clamp(1.2rem, 4vw, 2.5rem); border-bottom: 1px solid #eee;
  position: sticky; top: 0; background: #fff; z-index: 5;
}
.tpl-shop .s-logo { font-weight: 800; font-size: 1.1rem; color: #e0467c; letter-spacing: 0.02em; }
.tpl-shop .s-links { display: flex; gap: 1.3rem; }
.tpl-shop .s-links a { font-size: 0.85rem; color: #4a5060; }
.tpl-shop .s-links a:hover { color: #e0467c; }
.tpl-shop .s-cart-wrap { position: relative; }
.tpl-shop .s-cart-btn {
  position: relative; background: #fff0f5; border: 1px solid #f4c6d8; color: #e0467c;
  width: 42px; height: 42px; border-radius: 10px; font-size: 1.1rem; cursor: pointer;
  display: grid; place-items: center;
}
.tpl-shop .s-badge {
  position: absolute; top: -7px; right: -7px; min-width: 19px; height: 19px; padding: 0 5px;
  background: #e0467c; color: #fff; border-radius: 999px; font-size: 0.68rem; font-weight: 700;
  display: grid; place-items: center; opacity: 0; transform: scale(0.6);
  transition: opacity .2s ease, transform .2s ease;
}
.tpl-shop .s-badge.has { opacity: 1; transform: scale(1); }
.tpl-shop .s-cart {
  position: absolute; right: 0; top: calc(100% + 10px); width: min(330px, 86vw);
  background: #fff; border: 1px solid #eee; border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.18); padding: 1.1rem;
  opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s; z-index: 20;
}
.tpl-shop .s-cart.open {
  opacity: 1; visibility: visible; transform: translateY(0);
  transition: opacity .2s ease, transform .2s ease;
}
.tpl-shop .s-cart h4 { font-size: 0.95rem; margin-bottom: 0.8rem; }
.tpl-shop .s-cart-items { display: flex; flex-direction: column; gap: 0.7rem; max-height: 240px; overflow-y: auto; }
.tpl-shop .s-empty { color: #99a0ad; font-size: 0.85rem; text-align: center; padding: 1rem 0; }
.tpl-shop .s-line { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 0.5rem; font-size: 0.82rem; }
.tpl-shop .s-line-name { color: #2b2f3a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpl-shop .s-line-controls { display: inline-flex; align-items: center; gap: 0.35rem; }
.tpl-shop .s-qty {
  width: 24px; height: 24px; border: 1px solid #e2c2cf; background: #fff5f8; color: #e0467c;
  border-radius: 6px; cursor: pointer; font-size: 0.95rem; line-height: 1; display: grid; place-items: center;
}
.tpl-shop .s-line-qty { min-width: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.tpl-shop .s-line-price { font-weight: 700; color: #1f2430; min-width: 60px; text-align: right; font-variant-numeric: tabular-nums; }
.tpl-shop .s-cart-foot {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-top: 0.9rem; padding-top: 0.8rem; border-top: 1px solid #eee; font-size: 0.9rem;
}
.tpl-shop .s-checkout {
  display: block; text-align: center; margin-top: 0.9rem; background: #e0467c; color: #fff;
  padding: 0.7rem; border-radius: 8px; font-weight: 700; font-size: 0.85rem;
}
.tpl-shop .s-hero { padding: clamp(2rem, 6vw, 3.5rem) clamp(1.2rem, 4vw, 2.5rem); background: linear-gradient(160deg, #fff0f5, #fff); }
.tpl-shop .s-eyebrow { font-size: 0.78rem; color: #e0467c; font-weight: 600; margin-bottom: 0.6rem; }
.tpl-shop .s-hero h1 { font-size: clamp(1.8rem, 5vw, 3rem); color: #1f2430; margin-bottom: 0.7rem; }
.tpl-shop .s-lead { color: #586074; max-width: 460px; }
.tpl-shop .s-shop { padding: clamp(1.8rem, 5vw, 3rem) clamp(1.2rem, 4vw, 2.5rem); }
.tpl-shop .s-shop h2 { font-size: 1.4rem; margin-bottom: 1.3rem; }
.tpl-shop .s-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 1.1rem; }
.tpl-shop .s-card {
  border: 1px solid #eee; border-radius: 12px; overflow: hidden; display: flex; flex-direction: column;
  transition: box-shadow .2s ease, transform .2s ease;
}
.tpl-shop .s-card:hover { box-shadow: 0 16px 36px rgba(224,70,124,0.14); transform: translateY(-3px); }
.tpl-shop .s-shot { height: 130px; }
.tpl-shop .s-shot.s1 { background: linear-gradient(135deg, #6f4e2e, #c79a5b); }
.tpl-shop .s-shot.s2 { background: linear-gradient(135deg, #d98324, #f4c542); }
.tpl-shop .s-shot.s3 { background: linear-gradient(135deg, #c4541d, #f6a04f); }
.tpl-shop .s-shot.s4 { background: linear-gradient(135deg, #2e6f5a, #66c2a4); }
.tpl-shop .s-shot.s5 { background: linear-gradient(135deg, #7a5b3a, #b89a6e); }
.tpl-shop .s-shot.s6 { background: linear-gradient(135deg, #8a3b2e, #d9785f); }
.tpl-shop .s-card h3 { font-size: 0.92rem; margin: 0.8rem 0.9rem 0.4rem; line-height: 1.3; }
.tpl-shop .s-card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding: 0 0.9rem 0.9rem; }
.tpl-shop .s-price { font-weight: 800; color: #1f2430; font-size: 0.95rem; }
.tpl-shop .s-add {
  background: #e0467c; color: #fff; border: 0; padding: 0.5rem 0.9rem; border-radius: 8px;
  font-size: 0.78rem; font-weight: 700; cursor: pointer; transition: filter .15s ease;
}
.tpl-shop .s-add:hover { filter: brightness(1.08); }
.tpl-shop .s-foot { background: #1f2430; color: #c3c8d4; text-align: center; padding: 1.4rem; font-size: 0.82rem; }

/* =========================================================================
   THEME 5 — Inventory & catalog dashboard (inventory-catalog)
   ========================================================================= */
.tpl-inventory {
  background: #f7f8fb; color: #1c2230;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.tpl-inventory .i-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem clamp(1.2rem, 4vw, 2.2rem); background: #fff; border-bottom: 1px solid #e8eaf0;
}
.tpl-inventory .i-logo { font-weight: 800; font-size: 1.05rem; color: #1c2230; display: inline-flex; align-items: center; gap: 0.5rem; }
.tpl-inventory .i-tag {
  font-size: 0.6rem; letter-spacing: 0.12em; text-transform: uppercase;
  background: #ece8ff; color: #7c5cff; padding: 0.2rem 0.5rem; border-radius: 5px; font-weight: 700;
}
.tpl-inventory .i-user { font-size: 0.82rem; color: #6b7280; }
.tpl-inventory .i-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; padding: clamp(1.2rem, 4vw, 1.8rem) clamp(1.2rem, 4vw, 2.2rem) 0; }
.tpl-inventory .i-stat { background: #fff; border: 1px solid #e8eaf0; border-radius: 12px; padding: 1rem 1.2rem; display: flex; flex-direction: column; gap: 0.2rem; }
.tpl-inventory .i-stat-val { font-size: 1.6rem; font-weight: 800; color: #1c2230; }
.tpl-inventory .i-stat-label { font-size: 0.74rem; color: #6b7280; text-transform: uppercase; letter-spacing: 0.06em; }
.tpl-inventory .i-toolbar { display: flex; gap: 0.8rem; flex-wrap: wrap; align-items: center; padding: clamp(1.2rem, 4vw, 1.6rem) clamp(1.2rem, 4vw, 2.2rem); }
.tpl-inventory .i-search {
  flex: 1 1 220px; padding: 0.7rem 0.9rem; border: 1px solid #d9dce6; border-radius: 9px;
  font-size: 0.9rem; background: #fff; color: #1c2230;
}
.tpl-inventory .i-search:focus { outline: none; border-color: #7c5cff; box-shadow: 0 0 0 3px rgba(124,92,255,0.15); }
.tpl-inventory .i-chips { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.tpl-inventory .i-chip {
  background: #fff; border: 1px solid #d9dce6; color: #4a5060; padding: 0.5rem 0.9rem;
  border-radius: 999px; font-size: 0.78rem; cursor: pointer; transition: all .15s ease;
}
.tpl-inventory .i-chip:hover { border-color: #7c5cff; color: #7c5cff; }
.tpl-inventory .i-chip.on { background: #7c5cff; border-color: #7c5cff; color: #fff; }
.tpl-inventory .i-table { padding: 0 clamp(1.2rem, 4vw, 2.2rem) clamp(1.5rem, 4vw, 2.2rem); }
.tpl-inventory .i-head, .tpl-inventory .i-row { display: grid; grid-template-columns: 1fr auto 130px; gap: 1rem; align-items: center; }
.tpl-inventory .i-head { padding: 0.6rem 1rem; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: #9099a8; }
.tpl-inventory .i-rows { display: flex; flex-direction: column; gap: 0.5rem; }
.tpl-inventory .i-row { background: #fff; border: 1px solid #e8eaf0; border-radius: 10px; padding: 0.8rem 1rem; }
.tpl-inventory .i-info { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.tpl-inventory .i-name { font-weight: 600; font-size: 0.9rem; color: #1c2230; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpl-inventory .i-sub { font-size: 0.74rem; color: #8a92a3; }
.tpl-inventory .i-price { font-weight: 700; font-variant-numeric: tabular-nums; color: #1c2230; }
.tpl-inventory .i-stock {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  text-align: center; padding: 0.35rem 0.5rem; border-radius: 7px; white-space: nowrap;
}
.tpl-inventory .i-stock.in { background: #e3f7ee; color: #0a9d5c; }
.tpl-inventory .i-stock.low { background: #fff4e0; color: #c77b13; }
.tpl-inventory .i-stock.out { background: #fde8e8; color: #d64545; }
.tpl-inventory .i-empty { text-align: center; color: #9099a8; padding: 2rem; font-size: 0.9rem; }
.tpl-inventory .i-foot { text-align: center; padding: 1.3rem; font-size: 0.8rem; color: #8a92a3; }

/* ─── Shop + inventory: responsive (real phones AND the Mobile toggle) ───── */
@media (max-width: 600px) {
  .tpl-inventory .i-stats { grid-template-columns: 1fr; }
  .tpl-inventory .i-head { display: none; }
  .tpl-inventory .i-row { grid-template-columns: 1fr auto; row-gap: 0.5rem; }
  .tpl-inventory .i-stock { grid-column: 1 / -1; justify-self: start; text-align: left; }
}
.browser-frame.is-mobile .tpl-shop .s-links { display: none; }
.browser-frame.is-mobile .tpl-inventory .i-stats { grid-template-columns: 1fr; }
.browser-frame.is-mobile .tpl-inventory .i-head { display: none; }
.browser-frame.is-mobile .tpl-inventory .i-row { grid-template-columns: 1fr auto; row-gap: 0.5rem; }
.browser-frame.is-mobile .tpl-inventory .i-stock { grid-column: 1 / -1; justify-self: start; text-align: left; }

/* =========================================================================
   Preview motion — entrance animations + tactile interactions
   ---------------------------------------------------------------------------
   The preview is re-rendered each time a template page opens, so these
   animations play on mount and make every template feel alive. Interactive
   bits (cart badge, search results, button presses) animate too. All of it
   is disabled under prefers-reduced-motion.
   ========================================================================= */
@keyframes tpl-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes tpl-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes tpl-pop  { 0% { transform: scale(1); } 40% { transform: scale(1.4); } 100% { transform: scale(1); } }

/* Top-level blocks rise in with a gentle stagger. */
.tpl-doc > * { animation: tpl-rise .6s cubic-bezier(.2, .7, .2, 1) both; }
.tpl-doc > *:nth-child(1) { animation-delay: .02s; }
.tpl-doc > *:nth-child(2) { animation-delay: .10s; }
.tpl-doc > *:nth-child(3) { animation-delay: .18s; }
.tpl-doc > *:nth-child(4) { animation-delay: .26s; }
.tpl-doc > *:nth-child(5) { animation-delay: .34s; }
.tpl-doc > *:nth-child(6) { animation-delay: .42s; }
/* Sticky headers fade only (a transform would break position: sticky). */
.tpl-doc > header { animation-name: tpl-fade; animation-delay: 0s; }

/* Static cards/tiles cascade in just after their section. */
.tpl-portfolio .p-proj,
.tpl-shop .s-card,
.tpl-business .b-svc,
.tpl-wedding .w-shot { animation: tpl-rise .5s cubic-bezier(.2, .7, .2, 1) both; }
.tpl-portfolio .p-proj:nth-child(1), .tpl-shop .s-card:nth-child(1),
.tpl-business .b-svc:nth-child(1), .tpl-wedding .w-shot:nth-child(1) { animation-delay: .30s; }
.tpl-portfolio .p-proj:nth-child(2), .tpl-shop .s-card:nth-child(2),
.tpl-business .b-svc:nth-child(2), .tpl-wedding .w-shot:nth-child(2) { animation-delay: .38s; }
.tpl-portfolio .p-proj:nth-child(3), .tpl-shop .s-card:nth-child(3),
.tpl-business .b-svc:nth-child(3), .tpl-wedding .w-shot:nth-child(3) { animation-delay: .46s; }
.tpl-portfolio .p-proj:nth-child(4), .tpl-shop .s-card:nth-child(4),
.tpl-business .b-svc:nth-child(4) { animation-delay: .54s; }
.tpl-shop .s-card:nth-child(5) { animation-delay: .62s; }
.tpl-shop .s-card:nth-child(6) { animation-delay: .70s; }

/* Live search results fade as the list updates — reinforces the "live" feel. */
.tpl-inventory .i-row { animation: tpl-fade .22s ease both; transition: border-color .15s ease, box-shadow .15s ease; }
.tpl-inventory .i-row:hover { border-color: #cdbcff; box-shadow: 0 8px 20px rgba(124, 92, 255, 0.10); }

/* Cart badge pops when the count changes (class toggled in JS). */
.tpl-shop .s-badge.bump { animation: tpl-pop .3s ease; }

/* Tactile press feedback on the obvious controls. */
.tpl-shop .s-add:active, .tpl-shop .s-qty:active,
.tpl-shop .s-checkout:active, .tpl-inventory .i-chip:active { transform: scale(.94); }

/* Real small screens: match the Mobile-toggle layout so phones look clean too. */
@media (max-width: 600px) {
  .tpl-portfolio .p-nav nav,
  .tpl-business .b-call,
  .tpl-shop .s-links { display: none; }
  .tpl-wedding .w-gallery { grid-template-columns: 1fr 1fr; }
}

/* Don't leave hover lifts "stuck" on touch devices. */
@media (hover: none) {
  .tpl-portfolio .p-proj:hover,
  .tpl-shop .s-card:hover,
  .tpl-business .b-svc:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .tpl-doc > *,
  .tpl-portfolio .p-proj, .tpl-shop .s-card, .tpl-business .b-svc,
  .tpl-wedding .w-shot, .tpl-inventory .i-row, .tpl-shop .s-badge.bump {
    animation: none !important;
  }
}

/* =========================================================================
   THEME 6 — Link in bio (link-in-bio) · free, light/dark
   ========================================================================= */
.tpl-linkbio {
  --lb-accent: #6c5ce7;
  --lb-accent-soft: #a29bfe;
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: clamp(1.5rem, 5vw, 3rem) 1.2rem;
  background:
    radial-gradient(900px 500px at 8% -10%, #f0ecff, transparent 60%),
    radial-gradient(800px 450px at 110% 8%, #eafff6, transparent 55%),
    #eef1ff;
  transition: background .4s ease, color .3s ease;
}
.tpl-linkbio.lb-dark {
  color: #f0f0f6;
  background:
    radial-gradient(900px 500px at 8% -10%, #1b1530, transparent 60%),
    radial-gradient(800px 450px at 110% 8%, #102025, transparent 55%),
    #14131f;
}
.tpl-linkbio .lb-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(20, 20, 50, 0.08);
  border-radius: 26px;
  box-shadow: 0 30px 70px rgba(40, 30, 90, 0.16);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  padding: 2rem 1.5rem 1.2rem;
}
.tpl-linkbio.lb-dark .lb-card { background: rgba(28, 27, 42, 0.74); border-color: rgba(255, 255, 255, 0.08); box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5); }
.tpl-linkbio .lb-toggle {
  position: absolute; top: 0.9rem; right: 0.9rem; width: 36px; height: 36px;
  display: grid; place-items: center; border-radius: 50%; cursor: pointer;
  background: #fff; border: 1px solid rgba(20, 20, 50, 0.1); font-size: 0.95rem;
  transition: transform .2s ease, background .2s ease;
}
.tpl-linkbio .lb-toggle:hover { transform: rotate(-12deg) scale(1.08); }
.tpl-linkbio.lb-dark .lb-toggle { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.12); }
.tpl-linkbio .lb-profile { text-align: center; }
.tpl-linkbio .lb-avatar {
  width: 84px; height: 84px; margin: 0 auto 0.9rem; display: grid; place-items: center;
  border-radius: 50%; background: linear-gradient(135deg, var(--lb-accent), var(--lb-accent-soft));
  color: #fff; font-size: 1.7rem; font-weight: 700; box-shadow: 0 12px 28px rgba(108, 92, 231, 0.35);
}
.tpl-linkbio .lb-name { font-size: 1.4rem; font-weight: 700; color: #1d1d2b; }
.tpl-linkbio.lb-dark .lb-name { color: #f0f0f6; }
.tpl-linkbio .lb-tagline { color: #6a6a7e; font-size: 0.9rem; margin: 0.45rem auto 0; max-width: 300px; line-height: 1.5; }
.tpl-linkbio.lb-dark .lb-tagline { color: #a7a7bd; }
.tpl-linkbio .lb-socials { display: flex; justify-content: center; gap: 0.5rem; margin-top: 1rem; }
.tpl-linkbio .lb-socials a {
  width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%;
  color: #1d1d2b; background: #fff; border: 1px solid rgba(20, 20, 50, 0.1); font-size: 1rem;
  cursor: pointer; transition: transform .18s ease, color .18s ease, border-color .18s ease;
}
.tpl-linkbio .lb-socials a:hover { transform: translateY(-3px); color: var(--lb-accent); border-color: var(--lb-accent-soft); }
.tpl-linkbio.lb-dark .lb-socials a { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.12); color: #f0f0f6; }
.tpl-linkbio .lb-tabs {
  display: flex; gap: 0.3rem; margin: 1.4rem auto 1.1rem; padding: 0.28rem; width: max-content;
  background: #fff; border: 1px solid rgba(20, 20, 50, 0.1); border-radius: 999px;
}
.tpl-linkbio.lb-dark .lb-tabs { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.12); }
.tpl-linkbio .lb-tab {
  border: 0; background: transparent; color: #6a6a7e; font: inherit; font-size: 0.82rem;
  font-weight: 600; padding: 0.45rem 1.3rem; border-radius: 999px; cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.tpl-linkbio .lb-tab.on { background: var(--lb-accent); color: #fff; }
.tpl-linkbio .lb-panel { display: none; }
.tpl-linkbio .lb-panel.on { display: block; animation: tpl-fade .3s ease both; }
.tpl-linkbio .lb-links { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; }
.tpl-linkbio .lb-link {
  display: flex; align-items: center; gap: 0.7rem; padding: 0.85rem 1rem; border-radius: 16px;
  color: #1d1d2b; font-weight: 600; font-size: 0.92rem; background: #fff;
  border: 1px solid rgba(20, 20, 50, 0.1); cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.tpl-linkbio .lb-link:hover { transform: translateY(-2px); box-shadow: 0 12px 24px rgba(40, 30, 90, 0.12); }
.tpl-linkbio.lb-dark .lb-link { background: rgba(255, 255, 255, 0.04); border-color: rgba(255, 255, 255, 0.1); color: #f0f0f6; }
.tpl-linkbio .lb-emoji { font-size: 1.1rem; }
.tpl-linkbio .lb-label { flex: 1; }
.tpl-linkbio .lb-go { color: var(--lb-accent); transition: transform .18s ease; }
.tpl-linkbio .lb-link:hover .lb-go { transform: translateX(4px); }
.tpl-linkbio .lb-about { color: #6a6a7e; line-height: 1.7; font-size: 0.92rem; padding: 0.2rem; }
.tpl-linkbio .lb-about + .lb-about { margin-top: 0.8rem; }
.tpl-linkbio.lb-dark .lb-about { color: #a7a7bd; }
.tpl-linkbio .lb-foot { margin-top: 1.4rem; text-align: center; font-size: 0.76rem; color: #6a6a7e; }
.tpl-linkbio.lb-dark .lb-foot { color: #a7a7bd; }

/* =========================================================================
   THEME 7 — Coming soon / launch (coming-soon) · free with Pro
   ========================================================================= */
.tpl-coming {
  position: relative; overflow: hidden; min-height: 100%;
  display: grid; place-items: center; text-align: center;
  padding: clamp(2.5rem, 8vw, 5rem) 1.4rem; color: #eef0ff;
  background:
    radial-gradient(800px 500px at 15% 10%, #2a1f5c, transparent 60%),
    radial-gradient(700px 500px at 100% 90%, #0f3a4a, transparent 55%),
    #0c0b1a;
}
.tpl-coming::before, .tpl-coming::after {
  content: ''; position: absolute; border-radius: 50%; filter: blur(40px); opacity: 0.5; pointer-events: none;
}
.tpl-coming::before { width: 260px; height: 260px; background: #6c5ce7; top: -60px; left: -40px; }
.tpl-coming::after { width: 240px; height: 240px; background: #1fb6a6; bottom: -70px; right: -30px; }
.tpl-coming .cs-inner { position: relative; z-index: 1; max-width: 520px; }
.tpl-coming .cs-brand { font-weight: 800; letter-spacing: 0.4em; font-size: 0.9rem; color: #cdd2ff; }
.tpl-coming .cs-eyebrow { margin-top: 1.6rem; font-size: 0.8rem; letter-spacing: 0.18em; text-transform: uppercase; color: #9aa0e0; }
.tpl-coming .cs-title {
  font-size: clamp(2rem, 7vw, 3.4rem); line-height: 1.05; margin: 0.6rem 0 0.8rem;
  background: linear-gradient(120deg, #fff, #b9a6ff); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.tpl-coming .cs-lead { color: #b8bce0; font-size: 1.02rem; max-width: 420px; margin: 0 auto; }
.tpl-coming .cs-count { display: flex; justify-content: center; gap: 0.7rem; margin: 2rem 0; }
.tpl-coming .cs-unit {
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px; padding: 0.9rem 0.6rem; min-width: 68px; backdrop-filter: blur(6px);
}
.tpl-coming .cs-num { display: block; font-size: 1.9rem; font-weight: 800; font-variant-numeric: tabular-nums; color: #fff; }
.tpl-coming .cs-label { font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; color: #9aa0e0; }
.tpl-coming .cs-form { display: flex; gap: 0.5rem; max-width: 400px; margin: 0 auto; }
.tpl-coming .cs-input {
  flex: 1; padding: 0.8rem 1rem; border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06); color: #fff; font-size: 0.92rem;
}
.tpl-coming .cs-input::placeholder { color: #8a8fbf; }
.tpl-coming .cs-input:focus { outline: none; border-color: #a29bfe; box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.3); }
.tpl-coming .cs-btn {
  padding: 0.8rem 1.3rem; border: 0; border-radius: 10px; color: #fff; font-weight: 700; font-size: 0.9rem;
  background: linear-gradient(120deg, #6c5ce7, #a29bfe); cursor: pointer; transition: filter .15s ease, transform .15s ease;
}
.tpl-coming .cs-btn:hover { filter: brightness(1.08); }
.tpl-coming .cs-btn:active { transform: scale(.96); }
.tpl-coming .cs-thanks {
  max-width: 400px; margin: 0 auto; padding: 0.85rem; border-radius: 10px; font-weight: 600;
  background: rgba(108, 92, 231, 0.18); border: 1px solid rgba(162, 155, 254, 0.4); color: #e6e3ff;
}
.tpl-coming .cs-note { margin-top: 1rem; font-size: 0.78rem; color: #8a8fbf; }

/* Free-template previews: responsive (real phones + the Mobile toggle) */
@media (max-width: 600px) {
  .tpl-coming .cs-form { flex-direction: column; }
  .tpl-coming .cs-unit { min-width: 60px; padding: 0.7rem 0.5rem; }
  .tpl-coming .cs-num { font-size: 1.5rem; }
}
.browser-frame.is-mobile .tpl-coming .cs-form { flex-direction: column; }
.browser-frame.is-mobile .tpl-coming .cs-unit { min-width: 58px; padding: 0.7rem 0.5rem; }
.browser-frame.is-mobile .tpl-coming .cs-num { font-size: 1.5rem; }
