:root {
    --green-950: #0a3523;
    --green-900: #0f4a30;
    --green-800: #145f3a;
    --green-700: #1b7546;
    --green-600: #2c8a55;
    --green-500: #48a56a;
    --green-100: #eaf5ed;
    --green-050: #f5faf6;
    --ink: #18231d;
    --muted: #68746d;
    --line: #dce6df;
    --surface: #ffffff;
    --surface-2: #f8faf8;
    --warm: #fbf7ef;
    --accent: #b38a3e;
    --accent-soft: #f8edd2;
    --danger: #b13e3e;
    --danger-soft: #fff1f1;
    --info: #346e9d;
    --info-soft: #edf6fd;
    --shadow-sm: 0 6px 18px rgba(26, 49, 36, 0.06);
    --shadow-md: 0 16px 44px rgba(26, 49, 36, 0.10);
    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --header-h: 78px;
    --content-w: 1520px;
    --sidebar-w: 248px;
    font-family: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", "Heiti TC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    background: #fff;
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    cursor: pointer;
}

img {
    display: block;
    max-width: 100%;
}

svg {
    display: block;
}

.svg-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.icon {
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
}

.icon-sm {
    width: 18px;
    height: 18px;
}

.icon-lg {
    width: 28px;
    height: 28px;
}

.skip-link {
    position: fixed;
    left: 16px;
    top: -60px;
    z-index: 9999;
    background: var(--green-900);
    color: #fff;
    padding: 10px 16px;
    border-radius: 10px;
}

.skip-link:focus {
    top: 16px;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-h);
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(14px);
}

.header-inner {
    width: min(calc(100% - 48px), var(--content-w));
    height: 100%;
    margin: 0 auto;
    display: grid;
    grid-template-columns: auto minmax(420px, 1fr) minmax(280px, 360px) auto;
    gap: 16px;
    align-items: center;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--green-950);
    min-width: 214px;
}

.brand-mark {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(150deg, #ecf6ee, #d9ecdd);
    color: var(--green-800);
    border: 1px solid #d3e5d7;
}

.brand-copy {
    line-height: 1.15;
}

.brand-name {
    font-size: 25px;
    font-weight: 850;
    letter-spacing: .04em;
}

.brand-sub {
    margin-top: 5px;
    font-size: 12px;
    color: var(--green-700);
    letter-spacing: .14em;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.nav-link {
    border: 0;
    background: transparent;
    color: var(--ink);
    padding: 12px 15px;
    border-radius: 12px;
    font-weight: 750;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.nav-link:hover,
.nav-link.active {
    color: var(--green-900);
    background: var(--green-050);
}

.search-box {
    display: grid;
    grid-template-columns: 1fr 54px;
    border: 1px solid #cfdcd2;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    min-width: 0;
}

.search-box input {
    min-width: 0;
    border: 0;
    outline: 0;
    padding: 12px 16px;
    color: var(--ink);
    background: transparent;
}

.search-box button {
    border: 0;
    background: var(--green-800);
    color: #fff;
    display: grid;
    place-items: center;
}

.search-box button:hover {
    background: var(--green-900);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: end;
}

.header-action {
    position: relative;
    border: 0;
    background: transparent;
    color: var(--ink);
    padding: 10px 11px;
    border-radius: 11px;
    font-weight: 760;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
}

.header-action:hover {
    background: var(--green-050);
    color: var(--green-900);
}

.count-badge {
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    background: var(--green-800);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
}

.mobile-menu-btn {
    display: none;
}

.site-shell {
    width: min(calc(100% - 48px), var(--content-w));
    margin: 26px auto 0;
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    gap: 26px;
    align-items: start;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: calc(var(--header-h) + 20px);
}

.side-card {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.side-card.soft {
    background: linear-gradient(180deg, #fbfdfb, var(--green-050));
}

.side-card-head {
    padding: 19px 20px 8px;
}

.side-card-title {
    margin: 0;
    color: var(--green-950);
    font-size: 20px;
    font-weight: 850;
}

.side-card-desc {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.side-body {
    padding: 16px 20px 20px;
}

.member-greeting {
    font-size: 28px;
    font-weight: 900;
    color: var(--green-950);
    letter-spacing: .02em;
}

.member-level {
    display: inline-flex;
    margin-top: 10px;
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: #73581f;
    font-size: 13px;
    font-weight: 800;
}

.side-metric {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 15px 0;
    border-top: 1px solid var(--line);
    color: var(--ink);
}

.side-metric:first-child {
    border-top: 0;
}

.side-metric strong {
    color: var(--green-900);
    font-size: 19px;
}

.side-list {
    display: flex;
    flex-direction: column;
}

.side-link {
    width: 100%;
    border: 0;
    background: #fff;
    color: var(--ink);
    display: grid;
    grid-template-columns: 26px 1fr 20px;
    align-items: center;
    gap: 10px;
    padding: 16px 18px;
    border-top: 1px solid var(--line);
    text-align: left;
    font-weight: 760;
}

.side-link:first-child {
    border-top: 0;
}

.side-link:hover {
    background: var(--green-050);
    color: var(--green-900);
}

.side-link small {
    display: block;
    color: var(--muted);
    font-weight: 500;
    margin-top: 2px;
}

.sidebar-cta {
    width: 100%;
    border: 0;
    border-radius: 12px;
    padding: 13px 16px;
    background: var(--green-800);
    color: #fff;
    font-weight: 850;
}

.sidebar-cta.secondary {
    background: #fff;
    color: var(--green-800);
    border: 1px solid var(--green-700);
    margin-top: 10px;
}

.sidebar-cta:hover {
    filter: brightness(.95);
}

.content {
    min-width: 0;
}

.hero {
    position: relative;
    min-height: 330px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background-image: linear-gradient(90deg, rgba(250, 248, 241, .98) 0%, rgba(250, 248, 241, .90) 34%, rgba(250, 248, 241, .08) 66%), url('../images/hero.webp');
    background-size: cover;
    background-position: center;
    box-shadow: var(--shadow-md);
    border: 1px solid #e5e3d7;
}

.hero-copy {
    position: relative;
    z-index: 2;
    max-width: 620px;
    padding: 48px 54px;
}

.hero-kicker {
    color: var(--green-700);
    font-weight: 850;
    letter-spacing: .06em;
}

.hero h1 {
    margin: 8px 0 12px;
    color: var(--green-950);
    font-size: clamp(34px, 4vw, 52px);
    line-height: 1.16;
    letter-spacing: .02em;
}

.hero p {
    margin: 0;
    font-size: 18px;
    color: #3d4842;
}

.hero-points {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.hero-point {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .88);
    border: 1px solid #dbe5dc;
    color: var(--green-900);
    font-weight: 800;
}

.trust-strip {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #fff;
}

.trust-item {
    min-height: 86px;
    padding: 17px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 1px solid var(--line);
}

.trust-item:first-child {
    border-left: 0;
}

.trust-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--green-100);
    color: var(--green-800);
}

.trust-item strong {
    display: block;
    font-size: 15px;
}

.trust-item small {
    color: var(--muted);
}

.section {
    margin-top: 30px;
}

.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 16px;
}

.section-title {
    margin: 0;
    color: var(--green-950);
    font-size: 28px;
    font-weight: 900;
    letter-spacing: .02em;
}

.section-sub {
    margin: 3px 0 0;
    color: var(--muted);
}

.text-btn {
    border: 0;
    background: transparent;
    color: var(--green-800);
    font-weight: 850;
    padding: 7px 0;
}

.text-btn:hover {
    color: var(--green-950);
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}

.category-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #fff;
    min-width: 0;
    box-shadow: 0 2px 10px rgba(25, 48, 35, .035);
    transition: transform .18s ease, box-shadow .18s ease;
}

.category-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.category-card button {
    border: 0;
    background: #fff;
    width: 100%;
    padding: 0;
    text-align: center;
}

.category-card img {
    width: 100%;
    aspect-ratio: 1.58/1;
    object-fit: cover;
    background: #f4f6f4;
}

.category-name {
    display: block;
    padding: 12px 8px 14px;
    font-size: 17px;
    font-weight: 850;
    color: var(--ink);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
}

.product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #fff;
    transition: transform .18s ease, box-shadow .18s ease;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.product-media {
    position: relative;
    background: #f3f5f3;
    overflow: hidden;
}

.product-media img {
    width: 100%;
    aspect-ratio: 1.24/1;
    object-fit: cover;
}

.product-tag {
    position: absolute;
    left: 10px;
    top: 10px;
    background: rgba(15, 74, 48, .94);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    border-radius: 7px;
    padding: 4px 8px;
}

/* 商品收藏按鈕 */
.product-fav {
    position: absolute;
    top: 7px;
    right: 24px;
    z-index: 5;
    width: 32px;
    height: 32px;
    padding: 0;
    margin: 0;
    border: 1px solid rgba(255, 255, 255, .75);
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    color: #4e5c53;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.product-fav .icon {
    width: 19px;
    height: 19px;
    margin: 0;
    flex: none;
}

.product-body {
    padding: 14px 15px 15px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-name {
    margin: 0;
    font-size: 18px;
    font-weight: 850;
    line-height: 1.35;
}

.product-spec {
    margin-top: 5px;
    color: var(--muted);
    font-size: 14px;
    min-height: 22px;
}

.product-origin {
    margin-top: 5px;
    color: #7a857f;
    font-size: 12px;
}

.product-price-row {
    min-height: 48px;
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
}

.product-price {
    color: var(--green-900);
    font-size: 23px;
    font-weight: 900;
}

.product-price small {
    font-size: 12px;
    color: var(--muted);
    font-weight: 600;
    margin-left: 2px;
}

.visitor-price {
    color: var(--green-700);
    font-size: 13px;
    font-weight: 800;
}

.product-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    margin-top: 12px;
}

.btn {
    min-height: 43px;
    border-radius: 10px;
    border: 1px solid transparent;
    padding: 9px 14px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 7px;
    font-weight: 850;
    white-space: nowrap;
}

.btn-primary {
    background: var(--green-800);
    color: #fff;
    border-color: var(--green-800);
}

.btn-primary:hover {
    background: var(--green-900);
    border-color: var(--green-900);
}

.btn-outline {
    background: #fff;
    color: var(--green-800);
    border-color: #b9d1bf;
}

.btn-outline:hover {
    background: var(--green-050);
}

.btn-danger {
    background: #fff;
    color: var(--danger);
    border-color: #e8bcbc;
}

.btn-danger:hover {
    background: var(--danger-soft);
}

.btn-muted {
    background: #f0f3f1;
    color: #445149;
    border-color: #e0e5e2;
}

.order-panel {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #fff;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 13px 14px;
    border-bottom: 1px solid #e8eeea;
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
}

th {
    color: #4a574f;
    background: var(--surface-2);
    font-size: 13px;
    font-weight: 850;
}

tbody tr:last-child td {
    border-bottom: 0;
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 12px;
    font-weight: 850;
}

.status.green {
    background: #e9f6ec;
    color: #237443;
}

.status.blue {
    background: #edf6fd;
    color: #2d6b9b;
}

.status.gold {
    background: #fff7df;
    color: #8d6816;
}

.status.red {
    background: #fff0f0;
    color: #a33d3d;
}

.status.gray {
    background: #f0f2f1;
    color: #5f6b64;
}

.site-footer {
    margin-top: 40px;
    border-top: 1px solid var(--line);
    background: #fbfcfb;
}

.footer-inner {
    width: min(calc(100% - 48px), var(--content-w));
    margin: 0 auto;
    padding: 34px 0 42px;
    display: grid;
    grid-template-columns: 1.4fr repeat(3, 1fr);
    gap: 36px;
}

.footer-brand {
    max-width: 320px;
}

.footer-title {
    font-weight: 850;
    margin-bottom: 10px;
    color: var(--green-950);
}

.footer-links {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 14px;
}

.footer-links a {
    color: inherit;
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--green-800);
}

.copyright {
    border-top: 1px solid var(--line);
    padding: 16px 0;
    color: var(--muted);
    text-align: center;
    font-size: 13px;
}

/* Modal */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(9, 27, 18, .48);
    display: grid;
    place-items: center;
    padding: 24px;
}

.modal {
    width: min(680px, 100%);
    max-height: min(88vh, 880px);
    overflow: auto;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 30px 80px rgba(9, 27, 18, .25);
    border: 1px solid rgba(255, 255, 255, .5);
}

.modal.wide {
    width: min(960px, 100%);
}

.modal-head {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 20px 22px;
    border-bottom: 1px solid var(--line);
}

.modal-title {
    margin: 0;
    color: var(--green-950);
    font-size: 23px;
    font-weight: 900;
}

.icon-btn {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 10px;
    background: #f0f4f1;
    color: var(--ink);
}

.icon-btn:hover {
    background: #e6efe9;
}

.modal-body {
    padding: 22px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 0 22px 22px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-field {
    display: grid;
    gap: 7px;
}

.form-field.full {
    grid-column: 1 / -1;
}

.form-field label {
    font-weight: 800;
    color: #344239;
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    border: 1px solid #cad7ce;
    border-radius: 11px;
    padding: 11px 12px;
    outline: 0;
    background: #fff;
    color: var(--ink);
}

.form-field textarea {
    resize: vertical;
    min-height: 96px;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    border-color: var(--green-600);
    box-shadow: 0 0 0 3px rgba(72, 165, 106, .12);
}

.field-help {
    color: var(--muted);
    font-size: 12px;
}

.form-error {
    color: var(--danger);
    font-size: 13px;
}

.login-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 18px;
}

.login-tab {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 10px;
    padding: 9px 8px;
    font-weight: 800;
}

.login-tab.active {
    background: var(--green-050);
    color: var(--green-900);
    border-color: #b9d2c0;
}

.demo-box {
    margin-top: 16px;
    padding: 14px 15px;
    border-radius: 12px;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 13px;
}

.demo-box strong {
    color: var(--ink);
}

/* Cart */
.cart-list {
    display: grid;
    gap: 12px;
}

.cart-row {
    display: grid;
    grid-template-columns: 74px 1fr auto auto;
    gap: 14px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 13px;
}

.cart-row img {
    width: 74px;
    height: 64px;
    object-fit: cover;
    border-radius: 9px;
}

.qty {
    display: inline-grid;
    grid-template-columns: 34px 42px 34px;
    align-items: center;
    border: 1px solid #cdd9d0;
    border-radius: 9px;
    overflow: hidden;
}

.qty button {
    border: 0;
    background: #f5f8f6;
    height: 34px;
    display: grid;
    place-items: center;
}

.qty span {
    text-align: center;
    font-weight: 800;
}

.cart-summary {
    margin-top: 18px;
    border-top: 1px solid var(--line);
    padding-top: 16px;
    display: grid;
    gap: 8px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.summary-row.total {
    font-size: 21px;
    font-weight: 900;
    color: var(--green-950);
    margin-top: 5px;
}

/* Member center */
.page-title {
    margin: 0;
    font-size: 32px;
    color: var(--green-950);
    font-weight: 900;
}

.page-sub {
    margin: 5px 0 0;
    color: var(--muted);
}

.page-head {
    margin-bottom: 20px;
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
}

.panel {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fff;
    overflow: hidden;
}

.panel-head {
    padding: 17px 19px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.panel-title {
    margin: 0;
    font-size: 19px;
    color: var(--green-950);
    font-weight: 900;
}

.panel-body {
    padding: 18px 19px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.metric-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fff;
    padding: 18px;
    display: flex;
    gap: 13px;
    align-items: center;
}

.metric-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--green-100);
    color: var(--green-800);
    display: grid;
    place-items: center;
}

.metric-value {
    font-size: 25px;
    line-height: 1.2;
    font-weight: 900;
    color: var(--green-950);
}

.metric-label {
    color: var(--muted);
    font-size: 13px;
    margin-top: 3px;
}

.two-col {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, .8fr);
    gap: 16px;
}

/* Admin/driver shell */
.work-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
    background: #f7f9f7;
}

.work-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    background: #fff;
    border-right: 1px solid var(--line);
    padding: 22px 16px;
    display: flex;
    flex-direction: column;
}

.work-brand {
    padding: 0 8px 20px;
}

.work-profile {
    margin: 3px 7px 18px;
    padding: 14px;
    border-radius: 14px;
    background: var(--green-050);
}

.work-profile strong {
    display: block;
    font-size: 17px;
    color: var(--green-950);
}

.work-profile span {
    color: var(--muted);
    font-size: 13px;
}

.work-nav {
    display: grid;
    gap: 5px;
}

.work-nav button {
    width: 100%;
    border: 0;
    background: transparent;
    border-radius: 11px;
    padding: 12px 13px;
    color: #344239;
    display: flex;
    align-items: center;
    gap: 11px;
    text-align: left;
    font-weight: 780;
}

.work-nav button:hover,
.work-nav button.active {
    background: var(--green-100);
    color: var(--green-900);
}

.work-logout {
    margin-top: auto;
    width: 100%;
    border: 0;
    background: transparent;
    border-radius: 11px;
    padding: 12px 13px;
    color: #344239;
    text-align: left;
    font-weight: 780;
}

.work-logout:hover {
    background: var(--green-100);
    color: var(--green-900);
}

.work-main {
    min-width: 0;
}

.work-header {
    height: 74px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 60;
}

.work-header-title {
    font-size: 22px;
    font-weight: 900;
    color: var(--green-950);
}

.work-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.work-content {
    padding: 26px 28px 42px;
    max-width: 1540px;
    margin: 0 auto;
}

.admin-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.admin-toolbar input,
.admin-toolbar select {
    border: 1px solid #cad6ce;
    background: #fff;
    border-radius: 9px;
    padding: 9px 11px;
    outline: 0;
}

.driver-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.delivery-layout {
    margin-top: 18px;
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(330px, .75fr);
    gap: 16px;
}

.task-list {
    display: grid;
    gap: 12px;
}

.task-card {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    padding: 17px;
}

.task-top {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 16px;
}

.task-id {
    font-weight: 900;
    color: var(--green-900);
}

.task-grid {
    margin-top: 12px;
    display: grid;
    grid-template-columns: .8fr 1.5fr .7fr .7fr;
    gap: 12px;
}

.task-label {
    color: var(--muted);
    font-size: 12px;
}

.task-value {
    margin-top: 2px;
    font-weight: 750;
}

.task-actions {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.steps {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
}

.step {
    text-align: center;
    color: var(--muted);
    font-size: 12px;
}

.step-circle {
    margin: 0 auto 7px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #f0f4f1;
    color: #66736b;
    display: grid;
    place-items: center;
}

.step.done .step-circle,
.step.current .step-circle {
    background: var(--green-100);
    color: var(--green-800);
}

.step.current {
    color: var(--green-900);
    font-weight: 800;
}

.quick-list {
    display: grid;
    gap: 9px;
}

.quick-action {
    width: 100%;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 11px;
    padding: 12px 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    font-weight: 750;
}

.quick-action:hover {
    background: var(--surface-2);
}

/* Toast */
.toast-root {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 900;
    display: grid;
    gap: 10px;
    width: min(360px, calc(100% - 44px));
}

.toast {
    background: #183c29;
    color: #fff;
    padding: 13px 15px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    animation: toast-in .2s ease-out;
}

.toast.error {
    background: #7e3030;
}

@keyframes toast-in {
    from {
        transform: translateY(8px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.empty-state {
    padding: 42px 24px;
    text-align: center;
    color: var(--muted);
}

.empty-state .icon-wrap {
    width: 58px;
    height: 58px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: var(--green-050);
    color: var(--green-800);
    display: grid;
    place-items: center;
}

.hidden {
    display: none !important;
}

/* Tablet */
@media (max-width: 1320px) {
    :root {
        --sidebar-w: 225px;
    }

    .header-inner {
        grid-template-columns: auto 1fr minmax(220px, 340px) auto;
        gap: 14px;
    }

    .brand {
        min-width: 188px;
    }

    .brand-name {
        font-size: 22px;
    }

    .nav-link {
        padding: 10px 11px;
    }

    .product-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .category-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .trust-strip {
        grid-template-columns: repeat(3, 1fr);
    }

    .trust-item:nth-child(4) {
        border-left: 0;
        border-top: 1px solid var(--line);
    }

    .trust-item:nth-child(5) {
        border-top: 1px solid var(--line);
    }

    .dashboard-grid,
    .driver-metrics {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1080px) {
    .header-inner {
        grid-template-columns: auto 1fr auto;
    }

    .main-nav {
        display: none;
    }

    .search-box {
        grid-column: 2;
    }

    .mobile-menu-btn {
        display: inline-grid;
    }

    .site-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    .side-card {
        min-width: 0;
    }

    .hero {
        min-height: 310px;
    }

    .hero-copy {
        padding: 42px;
        max-width: 570px;
    }

    .work-shell {
        grid-template-columns: 76px minmax(0, 1fr);
    }

    .work-sidebar {
        padding: 18px 10px;
    }

    .work-brand .brand-copy,
    .work-profile,
    .work-nav span,
    .work-logout span {
        display: none;
    }

    .work-brand .brand {
        min-width: auto;
        justify-content: center;
    }

    .work-nav button,
    .work-logout {
        justify-content: center;
    }

    .delivery-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    :root {
        --header-h: 66px;
    }

    body {
        font-size: 15px;
    }

    .app-header {
        height: auto;
        min-height: var(--header-h);
    }

    .header-inner {
        width: min(calc(100% - 24px), var(--content-w));
        min-height: var(--header-h);
        grid-template-columns: auto 1fr auto;
        gap: 8px;
    }

    .brand {
        min-width: auto;
        gap: 8px;
    }

    .brand-mark {
        width: 40px;
        height: 40px;
        border-radius: 12px;
    }

    .brand-name {
        font-size: 20px;
    }

    .brand-sub {
        display: none;
    }

    .search-box {
        display: none;
    }

    .header-actions .header-action span.action-label {
        display: none;
    }

    .header-action {
        padding: 9px;
    }

    .header-actions {
        gap: 0;
    }

    .site-shell {
        width: min(calc(100% - 24px), var(--content-w));
        margin-top: 16px;
        gap: 16px;
    }

    .sidebar {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .sidebar .side-card:not(.mobile-priority) {
        display: none;
    }

    .hero {
        min-height: 370px;
        background-image: linear-gradient(180deg, rgba(250, 248, 241, .95) 0%, rgba(250, 248, 241, .88) 54%, rgba(250, 248, 241, .18) 100%), url('../images/hero.webp');
        background-position: 66% center;
    }

    .hero-copy {
        padding: 30px 24px;
        max-width: 100%;
    }

    .hero h1 {
        font-size: 34px;
    }

    .hero p {
        font-size: 16px;
    }

    .hero-point {
        padding: 8px 11px;
    }

    .trust-strip {
        grid-template-columns: 1fr 1fr;
    }

    .trust-item {
        min-height: 76px;
        padding: 13px;
    }

    .trust-item:nth-child(n+3) {
        border-top: 1px solid var(--line);
    }

    .trust-item:nth-child(odd) {
        border-left: 0;
    }

    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .product-body {
        padding: 11px;
    }

    .product-name {
        font-size: 16px;
    }

    .product-spec {
        font-size: 12px;
    }

    .product-price {
        font-size: 19px;
    }

    .product-actions {
        grid-template-columns: 1fr;
    }

    .product-actions .icon-btn {
        display: none;
    }

    .section {
        margin-top: 24px;
    }

    .section-title {
        font-size: 24px;
    }

    .footer-inner {
        width: min(calc(100% - 24px), var(--content-w));
        grid-template-columns: 1fr 1fr;
        gap: 24px 16px;
    }

    .footer-brand {
        grid-column: 1 / -1;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-field.full {
        grid-column: auto;
    }

    .cart-row {
        grid-template-columns: 58px 1fr auto;
    }

    .cart-row img {
        width: 58px;
        height: 54px;
    }

    .cart-row .cart-price {
        grid-column: 2 / -1;
    }

    .dashboard-grid,
    .driver-metrics {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .metric-card {
        padding: 14px;
    }

    .metric-icon {
        width: 42px;
        height: 42px;
    }

    .metric-value {
        font-size: 20px;
    }

    .two-col {
        grid-template-columns: 1fr;
    }

    .work-shell {
        display: block;
    }

    .work-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: 268px;
        z-index: 300;
        transform: translateX(-100%);
        transition: transform .2s ease;
        box-shadow: var(--shadow-md);
    }

    .work-sidebar.open {
        transform: translateX(0);
    }

    .work-brand .brand-copy,
    .work-profile,
    .work-nav span,
    .work-logout span {
        display: block;
    }

    .work-nav button,
    .work-logout {
        justify-content: flex-start;
    }

    .work-header {
        height: 66px;
        padding: 0 14px;
    }

    .work-content {
        padding: 18px 12px 34px;
    }

    .work-header-title {
        font-size: 19px;
    }

    .task-grid {
        grid-template-columns: 1fr 1fr;
    }

    .steps {
        grid-template-columns: repeat(5, minmax(54px, 1fr));
        overflow-x: auto;
        padding-bottom: 5px;
    }

    .modal-backdrop {
        padding: 12px;
        place-items: end center;
    }

    .modal {
        border-radius: 18px 18px 0 0;
        max-height: 92vh;
    }

    .modal-head {
        padding: 17px;
    }

    .modal-body {
        padding: 17px;
    }

    .modal-actions {
        padding: 0 17px 17px;
    }
}

@media (max-width: 430px) {
    .brand-name {
        font-size: 18px;
    }

    .category-grid {
        gap: 8px;
    }

    .category-name {
        font-size: 15px;
        padding: 10px 6px 11px;
    }

    .product-grid {
        grid-template-columns: 1fr 1fr;
    }

    .trust-strip {
        grid-template-columns: 1fr;
    }

    .trust-item {
        border-left: 0 !important;
        border-top: 1px solid var(--line);
    }

    .trust-item:first-child {
        border-top: 0;
    }

    .dashboard-grid,
    .driver-metrics {
        grid-template-columns: 1fr;
    }

    .footer-inner {
        grid-template-columns: 1fr;
    }

    .footer-brand {
        grid-column: auto;
    }
}

/* ===== Mockup-aligned presentation v2 ===== */
:root {
    --header-h: 72px;
    --content-w: 1420px;
    --sidebar-w: 272px;
    --radius-lg: 16px;
    --radius-md: 13px;
    --radius-sm: 10px;
    --shadow-sm: 0 3px 12px rgba(26, 49, 36, 0.035);
    --shadow-md: 0 8px 24px rgba(26, 49, 36, 0.055);
}

body {
    background: #fff;
}

.app-header {
    box-shadow: none;
}

.header-inner {
    width: min(calc(100% - 30px), var(--content-w));
    grid-template-columns: auto minmax(360px, 1fr) auto minmax(330px, 430px);
    gap: 12px;
}

.brand {
    min-width: 228px;
    gap: 9px;
}

.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 11px;
    box-shadow: none;
}

.brand-name {
    font-size: 25px;
    letter-spacing: .055em;
}

.brand-sub {
    margin-top: 3px;
    font-size: 11px;
    letter-spacing: .12em;
}

.main-nav {
    justify-content: center;
    gap: 3px;
}

.nav-link {
    padding: 10px 13px;
    border-radius: 10px;
    font-size: 15px;
}

.nav-link .icon {
    display: none;
}

.nav-link.active .icon {
    display: inline-block;
}

.header-actions {
    gap: 2px;
}

.header-action {
    padding: 9px 8px;
    font-size: 14px;
}

.header-logout {
    padding-left: 5px;
    padding-right: 5px;
}

.search-box {
    height: 46px;
    grid-template-columns: 1fr 52px;
    border-radius: 11px;
}

.search-box input {
    padding: 10px 14px;
    font-size: 14px;
}

.site-shell {
    width: min(calc(100% - 30px), var(--content-w));
    margin-top: 16px;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    gap: 18px;
}

.sidebar {
    gap: 12px;
    top: calc(var(--header-h) + 12px);
}

.side-card {
    border-radius: 12px;
    box-shadow: none;
}

.side-card.soft {
    background: linear-gradient(180deg, #fbfdf9, #f3f9ef);
}

.side-card-head {
    padding: 16px 17px 6px;
    text-align: center;
}

.side-card-title {
    font-size: 22px;
    line-height: 1.25;
}

.side-card-title span {
    color: var(--green-800);
}

.side-card-desc {
    font-size: 14px;
    line-height: 1.55;
}

.side-body {
    padding: 12px 16px 16px;
}

.sidebar-cta {
    min-height: 44px;
    border-radius: 8px;
    font-size: 15px;
}

.welcome-card {
    padding: 15px 15px 13px;
    text-align: center;
}

.welcome-card .side-card-head {
    padding: 0;
}

.welcome-avatar,
.member-avatar {
    width: 70px;
    height: 70px;
    margin: 0 auto 7px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: var(--green-800);
    background: #e7f4df;
    border: 1px solid #d7ead0;
}

.welcome-avatar .icon,
.member-avatar .icon {
    width: 36px;
    height: 36px;
}

.welcome-copy .side-card-desc {
    margin-top: 5px;
}

.welcome-actions {
    margin-top: 13px;
    display: grid;
    gap: 8px;
}

.member-welcome {
    padding: 18px 16px;
    display: grid;
    grid-template-columns: 82px 1fr;
    gap: 11px;
    align-items: center;
    text-align: left;
}

.member-welcome .member-avatar {
    margin: 0;
    width: 76px;
    height: 76px;
}

.member-welcome-copy .side-card-desc {
    margin-top: 8px;
    color: #365443;
    font-weight: 650;
}

.member-greeting {
    font-size: 23px;
    line-height: 1.28;
}

.member-greeting strong {
    font-size: 29px;
}

.helper-card .side-card-head {
    padding-top: 16px;
}

.helper-visual {
    height: 172px;
    display: grid;
    place-items: center;
    overflow: hidden;
    padding: 2px 26px;
}

.helper-visual img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.helper-card .side-body {
    padding-top: 6px;
}

.side-link {
    min-height: 66px;
    padding: 11px 14px;
    grid-template-columns: 28px 1fr 18px;
    font-size: 15px;
}

.side-link small {
    font-size: 12px;
    margin-top: 3px;
}

.hero {
    min-height: 218px;
    border-radius: 14px;
    box-shadow: none;
    background-position: center 48%;
}

.hero-copy {
    max-width: 610px;
    padding: 28px 38px;
}

.hero-kicker {
    display: none;
}

.hero h1 {
    margin: 0 0 8px;
    font-size: clamp(31px, 3vw, 42px);
    line-height: 1.15;
}

.hero p {
    font-size: 16px;
}

.hero-points {
    margin-top: 15px;
    gap: 9px;
}

.hero-point {
    padding: 8px 12px;
    font-size: 14px;
    background: rgba(255, 255, 255, .92);
}

.category-strip-home {
    margin-top: 12px;
}

.category-grid {
    gap: 9px;
}

.category-card {
    border-radius: 11px;
    box-shadow: none;
}

.category-card.category-compact img {
    aspect-ratio: 1.95/1;
    height: 88px;
    object-fit: contain;
    padding: 5px 12px 0;
    background: #fff;
}

.category-card.category-compact .category-name {
    padding: 4px 6px 11px;
    font-size: 15px;
}

.section {
    margin-top: 16px;
}

.section-head {
    margin-bottom: 8px;
    align-items: center;
}

.section-title {
    font-size: 25px;
}

.section-sub {
    font-size: 13px;
}

.text-btn {
    font-size: 14px;
}

.product-grid {
    gap: 9px;
}

.product-card {
    border-radius: 11px;
    box-shadow: none;
}

.product-media img {
    aspect-ratio: 1.48/1;
    height: 116px;
    object-fit: cover;
}

.product-tag {
    display: none;
}

.product-body {
    padding: 8px 10px 10px;
}

.product-name {
    font-size: 15px;
}

.product-spec {
    margin-top: 2px;
    min-height: auto;
    font-size: 12px;
}

.product-origin {
    display: none;
}

.product-price-row {
    min-height: 27px;
    margin-top: 3px;
    align-items: center;
}

.product-price {
    font-size: 19px;
    color: #e45420;
}

.product-price small {
    display: none;
}

.visitor-price {
    font-size: 12px;
}

.product-actions {
    margin-top: 5px;
    grid-template-columns: 1fr;
}

.product-actions .icon-btn {
    display: none;
}

.product-actions .btn {
    min-height: 31px;
    padding: 5px 8px;
    border-radius: 6px;
    font-size: 12px;
}

.order-panel {
    border-radius: 10px;
}

.order-panel th,
.order-panel td {
    padding: 7px 10px;
    font-size: 12px;
}

.order-panel .btn {
    min-height: 28px;
    padding: 4px 9px;
    border-radius: 6px;
    font-size: 11px;
}

.status {
    padding: 3px 8px;
    font-size: 11px;
}

.trust-strip {
    margin-top: 14px;
    grid-template-columns: repeat(4, 1fr);
    border-radius: 10px;
    background: #f7faf4;
}

.trust-item {
    min-height: 66px;
    padding: 10px 15px;
}

.trust-icon {
    width: 34px;
    height: 34px;
    background: transparent;
    border: 1px solid #cfe0cb;
}

.trust-item strong {
    font-size: 14px;
}

.trust-item small {
    font-size: 11px;
}

.site-footer {
    margin-top: 10px;
}

.footer-inner {
    width: min(calc(100% - 30px), var(--content-w));
    padding: 18px 0 16px;
    grid-template-columns: 1.25fr repeat(3, 1fr);
    gap: 24px;
}

.footer-title {
    font-size: 14px;
}

.footer-links,
.footer-links span,
.footer-links .text-btn {
    font-size: 12px;
}

.copyright {
    padding: 8px 0 14px;
    font-size: 11px;
}

/* Workspaces: match supplied driver/admin mockups */
.work-shell {
    grid-template-columns: 198px minmax(0, 1fr);
    background: #fbfcfb;
}

.work-sidebar {
    padding: 14px 10px;
}

.work-brand {
    padding: 0 4px 18px;
    border-bottom: 1px solid var(--line);
}

.work-brand .brand {
    min-width: 0;
}

.work-brand .brand-mark {
    width: 40px;
    height: 40px;
}

.work-brand .brand-name {
    font-size: 20px;
}

.work-brand .brand-sub {
    font-size: 9px;
}

.work-profile {
    display: none;
}

.work-nav {
    margin-top: 10px;
    gap: 6px;
}

.work-nav button {
    min-height: 48px;
    padding: 11px 12px;
    border-radius: 8px;
    font-size: 15px;
}

.work-header {
    height: 72px;
    padding: 0 22px;
}

.work-header-title {
    font-size: 21px;
}

.work-header-actions {
    font-size: 14px;
}

.work-content {
    max-width: 1380px;
    padding: 22px 20px 30px;
}

.page-head {
    margin-bottom: 12px;
}

.page-title {
    font-size: 25px;
}

.page-sub {
    font-size: 13px;
}

.driver-metrics,
.dashboard-grid {
    gap: 12px;
}

.metric-card {
    padding: 14px 16px;
    border-radius: 11px;
}

.metric-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
}

.metric-value {
    font-size: 24px;
}

.metric-label {
    font-size: 12px;
}

.delivery-layout {
    margin-top: 14px;
    grid-template-columns: minmax(0, 1.7fr) minmax(300px, .72fr);
    gap: 12px;
}

.panel {
    border-radius: 11px;
}

.panel-head {
    padding: 13px 15px;
}

.panel-title {
    font-size: 17px;
}

.panel-body {
    padding: 14px 15px;
}

.task-list {
    gap: 9px;
}

.task-card {
    padding: 13px;
    border-radius: 10px;
}

.task-grid {
    margin-top: 9px;
    gap: 9px;
}

.task-actions {
    margin-top: 10px;
    gap: 7px;
}

.task-actions .btn {
    min-height: 34px;
    padding: 6px 11px;
    font-size: 12px;
}

.steps {
    gap: 3px;
}

.step-circle {
    width: 38px;
    height: 38px;
}

.quick-action {
    padding: 10px 11px;
    border-radius: 8px;
    font-size: 13px;
}

@media (max-width: 1320px) {
    :root {
        --sidebar-w: 235px;
    }

    .header-inner {
        grid-template-columns: auto 1fr auto minmax(240px, 330px);
    }

    .brand {
        min-width: 190px;
    }

    .brand-name {
        font-size: 21px;
    }

    .main-nav .nav-link {
        padding: 9px 9px;
    }

    .header-action {
        padding: 8px 6px;
    }

    .product-media img {
        height: 105px;
    }
}

@media (max-width: 1080px) {
    .header-inner {
        grid-template-columns: auto 1fr auto;
    }

    .search-box {
        grid-column: 1 / -1;
        margin-bottom: 8px;
        height: 42px;
    }

    .app-header {
        height: auto;
    }

    .site-shell {
        margin-top: 12px;
    }
}

/* ===== Final RWD / no-clipping pass v3 ===== */
/* Keep every card's text and actions inside its own grid cell. */
.content,
.product-grid,
.product-card,
.product-body,
.product-actions,
.product-price-row {
    min-width: 0;
}

.product-card {
    height: 100%;
    overflow: hidden;
}

.product-media {
    cursor: pointer;
}

.product-media img {
    width: 100%;
    height: auto;
    aspect-ratio: 1.48 / 1;
    object-fit: cover;
}

.product-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    padding: 10px 11px 11px;
    overflow: visible;
}

.product-name-link {
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ink);
    text-align: left;
    font: inherit;
    font-size: 16px;
    font-weight: 850;
    line-height: 1.4;
    white-space: normal;
    word-break: keep-all;
    overflow-wrap: anywhere;
    cursor: pointer;
}

.product-name-link:hover,
.product-name-link:focus-visible {
    color: var(--green-800);
    outline: none;
}

.product-spec,
.product-origin,
.product-price,
.visitor-price {
    white-space: normal;
    overflow-wrap: anywhere;
}

.product-spec {
    line-height: 1.45;
}

.product-price-row {
    margin-top: auto;
    padding-top: 8px;
    min-height: 38px;
    align-items: center;
}

.product-actions {
    display: flex;
    width: 100%;
    margin-top: 8px;
}

.product-actions .btn {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 38px;
    padding: 7px 9px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* The detail action lives on the image/name, so no extra side icon can be clipped. */
.product-actions .icon-btn {
    display: none !important;
}

/* Keep category labels fully visible. */
.category-card,
.category-card button,
.category-name {
    min-width: 0;
}

.category-name {
    white-space: normal;
    word-break: keep-all;
    overflow-wrap: anywhere;
    line-height: 1.35;
}

/* Wide desktop: match the supplied six-card composition. */
@media (min-width: 1401px) {
    .product-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

/* Normal desktop / smaller laptop: give product content more breathing room. */
@media (min-width: 1081px) and (max-width: 1400px) {
    :root {
        --sidebar-w: 230px;
    }

    .site-shell {
        gap: 16px;
    }

    .product-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 12px;
    }

    .category-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .product-media img {
        aspect-ratio: 1.55 / 1;
    }

    .product-name-link {
        font-size: 16px;
    }

    .product-actions .btn {
        font-size: 13px;
    }
}

/* Tablet: sidebar becomes a compact two-column block above the products. */
@media (max-width: 1080px) {
    .site-shell {
        grid-template-columns: minmax(0, 1fr);
        width: min(calc(100% - 28px), var(--content-w));
    }

    .sidebar {
        position: static;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sidebar>* {
        min-width: 0;
    }

    .product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px;
    }

    .category-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .product-actions .btn {
        min-height: 42px;
        font-size: 14px;
    }
}

/* Large phone / portrait tablet. */
@media (max-width: 760px) {
    .site-shell {
        width: min(calc(100% - 20px), var(--content-w));
    }

    .sidebar {
        grid-template-columns: 1fr;
    }

    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .product-media img {
        aspect-ratio: 1.35 / 1;
    }

    .product-body {
        padding: 11px;
    }

    .product-name-link {
        font-size: 16px;
    }

    .product-spec {
        font-size: 13px;
    }

    .product-price {
        font-size: 20px;
    }

    .product-actions .btn {
        min-height: 44px;
        font-size: 14px;
    }

    .section-head {
        align-items: flex-start;
    }
}

/* Small phones: one product per row for older users and no cramped text. */
@media (max-width: 520px) {
    .product-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .product-card {
        display: grid;
        grid-template-columns: minmax(118px, 38%) minmax(0, 1fr);
    }

    .product-media {
        height: 100%;
        min-height: 170px;
    }

    .product-media img {
        width: 100%;
        height: 100%;
        aspect-ratio: auto;
        object-fit: cover;
    }

    .product-body {
        padding: 14px;
    }

    .product-name-link {
        font-size: 18px;
    }

    .product-spec {
        font-size: 14px;
    }

    .product-price-row {
        padding-top: 10px;
    }

    .product-actions .btn {
        min-height: 46px;
    }

    .category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Very narrow devices: card becomes vertical instead of squeezing its contents. */
@media (max-width: 380px) {
    .product-card {
        display: flex;
    }

    .product-media {
        min-height: 0;
    }

    .product-media img {
        height: auto;
        aspect-ratio: 1.5 / 1;
    }

    .category-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* ===== Feature pass v4: favorites, quantity picker, product traceability ===== */
.product-fav.active {
    color: #cf2f2f;
    background: #fff4f4;
    border-color: #efc1c1;
}

.product-fav.active:hover,
.product-fav.active:focus-visible {
    color: #b91f1f;
    background: #ffeaea;
}

.product-purchase {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
}

.qty-picker {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
    padding: 6px 8px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #f8fbf8;
}

.qty-label {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.qty-control {
    min-width: 0;
    display: grid;
    grid-template-columns: 30px minmax(36px, 50px) 30px;
    align-items: center;
    border: 1px solid #cddbd1;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.qty-control button {
    width: 30px;
    height: 32px;
    border: 0;
    background: #fff;
    color: var(--green-800);
    display: grid;
    place-items: center;
}

.qty-control button:hover,
.qty-control button:focus-visible {
    background: var(--green-050);
}

.product-qty-input {
    width: 100%;
    min-width: 0;
    height: 32px;
    border: 0;
    border-left: 1px solid #d9e3dc;
    border-right: 1px solid #d9e3dc;
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-size: 14px;
    font-weight: 850;
    text-align: center;
    appearance: textfield;
    -moz-appearance: textfield;
}

.product-qty-input::-webkit-inner-spin-button,
.product-qty-input::-webkit-outer-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

.product-qty-input:focus {
    outline: 2px solid rgba(19, 105, 63, .16);
    outline-offset: -2px;
}

.product-detail-grid {
    display: grid;
    grid-template-columns: minmax(280px, .95fr) minmax(0, 1.05fr);
    gap: 28px;
    align-items: start;
}

.product-detail-image img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 16px;
    background: #f2f6f3;
}

.product-detail-content {
    min-width: 0;
}

.product-detail-name {
    margin: 0 0 14px;
    color: var(--green-950);
    font-size: 28px;
    font-weight: 900;
    line-height: 1.25;
}

.product-detail-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.detail-meta-item {
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fbfdfb;
}

.detail-meta-item>span {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.detail-meta-item strong {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--ink);
    font-size: 15px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.detail-meta-item small {
    display: block;
    margin-top: 4px;
    color: #758178;
    font-size: 11px;
    overflow-wrap: anywhere;
}

.detail-meta-item .traceability-value {
    color: var(--green-800);
}

.product-detail-price {
    margin: 18px 0 12px;
}

.detail-purchase {
    max-width: 360px;
    grid-template-columns: 150px minmax(0, 1fr);
    align-items: stretch;
}

.detail-purchase .qty-picker {
    height: 100%;
}

/* Product cards remain unclipped when quantity controls are shown. */
.product-actions {
    overflow: visible;
}

.product-actions .product-purchase {
    min-width: 0;
}

.product-card .qty-picker {
    min-height: 40px;
}

.product-card .product-actions .btn {
    min-height: 40px;
}

@media (max-width: 1400px) {
    .product-card .qty-picker {
        padding: 5px 6px;
    }

    .product-card .qty-control {
        grid-template-columns: 28px minmax(32px, 44px) 28px;
    }

    .product-card .qty-control button {
        width: 28px;
    }
}

@media (max-width: 760px) {
    .product-detail-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .product-detail-image img {
        aspect-ratio: 16 / 10;
    }

    .product-detail-name {
        font-size: 24px;
    }

    .product-detail-meta {
        grid-template-columns: 1fr 1fr;
    }

    .detail-purchase {
        max-width: none;
    }
}

@media (max-width: 520px) {
    .product-card .product-purchase {
        gap: 7px;
    }

    .product-card .qty-picker {
        padding: 6px 8px;
    }

    .product-detail-meta {
        grid-template-columns: 1fr;
    }

    .detail-purchase {
        grid-template-columns: 1fr;
    }
}

/* ===== Footer redesign v9 ===== */
.site-footer {
    margin-top: 36px;
    color: var(--ink);
    background: #fff;
    border-top: 1px solid var(--line);
}

.footer-service {
    background: linear-gradient(180deg, #f8fbf8 0%, #f2f7f3 100%);
    border-bottom: 1px solid var(--line);
}

.footer-service-inner {
    width: min(calc(100% - 30px), var(--content-w));
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.footer-service-item {
    min-width: 0;
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 20px;
    border-left: 1px solid #dce7df;
}

.footer-service-item:first-child {
    border-left: 0;
}

.footer-service-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: grid;
    place-items: center;
    color: var(--green-800);
    background: #fff;
    border: 1px solid #cfe0d3;
    border-radius: 50%;
}

.footer-service-icon .icon {
    width: 20px;
    height: 20px;
}

.footer-service-item strong {
    display: block;
    color: var(--green-950);
    font-size: 14px;
    font-weight: 850;
    line-height: 1.35;
}

.footer-service-item small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.4;
}

.footer-main {
    background: #fff;
}

.footer-main-inner {
    width: min(calc(100% - 30px), var(--content-w));
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(280px, 1.45fr) repeat(3, minmax(150px, .8fr));
    gap: 48px;
    padding: 36px 0 34px;
}

.footer-brand-block,
.footer-column {
    min-width: 0;
}

.footer-brand-block {
    max-width: 390px;
}

.footer-logo {
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    padding: 0;
    margin: 0;
    background: transparent;
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: var(--green-950);
    text-align: left;
}

.footer-logo-mark {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    display: grid;
    place-items: center;
    color: var(--green-800);
    background: var(--green-050);
    border: 1px solid #d5e6da;
    border-radius: 12px;
}

.footer-logo-copy {
    min-width: 0;
}

.footer-logo strong {
    display: block;
    color: var(--green-950);
    font-size: 22px;
    font-weight: 900;
    line-height: 1.2;
    letter-spacing: .04em;
}

.footer-logo small {
    display: block;
    margin-top: 3px;
    color: var(--green-700);
    font-size: 11px;
    letter-spacing: .09em;
}

.footer-intro {
    max-width: 350px;
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.85;
}

.footer-contact {
    display: grid;
    gap: 6px;
    margin-top: 16px;
    color: #59665e;
    font-size: 12px;
}

.footer-contact a,
.footer-contact button {
    width: fit-content;
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    padding: 0;
    background: transparent;
    color: inherit;
    text-decoration: none;
    font: inherit;
    text-align: left;
}

.footer-contact a:hover,
.footer-contact button:hover {
    color: var(--green-800);
}

.footer-heading {
    position: relative;
    margin: 0 0 17px;
    padding-bottom: 10px;
    color: var(--green-950);
    font-size: 15px;
    font-weight: 900;
    line-height: 1.4;
}

.footer-heading::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 28px;
    height: 2px;
    border-radius: 999px;
    background: var(--green-700);
}

.footer-nav {
    display: grid;
    gap: 9px;
}

.footer-nav button,
.footer-nav span {
    width: fit-content;
    max-width: 100%;
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    padding: 0;
    margin: 0;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 13px;
    line-height: 1.5;
    text-align: left;
}

.footer-nav button {
    cursor: pointer;
    transition: color .15s ease, transform .15s ease;
}

.footer-nav button:hover,
.footer-nav button:focus-visible {
    color: var(--green-800);
    transform: translateX(2px);
    outline: none;
}

.footer-payment {
    margin-top: 24px;
}

.footer-payment-title {
    display: block;
    margin-bottom: 9px;
    color: #465249;
    font-size: 12px;
    font-weight: 800;
}

.footer-payment-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.footer-payment-list span {
    padding: 5px 8px;
    color: #526058;
    background: #f7f9f7;
    border: 1px solid #dfe7e1;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
}

.footer-bottom {
    background: #fafbfa;
    border-top: 1px solid var(--line);
}

.footer-bottom-inner {
    width: min(calc(100% - 30px), var(--content-w));
    min-height: 54px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.footer-bottom p {
    margin: 0;
    color: #7b857f;
    font-size: 11px;
}

.footer-policy {
    display: flex;
    align-items: center;
    gap: 20px;
}

.footer-policy span {
    color: #6d7871;
    font-size: 11px;
}

@media (max-width: 1080px) {
    .footer-service-inner {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .footer-service-item:nth-child(3),
    .footer-service-item:nth-child(4) {
        border-top: 1px solid #dce7df;
    }

    .footer-service-item:nth-child(3) {
        border-left: 0;
    }

    .footer-main-inner {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 32px 26px;
    }

    .footer-brand-block {
        grid-column: 1 / -1;
        max-width: 100%;
    }

    .footer-intro {
        max-width: 540px;
    }
}

@media (max-width: 760px) {
    .site-footer {
        margin-top: 28px;
    }

    .footer-service-inner,
    .footer-main-inner,
    .footer-bottom-inner {
        width: min(calc(100% - 24px), var(--content-w));
    }

    .footer-service-item {
        min-height: 72px;
        justify-content: flex-start;
        padding: 13px 14px;
    }

    .footer-main-inner {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 28px 20px;
        padding: 30px 0 28px;
    }

    .footer-brand-block {
        grid-column: 1 / -1;
    }

    .footer-bottom-inner {
        padding: 14px 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 9px;
    }

    .footer-policy {
        flex-wrap: wrap;
        gap: 9px 16px;
    }
}

@media (max-width: 520px) {
    .footer-service-inner {
        grid-template-columns: 1fr;
    }

    .footer-service-item {
        border-left: 0;
        border-top: 1px solid #dce7df;
    }

    .footer-service-item:first-child {
        border-top: 0;
    }

    .footer-main-inner {
        grid-template-columns: 1fr;
        gap: 25px;
        padding-top: 28px;
    }

    .footer-brand-block {
        grid-column: auto;
    }

    .footer-policy {
        display: grid;
        grid-template-columns: repeat(2, auto);
    }
}

/* =========================================================
   Multi-page architecture additions
   ========================================================= */
a {
    color: inherit;
}

.category-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.footer-nav a {
    width: fit-content;
    max-width: 100%;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
    text-decoration: none;
    transition: color .15s ease, transform .15s ease;
}

.footer-nav a:hover,
.footer-nav a:focus-visible {
    color: var(--green-800);
    transform: translateX(2px);
    outline: none;
}

.footer-policy a {
    color: #6d7871;
    font-size: 11px;
    text-decoration: none;
}

.footer-policy a:hover,
.footer-policy a:focus-visible {
    color: var(--green-800);
}

.sidebar-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.side-link {
    text-decoration: none;
}

.text-btn {
    text-decoration: none;
}

/* Authentication pages */
.auth-screen {
    min-height: 100vh;
    background: linear-gradient(135deg, #f8fbf8 0%, #eef6ef 55%, #f8f4eb 100%);
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 18px;
}

.auth-card {
    width: min(520px, 100%);
    padding: 34px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 24px 70px rgba(20, 55, 37, .12);
}

.auth-card-wide {
    width: min(720px, 100%);
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--green-950);
    text-decoration: none;
}

.auth-brand strong {
    display: block;
    font-size: 23px;
    font-weight: 900;
    letter-spacing: .04em;
}

.auth-brand small {
    display: block;
    margin-top: 3px;
    color: var(--green-700);
    font-size: 11px;
    letter-spacing: .1em;
}

.auth-heading {
    margin: 30px 0 22px;
}

.auth-heading h1 {
    margin: 0;
    color: var(--green-950);
    font-size: 30px;
    font-weight: 900;
}

.auth-heading p {
    margin: 7px 0 0;
    color: var(--muted);
}

.auth-submit {
    width: 100%;
    min-height: 48px;
}

.auth-secondary {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
    color: var(--muted);
    font-size: 14px;
}

.auth-secondary a {
    color: var(--green-800);
    font-weight: 800;
}

.demo-account-list {
    display: grid;
    gap: 5px;
    margin-top: 8px;
}

.form-success {
    color: var(--green-700);
    font-size: 13px;
    font-weight: 700;
}

/* Catalog filters */
.filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0 20px;
}

.filter-pill {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 18px;
    border: 1px solid #bdd4c4;
    border-radius: 11px;
    background: #fff;
    color: var(--green-900);
    text-decoration: none;
    font-weight: 850;
}

.filter-pill:hover,
.filter-pill.active {
    background: var(--green-800);
    border-color: var(--green-800);
    color: #fff;
}

/* Product details */
.product-detail-page {
    display: grid;
    grid-template-columns: minmax(340px, .95fr) minmax(0, 1.05fr);
    gap: 36px;
    align-items: start;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: #fff;
}

.product-detail-page .product-detail-image img {
    aspect-ratio: 4 / 3;
}

.detail-category {
    display: inline-flex;
    margin-bottom: 10px;
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--green-100);
    color: var(--green-800);
    font-size: 12px;
    font-weight: 850;
}

.product-detail-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.product-detail-heading .product-detail-name {
    margin-bottom: 0;
}

.detail-fav {
    position: static;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
}

.detail-fav .icon {
    width: 22px;
    height: 22px;
}

.detail-lead {
    margin: 10px 0 20px;
    color: var(--muted);
    font-size: 16px;
}

.visitor-detail-notice {
    margin-top: 18px;
    padding: 14px 16px;
    border-radius: 12px;
    background: var(--green-050);
    color: var(--green-900);
    font-weight: 750;
}

.detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

/* Informational pages */
.info-stack {
    display: grid;
    gap: 14px;
}

.info-panel .panel-body p {
    margin: 0;
    color: #526058;
    line-height: 1.9;
}

.partner-panel {
    padding: 10px 0 48px;
}

.partner-head {
    margin: 0 auto 30px;
    display: grid;
    justify-items: center;
    gap: 12px;
}

.partner-head::after {
    content: "";
    width: 58px;
    height: 3px;
    border-radius: 999px;
    background: var(--green-700);
}

.partner-title {
    margin: 0;
    color: var(--green-950);
    font-size: 32px;
    font-weight: 900;
    line-height: 1.25;
    text-align: center;
}

.partner-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.partner-card {
    min-height: 156px;
    border: 1px solid #cfe3d5;
    border-radius: 8px;
    background: #fff;
    padding: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: stretch;
    overflow: hidden;
    box-shadow: 0 10px 24px rgba(20, 63, 39, .06);
}

.partner-image-placeholder {
    width: 100%;
    min-height: 118px;
    display: grid;
    place-items: center;
    color: var(--green-950);
    font-size: 22px;
    font-weight: 900;
    line-height: 1.45;
    text-align: center;
}

.partner-name {
    width: 100%;
    min-height: 44px;
    padding: 11px 14px;
    display: grid;
    place-items: center;
    border-top: 1px solid #cfe3d5;
    background: var(--green-050);
    color: var(--green-950);
    font-size: 16px;
    font-weight: 900;
    line-height: 1.35;
    text-align: center;
}

@media (max-width: 1060px) {
    .partner-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.brand-story-article {
    max-width: 980px;
    padding: 6px 0 56px 34px;
}

.brand-story-head {
    margin-bottom: 40px;
    text-align: center;
}

.story-kicker {
    margin: 0;
    color: #9b7a32;
    font-size: 15px;
    font-weight: 850;
    letter-spacing: 0;
}

.story-title {
    margin: 12px 0 0;
    color: var(--green-950);
    font-size: 34px;
    font-weight: 900;
    line-height: 1.25;
}

.story-lead {
    margin: 12px auto 0;
    max-width: 720px;
    color: #66726b;
    font-size: 15px;
    line-height: 1.9;
    font-weight: 700;
}

.story-copy {
    display: grid;
    gap: 26px;
    text-align: left;
}

.story-copy p {
    margin: 0;
    color: #435149;
    font-size: 16px;
    line-height: 2.2;
    font-weight: 650;
}

@media (max-width: 760px) {
    .brand-story-article {
        padding: 0 0 34px;
    }

    .brand-story-head {
        margin-bottom: 28px;
        text-align: left;
    }

    .story-title {
        font-size: 28px;
    }

    .story-lead {
        font-size: 16px;
    }

    .story-copy {
        gap: 18px;
    }

    .story-copy p {
        font-size: 16px;
        line-height: 2;
    }
}

@media (max-width: 760px) {
    .partner-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .partner-card {
        min-height: 160px;
    }
}

.contact-page {
    padding: 10px 0 48px;
}

.contact-head {
    margin: 0 0 24px;
    display: grid;
    justify-items: center;
    gap: 12px;
}

.contact-head::after {
    content: "";
    width: 58px;
    height: 3px;
    border-radius: 999px;
    background: var(--green-700);
}

.contact-title {
    margin: 0;
    color: var(--green-950);
    font-size: 32px;
    font-weight: 900;
    line-height: 1.25;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.contact-card {
    min-height: 158px;
    border: 1px solid #cfe3d5;
    border-radius: 8px;
    background: #fff;
    padding: 24px;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 10px;
    text-align: center;
    box-shadow: 0 10px 24px rgba(20, 63, 39, .06);
}

.contact-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--green-050);
    color: var(--green-800);
}

.contact-card-icon .icon {
    width: 24px;
    height: 24px;
}

.contact-card-label {
    color: #66726b;
    font-size: 14px;
    font-weight: 800;
}

.contact-card-value,
.contact-card-value a {
    color: var(--green-950);
    font-size: 20px;
    font-weight: 900;
    line-height: 1.45;
    text-decoration: none;
}

.contact-card-value a:hover,
.contact-card-value a:focus-visible {
    color: var(--green-800);
    outline: none;
}

@media (max-width: 760px) {
    .contact-grid {
        grid-template-columns: 1fr;
    }

    .contact-card {
        min-height: 140px;
    }

    .contact-title {
        font-size: 28px;
    }
}

/* Cart / checkout */
.page-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.cart-price {
    display: grid;
    justify-items: end;
    gap: 4px;
}

.danger-text {
    color: var(--danger) !important;
}

.checkout-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, .6fr);
    gap: 18px;
    align-items: start;
}

.checkout-summary {
    position: sticky;
    top: calc(var(--header-h) + 18px);
}

.payment-hint {
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--green-050);
    color: var(--green-900);
    font-size: 13px;
}

/* Orders */
.order-items {
    display: grid;
    gap: 11px;
}

.order-item {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) auto;
    gap: 13px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.order-item:last-child {
    border-bottom: 0;
}

.order-item img {
    width: 72px;
    height: 64px;
    border-radius: 10px;
    object-fit: cover;
}

.order-item span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
}

.detail-list {
    display: grid;
    gap: 0;
}

.detail-list>div {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.detail-list>div:last-child {
    border-bottom: 0;
}

.detail-list>div>span {
    color: var(--muted);
    font-size: 13px;
}

.detail-list>div>strong {
    min-width: 0;
    overflow-wrap: anywhere;
}

.detail-list .detail-actions {
    grid-column: 1 / -1;
    display: flex;
}

/* Wallet */
.wallet-hero {
    display: grid;
    grid-template-columns: minmax(220px, .7fr) minmax(0, 1.3fr);
    gap: 20px;
    align-items: center;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #f7fbf7, #eef7ef);
}

.wallet-hero>div>span {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.wallet-hero>div>strong {
    display: block;
    margin-top: 4px;
    color: var(--green-950);
    font-size: 34px;
}

.topup-inline {
    display: grid;
    grid-template-columns: auto minmax(120px, 1fr) auto;
    gap: 10px;
    align-items: center;
}

.topup-inline label {
    font-weight: 800;
}

.topup-inline input {
    min-width: 0;
    border: 1px solid #cad7ce;
    border-radius: 10px;
    padding: 10px 12px;
}

.wallet-plus {
    color: var(--green-700);
    font-weight: 800;
}

.wallet-minus {
    color: var(--danger);
    font-weight: 800;
}

/* Admin workspace navigation */
.work-nav-link {
    width: 100%;
    min-height: 48px;
    border: 0;
    background: transparent;
    border-radius: 8px;
    padding: 11px 12px;
    color: #344239;
    display: flex;
    align-items: center;
    gap: 11px;
    text-align: left;
    font-weight: 780;
    text-decoration: none;
}

.work-nav-link:hover,
.work-nav-link.active {
    background: var(--green-100);
    color: var(--green-900);
}

.metric-note {
    margin-top: 3px;
    color: #89928d;
    font-size: 11px;
}

.admin-dashboard-metrics {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.inventory-list {
    display: grid;
    gap: 12px;
}

.inventory-row {
    display: grid;
    grid-template-columns: 120px minmax(100px, 1fr) 52px;
    gap: 12px;
    align-items: center;
}

.inventory-row>div:first-child strong,
.inventory-row>div:first-child span {
    display: block;
}

.inventory-row>div:first-child span {
    color: var(--muted);
    font-size: 11px;
}

.inventory-bar {
    height: 7px;
    border-radius: 999px;
    background: #eef1ef;
    overflow: hidden;
}

.inventory-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--green-700);
}

.report-shortcuts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 9px;
}

.report-shortcuts a {
    min-height: 86px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    display: grid;
    place-items: center;
    gap: 6px;
    color: var(--green-900);
    text-decoration: none;
    font-weight: 800;
    text-align: center;
}

.report-shortcuts a:hover {
    background: var(--green-050);
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.table-product {
    display: flex;
    align-items: center;
    gap: 10px;
}

.table-product img {
    width: 54px;
    height: 44px;
    object-fit: cover;
    border-radius: 7px;
}

.table-product small {
    display: block;
    color: var(--muted);
}

.inline-select {
    min-width: 130px;
    border: 1px solid #cad7ce;
    border-radius: 8px;
    padding: 7px 9px;
    background: #fff;
}

.wallet-adjust-inline {
    display: grid;
    grid-template-columns: 110px minmax(160px, 1fr) auto;
    gap: 7px;
}

.wallet-adjust-inline input {
    min-width: 0;
    border: 1px solid #cad7ce;
    border-radius: 8px;
    padding: 7px 9px;
}

.task-detail-actions {
    grid-column: 1 / -1 !important;
    display: flex !important;
    flex-wrap: wrap;
    gap: 8px;
}

@media (max-width: 1320px) {
    .admin-dashboard-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .product-detail-page {
        grid-template-columns: minmax(300px, .9fr) minmax(0, 1.1fr);
        gap: 24px;
    }
}

@media (max-width: 1080px) {
    .product-detail-page {
        grid-template-columns: 1fr;
    }

    .checkout-layout {
        grid-template-columns: 1fr;
    }

    .checkout-summary {
        position: static;
    }

    .admin-dashboard-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .work-nav-link span {
        display: none;
    }

    .work-nav-link {
        justify-content: center;
    }

    .report-shortcuts {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .auth-card {
        padding: 24px 18px;
        border-radius: 18px;
    }

    .auth-heading h1 {
        font-size: 26px;
    }

    .product-detail-page {
        padding: 16px;
        gap: 18px;
    }

    .wallet-hero {
        grid-template-columns: 1fr;
    }

    .topup-inline {
        grid-template-columns: 1fr;
    }

    .detail-list>div {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .admin-dashboard-metrics {
        grid-template-columns: 1fr 1fr;
    }

    .inventory-row {
        grid-template-columns: 90px minmax(80px, 1fr) 44px;
    }

    .wallet-adjust-inline {
        grid-template-columns: 1fr;
        min-width: 220px;
    }

    .work-sidebar.open .work-nav-link span {
        display: inline;
    }

    .work-sidebar.open .work-nav-link {
        justify-content: flex-start;
    }
}

@media (max-width: 520px) {
    .filter-pills {
        gap: 7px;
    }

    .filter-pill {
        min-height: 40px;
        padding: 8px 13px;
        font-size: 14px;
    }

    .order-item {
        grid-template-columns: 58px minmax(0, 1fr);
    }

    .order-item img {
        width: 58px;
        height: 54px;
    }

    .order-item>strong {
        grid-column: 2;
    }

    .admin-dashboard-metrics {
        grid-template-columns: 1fr;
    }

    .product-detail-heading {
        align-items: flex-start;
    }
}


/* ===== Multipage v3: visitor overlay login + descriptions ===== */
.header-action[data-action="open-login"] {
    font: inherit;
}

.footer-login-link {
    width: fit-content;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 13px;
    line-height: 1.5;
    text-align: left;
}

.footer-login-link:hover,
.footer-login-link:focus-visible {
    color: var(--green-800);
}

.login-modal {
    width: min(620px, 100%);
}

.unified-login-form {
    grid-template-columns: 1fr;
}

.login-submit {
    width: 100%;
    min-height: 48px;
}

.login-register-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    color: var(--muted);
    font-size: 14px;
}

.login-register-row a {
    color: var(--green-800);
    font-weight: 800;
    text-decoration: none;
}

.demo-account-list {
    display: grid;
    gap: 5px;
    margin-top: 8px;
}

.product-description-block {
    margin-top: 18px;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fbfdfb;
}

.product-description-block h2 {
    margin: 0 0 8px;
    color: var(--green-950);
    font-size: 18px;
    font-weight: 900;
}

.product-description-block p {
    margin: 0;
    color: #4d5a52;
    line-height: 1.8;
}

@media (max-width: 760px) {
    .login-modal {
        width: 100%;
    }

    .login-register-row {
        flex-wrap: wrap;
    }

    .product-description-block {
        padding: 15px 16px;
    }
}


/* ===== Inline member registration modal v4 ===== */
.login-inline-link {
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--green-800);
    font-weight: 850;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.login-inline-link:hover,
.login-inline-link:focus-visible {
    color: var(--green-950);
}

.register-intro {
    margin: 0 0 18px;
    color: var(--muted);
    line-height: 1.7;
}

.form-success {
    color: var(--green-800);
    font-size: 14px;
    font-weight: 750;
    line-height: 1.6;
}

.register-submit:disabled {
    opacity: .55;
    cursor: default;
}

@media (max-width: 760px) {
    .register-modal .form-grid {
        grid-template-columns: 1fr;
    }

    .register-modal .form-field.full {
        grid-column: auto;
    }
}


/* ===== Member center summary links ===== */
.metric-card-link {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.metric-card-link:hover {
    transform: translateY(-2px);
    border-color: #b9d3c1;
    background: #fbfdfb;
    box-shadow: var(--shadow-sm);
}

.metric-card-link:focus-visible {
    outline: 3px solid rgba(44, 138, 85, .18);
    outline-offset: 2px;
    border-color: var(--green-600);
}

.membership-level-panel {
    max-width: 760px;
}

.membership-level-card {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 8px 2px;
}

.membership-level-label {
    display: block;
    color: var(--muted);
    font-size: 14px;
    font-weight: 800;
}

.membership-level-value {
    display: block;
    margin-top: 4px;
    color: var(--green-950);
    font-size: 30px;
    line-height: 1.25;
    font-weight: 900;
}

.membership-level-card p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 14px;
}

@media (max-width: 760px) {
    .metric-card-link {
        min-height: 88px;
    }

    .membership-level-panel {
        max-width: none;
    }
}


/* ===== Member profile avatar ===== */
.member-avatar {
    overflow: hidden;
}

.member-avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.profile-avatar-field {
    padding-bottom: 6px;
}

.profile-avatar-editor {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fbfdfb;
}

.profile-avatar-preview {
    width: 112px;
    height: 112px;
    flex: 0 0 112px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid #d3e4d7;
    border-radius: 50%;
    background: var(--green-100);
    color: var(--green-800);
}

.profile-avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar-placeholder {
    display: grid;
    place-items: center;
}

.profile-avatar-placeholder .icon {
    width: 42px;
    height: 42px;
}

.profile-avatar-copy {
    min-width: 0;
    flex: 1;
}

.profile-avatar-copy>strong {
    display: block;
    color: var(--green-950);
    font-size: 17px;
    font-weight: 850;
}

.profile-avatar-copy>p {
    margin: 5px 0 12px;
    color: var(--muted);
    font-size: 13px;
}

.profile-avatar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.profile-avatar-upload {
    cursor: pointer;
}

.profile-avatar-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 760px) {
    .profile-avatar-editor {
        align-items: flex-start;
    }

    .profile-avatar-preview {
        width: 96px;
        height: 96px;
        flex-basis: 96px;
    }
}

@media (max-width: 520px) {
    .profile-avatar-editor {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .profile-avatar-copy {
        width: 100%;
    }

    .profile-avatar-actions {
        justify-content: center;
    }
}
