.cs-header-panel[data-mode="cart"] {
    position: fixed;
    inset: 0 0 0 auto;
    display: flex;
    width: min(440px, 100vw);
    max-width: none;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    padding: 0;
    overflow: hidden;
    flex-direction: column;
    border: 0;
    border-radius: 0;
    background: #f5f3ee;
    box-shadow: -16px 0 48px rgb(8 23 38 / 24%);
    animation: cs-cart-slide-in 220ms ease-out both;
}

.cs-header-panel[data-mode="cart"] .cs-header-panel-inner {
    display: flex;
    min-height: 0;
    padding: 0;
    flex: 1 1 auto;
    flex-direction: column;
}

.cs-header-panel[data-mode="cart"] .cs-header-panel-heading {
    min-height: 72px;
    margin: 0;
    padding: 12px 20px;
    flex: 0 0 auto;
    color: #fff;
    background: #142a42;
}

.cs-header-panel[data-mode="cart"] .cs-header-panel-heading h2 {
    margin-right: auto;
    color: #fff;
    font-size: 1.16rem;
    font-weight: 700;
}

.cs-header-panel[data-mode="cart"] .cs-header-panel-clear {
    min-height: 34px;
    padding: 5px 11px;
    border: 1px solid rgb(255 255 255 / 45%);
    border-radius: 999px;
    color: #fff;
    background: transparent;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 650;
    cursor: pointer;
}

.cs-header-panel:not([data-mode="cart"]) .cs-header-panel-clear {
    display: none !important;
}

.cs-header-panel[data-mode="cart"] .cs-header-panel-clear:hover:not(:disabled) {
    border-color: #fff;
    color: #142a42;
    background: #fff;
}

.cs-header-panel[data-mode="cart"] .cs-header-panel-clear:disabled {
    opacity: 0.5;
    cursor: wait;
}

.cs-header-panel[data-mode="cart"] .cs-header-panel-close {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
    border-color: rgb(255 255 255 / 45%);
    color: #fff;
}

.cs-header-panel[data-mode="cart"] .cs-header-panel-close:hover {
    border-color: #fff;
    color: #142a42;
    background: #fff;
}

.cs-header-panel-content[data-cs-panel-content="cart"] {
    display: flex;
    min-height: 0;
    flex: 1 1 auto;
    flex-direction: column;
    overflow: hidden;
}

.cs-header-panel-content[data-cs-panel-content="cart"][hidden] {
    display: none !important;
}

[data-cs-cart-body] {
    display: flex;
    min-height: 0;
    flex: 1 1 auto;
    flex-direction: column;
    overflow: hidden;
    overscroll-behavior: contain;
}

.cs-cart-scroll {
    min-height: 0;
    padding-block: 0 14px;
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.cs-cart-empty {
    display: grid;
    min-height: 0;
    flex: 1 1 auto;
    place-items: center;
    color: #4c5b68;
    font-size: 1rem;
    text-align: center;
}

.cs-cart-items {
    display: flex;
    min-height: 0;
    padding-inline: 20px;
    flex: 0 0 auto;
    flex-direction: column;
}

.cs-cart-item {
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr) auto;
    column-gap: 12px;
    row-gap: 7px;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid #dcdedc;
}

.cs-cart-item-media {
    grid-column: 1;
    grid-row: 1 / span 2;
    width: 62px;
    height: 62px;
    overflow: hidden;
    padding: 6px;
    border: 1px solid #dcdedc;
    border-radius: 9px;
    box-sizing: border-box;
    background: #fff;
}

.cs-cart-item-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cs-cart-item-details { grid-column: 2; grid-row: 1; min-width: 0; }
.cs-cart-item-name { margin: 0 0 3px; font-size: 0.92rem; font-weight: 700; line-height: 1.3; }
.cs-cart-item-name a { color: #142a42; text-decoration: none; }
.cs-cart-item-name a:hover { color: #bd302c; }
.cs-cart-item-variant { color: #687580; font-size: 0.8rem; line-height: 1.35; }
.cs-cart-item-meta { margin: 2px 0 0; color: #687580; font-size: 0.78rem; line-height: 1.35; }
.cs-cart-item-meta dl { margin: 0; }
.cs-cart-item-meta dt,
.cs-cart-item-meta dd { display: inline; margin: 0; }
.cs-cart-item-meta dt { font-weight: 650; }
.cs-cart-item-meta dd::after { content: " · "; }
.cs-cart-item-meta dd:last-child::after { content: ""; }
.cs-cart-item-price { grid-column: 3; grid-row: 1; align-self: center; color: #142a42; font-size: 0.92rem; font-weight: 700; text-align: right; white-space: nowrap; }
.cs-cart-offer-label { display: inline-block; max-width: 100%; margin-top: 5px; padding: 4px 8px; border-radius: 999px; color: #fff; background: #142a42; font-size: 11px; font-weight: 650; line-height: 1.25; }
.cs-cart-item-controls { grid-column: 2 / 4; grid-row: 2; display: flex; align-items: center; gap: 12px; min-width: 0; }

.cs-cart-quantity-control {
    display: inline-flex;
    min-height: 32px;
    align-items: center;
    gap: 5px;
}

.cs-cart-quantity-control button {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid #c8ced3;
    border-radius: 6px;
    color: #142a42;
    background: #fff;
    font-size: 1rem;
    cursor: pointer;
}
.cs-cart-quantity-control button:hover:not(:disabled) { border-color: #142a42; background: #f2f5f7; }

.cs-cart-quantity-control input {
    width: 30px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    color: #142a42;
    background: transparent;
    font: inherit;
    font-size: 0.85rem;
    text-align: center;
    -moz-appearance: textfield;
}
.cs-cart-quantity-control input:focus-visible { outline: 2px solid #142a42; outline-offset: 2px; }

.cs-cart-quantity-control input::-webkit-inner-spin-button,
.cs-cart-quantity-control input::-webkit-outer-spin-button { margin: 0; -webkit-appearance: none; }
.cs-cart-quantity-control button:disabled,
.cs-cart-clear:disabled,
.cs-cart-remove:disabled { opacity: 0.5; cursor: wait; }
.cs-cart-remove,
.cs-cart-clear { padding: 4px 4px; border: 0; color: #c0392b; background: transparent; font: inherit; font-size: 0.82rem; font-weight: 600; cursor: pointer; }
.cs-cart-remove { display: inline-flex; align-items: center; gap: 4px; }
.cs-cart-remove span { font-size: 1rem; line-height: 1; }
.cs-cart-remove:hover,
.cs-cart-clear:hover { color: #bd302c; }
.cs-cart-summary {
    min-height: 0;
    max-height: 60vh;
    padding: 18px 20px max(18px, env(safe-area-inset-bottom));
    flex: 0 0 auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-top: 1px solid #e5e7e8;
    background: #fff;
}

@media (max-height: 500px) {
    .cs-cart-summary {
        min-height: 0;
        max-height: 48%;
    }
}

.cs-cart-subtotal,
.cs-cart-summary-row,
.cs-cart-summary-total { display: flex; justify-content: space-between; gap: 16px; color: #142a42; font-size: 0.9rem; }
.cs-cart-subtotal { margin-bottom: 6px; font-weight: 700; }
.cs-cart-subtotal strong { font-size: 1rem; font-weight: 750; }
.cs-cart-summary-row { margin: 5px 0; }
.cs-cart-summary-row--discount { color: #1f8f5f; font-weight: 600; }
.cs-cart-summary-row--discount strong { color: inherit; }
.cs-cart-summary-row--bogo,
.cs-cart-summary-row--bogo strong { color: #b4232d; }
.cs-cart-summary-row--sale,
.cs-cart-summary-row--sale strong { color: #0f766e; }
.cs-cart-summary-total { margin-top: 9px; padding-top: 10px; border-top: 1px solid #e5e7e8; font-size: 1rem; font-weight: 750; }
.cs-cart-summary-total strong { font-size: 1.12rem; }
.cs-cart-summary-fineprint { margin: 5px 0 10px; color: #64717b; font-size: 0.74rem; line-height: 1.4; }
.cs-cart-shipping { margin: 5px 0 15px; color: #64717b; font-size: 0.8rem; line-height: 1.4; }
.cs-cart-research-note { margin: 12px 0 0; color: #64717b; font-size: 0.72rem; line-height: 1.4; text-align: center; }
.cs-site-shell .cs-cart-checkout { display: flex; min-height: 48px; align-items: center; justify-content: center; border-radius: 5px; color: #fff; background: #bd302c; font-size: 0.94rem; font-weight: 750; text-decoration: none; }
.cs-site-shell .cs-cart-checkout { border-radius: 999px; box-shadow: 0 8px 18px rgb(189 48 44 / 20%); }
.cs-site-shell .cs-cart-checkout:hover { color: #fff; background: #9c211f; }
.cs-cart-view { display: block; margin-top: 11px; color: #142a42; font-size: 0.84rem; font-weight: 650; text-align: center; text-decoration: underline; text-underline-offset: 3px; }
.cs-cart-status { margin: 0; padding: 0 20px; color: #9c211f; font-size: 0.82rem; }
.cs-cart-status:empty { display: none; }

@media (max-width: 360px) {
    .cs-cart-items { padding-inline: 14px; }
    .cs-cart-item { grid-template-columns: 50px minmax(0, 1fr) auto; column-gap: 9px; }
    .cs-cart-item-media { width: 50px; height: 50px; padding: 4px; }
    .cs-cart-item-controls { gap: 8px; }
    .cs-cart-quantity-control { gap: 3px; }
}

.cs-freeship {
    margin: 14px 20px 16px;
    padding: 12px 14px;
    border: 1px solid #d8e4ef;
    border-radius: 10px;
    color: #254b70;
    background: #eff6fb;
}
.cs-freeship--won { border-color: #c9e7d3; color: #245c39; background: #eff8f1; }
.cs-freeship-label { display: flex; justify-content: space-between; gap: 10px; margin: 0 0 8px; font-size: 0.82rem; font-weight: 650; }
.cs-freeship-label > :last-child { flex: 0 0 auto; }
.cs-freeship-track { height: 7px; overflow: hidden; border-radius: 999px; background: #d7e4ed; }
.cs-freeship-fill { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #e36b6b, #c93636); transition: width 400ms ease; }
.cs-freeship--won .cs-freeship-track { background: #d8eadc; }
.cs-freeship--won .cs-freeship-fill { background: linear-gradient(90deg, #4aaf70, #23844b); }
.cs-freeship-note { margin: 7px 0 0; color: #627b90; font-size: 0.72rem; line-height: 1.4; }
.cs-freeship--won .cs-freeship-note { color: #52745c; }

.cs-cart-recommendations { margin: 14px 20px 4px; padding: 13px 14px; border: 1px solid rgb(189 48 44 / 18%); border-radius: 11px; background: #fbf5ee; }
.cs-cart-recommendations h3 { margin: 0 0 10px; color: #142a42; font-size: 0.88rem; }
.cs-cart-recommendation-list { display: flex; flex-direction: column; gap: 8px; }
.cs-cart-recommendation { display: grid; min-width: 0; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 7px; border: 1px solid rgb(20 42 66 / 8%); border-radius: 9px; background: #fff; }
.cs-cart-recommendation-media { display: grid; width: 40px; height: 40px; place-items: center; overflow: hidden; }
.cs-cart-recommendation-image { display: block; width: 100%; height: 100%; object-fit: contain; }
.cs-cart-recommendation-details { display: flex; min-width: 0; flex-direction: column; align-items: flex-start; gap: 3px; }
.cs-cart-recommendation-name { display: -webkit-box; max-width: 100%; overflow: hidden; color: #142a42; font-size: 0.8rem; font-weight: 650; line-height: 1.25; text-decoration: none; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.cs-cart-recommendation-option-label { color: #617181; font-size: 0.73rem; font-weight: 500; }
.cs-cart-recommendation-price { color: #536577; font-size: 0.74rem; }
.cs-cart-recommendation-variant-label { width: 100%; min-width: 0; }
.cs-cart-recommendation-variant-label select { display: block; width: 100%; max-width: 100%; padding: 4px 6px; border: 1px solid #d5dce1; border-radius: 6px; color: #142a42; background: #fff; font: inherit; font-size: 0.7rem; }
.cs-cart-recommendation-add { min-height: 29px; padding: 4px 9px; border: 1px solid #bd302c; border-radius: 999px; color: #fff; background: #bd302c; font: inherit; font-size: 0.72rem; font-weight: 700; white-space: nowrap; cursor: pointer; }
.cs-cart-recommendation-add:hover:not(:disabled) { background: #9c211f; }
.cs-cart-recommendation-add:disabled { opacity: 0.55; cursor: wait; }
.cs-cart-recommendation-options { color: #142a42; font-size: 0.7rem; font-weight: 650; white-space: nowrap; }
.cs-cart-recommendations-more { margin-top: 9px; }
.cs-cart-recommendations-more summary { color: #536577; font-size: 0.76rem; font-weight: 650; cursor: pointer; }
.cs-cart-recommendations-more .cs-cart-recommendation-list { margin-top: 8px; }

@keyframes cs-cart-slide-in {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

@media (max-width: 900px) {
    .cs-header-panel[data-mode="mobile-menu"] { animation: cs-menu-slide-in 220ms ease-out both; }
    .cs-header-panel[data-mode="cart"] { width: 92vw; }
}

@media (max-width: 380px) {
    .cs-header-panel[data-mode="cart"] .cs-header-panel-heading { gap: 8px; padding-inline: 14px; }
    .cs-header-panel[data-mode="cart"] .cs-header-panel-heading h2 { min-width: 0; font-size: 1rem; white-space: nowrap; }
    .cs-header-panel[data-mode="cart"] .cs-header-panel-clear { flex: 0 0 auto; padding-inline: 8px; font-size: .72rem; white-space: nowrap; }
    .cs-header-panel[data-mode="cart"] .cs-header-panel-close { width: 36px; height: 36px; flex-basis: 36px; }
    .cs-cart-research-note { margin-top: 7px; font-size: 0.65rem; line-height: 1.32; }
}

@keyframes cs-menu-slide-in {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
    .cs-header-panel[data-mode="cart"],
    .cs-header-panel[data-mode="mobile-menu"] { animation: none; }
}
