/* ============================================================
   Pricing page — "Bplus Fixasset Tracking" (navy design)
   Ported from the approved Claude Design comp. Tokens first.
   ============================================================ */
.pricing-page {
    /* Toned to the Fixed Asset Tracking product branding: deep-navy headings
       (as on the product page) with the product's violet-indigo gradient on
       actions — card header, CTA, chip, banner, badges. */
    --pp-primary: #7c3aed;      /* violet — actions & accents                */
    --pp-primary-dark: #6425d0; /* hover                                     */
    --pp-grad: linear-gradient(135deg, #a855f7 0%, #6366f1 100%);
    --pp-heading: #1e3a8a;      /* deep navy — headings & price figures      */
    --pp-fill: #8b5cf6;         /* slider progress                           */
    --pp-soft: #f1edfd;         /* active row, soft highlights               */
    --pp-ink: #1f2937;
    --pp-muted: #64748b;
    --pp-bg: #f6f7fd;           /* section ground                            */
    --pp-card: #ffffff;
    --pp-border: #e7e6f6;
    --pp-track: #e6e3f7;
    --pp-good: #22a06b;
    --pp-radius: 16px;

    background: var(--pp-bg);
    color: var(--pp-ink);
    padding: 48px 0 64px;
}
.pricing-page .pp-container { max-width: 1140px; margin: 0 auto; padding: 0 20px; }

/* ---------- header ---------- */
.pricing-head { max-width: 760px; margin: 0 auto 36px; text-align: center; }
.pricing-eyebrow {
    font-size: 12px; font-weight: 600; letter-spacing: 4px;
    color: var(--pp-muted); margin-bottom: 10px;
}
.pricing-title {
    font-size: 32px; font-weight: 800; line-height: 1.4;
    color: var(--pp-heading); text-wrap: balance; margin: 0 0 10px;
}
.pricing-sub { font-size: 15.5px; color: var(--pp-muted); margin: 0; }

/* ---------- slider panel ---------- */
.unit-panel {
    background: var(--pp-card);
    border: 1px solid var(--pp-border);
    border-radius: var(--pp-radius);
    box-shadow: 0 6px 20px rgba(88, 63, 200, .07);
    padding: 26px 32px 22px;
    margin-bottom: 28px;
}
.unit-panel-top {
    display: flex; align-items: baseline; justify-content: space-between;
    /* No top spacer: the "พิมพ์เองได้เลย" tooltip is absolute and overflows above
       the panel edge into the gap under the header — reserving room here would just
       leave a dead band. margin-bottom: room for the chip riding above the track. */
    gap: 16px; margin-bottom: 46px;
}
.unit-panel-label { font-size: 18px; font-weight: 700; }
/* Pencil in the box — a quiet cue that the number is editable, not just a readout. */
.unit-input-icon { font-size: 14px; color: var(--pp-muted); }

/* free-text quantity: the visitor types their real asset/document count */
.unit-input-wrap {
    position: relative;
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--pp-soft); border: 1.5px solid var(--pp-border);
    border-radius: 10px; padding: 6px 14px;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.unit-input-wrap:focus-within { border-color: var(--pp-primary); box-shadow: 0 0 0 3px rgba(124, 58, 237, .15); }
.unit-input {
    width: 108px; border: 0; background: transparent; outline: none;
    text-align: right; font-size: 20px; font-weight: 800;
    color: var(--pp-heading); font-variant-numeric: tabular-nums;
}
.unit-input-suffix { font-size: 14px; color: var(--pp-muted); font-weight: 600; }
/* Callout above the input box, styled to match .unit-slider-chip so the two read
   as one system. Absolutely positioned + pointer-events:none: it floats over the
   box, overflows above the panel edge, and never pushes the panel layout. Arrow
   points down at the box — same triangle trick as .unit-slider-chip::after. */
.unit-input-chip {
    --chip-color: #ec4899;      /* rose — set here so the pill and its arrow match */
    position: absolute; bottom: calc(100% + 9px); right: 12px;
    background: var(--chip-color); color: #fff;
    font-size: 13px; font-weight: 700; white-space: nowrap;
    padding: 5px 12px; border-radius: 8px;
    box-shadow: 0 6px 16px rgba(236, 72, 153, .28);
    pointer-events: none;
    animation: chip-bob 2.4s ease-in-out infinite;
}
.unit-input-chip::after {
    content: ""; position: absolute; left: 18px; top: 100%;
    border: 5px solid transparent; border-top-color: var(--chip-color, var(--pp-primary));
    border-bottom: 0;
}
/* Gentle float so the hint catches the eye without demanding attention. chip-bob is
   for the tooltip sitting ABOVE the box (desktop); chip-nudge for the side placement
   on mobile, where it slides toward the box instead. */
@keyframes chip-bob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-5px); }
}
@keyframes chip-nudge {
    0%, 100% { transform: translateX(0); }
    50%      { transform: translateX(-4px); }
}

.unit-hint { margin-top: 16px; font-size: 12.5px; color: var(--pp-muted); line-height: 1.5; }
.unit-hint i { color: var(--pp-primary); margin-right: 5px; }

.unit-slider-wrap { position: relative; }
/* JS slides this with translateX and clamps it inside the track — centred on the
   thumb, the chip used to hang past the viewport at the ends and the leading digits
   were cut off ("1 - 2,000" read as "- 2,000"). Moved by transform rather than
   `left` so sliding stays off the layout path. The arrow is placed separately via
   --chip-arrow so it still points at the thumb once the chip is clamped. */
.unit-slider-chip {
    position: absolute; top: -42px; left: 0;
    background: var(--pp-primary); color: #fff;
    font-size: 13px; font-weight: 700; white-space: nowrap;
    padding: 5px 12px; border-radius: 8px;
    font-variant-numeric: tabular-nums;
    pointer-events: none;
    transition: transform .12s ease;
}
.unit-slider-chip::after {
    content: ""; position: absolute; left: var(--chip-arrow, 50%); bottom: -5px;
    transform: translateX(-50%);
    border: 5px solid transparent; border-top-color: var(--pp-primary);
    border-bottom: 0;
}

.unit-slider {
    -webkit-appearance: none; appearance: none;
    width: 100%; height: 8px; border-radius: 6px;
    background: var(--pp-track); /* JS paints the fill */
    outline: none; cursor: pointer; display: block;
}
.unit-slider::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 26px; height: 26px; border-radius: 50%;
    background: #fff; border: 4px solid var(--pp-primary);
    box-shadow: 0 2px 8px rgba(76, 29, 149, .3);
    cursor: grab; transition: transform .15s ease;
}
.unit-slider::-webkit-slider-thumb:active { cursor: grabbing; transform: scale(1.08); }
.unit-slider::-moz-range-thumb {
    width: 26px; height: 26px; border-radius: 50%;
    background: #fff; border: 4px solid var(--pp-primary);
    box-shadow: 0 2px 8px rgba(76, 29, 149, .3); cursor: grab;
}
.unit-slider:focus-visible { box-shadow: 0 0 0 4px rgba(124, 58, 237, .25); }

.unit-slider-ticks {
    position: relative; height: 22px;
    margin-top: 8px; font-size: 13px; color: var(--pp-muted);
    font-variant-numeric: tabular-nums;
}
.unit-slider-ticks span {
    position: absolute; top: 0; transform: translateX(-50%);
    white-space: nowrap;
}
/* Pin the end labels to the track edges instead of centring them on the thumb —
   centred, the first and last (the wider "10,000+") hang off the track. */
.unit-slider-ticks span:first-child { left: 0 !important; transform: none; }
.unit-slider-ticks span:last-child { left: auto !important; right: 0; transform: none; }

/* ---------- layout: package card + info column ---------- */
.pricing-cards { row-gap: 24px; }
.pricing-cards .div-order { display: flex; }

.pricing.card {
    width: 100%; border: 1px solid var(--pp-border);
    border-radius: var(--pp-radius); overflow: hidden;
    box-shadow: 0 10px 28px rgba(88, 63, 200, .09);
    background: var(--pp-card);
}
.pricing .card-head {
    background: var(--pp-grad); color: #fff;
    padding: 20px 28px;
}
.pricing .card-head small { display: block; font-size: 13px; opacity: .85; margin-bottom: 4px; }
.pricing .card-head .card-head-range {
    font-size: 21px; font-weight: 800; font-variant-numeric: tabular-nums;
}
.pricing.card { display: flex; flex-direction: column; }
.pricing .card-body { padding: 18px 28px 24px; flex: 1 1 auto; display: flex; flex-direction: column; }
/* margin-top:auto → CTA hugs the card bottom. color also lives here (0,3,0) so it
   beats Bootstrap's a:not([href]):not([tabindex]){color:inherit} (0,2,1) — our
   buttons are href-less <a>, which that reset would otherwise darken. */
.pricing .card-body .btnOrder { margin-top: auto; color: #fff; }

.pricing .prices { margin-bottom: 4px; }
.pricing .price-currency { font-size: 20px; font-weight: 700; color: var(--pp-heading); vertical-align: 18px; margin-right: 2px; }
.pricing .price-value {
    font-size: 46px; font-weight: 800; letter-spacing: -1px;
    color: var(--pp-heading); font-variant-numeric: tabular-nums;
}
.pricing .price-duration { font-size: 15px; color: var(--pp-muted); font-weight: 500; margin-left: 6px; }
/* promo line: struck-through full price + "-33%" badge, riding beside the price */
.pricing .prices { display: block; }
.pricing .promo-line { display: inline-flex; align-items: center; gap: 8px; margin-left: 14px; vertical-align: middle; }
.pricing .promo-line.hidden { display: none !important; }
.pricing .normal-price-show { font-size: 15px; color: #9aa7bd; text-decoration: line-through; font-variant-numeric: tabular-nums; }
.pricing .discount-show {
    display: inline-block; padding: 2px 9px; border-radius: 20px;
    background: #fdeef1; color: #d6336c; font-size: 12.5px; font-weight: 700; line-height: 1.6;
}
.pricing .vat-show { font-size: 13px; color: var(--pp-muted); font-variant-numeric: tabular-nums; }
.pricing .notify-show { font-size: 12.5px; color: #d6336c; margin-top: 4px; font-weight: 600; }

.pricing .card-divider { border: 0; border-top: 1px solid var(--pp-border); margin: 14px 0 12px; }

.pricing .icon-list { list-style: none; padding: 0; margin: 0 0 18px; text-align: left; }
/* "icon-list" is also a fontello glyph name — the site's icon font paints a "≣"
   onto any element with this class. Kill that pseudo inside the pricing card. */
.pricing .icon-list::before { content: none !important; }
.pricing .icon-list li {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 5px 0; font-size: 14.5px; line-height: 1.55;
}
.pricing .icon-list i { margin-top: 3px; font-size: 15px; color: var(--pp-good); flex: 0 0 auto; }
.pricing .icon-list .fa-times-circle, .pricing .icon-list .fa-times { color: #e03131; }

/* Two actions now: buy straight away (primary) or ask for a quotation (secondary).
   .btnBuy shares the CTA styling; .btnOrder-alt is the quieter outlined variant so
   the pair reads as one decision rather than two competing buttons. */
.pricing .card-body .btnBuy { margin-top: auto; color: #fff; }

.pricing .btnBuy,
.pricing .btnOrder {
    display: block; width: 100%; padding: 13px 24px;
    border: 0; border-radius: 10px; cursor: pointer;
    background: var(--pp-grad); color: #fff;
    font-size: 16px; font-weight: 700; text-align: center; text-decoration: none;
    transition: background .15s ease, transform .15s ease;
}
/* Selector carries .card-body (0,4,0) for the same reason the base colour does:
   Bootstrap's a:not([href]):not([tabindex]):hover{color:inherit} is (0,3,1) and
   would otherwise darken the label on hover. :focus is in the same reset. */
.pricing .card-body .btnBuy:hover,
.pricing .card-body .btnBuy:focus,
.pricing .card-body .btnOrder:hover,
.pricing .card-body .btnOrder:focus { background: var(--pp-primary-dark); background-image: none; color: #fff; text-decoration: none; }
.pricing .btnBuy:active,
.pricing .btnOrder:active { transform: translateY(1px); }

/* The outlined variant has to come after the filled rules above — same specificity,
   so source order is what decides which one paints the quotation button. */
.pricing .card-body .btnOrder-alt,
.pricing .card-body .btnOrder-alt:focus {
    margin-top: 10px;
    background: transparent; background-image: none;
    border: 1.5px solid var(--pp-primary); color: var(--pp-primary);
}
.pricing .card-body .btnOrder-alt:hover {
    margin-top: 10px;
    background: var(--pp-soft); background-image: none;
    border: 1.5px solid var(--pp-primary); color: var(--pp-primary); text-decoration: none;
}

/* ---------- bundle recommendation card (JS-owned #bundleCard) ---------- */
#bundleCard { order: -1; } /* always takes the left slot when it replaces the single card */
.pricing.card.is-bundle .card-head { background: linear-gradient(135deg, #6d28d9 0%, #4338ca 100%); }
.bundle-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 2px; }
.bundle-item {
    display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px;
    padding: 12px 14px; border: 1px solid var(--pp-border); border-radius: 12px; background: #faf9ff;
}
.bundle-item-tag {
    padding: 4px 10px; border-radius: 8px; background: var(--pp-grad);
    color: #fff; font-size: 12.5px; font-weight: 800; white-space: nowrap;
}
.bundle-item-range { font-size: 13.5px; color: var(--pp-ink); font-variant-numeric: tabular-nums; }
.bundle-item-cost { text-align: right; white-space: nowrap; }
.bundle-item-full { display: block; font-size: 12px; color: #9aa7bd; text-decoration: line-through; font-variant-numeric: tabular-nums; }
.bundle-item-price { font-size: 16px; font-weight: 800; color: var(--pp-heading); font-variant-numeric: tabular-nums; }
.bundle-total {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 14px; padding-top: 14px; border-top: 2px dashed var(--pp-border);
}
.bundle-total-label { font-size: 15px; font-weight: 700; color: var(--pp-ink); }
.bundle-total-price { font-size: 30px; font-weight: 800; color: var(--pp-heading); font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.pricing.card.is-bundle .vat-show { font-size: 13px; color: var(--pp-muted); font-variant-numeric: tabular-nums; margin-top: 2px; }
.bundle-cover {
    margin-top: 10px; font-size: 13px; font-weight: 600; color: var(--pp-good);
    display: flex; align-items: center; gap: 7px;
}
.bundle-cover i { font-size: 15px; }

/* ---------- info cards (why / price table) ---------- */
.pp-info-card {
    background: var(--pp-card);
    border: 1px solid var(--pp-border);
    border-radius: var(--pp-radius);
    box-shadow: 0 6px 20px rgba(88, 63, 200, .07);
    padding: 24px 28px;
}
.pp-info-card + .pp-info-card { margin-top: 24px; }
.pp-info-card h5 { font-size: 18px; font-weight: 800; margin: 0 0 18px; color: var(--pp-ink); }

.pp-why-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 24px; }
.pp-why-item { display: flex; gap: 12px; align-items: flex-start; }
.pp-why-badge {
    flex: 0 0 auto; width: 44px; height: 44px; border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--pp-grad); color: #fff;
    font-size: 13px; font-weight: 800;
}
.pp-why-item b { display: block; font-size: 14.5px; margin-bottom: 2px; }
.pp-why-item small { font-size: 12.5px; color: var(--pp-muted); line-height: 1.5; display: block; }

/* price table — rows generated by JS from the live tiers */
.pp-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.pp-price-table { width: 100%; border-collapse: separate; border-spacing: 0 6px; }
.pp-price-table td {
    padding: 12px 16px; font-size: 14.5px;
    font-variant-numeric: tabular-nums;
}
/* the unit ("หน่วย") must never be orphaned from its range */
.pp-price-table td:first-child { white-space: nowrap; }
.pp-price-table .pt-pkg {
    display: block; font-size: 12px; font-weight: 800;
    color: var(--pp-primary); letter-spacing: .2px;
}
.pp-price-table .pt-range { display: block; }
.pp-price-table td:last-child { text-align: right; font-weight: 800; color: var(--pp-heading); white-space: nowrap; }
.pp-price-table .pt-full { color: #9aa7bd; font-weight: 500; text-decoration: line-through; margin-right: 6px; }
.pp-price-table .pt-promo { color: var(--pp-heading); }
.pp-price-table .pt-off { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 20px; background: #fdeef1; color: #d6336c; font-size: 11.5px; font-weight: 700; }
.pp-price-table tr { cursor: pointer; }
.pp-price-table tr td:first-child { border-radius: 10px 0 0 10px; }
.pp-price-table tr td:last-child { border-radius: 0 10px 10px 0; }
.pp-price-table tr:hover td { background: #f6f4fe; }
.pp-price-table tr.active td { background: var(--pp-soft); }
.pp-price-note { font-size: 13px; color: var(--pp-muted); margin: 12px 4px 0; }
.pp-price-note a, .pp-price-note b { color: var(--pp-primary); font-weight: 700; text-decoration: none; }

/* ---------- contact banner ---------- */
.pp-banner {
    background: var(--pp-grad); color: #fff;
    border-radius: var(--pp-radius);
    padding: 28px 32px; margin-top: 28px;
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
}
.pp-banner b { font-size: 18px; display: block; margin-bottom: 4px; }
.pp-banner small { font-size: 14px; opacity: .85; }
.pp-banner .pp-banner-btn {
    background: #fff; color: var(--pp-primary);
    font-weight: 800; font-size: 15px;
    padding: 11px 26px; border-radius: 10px; text-decoration: none; white-space: nowrap;
}
.pp-banner .pp-banner-btn:hover { background: var(--pp-soft); color: var(--pp-primary-dark); }

.div-contact { padding: 56px 24px; font-size: 19px; color: var(--pp-muted); }
.hidden { display: none !important; }

/* ---------- responsive ---------- */
@media (max-width: 991.98px) {
    .pp-why-grid { grid-template-columns: 1fr; }
}
@media (max-width: 575.98px) {
    .pricing-page { padding: 32px 0 40px; }
    .pricing-title { font-size: 25px; }
    /* This panel alone goes edge-to-edge on phones: the negative margins cancel the
       .pp-container padding (0 20px), so keep the two in step if that changes. Side
       borders and the radius come off so it reads as a full-width band; the other
       cards keep their inset and rounded corners. */
    .unit-panel {
        padding: 22px 18px 16px;
        margin-left: -20px; margin-right: -20px;
        border-radius: 0; border-left: 0; border-right: 0;
    }
    /* Stack the label and the box on their own rows — side by side is too cramped on a
       phone. */
    .unit-panel-top { flex-direction: column; align-items: flex-start; gap: 0; margin-bottom: 44px; }
    .unit-input-wrap { margin-top: 12px; }
    .unit-input { width: 78px; } /* tighter so the box + side tooltip fit narrow screens */
    /* Beside the box (not above) to save vertical space: the tooltip sits to the right,
       its arrow pointing left at the box, and nudges sideways instead of bobbing up. */
    .unit-input-chip {
        font-size: 12.5px; padding: 4px 11px;
        top: calc(50% - 12px); bottom: auto; left: calc(100% + 14px); right: auto;
        animation: chip-nudge 2.2s ease-in-out infinite;
    }
    .unit-input-chip::after {
        left: -5px; right: auto; top: 50%; bottom: auto;
        transform: translateY(-50%);
        border: 5px solid transparent; border-right-color: var(--chip-color, var(--pp-primary));
        border-left: 0;
    }
    /* All six boundaries on one row. The labels sit at fixed points on the track, so
       the only way to buy space between them is to set them smaller — these are a
       scale legend, not body copy. Measured at 320px (the tightest case): 12px
       leaves a 1px gap, 11px leaves 7px. Wider phones get more. */
    .unit-slider-ticks { font-size: 11px; }
    .bundle-total-price { font-size: 26px; }
    .pricing .card-body { padding: 22px 20px 24px; }
    .pricing .price-value { font-size: 40px; }
    .pp-info-card { padding: 20px 18px; }
    /* The range column is nowrap, so buy it room on narrow screens: tighter cells
       and the struck-through full price moved onto its own line. */
    .pp-price-table td { padding: 10px 10px; font-size: 13.5px; }
    .pp-price-table .pt-full { display: block; margin: 0 0 2px; }
    .pp-banner { padding: 22px 20px; }
}
@media (prefers-reduced-motion: reduce) {
    .pricing-page * { transition: none !important; }
    .unit-input-chip { animation: none !important; }
}
