/* DigiSell storefront theme (2026 redesign).
   Loaded last in views/layout.ejs, so it restyles every public page.
   Tokens first, then base, header, footer, shared components, page sections, legacy overrides. */

:root {
    --ds-bg: #F7F7FA;
    --ds-surface: #FFFFFF;
    --ds-ink: #15161E;
    --ds-muted: #5E6172;
    --ds-line: #E6E7EE;
    --ds-line-strong: #D4D5E0;
    --ds-accent: #5B46E5;
    --ds-accent-ink: #4535C9;
    --ds-accent-soft: #EFEDFD;
    --ds-amber-bg: #FEF3C7;
    --ds-amber-fg: #92400E;
    --ds-green-bg: #DCFCE7;
    --ds-green-fg: #166534;
    --ds-dark: #15161E;
    --ds-dark-2: #1F2130;
    --ds-dark-muted: #B8BACB;
    --ds-radius: 18px;
    --ds-font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --ds-display: "Bricolage Grotesque", "Inter", system-ui, sans-serif;

    /* Old variables still used by inline styles in some views */
    --primary-color: #5B46E5;
    --primary-dark: #4535C9;
    --gradient-primary: linear-gradient(135deg, #5B46E5 0%, #5B46E5 100%);
    --gradient-secondary: #EFEDFD;
}

/* ---------- Base ---------- */
body {
    background: var(--ds-bg);
    color: var(--ds-ink);
    font-family: var(--ds-font);
}
h1, h2, h3, .h1, .h2, .h3, .display-4, .section-title {
    font-family: var(--ds-display);
    letter-spacing: -0.02em;
    text-wrap: balance;
}
a { color: var(--ds-accent-ink); }
a:hover { color: var(--ds-accent); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--ds-accent);
    outline-offset: 2px;
}
.ds-container {
    max-width: 1240px;
    margin: 0 auto;
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
}
@media (min-width: 768px) {
    .ds-container { padding-left: 24px; padding-right: 24px; }
}
.ds-muted { color: var(--ds-muted); }
.ds-clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Header ---------- */
.ds-header {
    background: var(--ds-surface);
    border-bottom: 1px solid var(--ds-line);
    position: sticky;
    top: 0;
    z-index: 1030;
}
.ds-header .navbar { padding: 12px 0; box-shadow: none; background: transparent; }
.ds-header .ds-nav-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; width: 100%; }
.ds-brand { display: flex; align-items: center; gap: 10px; color: var(--ds-ink); text-decoration: none; margin-right: 4px; }
.ds-brand:hover { color: var(--ds-ink); }
.ds-brand-mark {
    width: 36px; height: 36px; border-radius: 10px;
    background: var(--ds-accent); color: #fff;
    display: grid; place-items: center;
    font-family: var(--ds-display); font-weight: 800; font-size: 15px;
}
.ds-brand-name { font-family: var(--ds-display); font-weight: 800; font-size: 21px; letter-spacing: -0.02em; }
.ds-search {
    flex: 1 1 280px; max-width: 460px;
    display: flex; align-items: center; gap: 10px;
    padding: 0 14px; min-height: 44px;
    border-radius: 12px; background: var(--ds-bg); border: 1px solid var(--ds-line);
    color: var(--ds-muted); margin: 0;
}
.ds-search:focus-within { border-color: var(--ds-accent); background: var(--ds-surface); }
.ds-search input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: 15px; color: var(--ds-ink); outline: none; }
.ds-header .navbar-nav .nav-link {
    padding: 10px 12px !important; border-radius: 10px;
    font-weight: 600; font-size: 15px; color: var(--ds-ink);
}
.ds-header .navbar-nav .nav-link::after { display: none; }
.ds-header .navbar-nav .nav-link:hover,
.ds-header .navbar-nav .nav-link.active { background: #EEEEF4; color: var(--ds-ink); }
.ds-header .ds-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.ds-icon-btn {
    position: relative; width: 44px; height: 44px; border-radius: 12px;
    border: 1px solid var(--ds-line); display: grid; place-items: center;
    color: var(--ds-ink); text-decoration: none; background: var(--ds-surface);
}
.ds-icon-btn:hover { border-color: var(--ds-line-strong); color: var(--ds-ink); }
.ds-icon-btn .badge {
    position: absolute; top: -6px; right: -6px;
    background: var(--ds-accent) !important; font-size: 11px; border-radius: 999px; padding: 3px 6px;
}
.ds-btn-ghost { padding: 10px 14px; border-radius: 12px; font-weight: 600; font-size: 15px; color: var(--ds-ink); text-decoration: none; }
.ds-btn-ghost:hover { background: #EEEEF4; color: var(--ds-ink); }
.ds-btn-dark { padding: 10px 16px; border-radius: 12px; font-weight: 600; font-size: 15px; background: var(--ds-ink); color: #fff; text-decoration: none; }
.ds-btn-dark:hover { background: #2A2C3A; color: #fff; }
.ds-user-btn {
    display: flex; align-items: center; gap: 10px;
    padding: 5px 6px 5px 12px; border-radius: 12px; border: 1px solid var(--ds-line);
    color: var(--ds-ink); text-decoration: none; font-weight: 600; font-size: 15px; background: var(--ds-surface);
}
.ds-user-btn:hover { border-color: var(--ds-line-strong); color: var(--ds-ink); }
.ds-user-btn::after { display: none !important; }
.ds-header #userCredits {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 10px; border-radius: 9px;
    background: var(--ds-amber-bg) !important; color: var(--ds-amber-fg) !important;
    font-size: 13px; font-weight: 700; box-shadow: none; border: 0;
}
.ds-header .dropdown-menu {
    border: 1px solid var(--ds-line); border-radius: 14px; padding: 6px;
    box-shadow: 0 18px 40px -16px rgba(21, 22, 30, .3);
}
.ds-header .dropdown-item { border-radius: 9px; padding: 9px 12px; font-size: 14px; font-weight: 500; }
.ds-header .dropdown-item:hover { background: var(--ds-bg); color: var(--ds-ink); }
.ds-header .navbar-toggler { border: 1px solid var(--ds-line); border-radius: 12px; padding: 9px 11px; }
.ds-header .navbar-toggler:focus { box-shadow: none; }
@media (min-width: 992px) {
    .ds-header .navbar-collapse { display: flex !important; flex: 1 1 auto; align-items: center; gap: 16px; }
}
@media (max-width: 991.98px) {
    .ds-header .navbar-collapse { flex-basis: 100%; padding: 12px 0 4px; }
    .ds-header .navbar-collapse .ds-search { max-width: none; margin-bottom: 8px; }
    .ds-header .ds-actions { margin-left: 0; margin-top: 8px; flex-wrap: wrap; }
}

/* ---------- Footer ---------- */
.ds-footer { margin-top: 96px; background: var(--ds-surface); border-top: 1px solid var(--ds-line); color: var(--ds-muted); font-size: 14px; }
.ds-footer-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 40px; padding-top: 48px; padding-bottom: 32px; }
.ds-footer-about { flex: 1 1 260px; max-width: 360px; display: flex; flex-direction: column; gap: 12px; }
.ds-footer-about p { margin: 0; line-height: 1.6; }
.ds-footer-cols { display: flex; flex-wrap: wrap; gap: 48px; }
.ds-footer-col { display: flex; flex-direction: column; gap: 10px; min-width: 120px; }
.ds-footer-col strong { color: var(--ds-ink); font-weight: 700; }
.ds-footer a { color: var(--ds-muted); text-decoration: none; }
.ds-footer a:hover { color: var(--ds-accent-ink); }
.ds-footer-bottom { border-top: 1px solid var(--ds-line); padding-top: 20px; padding-bottom: 32px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 13px; }

/* ---------- Shared components ---------- */
.ds-section { padding-top: 72px; display: flex; flex-direction: column; gap: 24px; }
.ds-section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 16px; }
.ds-section-head h2 { font-size: clamp(26px, 3vw, 34px); font-weight: 700; margin: 0; }
.ds-section-head p { margin: 6px 0 0; color: var(--ds-muted); }
.ds-link-more { font-weight: 600; color: var(--ds-accent-ink); text-decoration: none; white-space: nowrap; }

.ds-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 10px; border-radius: 999px;
    font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.ds-pill-credit { background: var(--ds-amber-bg); color: var(--ds-amber-fg); }
.ds-pill-free { background: var(--ds-green-bg); color: var(--ds-green-fg); }
.ds-strike { font-size: 12px; color: var(--ds-muted); text-decoration: line-through; }

.ds-chip {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 14px; border-radius: 999px;
    border: 1px solid var(--ds-line); background: var(--ds-surface);
    color: var(--ds-ink); font-weight: 500; font-size: 14px; text-decoration: none;
    cursor: pointer; transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.ds-chip:hover { border-color: var(--ds-accent); color: var(--ds-accent-ink); }
.ds-chip.is-active { background: var(--ds-ink); border-color: var(--ds-ink); color: #fff; }
.ds-chip-count { font-size: 12px; color: var(--ds-muted); font-variant-numeric: tabular-nums; }
.ds-chip.is-active .ds-chip-count { color: #C9CBDA; }

.ds-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }

/* Product card */
.ds-card {
    display: flex; flex-direction: column; height: 100%;
    background: var(--ds-surface); border: 1px solid var(--ds-line); border-radius: var(--ds-radius);
    overflow: hidden; color: var(--ds-ink); text-decoration: none;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.ds-card:hover { transform: translateY(-3px); box-shadow: 0 16px 32px -18px rgba(21, 22, 30, .35); border-color: var(--ds-line-strong); color: var(--ds-ink); }
.ds-card-media, .ds-card .product-image { position: relative; aspect-ratio: 4 / 3; height: auto; min-height: 0; border-radius: 0; background: #EEEEF4 center / cover no-repeat; }
.ds-card-badge {
    position: absolute; top: 12px; left: 12px;
    padding: 4px 9px; border-radius: 999px;
    background: rgba(255, 255, 255, .94); color: var(--ds-ink);
    font-size: 12px; font-weight: 600;
}
.ds-card-badge.is-dark { background: var(--ds-ink); color: #fff; }
.ds-card-body { display: flex; flex-direction: column; gap: 6px; padding: 16px; flex: 1; }
.ds-card-cat { font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--ds-muted); }
.ds-card-title { font-weight: 600; font-size: 15px; line-height: 1.4; margin: 0; }
.ds-card-author { font-size: 13px; color: var(--ds-muted); }
.ds-card-foot { margin-top: auto; padding-top: 8px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; }
.ds-card-meta { font-size: 13px; color: var(--ds-muted); }

/* Empty state */
.ds-empty { text-align: center; padding: 64px 16px; background: var(--ds-surface); border: 1px dashed var(--ds-line-strong); border-radius: var(--ds-radius); color: var(--ds-muted); }
.ds-empty h3 { color: var(--ds-ink); font-size: 22px; margin: 8px 0; }

/* Pagination */
.ds-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; padding: 24px 0 0; }
.ds-pager a, .ds-pager span {
    min-width: 44px; height: 44px; padding: 0 10px; border-radius: 12px;
    display: inline-grid; place-items: center;
    border: 1px solid var(--ds-line); background: var(--ds-surface);
    color: var(--ds-ink); font-weight: 600; text-decoration: none; font-variant-numeric: tabular-nums;
}
.ds-pager a:hover { border-color: var(--ds-accent); color: var(--ds-accent-ink); }
.ds-pager .is-current { background: var(--ds-ink); border-color: var(--ds-ink); color: #fff; }
.ds-pager .is-gap { border: 0; background: transparent; color: var(--ds-muted); min-width: 24px; }
.ds-pager .is-disabled { color: #A3A5B5; }

/* Category tile in lists */
.ds-cat-link {
    display: flex; align-items: center; gap: 12px; padding: 12px;
    border-radius: 14px; background: var(--ds-surface); border: 1px solid var(--ds-line);
    color: var(--ds-ink); font-weight: 600; font-size: 15px; text-decoration: none;
    transition: transform .2s ease, border-color .2s ease;
}
.ds-cat-link:hover { transform: translateY(-2px); border-color: var(--cat, var(--ds-line-strong)); color: var(--ds-ink); }
.ds-cat-link:hover .cat-ico { background: var(--cat, #6366f1); color: #fff; }
.ds-cat-link small { margin-left: auto; color: var(--ds-muted); font-weight: 500; font-variant-numeric: tabular-nums; }

/* ---------- Home ---------- */
.ds-hero { background: var(--ds-surface); border-bottom: 1px solid var(--ds-line); }
.ds-hero-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 48px; padding-top: 56px; padding-bottom: 48px; }
.ds-hero-copy { flex: 1 1 460px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.ds-eyebrow {
    align-self: flex-start; padding: 7px 12px; border-radius: 999px;
    background: var(--ds-accent-soft); color: var(--ds-accent-ink);
    font-size: 13px; font-weight: 600; letter-spacing: .02em;
}
.ds-hero h1 { font-size: clamp(38px, 5.4vw, 60px); line-height: 1.03; letter-spacing: -0.035em; font-weight: 800; margin: 0; }
.ds-hero-lede { font-size: 18px; line-height: 1.6; color: var(--ds-muted); max-width: 54ch; margin: 0; }
.ds-hero-search {
    display: flex; gap: 8px; padding: 8px;
    background: var(--ds-bg); border: 1px solid var(--ds-line); border-radius: 16px; max-width: 580px;
}
.ds-hero-search:focus-within { border-color: var(--ds-accent); }
.ds-hero-search label { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding-left: 10px; margin: 0; color: var(--ds-muted); }
.ds-hero-search input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: 16px; color: var(--ds-ink); padding: 12px 0; outline: none; }
.ds-hero-search button {
    border: 0; border-radius: 12px; background: var(--ds-accent); color: #fff;
    font-weight: 600; font-size: 15px; padding: 0 22px; min-height: 48px;
}
.ds-hero-search button:hover { background: var(--ds-accent-ink); }
.ds-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; }
.ds-quick > span { color: var(--ds-muted); margin-right: 2px; }
.ds-hero-collage { flex: 1 1 420px; min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ds-hero-collage a {
    display: block; aspect-ratio: 4 / 3; height: auto; border-radius: 20px;
    background: #EEEEF4 center / cover no-repeat; border: 1px solid var(--ds-line);
    transition: transform .2s ease, box-shadow .2s ease;
}
.ds-hero-collage a:hover { transform: translateY(-3px); box-shadow: 0 16px 32px -18px rgba(21, 22, 30, .35); }
.ds-hero-collage a:nth-child(2) { margin-top: 32px; }
.ds-hero-collage a:nth-child(3) { margin-top: -32px; }
.ds-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; padding-bottom: 40px; }
.ds-fact { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; background: var(--ds-bg); }
.ds-fact .cat-ico { width: 40px; height: 40px; border-radius: 12px; font-size: 17px; }
.ds-fact strong { display: block; font-variant-numeric: tabular-nums; }
.ds-fact span.ds-muted { font-size: 13px; }

.ds-cat-feature { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.ds-cat-big {
    display: flex; align-items: center; gap: 20px; padding: 26px;
    border-radius: 20px; background: var(--ds-surface); border: 1px solid var(--ds-line);
    color: var(--ds-ink); text-decoration: none; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.ds-cat-big:hover { transform: translateY(-3px); border-color: var(--cat, var(--ds-line-strong)); box-shadow: 0 18px 36px -20px var(--cat, rgba(21, 22, 30, .4)); color: var(--ds-ink); }
.ds-cat-big:hover .cat-ico { background: var(--cat, #6366f1); color: #fff; }
.ds-cat-big h3 { font-size: 24px; margin: 0 0 4px; }
.ds-cat-big p { margin: 0 0 6px; color: var(--ds-muted); font-size: 15px; }
.ds-cat-big .ds-count { font-size: 14px; font-weight: 700; color: var(--cat, var(--ds-accent-ink)); font-variant-numeric: tabular-nums; }
.ds-cat-small { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.ds-cat-small .cat-ico { width: 40px; height: 40px; border-radius: 12px; font-size: 17px; }

.ds-tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px; background: #EEEEF4; border-radius: 12px; }
.ds-tab {
    border: 0; border-radius: 9px; padding: 8px 14px; min-height: 40px;
    background: transparent; color: var(--ds-muted); font-size: 14px; font-weight: 600; cursor: pointer;
}
.ds-tab:hover { color: var(--ds-ink); }
.ds-tab.is-active { background: var(--ds-surface); color: var(--ds-ink); box-shadow: 0 1px 3px rgba(21, 22, 30, .12); }

.ds-band { background: var(--ds-dark); color: #fff; border-radius: 28px; padding: clamp(28px, 4vw, 48px); display: flex; flex-wrap: wrap; gap: 36px; align-items: center; }
.ds-band h2 { color: #fff; font-size: clamp(28px, 3.4vw, 38px); margin: 0; }
.ds-band p { color: var(--ds-dark-muted); font-size: 17px; line-height: 1.6; margin: 0; }
.ds-band-copy { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.ds-band-plans { flex: 1 1 520px; min-width: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.ds-band-plan { background: var(--ds-dark-2); border-radius: 18px; padding: 20px; display: flex; flex-direction: column; gap: 6px; color: #fff; text-decoration: none; border: 1px solid transparent; }
.ds-band-plan:hover { border-color: #4B4E66; color: #fff; }
.ds-band-plan .ds-plan-name { font-size: 13px; font-weight: 700; color: #A5A0FF; }
.ds-band-plan .ds-plan-price { font-family: var(--ds-display); font-weight: 800; font-size: 30px; font-variant-numeric: tabular-nums; }
.ds-band-plan .ds-plan-meta { color: var(--ds-dark-muted); font-size: 14px; }
.ds-band-plan.is-popular { background: var(--ds-accent); }
.ds-band-plan.is-popular .ds-plan-name, .ds-band-plan.is-popular .ds-plan-meta { color: #E4E0FF; }
.ds-btn-light { padding: 13px 22px; border-radius: 12px; background: #fff; color: var(--ds-ink); font-weight: 700; text-decoration: none; }
.ds-btn-light:hover { background: #EEEEF4; color: var(--ds-ink); }
.ds-btn-outline-light { padding: 13px 22px; border-radius: 12px; border: 1px solid #3A3C4D; color: #fff; font-weight: 600; text-decoration: none; }
.ds-btn-outline-light:hover { border-color: #fff; color: #fff; }

/* ---------- Category page ---------- */
.ds-page-head { background: var(--ds-surface); border-bottom: 1px solid var(--ds-line); }
.ds-page-head-inner { padding-top: 24px; padding-bottom: 28px; display: flex; flex-direction: column; gap: 18px; }
.ds-crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; color: var(--ds-muted); margin: 0; padding: 0; list-style: none; }
.ds-crumbs a { color: var(--ds-muted); text-decoration: none; }
.ds-crumbs a:hover { color: var(--ds-accent-ink); }
.ds-crumbs li + li::before { content: "/"; margin-right: 8px; color: #A3A5B5; }
.ds-crumbs [aria-current] { color: var(--ds-ink); font-weight: 600; }
.ds-page-title { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; }
.ds-page-title h1 { font-size: clamp(32px, 4vw, 44px); font-weight: 800; letter-spacing: -0.03em; margin: 0 0 6px; }
.ds-page-title p { margin: 0; color: var(--ds-muted); font-size: 16px; max-width: 70ch; }
.ds-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 28px; padding-bottom: 18px; }
.ds-toolbar label { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; color: var(--ds-muted); }
.ds-select { min-height: 44px; border-radius: 12px; border: 1px solid var(--ds-line); background: var(--ds-surface); font-size: 14px; color: var(--ds-ink); padding: 0 12px; }

/* ---------- Pricing ---------- */
.ds-pricing-head { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; padding-top: 56px; }
.ds-pricing-head .ds-eyebrow { align-self: center; }
.ds-pricing-head h1 { font-size: clamp(36px, 5vw, 54px); line-height: 1.05; letter-spacing: -0.035em; font-weight: 800; max-width: 18ch; margin: 0; }
.ds-pricing-head p { font-size: 18px; line-height: 1.6; color: var(--ds-muted); max-width: 58ch; margin: 0; }
.ds-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 20px; padding-top: 44px; align-items: stretch; }
.ds-plan {
    position: relative; background: var(--ds-surface); border: 1px solid var(--ds-line); border-radius: 24px;
    padding: 30px; display: flex; flex-direction: column; gap: 20px;
}
.ds-plan h2 { font-size: 22px; margin: 0; }
.ds-plan-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; }
.ds-plan-price strong { font-family: var(--ds-display); font-size: 50px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1; }
.ds-plan-price span { color: var(--ds-muted); }
.ds-plan-save { font-size: 14px; color: var(--ds-muted); }
.ds-plan-save b { color: #047857; font-weight: 600; }
.ds-plan ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; font-size: 15px; }
.ds-plan li { display: flex; gap: 10px; }
.ds-plan li i { color: #0F766E; margin-top: 4px; }
.ds-plan .ds-plan-cta { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.ds-plan-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
    min-height: 50px; border-radius: 14px; font-weight: 700; font-size: 15px;
    border: 1px solid var(--ds-ink); background: transparent; color: var(--ds-ink); cursor: pointer;
}
.ds-plan-btn:hover { background: var(--ds-ink); color: #fff; }
.ds-plan-btn:disabled { border-color: var(--ds-green-fg); color: var(--ds-green-fg); background: var(--ds-green-bg); cursor: default; }
.ds-plan-note { text-align: center; font-size: 13px; color: var(--ds-muted); }
.ds-plan.is-popular { background: var(--ds-dark); color: #fff; border-color: var(--ds-dark); }
.ds-plan.is-popular h2 { color: #fff; }
.ds-plan.is-popular .ds-plan-price span, .ds-plan.is-popular .ds-plan-save, .ds-plan.is-popular .ds-plan-note, .ds-plan.is-popular .ds-muted { color: var(--ds-dark-muted); }
.ds-plan.is-popular .ds-plan-save b { color: #86EFAC; }
.ds-plan.is-popular li i { color: #86EFAC; }
.ds-plan.is-popular .ds-plan-btn { background: var(--ds-accent); border-color: var(--ds-accent); color: #fff; }
.ds-plan.is-popular .ds-plan-btn:hover { background: var(--ds-accent-ink); }
.ds-plan-flag {
    position: absolute; top: -13px; left: 30px; padding: 6px 12px; border-radius: 999px;
    background: var(--ds-accent); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .04em;
}
.ds-plan.is-popular .ds-plan-flag { background: #FCD34D; color: var(--ds-ink); }
.ds-how { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.ds-how > div { background: var(--ds-surface); border: 1px solid var(--ds-line); border-radius: 18px; padding: 22px; display: flex; flex-direction: column; gap: 8px; }
.ds-how b { font-size: 17px; }
.ds-how p { margin: 0; color: var(--ds-muted); font-size: 15px; line-height: 1.55; }

/* ---------- Legacy markup on pages not rebuilt (products, search, product detail, cart, dashboard) ---------- */
main { min-height: 50vh; }
.card { background: var(--ds-surface); border: 1px solid var(--ds-line); border-radius: var(--ds-radius); box-shadow: none; color: var(--ds-ink); }
.card:hover { box-shadow: none; transform: none; }
.product-card { border-radius: var(--ds-radius); overflow: hidden; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.product-card:hover { transform: translateY(-3px); box-shadow: 0 16px 32px -18px rgba(21, 22, 30, .35); border-color: var(--ds-line-strong); }
.product-card .product-image { height: auto; aspect-ratio: 4 / 3; background-size: cover; background-position: center; }
.product-card .card-title { font-size: 15px; font-weight: 600; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-card .product-price, .product-card .text-warning.fw-bold { display: inline-flex; padding: 4px 10px; border-radius: 999px; background: var(--ds-amber-bg); color: var(--ds-amber-fg) !important; font-weight: 700; font-size: 13px; }
.product-badge { border-radius: 999px; font-size: 12px; font-weight: 600; padding: 4px 9px; }
.btn { border-radius: 12px; font-weight: 600; }
.btn-primary, .btn-primary:focus { background: var(--ds-accent); border-color: var(--ds-accent); box-shadow: none; }
.btn-primary:hover, .btn-primary:active { background: var(--ds-accent-ink) !important; border-color: var(--ds-accent-ink) !important; transform: none; box-shadow: none; }
.btn-outline-primary { color: var(--ds-accent-ink); border-color: var(--ds-accent); background: transparent; }
.btn-outline-primary:hover, .btn-outline-primary:active { background: var(--ds-accent) !important; border-color: var(--ds-accent) !important; color: #fff !important; }
.text-primary { color: var(--ds-accent) !important; }
.bg-primary { background-color: var(--ds-accent) !important; }
.border-primary { border-color: var(--ds-accent) !important; }
.bg-gradient-primary { background: var(--ds-dark) !important; }
.section-title { font-weight: 700; }
.section-title::after { display: none; }
.breadcrumb { font-size: 14px; }
.breadcrumb a { color: var(--ds-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--ds-accent-ink); }
.pagination .page-link { border-radius: 12px; margin: 0 3px; border: 1px solid var(--ds-line); color: var(--ds-ink); min-width: 44px; height: 44px; display: grid; place-items: center; }
.pagination .page-item.active .page-link { background: var(--ds-ink); border-color: var(--ds-ink); color: #fff; }
.form-control, .form-select { border-radius: 12px; border-color: var(--ds-line); min-height: 44px; }
.form-control:focus, .form-select:focus { border-color: var(--ds-accent); box-shadow: 0 0 0 3px rgba(91, 70, 229, .15); }
/* Gradient buttons and avatars written inline in product-detail.ejs */
[style*="linear-gradient(135deg, #667eea"], [style*="linear-gradient(135deg, #10b981"] { background: var(--ds-accent) !important; border-color: var(--ds-accent) !important; border-radius: 14px !important; box-shadow: none !important; }
[style*="linear-gradient(135deg, #10b981"] { background: #047857 !important; border-color: #047857 !important; }
.seller-avatar[style*="linear-gradient"] { border-radius: 14px !important; }
.product-tag-link { display: inline-flex; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--ds-line); background: var(--ds-surface); color: var(--ds-ink); font-size: 13px; text-decoration: none; }
.product-tag-link:hover { border-color: var(--ds-accent); color: var(--ds-accent-ink); }
.accordion-item { border-color: var(--ds-line); }
.accordion-item:first-of-type { border-top-left-radius: 16px; border-top-right-radius: 16px; }
.accordion-item:last-of-type { border-bottom-left-radius: 16px; border-bottom-right-radius: 16px; }
.accordion-button:not(.collapsed) { background: var(--ds-accent-soft); color: var(--ds-ink); box-shadow: none; }
.accordion-button:focus { box-shadow: 0 0 0 3px rgba(91, 70, 229, .15); }
.table { --bs-table-bg: var(--ds-surface); }

@media (prefers-reduced-motion: reduce) {
    .ds-card, .ds-cat-big, .ds-cat-link, .ds-hero-collage a, .product-card { transition: none; }
    .ds-card:hover, .ds-cat-big:hover, .ds-cat-link:hover, .ds-hero-collage a:hover, .product-card:hover { transform: none; }
}
