@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/inter-latin.woff2') format('woff2');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/inter-latin.woff2') format('woff2');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/inter-latin.woff2') format('woff2');
}

:root {
    --bg: #f7f6f4;
    --bg-muted: #f7f6f4;
    --surface: #ffffff;
    --text: #2c2c2c;
    --text-muted: #6b6b6b;
    --border: #e8e6e3;
    --accent: #8b7e74;
    --accent-hover: #6f635a;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.08);
    --radius: 0;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

[data-theme='dark'] {
    --bg: #1c1b1a;
    --bg-muted: #232220;
    --surface: #262422;
    --text: #eceae6;
    --text-muted: #a8a29c;
    --border: #3a3734;
    --accent: #b0a396;
    --accent-hover: #c8bdb0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.35);
}

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

[hidden] {
    display: none !important;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: none;
}

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

button {
    font-family: inherit;
}

.logo-primary {
    color: var(--text);
}

.logo-secondary {
    font-weight: 400;
    color: var(--text-muted);
}

.sort-tab.active,
.nav-item.is-active > .sort-tab {
    color: var(--text);
    background: var(--bg);
    border-color: var(--accent);
}

.nav-sub a:hover,
.nav-sub a.is-active {
    color: var(--text);
    background: color-mix(in srgb, var(--accent) 10%, var(--bg));
}

.locale-switch {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid var(--border);
    background: var(--surface);
}

.locale-switch-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 0.55rem;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.locale-switch-link + .locale-switch-link {
    border-left: 1px solid var(--border);
}

.locale-switch-link:hover,
.locale-switch-link.is-active {
    color: var(--text);
    background: var(--bg);
}

.theme-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    flex-shrink: 0;
}

.theme-toggle-btn:hover {
    color: var(--text);
    border-color: var(--accent);
}

.theme-toggle-icon {
    font-size: 0.9375rem;
    line-height: 1;
}

.theme-toggle-icon-moon {
    display: none;
}

[data-theme='dark'] .theme-toggle-icon-sun {
    display: none;
}

[data-theme='dark'] .theme-toggle-icon-moon {
    display: inline;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    box-sizing: border-box;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-family: inherit;
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s, border-color 0.15s;
}

.btn:disabled {
    cursor: default;
    opacity: 0.72;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg);
}

.btn-block {
    width: 100%;
}

button.btn {
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
}

.btn-sm {
    height: 2.25rem;
    min-width: 4.75rem;
    padding: 0 0.75rem;
    font-size: 0.8125rem;
    white-space: nowrap;
}

.home {
    padding: 2rem 0 4rem;
}

.subcat-chip.is-active {
    color: var(--text);
    background: var(--bg);
    border-color: var(--accent);
}

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

.category-card-body p,
.category-card-meta {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 0.125rem;
}

.card-price-original,
.product-detail-price-original {
    margin-right: 0.4rem;
    font-size: 0.8em;
    color: var(--text-muted);
    font-weight: 400;
    text-decoration: line-through;
}

.wishlist-btn.is-active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.wishlist-btn.is-active:hover {
    color: #fff;
}

.card-cart .btn {
    width: auto;
}

.category-card-meta {
    display: inline-block;
    margin-top: 0.65rem;
}

.product-detail-thumb.is-active {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

.product-wishlist-btn.is-active {
    color: var(--accent-hover);
    border-color: var(--accent);
}

.empty-state {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--text-muted);
}

.empty-state .btn {
    margin-top: 1.25rem;
}

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

.flash {
    margin: 1.5rem 0;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    background: var(--surface);
    border: 1px solid var(--border);
}

.flash-success {
    border-color: var(--accent);
}

.flash-warning {
    background: #f7f1e6;
    border-color: #e3cfa1;
    color: #8a6417;
}

.flash-error {
    background: #f7ecec;
    border-color: #e3c6c6;
    color: #a44;
}

[data-theme='dark'] .flash-error {
    background: color-mix(in srgb, #e08585 12%, var(--surface));
    border-color: color-mix(in srgb, #e08585 35%, var(--border));
    color: #e08585;
}

.flash-error-title {
    margin: 0 0 0.35rem;
    font-weight: 600;
}

.flash-error-list {
    margin: 0;
    padding-left: 1.1rem;
}

.flash-error-list li + li {
    margin-top: 0.2rem;
}

[data-theme='dark'] .flash-warning {
    background: color-mix(in srgb, #e0b258 12%, var(--surface));
    border-color: color-mix(in srgb, #e0b258 35%, var(--border));
    color: #e0b258;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group > label:not(.form-check) {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    margin-bottom: 0.375rem;
    color: var(--text);
}

.form-control {
    width: 100%;
    padding: 0.625rem 0.75rem;
    font-size: 0.875rem;
    font-family: inherit;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    transition: border-color 0.15s;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
}

.form-control:disabled {
    color: var(--text-muted);
    background: var(--bg-muted);
    cursor: not-allowed;
}

select.form-control {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 2rem;
    background-color: var(--surface);
    background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
        linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
    background-position: calc(100% - 1rem) calc(50% - 0.12rem), calc(100% - 0.7rem) calc(50% - 0.12rem);
    background-size: 0.32rem 0.32rem, 0.32rem 0.32rem;
    background-repeat: no-repeat;
    cursor: pointer;
}

select.form-control:hover {
    border-color: var(--accent);
}

.pretty-select,
.sort-select-wrap,
.order-shipping-select-wrap {
    position: relative;
    display: block;
}

.pretty-select-list {
    position: absolute;
    z-index: 40;
    left: 0;
    right: 0;
    top: calc(100% + 0.25rem);
    max-height: 16rem;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    margin: 0;
    padding: 0.3rem 0;
    list-style: none;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 10px 28px rgba(28, 27, 26, 0.12);
}

.pretty-select.is-open select.form-control,
.sort-select-wrap.is-open .sort-select,
.order-shipping-select-wrap.is-open .order-shipping-select {
    border-color: var(--accent);
}

.pretty-select-option {
    display: block;
    width: 100%;
    padding: 0.55rem 0.85rem;
    text-align: left;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.35;
    color: var(--text);
    background: none;
    border: 0;
    cursor: pointer;
}

.pretty-select-option:hover,
.pretty-select-option.is-active {
    background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}

.pretty-select-option.is-selected {
    font-weight: 500;
    color: var(--accent-hover);
}

.pretty-select-option:disabled {
    color: var(--text-muted);
    cursor: default;
}

[data-theme='dark'] select.form-control {
    background-color: #1a1918;
}

[data-theme='dark'] .pretty-select-list {
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

textarea.form-control {
    min-height: 8rem;
    resize: vertical;
    line-height: 1.5;
}

.form-group label.form-check {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 0;
    font-size: 0.875rem;
    font-weight: 400;
    cursor: pointer;
}

.form-check input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    margin: 0;
    flex-shrink: 0;
    accent-color: var(--accent);
}

.image-may-vary-field {
    margin-top: 1rem;
    padding: 0.75rem 0.9rem;
    background: var(--bg);
    border: 1px solid var(--border);
}

.admin-check-list-row .form-group {
    flex-shrink: 0;
    width: 8rem;
    margin: 0;
}

.shipping-package-add .form-group {
    flex: 1;
    margin-bottom: 0;
}

.form-row--inline .btn {
    margin-top: 0.05rem;
}

.form-error {
    font-size: 0.8125rem;
    color: #c44;
    margin-top: 0.25rem;
}

.form-control.is-invalid,
.search-select.is-invalid .search-select-input {
    border-color: #c44;
}

.form-hint {
    margin: 0.375rem 0 1rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.account-nav a:hover,
.account-nav a.is-active {
    color: var(--text);
    border-color: var(--accent);
    background: var(--bg);
}

.site-auth-name.is-active {
    color: var(--text);
}

.site-auth .btn {
    height: 2.25rem;
}

.footer-text-btn {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-size: 0.8125rem;
    color: var(--text-muted);
    cursor: pointer;
}

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

.add-to-cart-form .form-group {
    margin-bottom: 0.85rem;
}

.cart-summary .btn + .btn {
    margin-top: 0.5rem;
}

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

.variant-section-head .order-panel-title {
    margin-bottom: 0.4rem;
}

.variant-section-head .form-hint {
    margin: 0;
}

.variant-row.is-marked-for-delete .form-group label {
    text-decoration: line-through;
}

.form-row--item .btn {
    margin-top: 0.05rem;
}

[data-theme='dark'] .form-control {
    background: #1a1918;
    border-color: #7a7269;
    color: #f3efe8;
}

[data-theme='dark'] .form-control::placeholder {
    color: #c4bbb1;
}

[data-theme='dark'] .form-group > label:not(.form-check) {
    color: #f3efe8;
}

.order-panel,
.order-fact {
    background: var(--surface);
    border: 1px solid var(--border);
}

.order-main {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    min-width: 0;
}

.order-panel {
    padding: 1.35rem 1.35rem 1.25rem;
}

.order-panel-title,
.order-fact-title {
    margin: 0 0 1rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
}

.order-items {
    list-style: none;
    margin: 0;
    padding: 0;
}

.order-item {
    display: grid;
    grid-template-columns: 5.5rem minmax(0, 1fr) auto;
    gap: 1rem 1.15rem;
    align-items: start;
    padding: 1.05rem 0;
    border-top: 1px solid var(--border);
}

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

.order-item + .order-item {
    margin-top: 0.15rem;
}

.order-item-media {
    display: block;
    width: 5.5rem;
    aspect-ratio: 1 / 1;
    background: var(--bg);
    border: 1px solid var(--border);
    overflow: hidden;
}

.order-item-media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.order-item-body {
    min-width: 0;
}

.order-item-name {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.order-item-name a {
    color: inherit;
}

.order-item-name a:hover {
    color: var(--accent-hover);
}

.order-item-variant {
    margin-top: 0.45rem;
}

.order-item-variant-value {
    display: inline-flex;
    align-items: center;
    min-height: 1.5rem;
    padding: 0 0.55rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text);
    background: color-mix(in srgb, var(--accent) 10%, var(--surface));
    border: 1px solid var(--accent);
}

.order-item-sku {
    margin-top: 0.35rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.order-item-supplier-note,
.order-item-backorder-note {
    display: inline-flex;
    align-items: center;
    margin-top: 0.35rem;
    padding: 0.3rem 0.55rem;
    font-size: 0.75rem;
    color: #8a6d1a;
    background: #fdf3d8;
    border: 1px solid #f0dda0;
}

.order-item-discount {
    margin-top: 0.5rem;
}

.order-discount-badge {
    display: inline-flex;
    align-items: center;
    height: 1.45rem;
    padding: 0 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    line-height: 1;
    color: #3d6b4e;
    background: #eef4ef;
    border: 1px solid #d5e4d8;
}

.order-item-pricing {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    gap: 0.15rem;
    min-width: 6.25rem;
}

.order-item-qty {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.order-item-unit {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.order-item-price {
    margin: 0.2rem 0 0;
    font-size: 1rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.order-totals {
    margin: 0;
    padding-top: 0;
    border-top: 0;
}

.order-totals > div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.3rem 0;
    font-size: 0.875rem;
}

.order-reductions {
    margin: 0.45rem 0 0.2rem;
    padding: 0.9rem 0 0.85rem;
    border-top: 1px solid var(--border);
}

.order-reductions-title {
    margin: 0 0 0.75rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
}

.order-reductions-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.order-reductions-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.25rem;
}

.order-reductions-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
    min-width: 0;
}

.order-reductions-name {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--text);
}

.order-reductions-amount {
    margin: 0;
    padding-top: 0.1rem;
    font-size: 0.875rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    color: #3d6b4e;
    white-space: nowrap;
}

[data-theme='dark'] .order-discount-badge {
    color: #b7d4c0;
    background: color-mix(in srgb, #3d6b4e 28%, var(--surface));
    border-color: color-mix(in srgb, #3d6b4e 45%, var(--border));
}

[data-theme='dark'] .order-reductions-amount {
    color: #9dbea8;
}

.order-totals dt {
    color: var(--text-muted);
}

.order-totals dd {
    margin: 0;
    font-variant-numeric: tabular-nums;
}

.order-panel--total {
    padding: 1.35rem 1.35rem 1.25rem;
    text-align: right;
}

.order-panel-actions {
    text-align: right;
}

.order-total-amount {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 500;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.order-facts {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.order-fact {
    padding: 1.1rem 1.15rem 1.05rem;
}

.order-fact p {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.55;
}

.order-fact-extra {
    margin-top: 0.65rem;
}

.stripe-meta {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin: 0.75rem 0 0;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.stripe-meta-row {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.stripe-meta-row dt {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.stripe-meta-row dd {
    margin: 0;
}

.stripe-meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    max-width: 100%;
    padding: 0.3rem 0.55rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.75rem;
    color: #5147e5;
    background: color-mix(in srgb, #635bff 8%, var(--surface));
    border: 1px solid color-mix(in srgb, #635bff 22%, var(--border));
    overflow-wrap: anywhere;
}

a.stripe-meta-chip {
    transition: border-color 0.15s ease, background 0.15s ease;
}

a.stripe-meta-chip::after {
    content: '↗';
    flex-shrink: 0;
    font-family: system-ui, sans-serif;
    color: color-mix(in srgb, #635bff 60%, var(--text-muted));
}

a.stripe-meta-chip:hover {
    background: color-mix(in srgb, #635bff 14%, var(--surface));
    border-color: color-mix(in srgb, #635bff 35%, var(--border));
}

[data-theme='dark'] .stripe-meta-chip {
    color: #b3aeff;
    background: color-mix(in srgb, #635bff 16%, var(--surface));
    border-color: color-mix(in srgb, #635bff 32%, var(--border));
}

[data-theme='dark'] a.stripe-meta-chip:hover {
    background: color-mix(in srgb, #635bff 26%, var(--surface));
}

.stripe-fee-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.55rem;
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
    color: #a44;
    background: #f7ecec;
    border: 1px solid #e3c6c6;
}

.stripe-status-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.55rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.stripe-status-chip--paid {
    color: #3d6b4e;
    background: #eef4ef;
    border: 1px solid #d5e4d8;
}

.stripe-status-chip--pending {
    color: #8a6d1f;
    background: #fbf3dc;
    border: 1px solid #ecd9a3;
}

.stripe-status-chip--failed {
    color: #a44;
    background: #f7ecec;
    border: 1px solid #e3c6c6;
}

[data-theme='dark'] .stripe-status-chip--paid {
    color: #8fceac;
    background: color-mix(in srgb, #8fceac 12%, var(--surface));
    border-color: color-mix(in srgb, #8fceac 32%, var(--border));
}

[data-theme='dark'] .stripe-status-chip--pending {
    color: #e0b673;
    background: color-mix(in srgb, #e0b673 12%, var(--surface));
    border-color: color-mix(in srgb, #e0b673 32%, var(--border));
}

[data-theme='dark'] .stripe-status-chip--failed {
    color: #e08585;
    background: color-mix(in srgb, #e08585 12%, var(--surface));
    border-color: color-mix(in srgb, #e08585 32%, var(--border));
}

[data-theme='dark'] .stripe-fee-chip {
    color: #e08585;
    background: color-mix(in srgb, #e08585 12%, var(--surface));
    border-color: color-mix(in srgb, #e08585 32%, var(--border));
}

.stripe-fee-percentage {
    margin-left: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.order-facts > .btn {
    margin-top: 0.25rem;
}

[data-theme='dark'] .form-error {
    color: #e08585;
}

@media (max-width: 768px) {
.home {
        padding: 1.75rem 0 3rem;
    }
}

@media (max-width: 480px) {
.category-grid,
    .product-grid,
    .product-grid--related,
    .category-layout .product-grid,
    .choice-grid,
    .form-row {
        grid-template-columns: 1fr;
    }

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

.order-item-pricing {
        grid-column: 2;
        align-items: flex-start;
        text-align: left;
    }
}

.admin-nav-link.active {
    color: var(--text);
    border-bottom-color: var(--accent);
}

.admin-tabs a.active {
    color: var(--text);
    border-bottom-color: var(--accent);
}

.admin-tabs a.active .admin-tab-count {
    color: var(--accent-hover);
    border-color: color-mix(in srgb, var(--accent) 32%, var(--border));
    background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}

.admin-subtabs a.active {
    color: var(--text);
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}

.admin-subtabs a.active .admin-tab-count {
    color: var(--accent-hover);
    border-color: color-mix(in srgb, var(--accent) 32%, var(--border));
    background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}

.admin-toolbar .form-control {
    max-width: 16rem;
}

.admin-sort-link:hover,
.admin-sort-link.is-active {
    color: var(--text);
}

.admin-table-icon-col {
    text-align: center;
    white-space: nowrap;
}

.admin-table-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    flex-shrink: 0;
    padding: 0;
    font: inherit;
    color: var(--text-muted);
    border: 1px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}

a.admin-table-icon-btn:hover,
button.admin-table-icon-btn:hover {
    color: var(--text);
    border-color: var(--text-muted);
}

.admin-table-icon-btn.is-disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.admin-discount-form .form-group:last-child {
    margin-bottom: 0;
}

.admin-discount-form .form-hint {
    margin-bottom: 0.85rem;
}

.admin-discount-form .form-group .form-hint,
.admin-discount-form .form-row + .form-hint,
.admin-discount-form .form-hint:last-child {
    margin-bottom: 0;
}

.discount-value-field .form-control {
    border-right: 0;
}

.discount-value-field .form-control:focus {
    position: relative;
    z-index: 1;
}

.discount-value-field .form-control:focus + .discount-value-suffix {
    border-color: var(--accent);
}

.admin-pagination .btn[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: 0.45;
    pointer-events: none;
}

.admin-order-actions .btn {
    height: 2.5rem;
    min-width: 10.75rem;
    padding: 0 1rem;
    white-space: nowrap;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 1.5rem;
    padding: 0 0.6rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    line-height: 1;
    text-transform: uppercase;
    white-space: nowrap;
    border: 1px solid var(--border);
}

.badge-inline {
    height: 1.2rem;
    margin-left: 0.4rem;
    padding: 0 0.45rem;
    font-size: 0.625rem;
    vertical-align: middle;
}

.badge-featured {
    color: var(--accent-hover);
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 12%, var(--surface));
}

.badge-active,
.badge-shipped {
    color: #3d6b4e;
    border-color: #d5e4d8;
    background: #eef4ef;
}

/* Violet : une teinte que rien d'autre n'occupe. La sarcelle essayée d'abord
   tombait trop près du vert d'« expédiée » et du bleu de « livrée », or ces
   trois pastilles se lisent dans la même colonne. */
.badge-in_transit {
    color: #6a4a9c;
    border-color: #ddd2ec;
    background: #f2eef8;
}

/*
 * Bleu : le colis n'est plus en mouvement. Distinct du vert d'"expédiée"
 * juste à côté, qui dit l'inverse — parti, pas encore arrivé.
 */
.badge-delivered {
    color: #2f5d8a;
    border-color: #c6d8e8;
    background: #eef3f8;
}

.badge-draft {
    color: var(--text-muted);
    border-color: var(--border);
    background: var(--bg);
}

.badge-preparing {
    color: #8a6d1f;
    border-color: #ecd9a3;
    background: #fbf3dc;
}

.badge-refunded {
    color: #a44;
    border-color: #e3c6c6;
    background: #f7ecec;
}

.admin-order-create .form-row--item .btn {
    margin-top: 1.7rem;
}

.search-select.is-open .search-select-input {
    border-color: var(--accent);
}

.search-select-option:hover,
.search-select-option.is-active {
    background: var(--bg);
}

.admin-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.additional-images-placeholder {
    background: var(--bg);
    border: 2px dashed var(--accent);
}

.additional-images-placeholder::after,
.additional-images-placeholder img {
    display: none;
}

.lang-toggle {
    display: inline-flex;
    gap: 0;
    margin-bottom: 1.25rem;
    border: 1px solid var(--border);
    background: var(--surface);
}

.lang-toggle-btn {
    appearance: none;
    margin: 0;
    padding: 0.4rem 1rem;
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--text-muted);
    background: transparent;
    border: 0;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}

.lang-toggle-btn + .lang-toggle-btn {
    border-left: 1px solid var(--border);
}

.lang-toggle-btn:hover {
    color: var(--text);
}

.lang-toggle-btn.is-active {
    color: var(--text);
    background: color-mix(in srgb, var(--accent) 12%, var(--surface));
}

[data-lang-panel][hidden] {
    display: none;
}

.description-editor-mode-btn.is-active {
    color: var(--text);
    background: color-mix(in srgb, var(--accent) 12%, var(--surface));
}

.description-editor-group .ql-toolbar.ql-snow,
.description-editor-group .ql-container.ql-snow {
    border-color: var(--border);
    background: var(--surface);
    font-family: inherit;
}

.description-editor-group .ql-toolbar.ql-snow {
    border-radius: var(--radius);
}

.description-editor-group .ql-container.ql-snow {
    border-radius: var(--radius);
    min-height: 12rem;
    font-size: 0.875rem;
}

.description-editor-group .ql-editor {
    min-height: 12rem;
    color: var(--text);
    line-height: 1.6;
}

.description-editor-group .ql-editor.ql-blank::before {
    color: var(--text-muted);
    font-style: normal;
}

.description-editor-group .ql-snow .ql-stroke {
    stroke: var(--text-muted);
}

.description-editor-group .ql-snow .ql-fill {
    fill: var(--text-muted);
}

.description-editor-group .ql-snow .ql-picker {
    color: var(--text-muted);
}

.description-editor-group .ql-snow.ql-toolbar button:hover .ql-stroke,
.description-editor-group .ql-snow.ql-toolbar button.ql-active .ql-stroke {
    stroke: var(--accent);
}

.description-editor-group .ql-snow.ql-toolbar button:hover .ql-fill,
.description-editor-group .ql-snow.ql-toolbar button.ql-active .ql-fill {
    fill: var(--accent);
}

.description-editor-group.is-html-mode .ql-toolbar.ql-snow,
.description-editor-group.is-html-mode .ql-container.ql-snow {
    display: none;
}

@media (max-width: 768px) {
.admin-order-actions .btn {
        flex: 1 1 calc(50% - 0.25rem);
        min-width: 0;
    }
}

.modal-actions .btn {
    min-width: 7rem;
}

.tier-row .form-group {
    flex: 1;
    min-width: 0;
    margin: 0;
}

@keyframes modal-in {
    from {
        opacity: 0;
        transform: translateY(0.5rem);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.order-timeline {
    list-style: none;
    margin: 0;
    padding: 0;
}

.order-timeline-item {
    --history-tone: var(--accent);
    display: grid;
    grid-template-columns: 0.7rem minmax(0, 1fr);
    column-gap: 0.9rem;
    position: relative;
    padding-bottom: 1.2rem;
}

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

.order-timeline-item:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 0.3rem;
    top: 0.95rem;
    bottom: 0;
    width: 1px;
    background: var(--border);
}

.order-timeline-item.is-placed {
    --history-tone: var(--accent-hover);
}

.order-timeline-item.is-preparing {
    --history-tone: #8a6d1f;
}

.order-timeline-item.is-shipped {
    --history-tone: #3d6b4e;
}

.order-timeline-item.is-in_transit {
    --history-tone: #6a4a9c;
}

.order-timeline-item.is-refunded {
    --history-tone: #a44;
}

.order-timeline-marker {
    width: 0.7rem;
    height: 0.7rem;
    margin-top: 0.28rem;
    background: var(--surface);
    border: 1.5px solid var(--history-tone);
    z-index: 1;
}

.order-timeline-item.is-current .order-timeline-marker {
    background: var(--history-tone);
}

.order-timeline-body {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem 1.25rem;
    min-width: 0;
}

.order-timeline-status {
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.35;
}

.order-timeline-item.is-current .order-timeline-status {
    font-weight: 600;
}

.order-timeline-date {
    font-size: 0.8125rem;
    color: var(--text-muted);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.order-timeline-note {
    grid-column: 2;
    margin: 0.2rem 0 0;
    font-size: 0.8125rem;
    line-height: 1.4;
    color: var(--text-muted);
}

[data-theme='dark'] .order-timeline-item.is-preparing {
    --history-tone: #e0c36a;
}

[data-theme='dark'] .order-timeline-item.is-shipped {
    --history-tone: #9dccab;
}

[data-theme='dark'] .order-timeline-item.is-in_transit {
    --history-tone: #ab93dc;
}

[data-theme='dark'] .order-timeline-item.is-refunded {
    --history-tone: #e0a3a3;
}

@media (max-width: 480px) {
.order-timeline-body {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.2rem;
    }
}

.legal-nav a:hover,
.legal-nav a.is-active {
    color: var(--text);
    border-color: var(--accent);
    background: var(--bg);
}