:root {
    --brand-primary: #5f3f17;
    --bg: #f6f1e8;
    --bg-soft: #fbf7f1;
    --surface: rgba(255, 250, 242, 0.9);
    --surface-strong: #3d3020;
    --surface-muted: rgba(255, 250, 242, 0.72);
    --text: #2f2418;
    --muted: #6f604d;
    --border: rgba(125, 79, 42, 0.14);
    --border-strong: rgba(125, 79, 42, 0.22);
    --accent: #57442f;
    --accent-dark: #3d3020;
    --accent-soft: #ede0cd;
    --success: #315f3c;
    --danger: #7f2f2f;
    --shadow-soft: 0 18px 40px rgba(47, 36, 24, 0.08);
    --shadow-card: 0 24px 55px rgba(47, 36, 24, 0.1);
    --radius: 22px;
    --control-radius: 16px;
    --control-height: 56px;
    --control-padding-x: 1.15rem;
    --container: 1180px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: Georgia, "Times New Roman", serif;
    color: var(--text);
    background: radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.45), transparent 28%), radial-gradient(circle at 85% 25%, rgba(97, 57, 28, 0.12), transparent 24%), radial-gradient(circle at 50% 100%, rgba(82, 48, 22, 0.14), transparent 35%), linear-gradient(180deg, #f0dfbd 0%, #e7d1a7 100%);
}

main {
    flex: 1 0 auto;
    overflow-x: clip;
}

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

.ota-control-select,
.ota-control-checkbox {
    min-height: var(--control-height);
    border: 1px solid var(--border);
    border-radius: var(--control-radius);
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-soft);
}

.ota-control-select {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-width: 10rem;
    max-width: 100%;
    overflow: hidden;
}

.ota-control-select::after {
    position: absolute;
    inset-block: 0.8rem;
    right: 2.45rem;
    width: 1px;
    background: var(--border-strong);
    content: "";
    pointer-events: none;
}

.ota-control-select::before {
    position: absolute;
    right: 1.15rem;
    top: 50%;
    width: 0.5rem;
    height: 0.5rem;
    border-right: 1.5px solid var(--muted);
    border-bottom: 1.5px solid var(--muted);
    content: "";
    pointer-events: none;
    transform: translateY(-65%) rotate(45deg);
}

.ota-control-select select,
select.ota-control-select,
body:not(.l4d-platform) select:not([multiple]) {
    min-height: var(--control-height);
    padding: 0 3.1rem 0 var(--control-padding-x);
    border: 1px solid var(--border);
    border-radius: var(--control-radius);
    background-color: var(--surface);
    background-image:
        linear-gradient(45deg, transparent 50%, var(--muted) 50%),
        linear-gradient(135deg, var(--muted) 50%, transparent 50%),
        linear-gradient(90deg, var(--border-strong) 0, var(--border-strong) 1px, transparent 1px);
    background-position:
        calc(100% - 1.25rem) 52%,
        calc(100% - 0.88rem) 52%,
        calc(100% - 2.45rem) 50%;
    background-size:
        0.4rem 0.4rem,
        0.4rem 0.4rem,
        1px 1.6rem;
    background-repeat: no-repeat;
    color: var(--text);
    box-shadow: var(--shadow-soft);
    appearance: none;
    -webkit-appearance: none;
}

.ota-control-select select {
    width: 100%;
    border: 0;
    border-radius: inherit;
    background-color: transparent;
    background-image: none;
    box-shadow: none;
}

.ota-control-checkbox,
body:not(.l4d-platform) label:has(> input[type="checkbox"]) {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    min-height: var(--control-height);
    padding: 0 var(--control-padding-x);
    border: 1px solid var(--border);
    border-radius: var(--control-radius);
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-soft);
    line-height: 1.2;
    cursor: pointer;
}

body:not(.l4d-platform) input[type="checkbox"] {
    width: 1.125rem;
    height: 1.125rem;
    min-width: 1.125rem;
    min-height: 1.125rem;
    margin: 0;
    border: 1px solid var(--border-strong);
    border-radius: 0.35rem;
    background:
        linear-gradient(135deg, transparent 0 52%, #fff 52% 62%, transparent 62%) 50% 48% / 55% 55% no-repeat,
        linear-gradient(45deg, transparent 0 46%, #fff 46% 56%, transparent 56%) 35% 57% / 45% 45% no-repeat,
        var(--surface);
    box-shadow: 0 1px 2px rgba(47, 36, 24, 0.08);
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

body:not(.l4d-platform) input[type="checkbox"]:checked {
    border-color: var(--accent);
    background-color: var(--accent);
}

body:not(.l4d-platform) select:not([multiple]):focus-visible,
body:not(.l4d-platform) input[type="checkbox"]:focus-visible,
.ota-control-select:focus-within,
.ota-control-checkbox:focus-within {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(95, 63, 23, 0.14);
}

/* a {
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

button,
input,
select,
textarea {
    font: inherit;
}

[x-cloak] {
    display: none !important;
}

.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;
}

.container {
    width: min(calc(100% - 1.25rem), var(--container));
    margin: 0 auto;
}

@media (min-width: 760px) {
    .container {
        width: min(calc(100% - 2rem), var(--container));
    }
} */
[x-cloak] {
    display: none !important;
}

/* =========================================================================
   Cart Drawer — OTA Antique Styling
   ========================================================================= */

/* ---- Cart Button (Header) ---- */

.ota-header__cart-btn {
    position: absolute;
    right: 0;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid var(--ota-header-gold);
    background: var(--ota-header-brown);
    color: var(--ota-header-paper);
    font-family: var(--site-font-heading, Georgia, "Times New Roman", serif);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.22s ease, transform 0.18s ease;
}

.ota-header__cart-btn:hover {
    background: var(--ota-header-brown-dark);
    transform: translateY(-1px);
}

.ota-header__cart-btn-icon {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    line-height: 1;
}

.ota-header__cart-btn-label {
    line-height: 1;
}

.ota-header__cart-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: var(--ota-header-gold);
    color: var(--ota-header-brown);
    font-family: var(--site-font-ui, Georgia, serif);
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0;
    animation: badgePop 0.22s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes badgePop {
    from { transform: scale(0.5); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

/* ---- Overlay ---- */

.cart-drawer-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    justify-content: flex-end;
}

.cart-drawer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 10, 4, 0.52);
    backdrop-filter: blur(3px);
    transition: opacity 0.3s ease;
}

/* ---- Drawer Panel ---- */

.cart-drawer-panel {
    position: relative;
    width: 100%;
    max-width: 440px;
    height: 100%;
    display: flex;
    flex-direction: column;
    z-index: 10001;
    animation: cartSlideIn 0.32s cubic-bezier(0.16, 1, 0.3, 1) forwards;

    /* OTA parchment background */
    background:
        radial-gradient(circle at 15% 0%,   rgba(255,255,255,0.35), transparent 26%),
        radial-gradient(circle at 85% 100%,  rgba(120, 70, 30, 0.1), transparent 30%),
        linear-gradient(180deg, #f5e9cc 0%, #ede0be 55%, #e8d7b0 100%);

    /* Faint grid texture */
    background-image:
        radial-gradient(circle at 15% 0%,   rgba(255,255,255,0.35), transparent 26%),
        radial-gradient(circle at 85% 100%,  rgba(120, 70, 30, 0.1), transparent 30%),
        linear-gradient(rgba(54, 31, 17, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(54, 31, 17, 0.03) 1px, transparent 1px),
        linear-gradient(180deg, #f5e9cc 0%, #ede0be 55%, #e8d7b0 100%);
    background-size: auto, auto, 38px 38px, 38px 38px, auto;

    box-shadow: -8px 0 48px rgba(20, 10, 4, 0.28);
    border-left: 1px solid rgba(74, 45, 25, 0.32);
}

@keyframes cartSlideIn {
    from { transform: translateX(100%); }
    to   { transform: translateX(0); }
}

/* ---- Header ---- */

.cart-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px 16px;
    border-bottom: 1px solid rgba(74, 45, 25, 0.22);
    background: linear-gradient(
        180deg,
        rgba(244, 226, 187, 0.55) 0%,
        transparent 100%
    );
    flex-shrink: 0;
}

.cart-drawer-header-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.cart-drawer-header-inner h3 {
    margin: 0;
    font-family: var(--site-font-heading, Georgia, "Times New Roman", serif);
    font-size: 16px;
    font-weight: 400;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #2b1711;
}

.cart-drawer-header-ornament {
    font-size: 11px;
    color: rgba(157, 122, 60, 0.7);
    letter-spacing: 0;
}

.cart-drawer-close {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    background: none;
    border: 1px solid rgba(74, 45, 25, 0.24);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    color: #6f5538;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.cart-drawer-close:hover {
    background: rgba(74, 45, 25, 0.1);
    color: #2b1711;
    border-color: rgba(74, 45, 25, 0.4);
}

/* ---- Content / Scrollable Area ---- */

.cart-drawer-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 22px;
    scrollbar-width: thin;
    scrollbar-color: rgba(74, 45, 25, 0.28) transparent;
}

.cart-drawer-content::-webkit-scrollbar {
    width: 4px;
}

.cart-drawer-content::-webkit-scrollbar-thumb {
    background: rgba(74, 45, 25, 0.28);
    border-radius: 2px;
}

/* ---- Empty State ---- */

.cart-drawer-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    text-align: center;
    gap: 12px;
}

.cart-drawer-empty-icon {
    font-size: 40px;
    opacity: 0.45;
    margin-bottom: 4px;
}

.cart-drawer-empty p {
    font-family: var(--site-font-body, Georgia, "Times New Roman", serif);
    font-size: 15px;
    color: #6f5538;
    margin: 0;
}

.cart-drawer-continue-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 24px;
    margin-top: 8px;
    border: 1px solid #3a2116;
    background: transparent;
    color: #3a2116;
    font-family: var(--site-font-heading, Georgia, "Times New Roman", serif);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    cursor: pointer;
    transition: 0.25s ease;
}

.cart-drawer-continue-btn:hover {
    background: #3a2116;
    color: #f7e9c7;
}

/* ---- Items List ---- */

.cart-drawer-items-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.cart-drawer-item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 16px 0;
    border-bottom: 1px solid rgba(74, 45, 25, 0.14);
}

.cart-drawer-item:first-child {
    padding-top: 4px;
}

/* ---- Item Thumbnail ---- */

.cart-drawer-item-img {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    border: 1px solid rgba(74, 45, 25, 0.24);
    background: rgba(244, 226, 187, 0.7);
    overflow: hidden;
    display: grid;
    place-items: center;
}

.cart-drawer-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: sepia(0.12) saturate(0.92);
    transition: filter 0.2s ease;
}

.cart-drawer-item-img:hover img {
    filter: sepia(0) saturate(1);
}

.cart-drawer-item-placeholder {
    font-size: 22px;
    color: rgba(74, 45, 25, 0.3);
}

/* ---- Item Details ---- */

.cart-drawer-item-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cart-drawer-item-title {
    margin: 0;
    font-family: var(--site-font-heading, Georgia, "Times New Roman", serif);
    font-size: 14px;
    font-weight: 600;
    color: #2b1711;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-drawer-item-price {
    font-family: var(--site-font-ui, Georgia, "Times New Roman", serif);
    font-size: 14px;
    font-weight: 700;
    color: #3a2116;
}

.cart-drawer-item-type {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #9d7a3c;
    background: rgba(157, 122, 60, 0.12);
    border: 1px solid rgba(157, 122, 60, 0.3);
    padding: 1px 6px;
    width: max-content;
}

/* ---- Qty Controls ---- */

.cart-drawer-item-qty-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.qty-btn {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(74, 45, 25, 0.3);
    background: rgba(244, 226, 187, 0.6);
    color: #3a2116;
    font-size: 16px;
    font-family: var(--site-font-ui, Georgia, serif);
    cursor: pointer;
    transition: all 0.18s ease;
    line-height: 1;
    padding: 0;
}

.qty-btn:hover {
    background: #3a2116;
    color: #f7e9c7;
    border-color: #3a2116;
}

.qty-btn--disabled,
.qty-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.qty-val {
    min-width: 24px;
    text-align: center;
    font-family: var(--site-font-ui, Georgia, serif);
    font-size: 14px;
    font-weight: 700;
    color: #2b1711;
}

.remove-btn {
    margin-left: auto;
    background: none;
    border: none;
    padding: 0;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #9c3a27;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: opacity 0.2s;
}

.remove-btn:hover {
    opacity: 0.7;
}

/* ---- Footer ---- */

.cart-drawer-footer {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px 22px 22px;
    border-top: 1px solid rgba(74, 45, 25, 0.22);
    background: linear-gradient(
        0deg,
        rgba(232, 215, 176, 0.75) 0%,
        transparent 100%
    );
}

.cart-drawer-total-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cart-drawer-total-label,
.cart-drawer-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-drawer-total-label {
    font-size: 12px;
    color: #6f5538;
    letter-spacing: 0.06em;
}

.cart-drawer-total {
    font-family: var(--site-font-heading, Georgia, "Times New Roman", serif);
    font-size: 15px;
    color: #2b1711;
    font-weight: 500;
    padding-top: 8px;
    border-top: 2px solid rgba(74, 45, 25, 0.22);
}

.cart-drawer-total strong {
    font-size: 18px;
    font-weight: 700;
    color: #3a2116;
}

/* ---- Checkout Button ---- */

.cart-drawer-checkout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    border: 1px solid #1f100b;
    background: linear-gradient(135deg, #3a2116 0%, #1f100b 100%);
    color: #f7e9c7;
    font-family: var(--site-font-heading, Georgia, "Times New Roman", serif);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-decoration: none;
    text-align: center;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.28s ease;
    position: relative;
    overflow: hidden;
}

.cart-drawer-checkout-btn::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%);
    pointer-events: none;
}

.cart-drawer-checkout-btn:hover {
    background: linear-gradient(135deg, #1f100b 0%, #0a0402 100%);
    color: #f7e9c7;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(20, 10, 4, 0.32);
}

.cart-drawer-checkout-icon {
    font-size: 13px;
    opacity: 0.75;
}

/* ---- Clear Button ---- */

.cart-drawer-clear-btn {
    background: none;
    border: none;
    padding: 4px;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-align: center;
    color: #9c7856;
    cursor: pointer;
    transition: color 0.2s;
}

.cart-drawer-clear-btn:hover {
    color: #9c3a27;
}

/* =========================================================================
   Responsive Grid Layouts — Checkout & Admin Orders
   ========================================================================= */

/* Public Checkout two-column layout (form | order summary) */
.ota-checkout__layout {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 40px;
    align-items: start;
}

/* Admin Order Detail two-column layout (details | controls) */
.ota-admin-orders__detail-layout {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 32px;
    align-items: start;
    margin-bottom: 60px;
}

@media (max-width: 900px) {
    .ota-checkout__layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .ota-admin-orders__detail-layout {
        grid-template-columns: 1fr;
        gap: 24px;
        margin-bottom: 40px;
    }
}
