.cart-page {
    padding: 146px 24px 64px;
    background: var(--bg);
}

.cart-shell {
    max-width: 1360px;
    margin: 12px auto 0;
}

.cart-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 420px;
    gap: 26px;
    align-items: start;
}

.cart-layout:has(.cart-summary[hidden]) {
    grid-template-columns: minmax(0, 1fr);
}

.cart-main {
    border: 1px solid var(--line);
    background: #fffdfa;
    padding: 22px 22px 24px;
}

.cart-shell.cart-shell-empty {
    max-width: 1360px;
}

.cart-shell.cart-shell-empty .cart-layout {
    grid-template-columns: minmax(0, 1fr);
}

.cart-shell.cart-shell-empty .cart-main {
    max-width: none;
    margin: 0;
    width: auto;
}

.cart-shell.cart-shell-empty .cart-heading,
.cart-shell.cart-shell-empty .cart-actions,
.cart-shell.cart-shell-empty .cart-empty {
    max-width: none;
    margin-left: 0;
    margin-right: 0;
}

.cart-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.cart-heading h1 {
    margin: 0;
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    font-size: 34px;
    line-height: 1;
    font-weight: 400;
    color: #181818;
    letter-spacing: 0;
    font-family: 'Cormorant Garamond', serif;
}

.cart-heading-count {
    font-size: 16px;
    color: #4a4a4a;
    font-family: "Montserrat", sans-serif;
}

.cart-close-link {
    width: 30px;
    height: 30px;
    min-width: 30px;
    min-height: 30px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #222;
}

.cart-close-link svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 1.8;
    fill: none;
    stroke-linecap: round;
}

.cart-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 14px;
}

.cart-clear-btn {
    border: 0;
    background: transparent;
    color: #6f6760;
    min-height: 24px;
    padding: 0;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
}

.cart-clear-btn:hover {
    color: #38332f;
}

.cart-empty {
    border: 1px dashed rgba(23, 20, 17, 0.22);
    background: #f8f4ee;
    padding: 30px 22px;
    text-align: center;
    color: #57514b;
    max-width: 980px;
    margin: 0 auto;
}

.cart-empty p {
    margin: 0 0 12px;
}

.cart-shop-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 18px;
    border-radius: 999px;
    border: 1px solid #111;
    background: #111;
    color: #fff;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.cart-grid {
    display: grid;
    gap: 14px;
}

.cart-card {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 18px;
    border: 1px solid #e2ddd4;
    background: #fff;
    border-radius: 10px;
    padding: 10px;
}

.cart-card-clickable {
    cursor: pointer;
}

.cart-card-clickable:focus-visible {
    outline: 2px solid #171411;
    outline-offset: 2px;
}

.cart-card-media {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    background: #dfdfdf;
}

.cart-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b645e;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.cart-card-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 8px 8px 6px 0;
}

.cart-card-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.cart-card-top-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.cart-card-kicker {
    margin: 0;
    font-size: 11px;
    color: #4f4944;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.cart-favorite-btn {
    border: 0;
    background: transparent;
    color: #242424;
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.cart-favorite-btn:hover,
.cart-favorite-btn:focus-visible {
    color: #171411;
}

.cart-favorite-btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 1.8;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.cart-delete-icon-btn {
    border: 0;
    background: transparent;
    color: #171411;
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.cart-delete-icon-btn:hover,
.cart-delete-icon-btn:focus-visible {
    color: #000;
}

.cart-delete-icon-btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 1.8;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.cart-card-title {
    margin: 6px 0 8px;
    font-size: 22px;
    font-weight: 400;
    line-height: 1.14;
    color: #1a1a1a;
    font-family: 'Cormorant Garamond', serif;
}

.cart-card-detail-line {
    margin: 0;
    font-size: 14px;
    line-height: 1.38;
    color: #5f5852;
}

.cart-card-detail-line + .cart-card-detail-line {
    margin-top: 2px;
}

.cart-card-price-row {
    margin-top: auto;
    padding-top: 12px;
}

.cart-card-price {
    font-size: 20px;
    line-height: 1;
    color: #1f1f1f;
    font-family: 'Inter', sans-serif;
}

.cart-card-controls {
    margin-top: 10px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
}

.cart-qty-wrap {
    display: inline-flex;
    align-items: center;
    border: 1px solid #cfcfcf;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}

.cart-qty-value {
    min-width: 30px;
    text-align: center;
    font-size: 13px;
    color: #2f2a26;
}

.cart-qty-btn {
    width: 32px;
    height: 32px;
    border: 0;
    border-left: 1px solid #cfcfcf;
    background: transparent;
    color: #262220;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

.cart-qty-btn:first-child {
    border-left: 0;
    border-right: 1px solid #cfcfcf;
}

.cart-qty-btn:hover {
    background: #f1f1f1;
}

.cart-summary {
    border: 1px solid var(--line);
    background: #fffdfa;
    padding: 20px;
    height: fit-content;
    position: sticky;
    top: 132px;
}

.cart-summary-block {
    border-bottom: 1px solid #dadada;
    margin-bottom: 16px;
    padding-bottom: 14px;
}

.cart-summary-mini-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 0;
    font-size: 15px;
    line-height: 1.4;
    color: #2f2f2f;
}

.cart-summary-mini-row + .cart-summary-mini-row {
    margin-top: 6px;
}

.cart-summary-mini-row strong {
    font-size: 16px;
    line-height: 1;
    font-weight: 400;
    color: #1f1f1f;
    font-family: 'Inter', sans-serif;
}

.cart-summary-total-row {
    margin-top: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    line-height: 1;
    color: #1d1d1d;
    font-family: 'Inter', sans-serif;
}

.cart-summary-total-row strong {
    font-size: 20px;
    font-weight: 400;
    line-height: 1;
    color: #1d1d1d;
    font-family: 'Inter', sans-serif;
}

.cart-checkout-btn {
    width: 100%;
    min-height: 48px;
    border: 1px solid #050505;
    border-radius: 999px;
    background: #050505;
    color: #fff;
    font-size: 18px;
    line-height: 1;
    letter-spacing: 0;
    cursor: pointer;
}

.cart-checkout-btn:hover {
    background: #1a1a1a;
    border-color: #1a1a1a;
}

.cart-checkout-btn:disabled {
    opacity: 0.58;
    cursor: not-allowed;
}

.cart-checkout-note {
    margin: 12px 0 0;
    font-size: 12px;
    color: #5f5851;
    line-height: 1.4;
}

.cart-checkout-note a {
    color: #171411;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cart-continue-link {
    margin: 14px auto 0;
    display: block;
    width: fit-content;
    color: #2f2f2f;
    font-size: 13px;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cart-hidden-checkout-form {
    display: none;
}

body.cart-modal-open {
    overflow: hidden;
}

.cart-quickview-modal {
    position: fixed;
    inset: 0;
    z-index: 1700;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.cart-quickview-modal.is-visible {
    display: flex;
}

.cart-quickview-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.54);
}

.cart-quickview-panel {
    position: relative;
    width: min(980px, 94vw);
    max-height: min(90vh, 820px);
    overflow: auto;
    background: #fffdfa;
    border: 1px solid #dfd8cf;
    border-radius: 10px;
    padding: 20px;
    z-index: 1;
}

.cart-quickview-close {
    position: absolute;
    top: 12px;
    right: 12px;
    border: none;
    background: transparent;
    color: #171717;
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
    padding: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.cart-quickview-close svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 1.8;
    fill: none;
    stroke-linecap: round;
}

.cart-quickview-layout {
    display: grid;
    grid-template-columns: minmax(0, 46%) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.cart-quickview-media {
    border-radius: 8px;
    overflow: hidden;
    background: #ece6de;
    aspect-ratio: 1 / 1;
}

.cart-quickview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.75s ease;
}

.cart-quickview-media:hover .cart-quickview-image {
    transform: scale(1.08);
}

.cart-quickview-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6e665f;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.cart-quickview-content {
    min-width: 0;
    padding-right: 16px;
}

.cart-quickview-code {
    margin: 0 0 10px;
    font-size: 11px;
    color: #535353;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.cart-quickview-title {
    margin: 0 0 8px;
    font-size: 30px;
    line-height: 1.02;
    font-weight: 400;
    color: #1a1a1a;
    font-family: 'Cormorant Garamond', serif;
}

.cart-quickview-price {
    margin: 0 0 14px;
    font-size: 24px;
    line-height: 1;
    color: #1f1f1f;
    font-family: 'Inter', sans-serif;
}

.cart-quickview-meta {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #4f4a44;
}

.cart-quickview-description {
    margin-top: 6px;
    white-space: pre-line;
}

.cart-quickview-controls {
    margin-top: 14px;
}

.cart-quickview-qty-wrap {
    display: inline-flex;
    align-items: center;
    border: 1px solid #d8d1c8;
    border-radius: 8px;
    overflow: hidden;
    background: #fffdfa;
}

.cart-quickview-qty-btn {
    width: 40px;
    height: 40px;
    border: 0;
    background: transparent;
    color: #2a2521;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.cart-quickview-qty-btn + .cart-quickview-qty-value,
.cart-quickview-qty-value + .cart-quickview-qty-btn {
    border-left: 1px solid #d8d8d8;
}

.cart-quickview-qty-btn:hover {
    background: #f2f2f2;
}

.cart-quickview-qty-value {
    min-width: 46px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #2f2a26;
}

.cart-quickview-link {
    margin-top: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 20px;
    border-radius: 999px;
    border: 1px solid #171411;
    background: #171411;
    color: #fffdfa;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

#cartQuickViewModal .cart-quickview-link:hover {
    background: #2a2623;
    border-color: #2a2623;
}

#cartActionModal .success-modal-card {
    width: min(92vw, 460px);
}

#cartActionModal .success-modal-card h3 {
    font-size: 1.8rem;
}

@media (max-width: 1100px) {
    .cart-layout {
        grid-template-columns: 1fr;
    }

    .cart-summary {
        position: static;
    }
}

@media (max-width: 760px) {
    .cart-page {
        padding: 134px 12px 44px;
    }

    .cart-main,
    .cart-summary {
        padding: 16px;
    }

    .cart-heading h1 {
        font-size: 28px;
    }

    .cart-card {
        grid-template-columns: 130px minmax(0, 1fr);
        gap: 12px;
    }

    .cart-card-title {
        font-size: 20px;
    }

    .cart-card-price,
    .cart-summary-mini-row strong,
    .cart-summary-total-row,
    .cart-summary-total-row strong {
        font-size: 20px;
    }

    .cart-quickview-panel {
        padding: 16px;
    }

    .cart-quickview-layout {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .cart-quickview-content {
        padding-right: 0;
    }

    .cart-quickview-title {
        font-size: 28px;
    }

    .cart-quickview-price {
        font-size: 22px;
    }
}

@media (max-width: 520px) {
    .cart-card {
        grid-template-columns: 1fr;
    }

    .cart-card-media {
        max-width: 220px;
    }

    .cart-card-content {
        padding: 6px 0 4px;
    }

    .cart-card-price {
        font-size: 19px;
    }
}
