/* The sidebar shares the storefront palette, typeface and restrained accents. */
body.sm-sidebar-open { overflow: hidden; }
.sm-checkout-sidebar {
    --panel-bg: var(--wp--preset--color--night, #00151f);
    --panel-surface: var(--wp--preset--color--surface, #06232e);
    --panel-accent: var(--wp--preset--color--accent, #00e6ca);
    --panel-text: var(--wp--preset--color--white, #f5f8fa);
    --panel-muted: var(--wp--preset--color--muted, #bccbd3);
    --panel-line: #28434e;
    position: fixed;
    inset: 0 0 0 auto;
    width: min(640px, 100%);
    max-width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    padding: 0;
    border: 0;
    background: var(--panel-bg);
    color: var(--panel-text);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--panel-line) var(--panel-bg);
    font: inherit;
    font-size: 16px;
    line-height: 1.5;
    box-shadow: -24px 0 80px rgb(0 0 0 / 24%);
    color-scheme: dark;
}
.sm-checkout-sidebar::backdrop { background: rgb(0 10 16 / 65%); backdrop-filter: blur(4px); }
.sm-checkout-sidebar[open] { animation: sm-sidebar-enter .22s ease-out; }
.sm-sidebar-header {
    position: sticky; top: 0; z-index: 2;
    display: flex; justify-content: space-between; align-items: center; gap: 16px;
    padding: 22px 28px; background: var(--panel-bg); border-bottom: 1px solid var(--panel-line);
}
.sm-sidebar-header h2 { margin: 0; font: inherit; font-size: 26px; font-weight: 700; letter-spacing: -.6px; }
.sm-sidebar-header button {
    display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
    border: 1px solid var(--panel-line); border-radius: 50%;
    background: transparent; color: var(--panel-muted); font: inherit; font-size: 28px; line-height: 1; cursor: pointer;
}
.sm-sidebar-header button:hover { border-color: var(--panel-accent); color: var(--panel-accent); }
.sm-sidebar-content { padding: 28px; }
.sm-sidebar-message { margin: 16px 28px 0; padding: 12px 16px; border: 1px solid var(--panel-line); border-radius: 10px; background: var(--panel-surface); color: var(--panel-muted); font-size: 14px; }
.sm-panel-cart-item {
    display: grid; grid-template-columns: var(--wp--custom--checkout-cart-image-width) minmax(0, 1fr); gap: 18px;
    padding-bottom: 24px; margin-bottom: 24px; border-bottom: 1px solid var(--panel-line);
}
.sm-panel-cart-item img { width: 100%; height: 100%; min-height: 0; align-self: stretch; object-fit: cover; border-radius: 10px; }
.sm-panel-cart-item > div { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.sm-panel-cart-item .sm-panel-quantity { margin-top: auto; }
.sm-panel-cart-item h3 { margin: 0 0 6px; color: var(--panel-text); font: inherit; font-size: 17px; font-weight: 600; line-height: 1.4; }
.sm-panel-cart-item p { margin: 0 0 14px; color: var(--panel-accent); font-size: 18px; font-weight: 600; }
.sm-panel-quantity {
    display: inline-flex; align-items: stretch; max-width: 100%;
    border: 1px solid var(--panel-line); border-radius: 10px; overflow: hidden;
    background: var(--panel-surface);
}
.sm-panel-quantity input {
    box-sizing: border-box; width: 56px; min-width: 0; min-height: 44px; margin: 0; padding: 8px 4px;
    border: 0; border-radius: 0; background: transparent; color: var(--panel-text);
    font: inherit; font-size: 16px; text-align: center; appearance: textfield; -moz-appearance: textfield;
}
.sm-panel-quantity input::-webkit-inner-spin-button,
.sm-panel-quantity input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.sm-panel-quantity button {
    flex: 0 0 44px; width: 44px; min-height: 44px; margin: 0; padding: 0;
    border: 0; border-radius: 0; background: transparent; color: var(--panel-text);
    font: inherit; font-size: 22px; line-height: 1; text-decoration: none; cursor: pointer;
}
.sm-panel-quantity button:not(:disabled):hover { background: var(--panel-line); color: var(--panel-accent); }
.sm-panel-quantity :focus-visible { outline-offset: -3px; }
.sm-panel-quantity button:disabled { opacity: .4; cursor: not-allowed; }
.sm-checkout-sidebar .sm-panel-checkout > h2 { margin: 30px 0 24px; font: inherit; font-size: 22px; font-weight: 700; letter-spacing: -.4px; }
.sm-checkout-sidebar .woocommerce form.checkout { display: block; margin: 0; }
.sm-checkout-sidebar .woocommerce form.checkout #customer_details,
.sm-checkout-sidebar .woocommerce form.checkout #order_review {
    width: 100%; margin: 0; padding: 0; background: transparent; color: var(--panel-text); border: 0; border-radius: 0;
}
.sm-checkout-sidebar .woocommerce form.checkout #customer_details .col-1 { width: 100%; float: none; }
.sm-checkout-sidebar .sm-checkout-recipient h3 { margin: 0 0 18px; color: var(--panel-muted); font: inherit; font-size: 14px; font-weight: 600; }
.sm-checkout-sidebar .woocommerce-billing-fields__field-wrapper { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 16px; }
.sm-checkout-sidebar .woocommerce form.checkout .form-row { margin: 0; padding: 0; width: 100%; min-width: 0; }
.sm-checkout-sidebar #billing_email_field,
.sm-checkout-sidebar #billing_address_1_field,
.sm-checkout-sidebar .sm-checkout-delivery { grid-column: 1 / -1; }
.sm-checkout-sidebar .woocommerce form.checkout .form-row label { margin: 0 0 7px; color: var(--panel-text); font-size: 13px; font-weight: 500; line-height: 1.5; }
.sm-checkout-sidebar .woocommerce form.checkout .form-row input.input-text,
.sm-checkout-sidebar .woocommerce form.checkout .form-row textarea {
    width: 100%; min-height: 48px; padding: 12px 14px;
    border: 1px solid var(--panel-line); border-radius: 8px;
    background: var(--panel-surface); color: var(--panel-text); font: inherit; font-size: 16px; line-height: 1.4;
    box-shadow: none; transition: border-color .15s, box-shadow .15s;
}
.sm-checkout-sidebar .woocommerce form.checkout .form-row textarea { min-height: 100px; resize: vertical; }
.sm-checkout-sidebar .woocommerce form.checkout .form-row input::placeholder,
.sm-checkout-sidebar .woocommerce form.checkout .form-row textarea::placeholder { color: #839ca8; opacity: 1; }
.sm-checkout-sidebar .woocommerce form.checkout .form-row input:focus,
.sm-checkout-sidebar .woocommerce form.checkout .form-row textarea:focus { border-color: var(--panel-accent); outline: none; box-shadow: 0 0 0 3px rgb(0 230 202 / 10%); }
.sm-checkout-sidebar .woocommerce form.checkout .form-row .description { margin-top: 7px; color: var(--panel-muted); font-size: 12px; line-height: 1.5; }
.sm-checkout-sidebar .woocommerce form.checkout .required { color: #ff9b9b; text-decoration: none; }
.sm-checkout-sidebar .woocommerce form.checkout .optional { color: var(--panel-muted); font-size: 12px; font-weight: 400; }
.sm-checkout-sidebar .woocommerce form.checkout .woocommerce-invalid input,
.sm-checkout-sidebar .woocommerce form.checkout .woocommerce-invalid textarea { border-color: #ff9b9b; }
.sm-checkout-sidebar .sm-checkout-delivery { margin: 8px 0 0; }
.sm-checkout-sidebar .sm-checkout-delivery legend { margin-bottom: 12px; color: var(--panel-text); font-size: 14px; font-weight: 600; }
.sm-checkout-sidebar .sm-checkout-delivery ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 10px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.sm-checkout-sidebar .sm-checkout-delivery li { display: flex; align-items: center; gap: 10px; min-width: 0; margin: 0; padding: 12px; border: 1px solid var(--panel-line); border-radius: 10px; background: var(--panel-surface); }
.sm-checkout-sidebar .sm-checkout-delivery li:has(input:checked) { border-color: var(--panel-accent); background: #063039; }
.sm-checkout-sidebar .sm-checkout-delivery input { flex: 0 0 18px; width: 18px; height: 18px; margin: 0; accent-color: var(--panel-accent); }
.sm-checkout-sidebar .sm-checkout-delivery label { flex: 1; min-width: 0; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.sm-checkout-sidebar .sm-shipping-price { color: var(--panel-muted); font-size: 12px; }
.sm-checkout-sidebar .woocommerce form.checkout #order_review_heading { margin: 30px 0 16px; padding-top: 24px; border-top: 1px solid var(--panel-line); color: var(--panel-text); font: inherit; font-size: 20px; font-weight: 700; }
.sm-checkout-sidebar #customer_details .col-2,
.sm-checkout-sidebar .woocommerce-form-coupon-toggle,
.sm-checkout-sidebar .woocommerce-form-login-toggle { display: none; }
.sm-checkout-sidebar .woocommerce form.checkout table.shop_table { width: 100%; margin: 0 0 24px; border: 0; border-collapse: collapse; color: var(--panel-text); font-size: 14px; }
.sm-checkout-sidebar .woocommerce form.checkout table.shop_table th,
.sm-checkout-sidebar .woocommerce form.checkout table.shop_table td { padding: 14px 0; border: 0; border-bottom: 1px solid var(--panel-line); background: transparent; font-weight: 400; vertical-align: top; overflow-wrap: anywhere; }
.sm-checkout-sidebar .woocommerce form.checkout table.shop_table th { text-align: left; color: var(--panel-muted); }
.sm-checkout-sidebar .woocommerce form.checkout table.shop_table td:last-child,
.sm-checkout-sidebar .woocommerce form.checkout table.shop_table th:last-child { text-align: right; padding-left: 14px; }
.sm-checkout-sidebar .woocommerce form.checkout table.shop_table .order-total th,
.sm-checkout-sidebar .woocommerce form.checkout table.shop_table .order-total td { padding-top: 20px; border: 0; color: var(--panel-text); font-size: 20px; font-weight: 700; }
.sm-checkout-sidebar .woocommerce form.checkout table.shop_table .woocommerce-Price-amount { white-space: nowrap; }
.sm-checkout-sidebar .woocommerce form.checkout #payment { background: transparent; border: 0; border-radius: 0; }
.sm-checkout-sidebar #payment .wc_payment_methods {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 10px;
    margin: 0 0 20px;
    padding: 0;
    list-style: none;
}
.sm-checkout-sidebar #payment .wc_payment_method { min-width: 0; margin: 0; padding: 12px; border: 1px solid var(--panel-line); border-radius: 10px; background: var(--panel-surface); overflow-wrap: anywhere; }
.sm-checkout-sidebar #payment .wc_payment_method + .wc_payment_method { margin-top: 0; }
.sm-checkout-sidebar #payment .wc_payment_method > label { font-size: 14px; font-weight: 600; cursor: pointer; }
.sm-checkout-sidebar #payment .wc_payment_method input { accent-color: var(--panel-accent); }
.sm-checkout-sidebar #payment .payment_box { margin-top: 8px; background: transparent; color: var(--panel-muted); font-size: 13px; }
.sm-checkout-sidebar #payment .payment_box p { margin: 0; }
.sm-checkout-sidebar .woocommerce form.checkout #payment .place-order { padding: 0; }
.sm-checkout-sidebar #payment .woocommerce-privacy-policy-text,
.sm-checkout-sidebar #payment .woocommerce-terms-and-conditions-wrapper { color: var(--panel-muted); font-size: 12px; line-height: 1.65; }
.sm-checkout-sidebar .woocommerce form.checkout #payment a { color: var(--panel-accent); text-underline-offset: 3px; }
.sm-checkout-sidebar .woocommerce form.checkout .form-row label.checkbox { display: flex; align-items: baseline; gap: 8px; margin-top: 14px; font-size: 12px; font-weight: 400; }
.sm-checkout-sidebar .woocommerce form.checkout #place_order,
.sm-panel-result button,
.sm-sidebar-content > button {
    display: block; width: 100%; min-height: 52px; margin: 20px 0 0; padding: 14px 20px;
    border: 1px solid var(--panel-accent); border-radius: 999px;
    background: var(--panel-accent); color: #071015; font: inherit; font-size: 16px; font-weight: 700; line-height: 1.4; cursor: pointer;
}
.sm-checkout-sidebar .woocommerce form.checkout #place_order:hover,
.sm-panel-result button:hover,
.sm-sidebar-content > button:hover { background: #62ffe9; border-color: #62ffe9; }
.sm-checkout-sidebar .woocommerce form.checkout #place_order:disabled,
.sm-checkout-sidebar button:disabled { opacity: .5; cursor: wait; }
.sm-panel-result { overflow-wrap: anywhere; }
.sm-panel-result > h2 { margin: 0 0 16px; font: inherit; font-size: 26px; font-weight: 700; }
.sm-panel-result > p { color: var(--panel-muted); }
.sm-panel-result > ul { margin: 24px 0; padding-left: 20px; }
.sm-panel-result .sm-tickets { margin: 24px 0; padding: 20px; border: 1px solid var(--panel-line); border-radius: 12px; background: var(--panel-surface); }
.sm-panel-result .sm-tickets h2 { margin: 0 0 16px; font: inherit; font-size: 20px; font-weight: 600; }
.sm-panel-result .sm-tickets h3 { color: var(--panel-muted); font: inherit; font-size: 14px; }
.sm-panel-result .sm-tickets ul { list-style: none; margin: 0; padding: 0; }
.sm-panel-result .sm-tickets li { padding: 10px 0; border-bottom: 1px solid var(--panel-line); font-size: 14px; }
.sm-panel-result .sm-tickets li:last-child { border: 0; }
.sm-panel-result .sm-tickets strong { color: var(--panel-accent); font-size: 18px; font-variant-numeric: tabular-nums; }
.sm-panel-result button[data-panel-refresh] { background: transparent; color: var(--panel-accent); }
.sm-panel-result button[data-panel-refresh]:hover { background: var(--panel-surface); }
.sm-panel-errors { margin-bottom: 20px; padding: 16px; border: 1px solid #b86a72; border-radius: 10px; background: #321f2b; color: #ffd5d9; font-size: 14px; }
.sm-panel-errors .woocommerce-error { margin: 0; padding-left: 20px; background: transparent; color: inherit; }
.sm-checkout-sidebar :focus-visible { outline: 2px solid var(--panel-accent); outline-offset: 3px; }
/* The result receives focus for announcement, without framing the whole order. */
.sm-checkout-sidebar .sm-panel-result:focus { outline: none; }
@keyframes sm-sidebar-enter { from { transform: translateX(32px); opacity: .6; } to { transform: translateX(0); opacity: 1; } }
/* Keep options readable when the checkout drawer fills a narrow screen. */
@media (max-width: 560px) {
    .sm-checkout-sidebar .sm-checkout-delivery ul,
    .sm-checkout-sidebar #payment .wc_payment_methods {
        grid-template-columns: minmax(0, 1fr);
    }
}
@media (max-width: 480px) {
    .sm-sidebar-content { padding: 20px; }
    .sm-sidebar-header { padding: 16px 20px; }
    .sm-sidebar-header h2 { font-size: 23px; }
    .sm-sidebar-message { margin-inline: 20px; }
    .sm-panel-cart-item { grid-template-columns: var(--wp--custom--checkout-cart-image-width-mobile) minmax(0, 1fr); gap: 14px; }
    .sm-panel-cart-item h3 { font-size: 15px; }
    .sm-checkout-sidebar .woocommerce-billing-fields__field-wrapper { grid-template-columns: minmax(0, 1fr); gap: 18px; }
    .sm-checkout-sidebar .sm-panel-checkout > h2 { font-size: 21px; }
}
@media (prefers-reduced-motion: reduce) { .sm-checkout-sidebar[open] { animation: none; } }

/* Gutenberg owns the layout; AJAX changes only the content of dynamic slots. */
.sm-checkout-sidebar [data-sm-panel-view][hidden],
.sm-checkout-sidebar button[hidden] { display: none !important; }
.sm-checkout-sidebar .sm-sidebar-header.wp-block-group { margin: 0; max-width: none; }
.sm-checkout-sidebar .sm-sidebar-content.wp-block-group { margin: 0; max-width: none; }
.sm-checkout-sidebar .sm-sidebar-state { min-width: 0; }
.sm-checkout-sidebar .sm-sidebar-state > h2 { margin-block: 24px 18px; font-size: 22px; }
.sm-checkout-sidebar .sm-sidebar-state > p { color: inherit; opacity: .85; font-size: 14px; }
.sm-checkout-sidebar .sm-sidebar-slot { min-width: 0; }
.sm-sidebar-state > .sm-sidebar-action,
.sm-sidebar-content > .sm-sidebar-action {
    display: block; width: 100%; min-height: 48px; margin-block: 16px 0; padding: 12px 20px;
    border: 1px solid var(--panel-accent); border-radius: 999px; background: var(--panel-accent);
    color: #071015; font: inherit; font-weight: 600; cursor: pointer;
}
.sm-sidebar-state > .sm-sidebar-action[data-panel-refresh] { background: transparent; color: var(--panel-accent); }
/* The form's nested Gutenberg blocks own layout and retain their styles on AJAX updates. */
.sm-checkout-sidebar .woocommerce form.sm-block-checkout { display: block; }
.sm-checkout-sidebar .sm-checkout-fields-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px 16px; margin-block: 18px 28px; }
.sm-checkout-sidebar .sm-checkout-field { min-width: 0; }
.sm-checkout-sidebar .sm-checkout-fields-grid > .sm-checkout-field--full,
.sm-checkout-sidebar .sm-checkout-fields-grid > .sm-checkout-section { grid-column: 1 / -1; }
.sm-checkout-sidebar .sm-block-checkout > h3 { margin-block: 24px 16px; font-size: 20px; font-weight: 600; }
.sm-checkout-sidebar .sm-block-checkout .sm-checkout-field .form-row { margin: 0; }
.sm-checkout-sidebar .sm-checkout-section { min-width: 0; }
.sm-checkout-sidebar .sm-checkout-section--payment { margin-top: 20px; }
@media(max-width:480px){.sm-checkout-sidebar .sm-checkout-fields-grid{grid-template-columns:minmax(0,1fr);}}
.sm-checkout-sidebar .sm-block-checkout .sm-checkout-field .form-row,
.sm-checkout-sidebar .sm-block-checkout .sm-checkout-field .form-row input,
.sm-checkout-sidebar .sm-block-checkout .sm-checkout-field .form-row textarea { font-size: inherit; }
.sm-checkout-sidebar .sm-block-checkout .sm-checkout-field .form-row label { font-size: .8125em; }
.sm-checkout-sidebar .sm-block-checkout .sm-checkout-section label,
.sm-checkout-sidebar .sm-block-checkout .sm-checkout-section table.shop_table { font-size: .875em; }

/* Grid gaps own field spacing; Gutenberg flow margins must not offset columns. */
.sm-checkout-sidebar .sm-checkout-fields-grid > .sm-checkout-field,
.sm-checkout-sidebar .sm-checkout-fields-grid > .sm-checkout-section {
    margin-block: 0;
    align-self: start;
}
.sm-checkout-sidebar .woocommerce form.checkout .form-row .description {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}
.sm-checkout-sidebar .woocommerce form.checkout .form-row .description::before { display: none; }

/* Order confirmation keeps product images alongside the saved name and quantity. */
.sm-panel-result > .sm-result-products {
    display: grid;
    gap: var(--wp--preset--spacing--m);
    margin-block: var(--wp--preset--spacing--xl);
    padding: 0;
    list-style: none;
}
.sm-result-product {
    display: grid;
    grid-template-columns: var(--wp--custom--checkout-result-image-width) minmax(0, 1fr);
    align-items: center;
    gap: var(--wp--preset--spacing--m);
}
.sm-result-product img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--wp--preset--spacing--s);
}
.sm-result-product > div { min-width: 0; }
.sm-result-product strong { display: block; font-weight: 600; }
.sm-result-product span { display: block; color: var(--panel-muted); }

/* WooCommerce clearfix pseudo-elements must not occupy option grid cells. */
.sm-checkout-sidebar .sm-checkout-delivery ul::before,
.sm-checkout-sidebar .sm-checkout-delivery ul::after,
.sm-checkout-sidebar #payment ul.wc_payment_methods::before,
.sm-checkout-sidebar #payment ul.wc_payment_methods::after { content: none !important; display: none !important; }
.sm-checkout-sidebar #payment ul.wc_payment_methods,
.sm-checkout-sidebar .sm-checkout-delivery ul.woocommerce-shipping-methods {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.sm-checkout-sidebar #payment ul.wc_payment_methods > li { width: auto; float: none; }
.sm-checkout-sidebar #payment .wc_payment_method > label img { max-width: 100%; max-height: 38px; width: auto; object-fit: contain; vertical-align: middle; }
@media (max-width: 380px) {
    .sm-checkout-sidebar #payment ul.wc_payment_methods,
    .sm-checkout-sidebar .sm-checkout-delivery ul.woocommerce-shipping-methods { grid-template-columns: minmax(0, 1fr); }
}
