.cart-page-section {
    padding: 24px 0 40px;
    background: var(--gray1);
}

.cart-page *,
.cart-page *::before,
.cart-page *::after {
    box-sizing: border-box;
}

.cart-layout {
    display: grid;
    grid-template-columns: minmax(0, 1079fr) minmax(0, 609fr);
    gap: 32px;
    align-items: start;
}

.cart-products,
.cart-page .cart_totals,
.cart-coupon {
    min-width: 0;
    padding: 24px;
    border-radius: 16px;
    background: var(--white1);
}

.cart-title {
    margin: 0 0 24px;
    font-size: 32px;
    font-weight: 600;
}

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cart-product {
    display: grid;
    grid-template-columns: minmax(0, 300px) minmax(0, 1fr) 120px 45px;
    gap: 24px;
    align-items: center;
    min-width: 0;
    padding: 24px;
    border: 1px solid var(--gray4);
    border-radius: 8px;
}

.cart-product-preview {
    min-width: 0;
}

.cart-letter-images {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    min-height: 44px;
}

.cart-letter-image {
    position: relative;
    display: grid;
    place-items: center;
    flex: 0 0 min(48px, calc((100% - 20px) / 6));
    min-width: 0;
    max-width: 48px;
    aspect-ratio: 1.1;
}

.woocommerce .cart-letter-image img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cart-letter-image > span {
    font-size: 24px;
    font-weight: 700;
}

.cart-product-preview > img {
    display: block;
    width: auto;
    max-width: 100%;
    height: 48px;
    object-fit: contain;
}

.cart-product.is-gift-card {
    align-items: start;
}

.cart-product.is-gift-card .cart-product-preview {
    display: grid;
    place-items: center;
    align-self: start;
    justify-self: center;
    width: 100%;
    max-width: 220px;
    aspect-ratio: 802 / 564;
    overflow: hidden;
    border-radius: 8px;
}

.cart-product.is-gift-card .cart-product-preview > img {
    width: 100%;
    max-width: 220px;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.cart-product-description,
.cart-product-price {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.cart-field-label {
    color: #717171;
    font-size: 14px;
    font-weight: 500;
}

.cart-product-name,
.cart-product-price > span + span {
    font-size: 18px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.cart-product-name a:hover {
    color: var(--green1);
}

.cart-product-description .variation,
.cart-item-quantity {
    font-size: 14px;
    overflow-wrap: anywhere;
}

.cart-page .quantity .qty {
    width: 70px;
    padding: 6px;
    border: 1px solid var(--gray4);
    border-radius: 4px;
    font: inherit;
}

.cart-page .woocommerce a.remove {
    display: grid;
    place-items: center;
    width: 45px;
    height: 45px;
    border: 1px solid var(--gray4);
    border-radius: 4px;
    background: white;
}

.cart-page .woocommerce a.remove:hover {
    background: var(--gray1);
}

.cart-page .product-remove img,
.cart-page .cart-secure img,
.cart-page .cart-continue img,
.cart-page .cart-coupon button img {
    width: auto;
    height: auto;
    max-width: none;
}

.cart-page .product-remove img {
    width: 22px;
    height: 22px;
}

.cart-page .cart-secure img {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.cart-continue {
    display: inline-flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    margin-top: 24px;
    padding: 12px 24px;
    border: 1px solid var(--gray3);
    border-radius: 100px;
    background: white;
    font-size: 16px;
    font-weight: 700;
    transition: background 180ms ease;
}

.cart-continue img {
    transform: rotate(180deg);
}

.cart-continue:hover {
    background: var(--gray1);
}

.cart-page :focus-visible {
    outline: 2px solid var(--green1);
    outline-offset: 3px;
}

.cart-page .cart-collaterals {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
    min-width: 0;
}

.cart-page .cart-collaterals::before,
.cart-page .cart-collaterals::after {
    display: none;
}

.cart-page .cart-collaterals .cart_totals {
    float: none;
    width: 100%;
}

.cart-page .cart_totals > h2 {
    margin: 0 0 20px;
    font-size: 22px;
    font-weight: 600;
}

.cart-page .cart_totals table.shop_table {
    width: 100%;
    margin: 0 0 20px;
    border: 0;
    border-collapse: collapse;
    border-radius: 0;
    font-size: 16px;
}

.cart-page .cart_totals table.shop_table th,
.cart-page .cart_totals table.shop_table td {
    padding: 12px 0;
    border-top: 1px solid var(--gray4);
    background: none;
    font-weight: 500;
    vertical-align: top;
}

.cart-page .cart_totals table.shop_table th {
    width: auto;
    text-align: left;
}

.cart-page .cart_totals table.shop_table td {
    text-align: right;
    padding-left: 16px;
    font-weight: 600;
}

.cart-page .cart-collaterals .cart_totals table.shop_table,
.cart-page .cart_totals table.shop_table tbody {
    display: block;
}

.cart-page .cart_totals table.shop_table tr {
    display: flex;
}

.cart-page .cart-collaterals .cart_totals table.shop_table th {
    display: block;
    flex: 0 0 auto;
    width: auto;
    white-space: nowrap;
}

.cart-page .cart-collaterals .cart_totals table.shop_table td {
    display: block;
    flex: 1;
    min-width: 0;
}

.cart-page .cart_totals table.shop_table tr:last-child > * {
    padding-bottom: 0;
}

.cart-page .cart_totals table.shop_table tr:first-child > * {
    border-top: 1px solid var(--gray4);
}

.cart-page .cart_totals table.shop_table tbody tr:nth-child(n) > td {
    background: none;
}

.cart-page .cart_totals .order-total > * {
    font-size: 18px;
    font-weight: 600 !important;
}

.cart-page .cart_totals .order-total strong {
    font-weight: inherit;
}

.cart-page .wc-proceed-to-checkout {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0;
}

.cart-page .wc-proceed-to-checkout a.checkout-button {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 4px;
    min-height: 50px;
    margin: 0;
    padding: 12px 20px;
    border: 0;
    border-radius: 100px;
    background: var(--green1);
    color: white;
    font-size: 16px;
    font-weight: 700;
    line-height: normal;
    transition: background 180ms ease;
}

.cart-page .wc-proceed-to-checkout a.checkout-button:hover {
    background: #105d36;
}

.cart-secure {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.cart-coupon {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    padding-block: 18px;
}

.cart-coupon > label {
    font-size: 18px;
    font-weight: 600;
}

.cart-coupon-field {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 50px;
    padding: 10px 16px;
    border: 1px solid var(--gray4);
    border-radius: 8px;
}

.cart-coupon-field input {
    width: 100%;
    min-width: 0;
    height: auto;
    min-height: 0;
    padding: 0;
    border: 0;
    background: white;
    color: var(--black1);
    font: inherit;
}

.cart-coupon-field button {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--green1);
    cursor: pointer;
}

.cart-coupon-field button:hover {
    background: #105d36;
}

.cart-page .cart-coupon-field input:focus {
    outline: none;
    box-shadow: none;
}

.cart-coupon-field:has(input:focus-visible) {
    border-color: var(--green1);
    box-shadow: 0 0 0 1px var(--green1);
}

.cart-coupon-field:has(input[aria-invalid="true"]) {
    border-color: #b32d2e;
    box-shadow: none;
}

.cart-page .cart-coupon-field button img {
    pointer-events: none;
}

.cart-page .coupon-error-notice {
    margin: 0;
    color: #b32d2e;
    font-size: 14px;
    line-height: 1.5;
}

.cart-page :is(.woocommerce-error, .woocommerce-message, .woocommerce-info):focus {
    outline: none;
    box-shadow: none;
}

.cart-page .woocommerce-error {
    border: 1px solid #e7b6b6;
    background: #fff5f5;
    color: #8c2424;
}

.cart-page .woocommerce-message {
    border: 1px solid #bddac9;
    background: #f1f8f4;
    color: #235b3c;
}

.cart-page .cart-update {
    margin-top: 16px;
}

.cart-page .woocommerce-notices-wrapper:empty {
    display: none;
}

.cart-page .woocommerce-message,
.cart-page .woocommerce-error,
.cart-page .woocommerce-info {
    border-radius: 8px;
}

.cart-page :is(.woocommerce-message, .woocommerce-error, .woocommerce-info)::before {
    top: 50%;
    transform: translateY(-50%);
    line-height: 1;
}

.cart-empty-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 48px 16px;
    text-align: center;
}

.cart-empty-icon {
    display: grid;
    place-items: center;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--green-overlay);
}

.cart-empty-icon::before {
    content: '';
    width: 40px;
    height: 40px;
    background: var(--green1);
    mask: url('../../icons/bag.svg') center / contain no-repeat;
}

.cart-empty-content .wc-empty-cart-message {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 440px;
}

.cart-empty-content h2 {
    margin: 0;
    font-size: 26px;
    font-weight: 600;
}

.cart-empty-content p {
    margin: 0;
    color: var(--gray5);
    font-size: 16px;
}

.cart-empty-content .cart-continue {
    margin-top: 4px;
    transition: border-color 180ms ease, color 180ms ease;
}

.cart-empty-content .cart-continue:hover {
    border-color: var(--green1);
    background: white;
    color: var(--green1);
}

.cart-continue-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    background: currentColor;
    -webkit-mask: url('../../icons/cart/continue.svg') center / contain no-repeat;
    mask: url('../../icons/cart/continue.svg') center / contain no-repeat;
    transform: rotate(180deg);
}

@media (min-width: 769px) and (max-width: 1500px) {
    .cart-layout {
        grid-template-columns: minmax(0, 3fr) minmax(300px, 2fr);
        gap: 24px;
    }

    .cart-product {
        grid-template-columns: minmax(0, 1fr) 45px;
        gap: 16px;
        padding: 16px;
    }

    .cart-product-preview {
        grid-column: 1 / -1;
    }

    .cart-product-description {
        grid-column: 1 / -1;
    }

    .cart-product-price {
        grid-column: 1;
    }
}

@media (max-width: 768px) {
    .cart-page-section {
        padding: 24px 0 32px;
    }

    .cart-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 24px;
    }

    .cart-products,
    .cart-page .cart_totals,
    .cart-coupon {
        padding: 16px;
    }

    .cart-products {
        position: relative;
        margin-top: 42px;
    }

    .cart-products > .breadcrumbs {
        position: absolute;
        bottom: calc(100% + 24px);
        left: 0;
        width: 100%;
        margin: 0;
    }

    .cart-title {
        margin-bottom: 16px;
        font-size: 24px;
    }

    .cart-product {
        grid-template-columns: minmax(0, 1fr) 40px;
        gap: 16px;
        padding: 12px;
    }

    .cart-product-preview,
    .cart-product-description {
        grid-column: 1 / -1;
    }

    .cart-letter-images {
        min-height: 38px;
    }

    .cart-letter-image {
        flex-basis: min(42px, calc((100% - 20px) / 6));
        max-width: 42px;
    }

    .cart-field-label {
        font-size: 12px;
    }

    .cart-product-name,
    .cart-product-price > span + span {
        font-size: 16px;
    }

    .cart-page .woocommerce a.remove {
        width: 40px;
        height: 40px;
    }

    .cart-continue {
        display: flex;
        min-height: 45px;
        margin-top: 16px;
    }

    .cart-page .cart_totals > h2 {
        font-size: 20px;
    }

    .cart-page .cart_totals table.shop_table {
        font-size: 14px;
    }

    .cart-page .cart_totals table.shop_table tr {
        display: flex;
    }

    .cart-page .cart_totals table.shop_table td {
        text-align: right !important;
    }

    .cart-page .cart_totals table.shop_table td::before {
        display: none;
    }

    .cart-page .cart_totals .order-total > * {
        font-size: 16px;
    }

    .cart-page .wc-proceed-to-checkout a.checkout-button {
        min-height: 45px;
    }

    .cart-secure {
        font-size: 12px;
    }

    .cart-page .product-remove img {
        width: 20px;
        height: 20px;
    }

    .cart-page .cart-secure img {
        width: 16px;
        height: 16px;
    }

    .cart-empty-content {
        padding: 32px 0;
    }

    .cart-empty-content h2 {
        font-size: 22px;
    }

    .cart-empty-content p {
        font-size: 14px;
    }

    .cart-coupon {
        gap: 12px;
    }

    .cart-coupon > label {
        font-size: 16px;
    }

    .cart-coupon-field {
        min-height: 45px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cart-continue,
    .cart-empty-content .cart-continue,
    .cart-page .wc-proceed-to-checkout a.checkout-button {
        transition: none;
    }
}
