/* ==========================================================
   อภิวัฒน์ เครื่องเขียน — ธีมขาว มินิมอล
   แนวคิด: กระดาษขาว + หมึกปากกาลูกลื่นสีน้ำเงิน + ปากกาแดงสำหรับส่วนลด
   ========================================================== */

:root {
    --paper: #ffffff;
    --surface: #f4f5f3;
    --surface-2: #eceeea;
    /* สีหลักอิงจากโลโก้: กรมท่า #263f53 (ส้ม #e6a04a ใช้เฉพาะในโลโก้) */
    --ink: #1c2a37;
    --pencil: #66707a;
    --pencil-light: #98a0a8;
    --line: #e4e6e6;
    --ruled: #dee5eb;
    --blue: #263f53;
    --blue-hover: #1b2e3d;
    --blue-soft: #edf1f4;
    --red: #b4322c;
    --red-soft: #fbefee;
    --green: #2f7a4f;
    --green-soft: #ecf5ef;
    --amber: #8a6212;
    --amber-soft: #fbf4e4;

    --radius-sm: 6px;
    --radius: 10px;
    --font: 'IBM Plex Sans Thai', system-ui, -apple-system, 'Segoe UI', sans-serif;

    /* ปรับตัวแปร Bootstrap ให้เข้ากับธีม */
    --bs-body-font-family: var(--font);
    --bs-body-color: var(--ink);
    --bs-body-bg: var(--paper);
    --bs-border-color: var(--line);
    --bs-secondary-color: var(--pencil);
    --bs-link-color: var(--blue);
    --bs-link-color-rgb: 38, 63, 83;
    --bs-link-hover-color: var(--blue-hover);
    --bs-focus-ring-color: rgba(38, 63, 83, .25);
}

*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: var(--font);
    background: var(--paper);
    color: var(--ink);
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main { flex: 1 0 auto; }

h1, h2, h3, h4, h5, h6 { font-weight: 500; color: var(--ink); line-height: 1.3; }

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-hover); }

:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
}

.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--pencil); }
.small-text { font-size: .875rem; }

.wrap {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px;
}
.wrap-narrow { max-width: 760px; }

@media (max-width: 575px) {
    .wrap { padding: 0 16px; }
}

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--line);
}
.site-header .wrap {
    display: flex;
    align-items: center;
    gap: 32px;
    height: 76px;
}
.brand {
    display: flex;
    align-items: baseline;
    gap: 8px;
    color: var(--ink);
    font-weight: 600;
    font-size: 1.125rem;
    letter-spacing: -.01em;
    white-space: nowrap;
}
.brand:hover { color: var(--ink); }
.brand-logo { display: block; height: 46px; width: auto; }
@media (max-width: 640px) { .brand-logo { height: 36px; } }
.brand-mark {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--blue);
    display: inline-block;
    transform: translateY(-1px);
}
.site-nav {
    display: flex;
    gap: 24px;
    margin-right: auto;
}
.site-nav a {
    color: var(--pencil);
    font-size: .95rem;
    padding: 4px 0;
    border-bottom: 1.5px solid transparent;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a.is-active { color: var(--ink); border-bottom-color: var(--ink); }

.cart-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ink);
    font-size: .95rem;
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    white-space: nowrap;
}
.cart-link:hover { color: var(--ink); border-color: var(--ink); }
.cart-count {
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--blue);
    color: #fff;
    font-size: .75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 640px) {
    .site-header .wrap { gap: 16px; height: auto; padding-top: 12px; padding-bottom: 12px; flex-wrap: wrap; }
    .site-nav { order: 3; width: 100%; gap: 20px; }
    .brand { margin-right: auto; }
    .cart-link .cart-label { display: none; }
}

/* ---------- Footer ---------- */
.site-footer {
    border-top: 1px solid var(--line);
    margin-top: 96px;
    padding: 32px 0 40px;
    color: var(--pencil);
    font-size: .875rem;
}
.site-footer .wrap {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px 32px;
}
.site-footer a { color: var(--pencil); }
.footer-contact { font-style: normal; margin: 0; line-height: 1.7; }
.footer-name { color: var(--ink); font-weight: 500; margin-bottom: 2px; }
.footer-contact a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.site-footer a:hover { color: var(--ink); }

/* ---------- Buttons ---------- */
.btn {
    --bs-btn-font-family: var(--font);
    --bs-btn-font-weight: 500;
    --bs-btn-padding-x: 1.25rem;
    --bs-btn-padding-y: .6rem;
    --bs-btn-border-radius: 999px;
    --bs-btn-focus-box-shadow: 0 0 0 3px rgba(38, 63, 83, .2);
    transition: background-color .15s, border-color .15s, color .15s;
}
.btn-ink {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--ink);
    --bs-btn-border-color: var(--ink);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #000;
    --bs-btn-hover-border-color: #000;
    --bs-btn-active-bg: #000;
    --bs-btn-active-color: #fff;
    --bs-btn-disabled-bg: var(--surface-2);
    --bs-btn-disabled-border-color: var(--surface-2);
    --bs-btn-disabled-color: var(--pencil);
}
.btn-blue {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--blue);
    --bs-btn-border-color: var(--blue);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--blue-hover);
    --bs-btn-hover-border-color: var(--blue-hover);
    --bs-btn-active-bg: var(--blue-hover);
    --bs-btn-active-color: #fff;
}
.btn-line {
    --bs-btn-color: var(--ink);
    --bs-btn-bg: transparent;
    --bs-btn-border-color: var(--line);
    --bs-btn-hover-color: var(--ink);
    --bs-btn-hover-bg: var(--surface);
    --bs-btn-hover-border-color: var(--pencil-light);
    --bs-btn-active-bg: var(--surface-2);
    --bs-btn-active-color: var(--ink);
}
.btn-quiet {
    --bs-btn-color: var(--pencil);
    --bs-btn-bg: transparent;
    --bs-btn-border-color: transparent;
    --bs-btn-hover-color: var(--ink);
    --bs-btn-hover-bg: var(--surface);
    --bs-btn-hover-border-color: transparent;
}
.btn-danger-quiet {
    --bs-btn-color: var(--red);
    --bs-btn-bg: transparent;
    --bs-btn-border-color: transparent;
    --bs-btn-hover-color: var(--red);
    --bs-btn-hover-bg: var(--red-soft);
    --bs-btn-hover-border-color: transparent;
}
.btn-lg { --bs-btn-padding-y: .85rem; --bs-btn-font-size: 1.05rem; }
.btn-sm { --bs-btn-padding-x: .85rem; --bs-btn-padding-y: .35rem; --bs-btn-font-size: .85rem; }

/* ---------- Forms ---------- */
.form-label {
    font-size: .9rem;
    font-weight: 500;
    color: var(--ink);
    margin-bottom: 6px;
}
.form-label .opt { color: var(--pencil-light); font-weight: 400; }
.form-control, .form-select {
    font-family: var(--font);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: .65rem .85rem;
    color: var(--ink);
    background-color: var(--paper);
}
.form-control::placeholder { color: var(--pencil-light); }
.form-control:focus, .form-select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(38, 63, 83, .12);
}
.form-text { color: var(--pencil); font-size: .85rem; }

/* ---------- Flash / toast ---------- */
.notice {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: .95rem;
    margin-bottom: 24px;
}
.notice-success { background: var(--green-soft); color: var(--green); }
.notice-error { background: var(--red-soft); color: var(--red); }
.notice-info { background: var(--blue-soft); color: var(--blue); }
.notice a { color: inherit; text-decoration: underline; text-underline-offset: 3px; margin-left: auto; white-space: nowrap; }

/* ---------- Hero: กระดาษเส้นบรรทัด ---------- */
.hero {
    --rule: 40px;          /* ระยะห่างเส้นบรรทัด */
    --baseline: 26px;      /* ตำแหน่งเส้นให้ตรงกับฐานตัวอักษร */
    position: relative;
    margin: 32px 0 56px;
    padding: var(--rule) 0 var(--rule) 88px;
    background-image: linear-gradient(to bottom, transparent calc(var(--rule) - 1px), var(--ruled) 0);
    background-size: 100% var(--rule);
    background-position: 0 calc(var(--baseline) - var(--rule) + 1px);
    overflow: hidden;
}
/* เส้นแดงขอบสมุด */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 56px;
    width: 1px;
    background: rgba(180, 50, 44, .45);
}
.hero h1 {
    font-weight: 300;
    font-size: clamp(2.25rem, 5.2vw, 4rem);
    line-height: calc(var(--rule) * 2);
    letter-spacing: -.02em;
    margin: 0;
    position: relative;
    top: var(--h1-shift, 10px); /* ขยับหัวข้อตัวใหญ่ให้วางบนเส้น */
}
.hero p {
    font-size: 1.1rem;
    color: var(--pencil);
    margin: var(--rule) 0 0;
    max-width: 46ch;
    line-height: var(--rule);
}
@media (max-width: 640px) {
    .hero { --rule: 32px; --baseline: 22px; padding-left: 36px; margin: 16px 0 40px; }
    .hero::before { left: 20px; }
    .hero h1 { font-size: 2rem; }
    .hero p { font-size: 1rem; }
}

/* ---------- Catalog toolbar ---------- */
.catalog-bar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px 32px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}
.cat-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.cat-tabs a {
    padding: 7px 16px;
    border-radius: 999px;
    border: 1px solid var(--line);
    color: var(--pencil);
    font-size: .925rem;
    white-space: nowrap;
}
.cat-tabs a:hover { color: var(--ink); border-color: var(--pencil-light); }
.cat-tabs a.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }

.sort-form { display: flex; align-items: center; gap: 10px; }
.sort-form label { color: var(--pencil); font-size: .9rem; white-space: nowrap; }
.sort-form .form-select { width: auto; padding-top: .45rem; padding-bottom: .45rem; font-size: .925rem; border-radius: 999px; }

.result-count { color: var(--pencil); font-size: .9rem; margin-bottom: 20px; }

/* ---------- Product grid ---------- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 40px 24px;
}
@media (max-width: 991px) { .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 767px) { .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 16px; } }

.product { display: flex; flex-direction: column; }
.product-media {
    position: relative;
    aspect-ratio: 1 / 1;
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 14px;
}
.product-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s ease;
}
.product:hover .product-media img { transform: scale(1.03); }
.product-media .placeholder-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--pencil-light);
    font-size: 2rem;
}
.product.is-soldout .product-media img { opacity: .5; filter: grayscale(1); }

.tag {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 500;
    background: var(--paper);
}
.tag-sale { color: var(--red); }
.tag-soldout { color: var(--pencil); }

.product-name {
    font-size: .975rem;
    font-weight: 400;
    margin: 0 0 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.9em;
    line-height: 1.45;
}
.product-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 14px;
}
.price { font-weight: 600; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.price.is-sale { color: var(--red); }
.price-was {
    color: var(--pencil-light);
    font-size: .875rem;
    text-decoration: line-through;
    text-decoration-color: rgba(180, 50, 44, .6);
    font-variant-numeric: tabular-nums;
}
.product form { margin-top: auto; }
.product .btn { width: 100%; }
.stock-low { color: var(--amber); font-size: .825rem; margin: -8px 0 12px; }

/* ---------- Empty states ---------- */
.empty {
    text-align: center;
    padding: 80px 24px;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
}
.empty i { font-size: 2.25rem; color: var(--pencil-light); }
.empty h2 { font-size: 1.25rem; font-weight: 500; margin: 16px 0 8px; }
.empty p { color: var(--pencil); margin: 0 0 24px; }

/* ---------- Page heading ---------- */
.page-head { margin: 48px 0 32px; }
.page-head h1 { font-size: clamp(1.75rem, 3.5vw, 2.25rem); font-weight: 300; letter-spacing: -.015em; margin: 0 0 6px; }
.page-head p { color: var(--pencil); margin: 0; }

/* ---------- Steps (ตะกร้า → ชำระเงิน → เสร็จสิ้น) ---------- */
.steps {
    display: flex;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 32px 0 0;
    font-size: .875rem;
    color: var(--pencil-light);
    flex-wrap: wrap;
}
.steps li { display: flex; align-items: center; gap: 8px; }
.steps li + li::before { content: ''; width: 24px; height: 1px; background: var(--line); }
.steps .n {
    width: 22px; height: 22px;
    border-radius: 50%;
    border: 1px solid var(--line);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .75rem;
}
.steps .is-done { color: var(--pencil); }
.steps .is-done .n { background: var(--surface-2); border-color: var(--surface-2); }
.steps .is-current { color: var(--ink); font-weight: 500; }
.steps .is-current .n { background: var(--ink); border-color: var(--ink); color: #fff; }
/* จอเล็ก: แสดงชื่อเฉพาะขั้นตอนปัจจุบัน */
@media (max-width: 480px) {
    .steps { flex-wrap: nowrap; }
    .steps li:not(.is-current) { font-size: 0; gap: 0; }
    .steps li + li::before { margin-right: 8px; }
}

/* ---------- Cart ---------- */
.layout-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 56px;
    align-items: start;
}
@media (max-width: 991px) { .layout-split { grid-template-columns: 1fr; gap: 40px; } }

.cart-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.cart-item {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr) auto;
    gap: 20px;
    padding: 20px 0;
    border-bottom: 1px solid var(--line);
    align-items: center;
}
.cart-thumb {
    width: 88px; height: 88px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    color: var(--pencil-light);
}
.cart-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-info h3 { font-size: 1rem; font-weight: 500; margin: 0 0 2px; }
.cart-info .meta { color: var(--pencil); font-size: .875rem; }
.cart-info .warn { color: var(--amber); font-size: .825rem; margin-top: 4px; }
.cart-controls { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.cart-sum { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

.qty {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    overflow: hidden;
}
.qty button {
    width: 34px; height: 34px;
    border: 0;
    background: transparent;
    color: var(--ink);
    font-size: 1rem;
    line-height: 1;
}
.qty button:hover { background: var(--surface); }
.qty button:disabled { color: var(--pencil-light); background: transparent; }
.qty input {
    width: 40px;
    border: 0;
    text-align: center;
    font-variant-numeric: tabular-nums;
    font-family: var(--font);
    -moz-appearance: textfield;
    appearance: textfield;
    background: transparent;
}
.qty input::-webkit-outer-spin-button,
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty input:focus { outline: none; }

.cart-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 20px;
}

@media (max-width: 575px) {
    .cart-item { grid-template-columns: 64px minmax(0, 1fr); gap: 14px; }
    .cart-thumb { width: 64px; height: 64px; }
    .cart-sum { grid-column: 2; text-align: left; }
}

/* ---------- Summary panel ---------- */
.summary {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 28px;
    position: sticky;
    top: 88px;
}
.summary h2 { font-size: 1.05rem; font-weight: 500; margin: 0 0 20px; }
.summary-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 6px 0;
    font-size: .95rem;
}
.summary-row span:first-child { color: var(--pencil); }
.summary-row span:last-child { font-variant-numeric: tabular-nums; }
.summary-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-top: 1px solid var(--line);
    margin-top: 12px;
    padding-top: 16px;
    margin-bottom: 24px;
}
.summary-total span:first-child { font-weight: 500; }
.summary-total span:last-child { font-size: 1.5rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.summary .btn { width: 100%; }
.summary .hint { color: var(--pencil); font-size: .85rem; margin: 12px 0 0; text-align: center; }

.summary-items { list-style: none; padding: 0; margin: 0 0 16px; border-bottom: 1px solid var(--line); }
.summary-items li { display: flex; justify-content: space-between; gap: 12px; padding: 0 0 12px; font-size: .925rem; }
.summary-items .q { color: var(--pencil); }

/* ---------- Checkout ---------- */
.section-block { padding-bottom: 40px; margin-bottom: 40px; border-bottom: 1px solid var(--line); }
.section-block:last-child { border-bottom: 0; margin-bottom: 0; }
.section-title { display: flex; align-items: baseline; gap: 12px; font-size: 1.15rem; font-weight: 500; margin: 0 0 24px; }
.section-title .n { color: var(--pencil-light); font-weight: 400; font-variant-numeric: tabular-nums; }

.pay-box {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 28px;
    align-items: center;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 24px;
}
.pay-box .qr {
    width: 200px; height: 200px;
    background: var(--paper);
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
}
.pay-box .qr img { width: 100%; height: auto; display: block; }
.pay-box .qr { overflow: hidden; height: auto; }
.pay-box .qr.is-dynamic { border: 1px solid var(--line); padding: 6px; }
.pay-box .qr.is-dynamic img { image-rendering: pixelated; }
.qr-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.pay-account { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.copy-row { flex-wrap: wrap; row-gap: 2px; }
.copy-row > span, .copy-row .btn, .pay-account > span { white-space: nowrap; }
@media (max-width: 575px) { .pay-account { justify-content: center; } }
.pay-box .qr.qr-loading { min-height: 200px; border: 1px dashed var(--line); text-align: center; padding: 16px; }

/* ปุ่มแสดงเบอร์โทร (ท้ายเว็บ) */
.reveal-btn {
    border: 0;
    background: none;
    padding: 0;
    color: var(--ink);
    font: inherit;
    text-decoration: underline;
    text-decoration-color: var(--line);
    text-underline-offset: 3px;
    cursor: pointer;
}
.reveal-btn:hover { text-decoration-color: var(--ink); }
.pay-amount { font-size: 2rem; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.01em; line-height: 1.2; }
.pay-meta { color: var(--pencil); font-size: .9rem; margin: 4px 0 16px; }
.copy-row { display: flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
@media (max-width: 575px) {
    .pay-box { grid-template-columns: 1fr; justify-items: center; text-align: center; }
    .copy-row { justify-content: center; }
}

.dropzone {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border: 1.5px dashed var(--line);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color .15s, background-color .15s;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--blue); background: var(--blue-soft); }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone:focus-within { border-color: var(--blue); }
.dropzone .dz-icon {
    width: 48px; height: 48px; flex: none;
    border-radius: var(--radius-sm);
    background: var(--surface);
    display: flex; align-items: center; justify-content: center;
    color: var(--pencil);
    font-size: 1.25rem;
    overflow: hidden;
}
.dropzone .dz-icon img { width: 100%; height: 100%; object-fit: cover; }
.dropzone .dz-title { font-weight: 500; }
.dropzone .dz-sub { color: var(--pencil); font-size: .85rem; }
.dropzone.has-file { border-style: solid; border-color: var(--green); background: var(--green-soft); }

/* ---------- Success ---------- */
.done {
    text-align: center;
    padding: 72px 0 24px;
}
.done-mark {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--green-soft);
    color: var(--green);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 24px;
}
.done h1 { font-weight: 300; font-size: clamp(1.75rem, 4vw, 2.5rem); margin: 0 0 12px; }
.done p { color: var(--pencil); max-width: 46ch; margin: 0 auto; }
.order-no {
    display: inline-block;
    margin: 32px 0;
    padding: 20px 32px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.order-no small { display: block; color: var(--pencil); font-size: .85rem; }
.order-no strong { font-size: 1.5rem; font-weight: 600; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.done-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; }

/* ---------- Track ---------- */
.track-form {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}
.track-form .form-control { border-radius: 999px; padding-left: 1.25rem; }
@media (max-width: 575px) { .track-form { flex-direction: column; } }

.order-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 20px;
}
.order-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 18px 24px;
    border-bottom: 1px solid var(--line);
}
.order-card-head strong { font-weight: 600; font-variant-numeric: tabular-nums; }
.order-card-head .date { color: var(--pencil); font-size: .875rem; margin-left: 10px; }
.order-card-body { padding: 20px 24px; }
.order-lines { list-style: none; padding: 0; margin: 0 0 16px; }
.order-lines li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: .95rem; }
.order-lines .q { color: var(--pencil); }
.order-total { display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 12px; font-size: .95rem; }
.order-total strong { font-variant-numeric: tabular-nums; }

/* ความคืบหน้าคำสั่งซื้อ */
.progress-track {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}
.progress-track div { font-size: .8rem; color: var(--pencil-light); }
.progress-track div::before {
    content: '';
    display: block;
    height: 3px;
    border-radius: 3px;
    background: var(--surface-2);
    margin-bottom: 8px;
}
.progress-track .is-on { color: var(--ink); }
.progress-track .is-on::before { background: var(--blue); }

.tracking-no {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: .95rem;
}
.tracking-no strong { font-variant-numeric: tabular-nums; letter-spacing: .03em; }

/* ---------- Status pill ---------- */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 12px;
    border-radius: 999px;
    font-size: .825rem;
    font-weight: 500;
    white-space: nowrap;
}
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-pending { background: var(--amber-soft); color: var(--amber); }
.pill-shipping { background: var(--blue-soft); color: var(--blue); }
.pill-shipped { background: var(--green-soft); color: var(--green); }

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