/* ==============================================================
   Public test-request shop.

   Catalogue → cart → checkout → confirmation. Self-contained: the
   module ships its own CSS so it stays removable with its folder.
   ============================================================== */

:root {
    --sea: #176a72;
    --sea-2: #1e838d;
    --sea-deep: #0f4a50;
    --ink: #10222b;
    --muted: #6a7a80;
    --line: #d7e1e4;
    --soft: #eef4f5;
    --coral: #c94330;
    --ok: #1b7a4c;
    --paper: #fff;
    --r-lg: 16px;
    --r-md: 12px;
    --r-sm: 9px;
    --shadow-sm: 0 4px 18px rgba(16, 34, 43, .05);
    --shadow-md: 0 10px 28px rgba(16, 34, 43, .10);
}

* { box-sizing: border-box; margin: 0; }

/* The UA rule for [hidden] is only `display: none`, so any author rule that
   sets a display — .ts-card is a flex box — silently wins and the element
   stays on screen. The search filter hides cards with the attribute, so this
   has to outrank them. */
[hidden] { display: none !important; }

body {
    font-family: 'Hind Siliguri', 'Segoe UI', sans-serif;
    background: linear-gradient(160deg, #eaf3f4 0%, #f6fafa 40%, #eef4f5 100%);
    color: var(--ink);
    min-height: 100vh;
    /* room for the sticky summary bar on the catalogue */
    padding-bottom: 96px;
    line-height: 1.5;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; padding: 0; }

/* ============ Header ============ */
.ts-head {
    position: sticky; top: 0; z-index: 40;
    background: linear-gradient(120deg, var(--sea) 0%, var(--sea-2) 100%);
    color: #fff;
    box-shadow: 0 6px 20px rgba(23, 106, 114, .22);
}
.ts-head-in {
    max-width: 1080px; margin: 0 auto;
    display: flex; align-items: center; gap: 12px;
    padding: 11px 16px;
}
.ts-back {
    font-size: 13.5px; font-weight: 600; opacity: .9;
    padding: 7px 11px; border-radius: 30px; transition: .18s;
    white-space: nowrap;
}
.ts-back:hover { background: rgba(255, 255, 255, .16); opacity: 1; }

.ts-brand { display: flex; align-items: center; gap: 10px; margin: 0 auto 0 6px; }
.ts-brand-ico { font-size: 20px; }
.ts-brand b { display: block; font-size: 15.5px; font-weight: 700; line-height: 1.2; }
.ts-brand small { display: block; font-size: 11.5px; opacity: .82; }

.ts-cart-btn {
    position: relative; display: flex; align-items: center; gap: 8px;
    background: rgba(255, 255, 255, .17); border: 1px solid rgba(255, 255, 255, .28);
    padding: 8px 15px; border-radius: 30px;
    font-size: 14px; font-weight: 700; transition: .18s; white-space: nowrap;
}
.ts-cart-btn:hover { background: rgba(255, 255, 255, .27); }
.ts-badge {
    min-width: 22px; height: 22px; padding: 0 6px;
    background: #ffd24a; color: #3d2b00;
    border-radius: 30px; font-size: 12.5px; font-weight: 800;
    display: inline-grid; place-items: center;
}
.ts-badge.is-empty { background: rgba(255, 255, 255, .3); color: #fff; }
.ts-cart-btn.is-bumped { animation: tsBump .38s ease; }
@keyframes tsBump {
    0%, 100% { transform: scale(1); }
    35%      { transform: scale(1.13); }
}

/* ============ Step indicator ============ */
.ts-steps {
    max-width: 1080px; margin: 16px auto 0; padding: 0 16px;
    display: flex; gap: 6px;
}
.ts-step {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px;
    background: var(--paper); border: 1px solid var(--line);
    border-radius: 30px; padding: 7px 6px;
    font-size: 12.5px; font-weight: 600; color: var(--muted);
}
.ts-step-n {
    width: 20px; height: 20px; border-radius: 50%;
    background: var(--soft); color: var(--muted);
    display: grid; place-items: center; font-size: 11.5px; font-weight: 800;
}
.ts-step.is-now { border-color: var(--sea); color: var(--sea); box-shadow: var(--shadow-sm); }
.ts-step.is-now .ts-step-n { background: var(--sea); color: #fff; }
.ts-step.is-done { color: var(--ok); border-color: #bfe3d0; }
.ts-step.is-done .ts-step-n { background: var(--ok); color: #fff; }

/* ============ Shell ============ */
.ts-wrap { max-width: 1080px; margin: 0 auto; padding: 16px 16px 8px; }
.ts-h1 { font-size: 21px; font-weight: 700; margin-bottom: 14px; }

.ts-hero {
    background: linear-gradient(120deg, var(--sea) 0%, var(--sea-2) 100%);
    color: #fff; border-radius: var(--r-lg); padding: 22px 24px; margin-bottom: 16px;
    box-shadow: 0 12px 30px rgba(23, 106, 114, .25);
}
.ts-hero h1 { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.ts-hero p { font-size: 13.5px; opacity: .92; }

.ts-note, .ts-err {
    border-radius: var(--r-md); padding: 12px 14px; font-size: 13.5px; margin-bottom: 14px;
}
.ts-note { background: #fff7e0; border: 1px solid #f0dca6; color: #7a5b00; }
.ts-err  { background: #fdecea; border: 1px solid #f5c6c0; color: #a12626; }
.ts-err ul { margin-left: 18px; list-style: disc; }

/* ============ Toolbar ============ */
.ts-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.ts-search { position: relative; flex: 1; }
.ts-search::before {
    content: "🔍"; position: absolute; left: 12px; top: 50%;
    transform: translateY(-50%); font-size: 14px; pointer-events: none;
}
.ts-search input {
    width: 100%; padding: 11px 14px 11px 38px; font-size: 14.5px; font-family: inherit;
    border: 1.5px solid var(--line); border-radius: 30px; background: var(--paper); color: var(--ink);
}
.ts-search input:focus { outline: none; border-color: var(--sea); }
.ts-count { font-size: 13px; color: var(--muted); font-weight: 600; white-space: nowrap; }

/* ============ Product grid ============ */
.ts-grid {
    display: grid; gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.ts-grid-sm { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

.ts-card {
    background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md);
    padding: 14px; box-shadow: var(--shadow-sm);
    display: flex; flex-direction: column; gap: 12px; transition: .18s;
}
.ts-card:hover { box-shadow: var(--shadow-md); border-color: #b9d2d6; transform: translateY(-2px); }
.ts-card.is-in { border-color: var(--sea); background: #fbfefe; }
.ts-card-body { flex: 1; }
.ts-card-name { font-size: 14.5px; font-weight: 600; line-height: 1.35; margin-bottom: 6px; }
.ts-card-price { font-size: 18px; font-weight: 800; color: var(--sea); }

.ts-add {
    width: 100%; padding: 10px; font-family: inherit; font-size: 13.5px; font-weight: 700;
    color: #fff; background: linear-gradient(120deg, var(--sea), var(--sea-2));
    border: 0; border-radius: var(--r-sm); cursor: pointer; transition: .16s;
}
.ts-add:hover { filter: brightness(1.08); }
.ts-add:active { transform: scale(.98); }
.ts-add .ts-add-in { display: none; }
.ts-card.is-in .ts-add {
    background: #e8f5f0; color: var(--ok); box-shadow: inset 0 0 0 1.5px #bfe3d0;
}
.ts-card.is-in .ts-add .ts-add-idle { display: none; }
.ts-card.is-in .ts-add .ts-add-in { display: inline; }

.ts-empty { text-align: center; color: var(--muted); font-size: 14px; padding: 30px 10px; }

/* ============ Sticky catalogue summary ============ */
.ts-sticky {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    background: var(--paper); border-top: 1px solid var(--line);
    box-shadow: 0 -8px 24px rgba(16, 34, 43, .10);
    transform: translateY(0); transition: transform .22s ease;
}
.ts-sticky.is-hidden { transform: translateY(110%); }
.ts-sticky-in {
    max-width: 1080px; margin: 0 auto; padding: 11px 16px;
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.ts-sticky-sum b { display: block; font-size: 14px; }
.ts-sticky-sum span { font-size: 17px; font-weight: 800; color: var(--sea); }

/* ============ Buttons ============ */
.ts-btn {
    display: inline-block; text-align: center; cursor: pointer;
    padding: 12px 22px; border: 0; border-radius: var(--r-sm);
    font-family: inherit; font-size: 15px; font-weight: 700; transition: .16s;
}
.ts-btn-primary {
    color: #fff; background: linear-gradient(120deg, var(--sea), var(--sea-2));
    box-shadow: 0 8px 20px rgba(23, 106, 114, .28);
}
.ts-btn-primary:hover { transform: translateY(-2px); }
.ts-btn-ghost { background: var(--soft); color: var(--sea); }
.ts-btn-ghost:hover { background: #e2ecee; }
.ts-btn-block { display: block; width: 100%; margin-top: 9px; }
.ts-btn[disabled] { opacity: .6; cursor: progress; transform: none; }

/* ============ Cart ============ */
.ts-cart-layout {
    display: grid; grid-template-columns: 1fr 320px; gap: 18px; align-items: start;
}
.ts-lines {
    background: var(--paper); border: 1px solid var(--line);
    border-radius: var(--r-md); overflow: hidden; box-shadow: var(--shadow-sm);
}
.ts-line {
    display: grid;
    grid-template-columns: 1fr auto 96px 36px;
    align-items: center; gap: 12px;
    padding: 14px 16px; border-bottom: 1px solid var(--soft);
}
.ts-line:last-of-type { border-bottom: 0; }
.ts-line.is-going { opacity: .4; }
.ts-line-main h3 { font-size: 14.5px; font-weight: 600; line-height: 1.35; }
.ts-line-unit { font-size: 12px; color: var(--muted); margin-top: 2px; }
.ts-line-total { font-weight: 800; color: var(--sea); text-align: right; font-size: 15px; }
.ts-line-x {
    width: 30px; height: 30px; border: 0; border-radius: 50%; cursor: pointer;
    background: #fdecea; color: var(--coral); font-size: 16px; font-weight: 700; line-height: 1;
}
.ts-line-x:hover { background: var(--coral); color: #fff; }

.ts-qty {
    display: inline-flex; align-items: center;
    border: 1.5px solid var(--line); border-radius: 30px; overflow: hidden;
}
.ts-qty-btn {
    width: 30px; height: 30px; border: 0; background: var(--soft); color: var(--sea);
    font-size: 16px; font-weight: 800; cursor: pointer; line-height: 1;
}
.ts-qty-btn:hover { background: var(--sea); color: #fff; }
.ts-qty-n { min-width: 34px; text-align: center; font-weight: 700; font-size: 14px; }

.ts-clear {
    display: block; width: 100%; padding: 11px; border: 0; border-top: 1px solid var(--soft);
    background: transparent; color: var(--coral);
    font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.ts-clear:hover { background: #fdecea; }

/* ============ Summary panel ============ */
.ts-summary {
    background: var(--paper); border: 1px solid var(--line);
    border-radius: var(--r-md); padding: 18px; box-shadow: var(--shadow-sm);
}
.ts-summary-sticky { position: sticky; top: 76px; }
.ts-summary h2 {
    font-size: 15px; font-weight: 700; color: var(--sea);
    padding-bottom: 9px; margin-bottom: 12px; border-bottom: 2px solid var(--soft);
}
.ts-sum-row {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 13.5px; padding: 5px 0; color: var(--muted);
}
.ts-sum-row b { color: var(--ink); }
.ts-sum-total {
    display: flex; justify-content: space-between; align-items: center;
    background: var(--soft); border-radius: var(--r-sm);
    padding: 12px 14px; margin-top: 10px; font-weight: 700; font-size: 14px;
}
.ts-sum-total b { font-size: 19px; color: var(--sea); }
.ts-sum-note { font-size: 11.5px; color: var(--muted); margin-top: 9px; line-height: 1.5; }

.ts-order-list li {
    display: flex; justify-content: space-between; gap: 10px;
    font-size: 13.5px; padding: 7px 0; border-bottom: 1px solid var(--soft);
}
.ts-order-list li:last-child { border-bottom: 0; }
.ts-order-name em { font-style: normal; color: var(--muted); font-size: 12px; }
.ts-order-amt { font-weight: 700; color: var(--sea); white-space: nowrap; }

.ts-suggest { margin-top: 26px; }
.ts-suggest h2 { font-size: 16px; font-weight: 700; margin-bottom: 12px; }

/* ============ Empty / done states ============ */
.ts-blank, .ts-done {
    background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg);
    padding: 38px 24px; text-align: center; box-shadow: var(--shadow-sm);
}
.ts-blank-ico, .ts-done-ico { font-size: 44px; margin-bottom: 12px; }
.ts-blank h2, .ts-done h1 { font-size: 19px; font-weight: 700; margin-bottom: 7px; }
.ts-blank p, .ts-done p { font-size: 14px; color: var(--muted); margin-bottom: 18px; }
.ts-blank .ts-btn { margin-top: 4px; }

.ts-ref {
    display: inline-block; background: var(--soft); border: 1.5px dashed var(--sea);
    border-radius: var(--r-md); padding: 12px 26px; margin-bottom: 20px;
}
.ts-ref small { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 2px; }
.ts-ref b { font-size: 21px; font-weight: 800; color: var(--sea); letter-spacing: 1px; }

.ts-receipt { max-width: 420px; margin: 0 auto 18px; text-align: left; }
.ts-receipt h2 { font-size: 14px; font-weight: 700; color: var(--sea); margin-bottom: 8px; }
.ts-done-note { font-size: 12.5px; color: var(--muted); }
.ts-done-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ============ Checkout ============ */
.ts-checkout {
    display: grid; grid-template-columns: 1fr 320px; gap: 18px; align-items: start;
}
.ts-checkout-main { display: grid; gap: 14px; }
.ts-card-box {
    background: var(--paper); border: 1px solid var(--line);
    border-radius: var(--r-md); padding: 18px; box-shadow: var(--shadow-sm);
}
.ts-card-box h2 {
    font-size: 15px; font-weight: 700; color: var(--sea);
    padding-bottom: 9px; margin-bottom: 14px; border-bottom: 2px solid var(--soft);
}
.ts-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ts-fields .span2 { grid-column: span 2; }
.ts-fields label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 5px; }
.ts-fields label .req { color: var(--coral); }
.ts-fields input, .ts-fields select, .ts-fields textarea {
    width: 100%; padding: 10px 12px; font-size: 14px; font-family: inherit;
    border: 1.5px solid var(--line); border-radius: var(--r-sm);
    background: #fff; color: var(--ink);
}
.ts-fields input:focus, .ts-fields select:focus, .ts-fields textarea:focus {
    outline: none; border-color: var(--sea);
}
.ts-check {
    display: flex !important; align-items: center; gap: 9px;
    font-size: 13.5px; font-weight: 600; cursor: pointer; margin-bottom: 0 !important;
}
.ts-check input { width: 18px !important; height: 18px; accent-color: var(--sea); }
.ts-hp { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }

/* ============ Footer & toast ============ */
.ts-foot { text-align: center; padding: 22px 16px 10px; }
.ts-foot-call {
    display: inline-block; font-size: 14.5px; font-weight: 700; color: var(--sea);
    background: var(--paper); border: 1px solid var(--line);
    border-radius: 30px; padding: 9px 20px; margin-bottom: 10px;
}
.ts-foot p { font-size: 12px; color: var(--muted); max-width: 460px; margin: 0 auto; }

.ts-toast {
    position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 20px);
    background: var(--ink); color: #fff;
    padding: 11px 20px; border-radius: 30px; font-size: 13.5px; font-weight: 600;
    box-shadow: var(--shadow-md); z-index: 60;
    opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease;
}
.ts-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ============ Responsive ============ */
@media (max-width: 900px) {
    .ts-cart-layout, .ts-checkout { grid-template-columns: 1fr; }
    .ts-summary-sticky { position: static; }
}
@media (max-width: 620px) {
    .ts-back-t, .ts-cart-t { display: none; }
    .ts-brand { margin-left: 0; }
    .ts-step-l { display: none; }
    .ts-step { flex: 0 0 auto; padding: 7px 12px; }
    .ts-steps { justify-content: center; }
    .ts-fields { grid-template-columns: 1fr; }
    .ts-fields .span2 { grid-column: span 1; }
    .ts-line { grid-template-columns: 1fr auto; row-gap: 9px; }
    .ts-line-main { grid-column: 1 / -1; }
    .ts-line-total { text-align: left; }
    .ts-hero { padding: 18px; }
    .ts-hero h1 { font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}
