:root {
    /* Reuse theme variables from global.css; keep file cart-specific only. */
}

.cart-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
}

.cart-header__inner {
    min-height: 110px;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.cart-header__logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex: 0 0 auto;
}

.cart-header__logo img {
    display: block;
    max-width: 240px;
    height: auto;
}

.cart-steps {
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
}

.cart-steps__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 18px;
}

.cart-steps__item {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: rgba(71, 85, 105, 0.65);
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
}

.cart-steps__item::after {
    content: "";
    width: 110px;
    height: 2px;
    background: rgba(15, 23, 42, 0.08);
    margin-left: 18px;
}

.cart-steps__item:last-child::after {
    display: none;
}

.cart-steps__num {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    border: 2px solid rgba(15, 23, 42, 0.18);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    line-height: 1;
    font-weight: 700;
    background: transparent;
    color: inherit;
}

.cart-steps__item.is-active {
    color: var(--color-text);
}

.cart-steps__item.is-active .cart-steps__num {
    border-color: var(--color-text);
}

.cart-page__main {
    padding: 60px 0 56px;
}

.cart-page__main > .container {
    height: auto;
}

.cart-page__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.cart-page__title {
    margin: 0;
    font-size: 32px;
    line-height: 1.15;
    font-weight: 700;
    color: var(--color-text);
}

.cart-page__count {
    color: var(--color-muted);
    font-size: 14px;
    font-weight: 600;
}

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

.cart-page__left {
    position: relative;
}

.cart-page__notices:empty {
    display: none;
}

.cart-page__notices {
    margin: 0 0 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cart-page__notices .woocommerce-message,
.cart-page__notices .woocommerce-error,
.cart-page__notices .woocommerce-info {
    margin: 0;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--color-accent-hover);
    background: #fff;
    color: var(--color-accent);
    font-size: 14px;
    line-height: 1.35;
    font-weight: 700;
    list-style: none;
    box-shadow: 0 12px 30px rgba(37, 55, 87, 0.12);
    opacity: 1;
    transform: translateY(0);
    transition: opacity .28s ease, transform .28s ease;
}

.cart-page__notices .woocommerce-message.is-dismissing,
.cart-page__notices .woocommerce-error.is-dismissing,
.cart-page__notices .woocommerce-info.is-dismissing {
    opacity: 0;
    transform: translateY(-8px);
}

.cart-page__notices .woocommerce-message li,
.cart-page__notices .woocommerce-error li,
.cart-page__notices .woocommerce-info li {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cart-page__notices .woocommerce-message::before,
.cart-page__notices .woocommerce-error::before,
.cart-page__notices .woocommerce-info::before {
    content: none !important;
    display: none !important;
}

.cart-page__notices .woocommerce-message .restore-item,
.cart-page__notices .woocommerce-info .restore-item {
    margin-left: 8px;
    color: inherit;
    font-weight: 800;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.cart-page__notices .woocommerce-message .restore-item:focus-visible,
.cart-page__notices .woocommerce-info .restore-item:focus-visible {
    outline: 2px solid var(--color-accent-hover);
    outline-offset: 2px;
    border-radius: 4px;
}

.cart-page__notices .woocommerce-message .restore-item:hover,
.cart-page__notices .woocommerce-info .restore-item:hover {
    color: var(--color-accent-hover);
}

.cart-page__notices .woocommerce-error {
    border-color: rgba(220, 38, 38, 0.24);
    color: #b42318;
}

.cart-page__notices .woocommerce-error a {
    color: inherit;
    font-weight: 700;
}

.cart-items {
    border-radius: 16px;
    background: var(--color-surface);
    border: 1px solid rgba(37, 55, 87, 0.10);
    overflow: hidden;
}

.cart-items__empty {
    min-height: clamp(320px, 52vh, 520px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 34px 20px;
    text-align: center;
}

.cart-items__empty-image {
    width: min(360px, 88%);
    height: auto;
    display: block;
}

.cart-items__empty-title {
    margin: 0;
    font-size: clamp(20px, 2.2vw, 28px);
    line-height: 1.2;
    font-weight: 800;
    color: var(--color-text);
}

.cart-items__empty-button {
    min-height: 46px;
    border-radius: 999px;
    border: 1px solid #C9A227;
    background: #C9A227;
    color: #fff;
    padding: 0 28px;
    font-size: 15px;
    line-height: 1;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: background-color .2s ease, border-color .2s ease;
}

.cart-items__empty-button:hover {
    background: #e6bb2f;
    border-color: #e6bb2f;
}

.cart-items__row {
    display: flex;
    align-items: center;
    gap: 14px 18px;
    padding: 14px;
    border-bottom: 1px solid rgba(37, 55, 87, 0.08);
}

.cart-items__row:last-child {
    border-bottom: none;
}

.cart-items__row.is-removing {
    opacity: 0.55;
    pointer-events: none;
    transition: opacity .2s ease;
}

.cart-item__media {
    flex: 0 0 92px;
    width: 92px;
    height: 92px;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(37, 55, 87, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-item__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cart-item__info {
    flex: 1 1 0;
    min-width: 0;
}

.cart-item__brand {
    font-size: 12px;
    letter-spacing: 0.04em;
    font-weight: 800;
    text-transform: uppercase;
    color: #c9a227;
    margin-bottom: 4px;
}

.cart-item__title {
    max-width: 220px;
    font-size: 14px;
    line-height: 1.3;
    font-weight: 700;
    color: var(--color-text);
}

.cart-item__title a {
    color: inherit;
    text-decoration: none;
}

.cart-item__title a:hover {
    color: var(--color-accent-hover);
}

.cart-item__meta {
    margin-top: 8px;
    color: var(--color-muted);
    font-size: 12px;
    line-height: 1.35;
}

.cart-item__meta dl,
.cart-item__meta dt,
.cart-item__meta dd {
    margin: 0;
}

.cart-item__meta dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 8px;
}

.cart-item__meta dt {
    font-weight: 700;
    color: #334155;
}

.cart-item__meta dd {
    font-weight: 500;
    color: #475569;
}

.cart-item__meta dd p {
    margin: 0;
}

.cart-item__purchase {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: clamp(12px, 1.8vw, 20px);
    flex: 0 1 clamp(220px, 28vw, 320px);
    min-width: 0;
    margin-left: auto;
}

.cart-item__qty {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
}

.cart-qty {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(37, 55, 87, 0.04);
    border: 1px solid rgba(37, 55, 87, 0.10);
    border-radius: 999px;
    padding: 6px 10px;
}

.cart-qty__btn {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 1px solid rgba(37, 55, 87, 0.18);
    background: var(--color-surface);
    color: var(--color-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    font-size: 0;
    line-height: 0;
    font-weight: 700;
    padding: 0;
    font-family: var(--font-family);
    vertical-align: middle;
}

.cart-qty__btn::before {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    width: 12px;
    height: 12px;
    background: url('../image/icons/plus.svg') center / contain no-repeat;
}

.cart-qty__btn:hover {
    border-color: rgba(37, 55, 87, 0.35);
}

.cart-qty__btn[data-cart-qty-minus]::before {
    background-image: url('../image/icons/minus.svg');
}

.cart-qty__input {
    width: 34px;
    border: none;
    background: transparent;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text);
    padding: 0;
    -moz-appearance: textfield;
}

.cart-qty__input::-webkit-outer-spin-button,
.cart-qty__input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.cart-item__price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 2px;
    text-align: right;
    color: var(--color-text);
    white-space: nowrap;
}

.cart-item__price-current {
    font-size: clamp(18px, 2vw, 22px);
    font-weight: 800;
    line-height: 1.1;
}

.cart-item__price--discounted .cart-item__price-old {
    font-size: 15px;
    line-height: 1.1;
    color: #9ca3af;
    text-decoration: line-through;
    text-decoration-thickness: 1px;
}

.cart-item__price--discounted .cart-item__price-discount {
    font-size: 15px;
    line-height: 1.1;
    color: #dc2626;
    font-weight: 700;
}

.cart-item__price-discount-note {
    font-size: 12px;
    line-height: 1.2;
    font-weight: 600;
    color: #94a3b8;
}

.cart-item__price--discounted .cart-item__price-current {
    font-size: clamp(18px, 2vw, 22px);
    font-weight: 900;
    line-height: 1.05;
    color: #C9A227;
}

.cart-item__price-qty {
    font-size: 12px;
    line-height: 1.2;
    font-weight: 600;
    color: #64748b;
}

.cart-item__actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex: 0 0 auto;
    align-self: flex-start;
    gap: 10px;
}

.cart-item__remove {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid rgba(37, 55, 87, 0.10);
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.cart-item__remove img {
    width: 14px;
    height: 14px;
    display: block;
    object-fit: contain;
    opacity: 0.6;
}

.cart-item__remove:hover img {
    opacity: 0.85;
}

.cart-item__wish {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(37, 55, 87, 0.10);
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cart-item__wish img {
    width: 18px;
    height: 18px;
    display: block;
    object-fit: contain;
    opacity: 0.75;
}

.cart-item__wish--plugin {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(37, 55, 87, 0.10);
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cart-item__wish--plugin .tinv-wishlist,
.cart-item__wish--plugin .tinv-wishlist .tinvwl_add_to_wishlist_button {
    margin: 0;
    width: 100%;
    height: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    text-decoration: none;
    padding: 0;
}

.cart-item__wish--plugin .tinv-wishlist .tinvwl_add_to_wishlist_button.tinvwl-icon-heart:before,
.cart-item__wish--plugin .tinv-wishlist .tinvwl_add_to_wishlist_button.tinvwl-icon-heart-plus:before {
    content: "";
    display: block;
    position: static;
    top: auto;
    left: auto;
    width: 20px;
    height: 20px;
    margin: 0;
    background: url('/wp-content/themes/royalbx/image/icons/heart.svg') center / contain no-repeat;
    font-family: initial;
}

.cart-item__wish--plugin .tinv-wishlist .tinvwl_add_to_wishlist_button span,
.cart-item__wish--plugin .tinv-wishlist .tinvwl_add_to_wishlist_button .tinvwl_add_to_wishlist-text {
    display: none;
}

.cart-item__wish--plugin .tinv-wishlist .tinvwl_add_to_wishlist_button.tinvwl-icon-heart.tinvwl-product-in-list:before,
.cart-item__wish--plugin .tinv-wishlist .tinvwl_add_to_wishlist_button.tinvwl-icon-heart-plus.tinvwl-product-in-list:before {
    background-image: url('/wp-content/themes/royalbx/image/icons/heart-fill.svg');
}

@supports ((-webkit-mask-image: url("")) or (mask-image: url(""))) {
    .cart-item__wish--plugin .tinv-wishlist .tinvwl_add_to_wishlist_button.tinvwl-icon-heart.tinvwl-product-in-list:before,
    .cart-item__wish--plugin .tinv-wishlist .tinvwl_add_to_wishlist_button.tinvwl-icon-heart-plus.tinvwl-product-in-list:before {
        background: #e74c3c;
        -webkit-mask: url('/wp-content/themes/royalbx/image/icons/heart-fill.svg') center / contain no-repeat;
        mask: url('/wp-content/themes/royalbx/image/icons/heart-fill.svg') center / contain no-repeat;
        background-image: none;
    }
}

.cart-coupon {
    margin-bottom: 20px;
}

.cart-coupon__applied {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
}

.cart-coupon__card {
    border-radius: 16px;
    border: 1px solid rgba(37, 55, 87, 0.10);
    background: var(--color-surface);
    padding: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.cart-coupon__title {
    font-size: 16px;
    font-weight: 800;
    color: var(--color-text);
    margin: 0 0 4px;
}

.cart-coupon__meta {
    font-size: 13px;
    line-height: 1.25;
    color: var(--color-muted);
    margin: 0;
}

.cart-coupon__remove {
    min-height: 40px;
    border-radius: 12px;
    border: 1px solid rgba(37, 55, 87, 0.2);
    background: var(--color-surface);
    color: var(--color-text);
    padding: 0 14px;
    font-weight: 800;
    font-size: 14px;
    line-height: 1;
    transition: border-color .2s ease, color .2s ease, background-color .2s ease;
}

.cart-coupon__remove:hover {
    border-color: rgba(220, 38, 38, 0.4);
    color: #dc2626;
    background: rgba(220, 38, 38, 0.04);
}

.cart-coupon__form {
    border-radius: 16px;
    border: 1px solid rgba(37, 55, 87, 0.10);
    background: rgba(37, 55, 87, 0.04);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cart-coupon__label {
    color: var(--color-text);
    font-size: 14px;
    font-weight: 800;
    white-space: nowrap;
}

.cart-coupon__input {
    min-height: 40px;
    border-radius: 12px;
    border: 1px solid rgba(37, 55, 87, 0.12);
    background: var(--color-surface);
    padding: 8px 12px;
    font-size: 14px;
}

.cart-coupon__apply {
    min-height: 40px;
    border-radius: 12px;
    border: 1px solid var(--color-accent);
    background: var(--color-accent);
    color: #fff;
    padding: 0 14px;
    font-weight: 800;
    font-size: 14px;
    line-height: 1;
}

.cart-coupon__status {
    min-height: 18px;
    font-size: 13px;
    line-height: 1.35;
    font-weight: 700;
}

.cart-coupon__status.is-success {
    color: #16a34a;
}

.cart-coupon__status.is-error {
    color: #dc2626;
}

.cart-summary__card {
    border-radius: 16px;
    background: #2a2f3a;
    color: #fff;
    padding: 16px;
}

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

.cart-summary__title {
    margin: 0;
    font-size: 18px;
    line-height: 1.2;
    font-weight: 800;
}

.cart-pay {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.cart-pay__method {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.cart-pay__method input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.cart-pay__pill {
    min-height: 38px;
    padding: 0 14px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease;
}

.cart-pay__method input:checked + .cart-pay__pill {
    border-color: #C9A227;
    background: #C9A227;
    color: #fff;
    box-shadow: 0 0 0 2px rgba(201, 162, 39, 0.28);
}

.cart-page__main.is-cart-gateway-loading .cart-pay {
    pointer-events: none;
    opacity: 0.86;
}

.cart-summary__lines {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cart-summary__line {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.cart-summary__line strong {
    color: #fff;
    font-weight: 800;
}

.cart-summary__line--discount strong {
    color: #c9a227;
}

.cart-summary__total {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.cart-summary__total-label {
    font-size: 16px;
    font-weight: 800;
}

.cart-summary__total-value {
    font-size: 22px;
    font-weight: 900;
    white-space: nowrap;
}

.cart-summary__checkout {
    margin-top: 14px;
    width: 100%;
    min-height: 48px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid #C9A227;
    background: #C9A227;
    color: #fff;
    font-weight: 900;
    font-size: 15px;
    font-family: inherit;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: all .2s ease;
}

.cart-summary__checkout:hover:not(:disabled):not([aria-disabled="true"]) {
    background: #e6bb2f;
}

.cart-summary__checkout:disabled,
.cart-summary__checkout[aria-disabled="true"] {
    opacity: 0.55;
    pointer-events: none;
    cursor: not-allowed;
}

.cart-summary__terms {
    margin-top: 12px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 12px;
    line-height: 1.3;
    color: rgba(255, 255, 255, 0.7);
}

.cart-summary__terms input {
    margin-top: 2px;
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
}

@media (max-width: 1100px) {

    .cart-header__inner {
        flex-direction: column;
    }
    
    .cart-page__layout {
        grid-template-columns: 1fr;
    }

    .cart-steps {
        justify-content: flex-end;
        margin-bottom: 15px;
    }

    .cart-items__row {
        display: grid;
        grid-template-columns: 92px minmax(0, 1fr) minmax(320px, 38%) 34px;
        align-items: center;
        column-gap: 14px;
        row-gap: 12px;
    }

    .cart-item__media {
        grid-column: 1;
    }

    .cart-item__info {
        grid-column: 2;
    }

    .cart-item__purchase {
        grid-column: 3;
        margin-left: 0;
        width: 100%;
    }

    .cart-item__actions {
        grid-column: 4;
        margin-left: 0;
        align-self: center;
    }
}

@media (max-width: 768px) {
    .cart-page__notices {
        margin-bottom: 10px;
    }

    .cart-header__inner {
        min-height: 110px;
        gap: 12px;
    }

    .cart-steps {
        justify-content: center;
    }

    .cart-steps__list {
        gap: 10px;
    }

    .cart-steps__label {
        display: none;
    }

    .cart-steps__item::after {
        width: 56px;
        margin-left: 10px;
    }

    .cart-items__row {
        display: flex;
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 12px 10px;
    }

    .cart-items__empty {
        min-height: 290px;
        padding: 26px 14px;
        gap: 12px;
    }

    .cart-items__empty-image {
        width: min(280px, 92%);
    }

    .cart-item__media {
        order: 1;
    }

    .cart-item__info {
        order: 2;
        flex: 1 1 0;
        min-width: 160px;
        padding-right: 6px;
    }

    .cart-item__purchase {
        order: 4;
        flex: 1 1 100%;
        margin-left: 0;
        justify-content: flex-start;
        align-items: flex-end;
        gap: clamp(12px, 4vw, 22px);
        flex-wrap: wrap;
    }

    .cart-item__qty {
        margin-top: 0;
    }

    .cart-item__price {
        margin-top: 0;
        align-items: flex-start;
        text-align: left;
    }

    .cart-item__price--discounted .cart-item__price-current {
        font-size: clamp(22px, 6vw, 28px);
    }

    .cart-item__actions {
        order: 3;
        margin-left: auto;
        align-self: start;
    }

    .cart-coupon__form {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .cart-coupon__label {
        white-space: normal;
    }
}
