/* ── LAYOUT ─────────────────────────────────── */
.custom-cart-wrapper {
    display: flex;
    gap: 22px;
    align-items: flex-start;
}

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

.cart-right {
    flex: 0 0 656px;
    min-width: 0;
}

/* ── SHIPPING BANNER ─────────────────────────── */
h6.shipping-banner {
    color: #050106;
    font-weight: 600;
    line-height: 116.667%;
    padding-bottom: 24px;
}

h6.shipping-banner .shipping-banner__text,
h6.shipping-banner .shipping-banner__text * {
    font-weight: 600;
}

/* ── CART ITEM CARD ──────────────────────────── */
.cart-item-card {
    display: flex;
    gap: 44px;
    background: #fff;
    border-radius: 24px;
    padding: 14px 48px 14px 14px;
    margin-bottom: 20px;
    align-items: flex-start;
}

.cart-item-image img {
    width: 177px;
    height: auto;
    object-fit: contain;
}

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

.cart-item-brand {
    display: block;
    margin-bottom: 20px;
    color: #5C585D;
    font-style: normal;
    font-weight: 500;
    line-height: normal;
}

.cart-item-name {
    color: #050106;
    font-style: normal;
    font-weight: 600 !important;
    line-height: 116.667% !important;
    padding-bottom: 20px;
}

.cart-item-unit-price {
    color: #830A97;
    font-weight: 700;
    line-height: 140%;
    padding-bottom: 20px;
}

.cart-item-meta {
    color: #050106;
    font-style: normal;
    font-weight: 500;
    line-height: normal;
    padding-bottom: 20px;
}

/* ───────────────────Product image─────────────────────────── */
.cart-item-image {
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(248, 227, 249, 0.50) 0%, rgba(248, 227, 249, 0.00) 68.26%, #F8E3F9 143.81%);
    padding: 45px 19px 45px 20px;
}

/* ── QTY CONTROLS (pill + trash, reference design) ────────────────────────────── */
.qty-controls {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-top: 14px;
}

/* Capsule: − | qty | + with purple border & dividers */
.qty-pill {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid #7c3aed;
    border-radius: 999px;
    overflow: hidden;
    background: #fff;
    min-height: 40px;
}

.qty-pill .qty-btn {
    flex: 1 1 0;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0 12px;
    border: none;
    border-right: 1px solid #7c3aed;
    background: transparent;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    color: #7c3aed;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease;
}

.qty-pill .qty-btn:last-of-type {
    border-right: none;
}

.qty-pill .qty-btn:hover,
.qty-pill .qty-btn:focus-visible {
    background: rgba(124, 58, 237, 0.08);
    outline: none;
}

.qty-pill .qty-btn[aria-disabled="true"],
.qty-pill .qty-btn.is-loading {
    pointer-events: none;
    opacity: 0.55;
}

.qty-pill .qty-value {
    flex: 1 1 0;
    min-width: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid #7c3aed;
    font-weight: 700;
    font-size: 16px;
    color: #7c3aed;
    user-select: none;
}

.qty-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 4px;
    margin: 0;
    background: none;
    border: none;
    cursor: pointer;
    line-height: 0;
    color: #292d32;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.qty-delete:hover,
.qty-delete:focus-visible {
    opacity: 0.85;
    outline: none;
}

.qty-delete[aria-disabled="true"],
.qty-delete.is-loading {
    pointer-events: none;
    opacity: 0.5;
}

.qty-delete svg {
    display: block;
}

/* ── LINE TOTAL ──────────────────────────────── */
.cart-item-total {
    text-align: right;
    min-width: 110px;
}

.line-total {
    display: block;
    font-size: 18px;
    font-weight: 700 !important;
    color: #7c3aed;
}

.gst-label {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: #6b7280;
    margin-top: 6px;
    line-height: 1.3;
}

/* ── ORDER SUMMARY BOX ───────────────────────── */
.order-summary-box {
    background: #fff;
    border-radius: 24px;
    padding: 32px;
    position: sticky;
    top: 20px;
    overflow: visible;
}

.order-summary-box h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 40px;
}

.order-summary-box>hr {
    margin: 0 0 16px;
    border: none;
    border-top: 1px solid #e5e7eb;
}

.order-note-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 24px;
    color: #5C585D;
    padding: 28px 0;
}

.note-arrow {
    transition: transform 0.2s;
}

.note-arrow.open {
    transform: rotate(180deg);
}

.order-note-field textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 10px;
    font-size: 13px;
    resize: vertical;
}

.order-summary-box .gst-note {
    font-size: 15px;
    font-weight: 500;
    line-height: 1.45;
    color: #050106;
    margin: 24px 0 32px;
}

.order-summary-box .gst-note a.gst-note__shipping {
    color: #830A97;
    font-weight: 500;
    font-size: inherit !important;
    text-decoration: underline !important;
}

.order-summary-box .gst-note a.gst-note__shipping:hover {
    text-decoration: underline;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 24px;
    margin: 12px 0 44px;
}

/* Subscription breakdown (WooCommerce Subscriptions + APfS) */
.aidbox-cart-subscription-totals-wrap:empty {
    display: none;
}

.aidbox-subscription-summary {
    margin: 8px 0 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #ece8f0;
}

.aidbox-subscription-summary .summary-row {
    font-size: 15px;
    font-weight: 500;
    margin: 8px 0 14px;
}

.aidbox-total-due-today {
    font-weight: 500;
    margin-bottom: 18px;
}

.aidbox-total-due-today .aidbox-subscription-summary__label,
.aidbox-total-due-today .aidbox-subscription-summary__amount {
    font-weight: 500;
}

.aidbox-total-due-today .aidbox-subscription-summary__amount {
    color: #830A97;
}

.aidbox-recurring-block {
    padding: 14px 0 18px;
    border-top: 1px solid #ece8f0;
}

.aidbox-recurring-block:first-of-type {
    border-top: none;
    padding-top: 4px;
}

.aidbox-recurring-title-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 58%;
    min-width: 0;
    flex-wrap: wrap;
}

.aidbox-recurring-primary .aidbox-recurring-title {
    font-weight: 500;
    max-width: none;
    line-height: 1.35;
}

/* Same tooltip trigger as checkout (subscription summary on cart) */
.co-info-tip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    outline: none;
    z-index: 1;
    -webkit-tap-highlight-color: transparent;
}

.co-info-tip__icon {
    width: 20px;
    height: 20px;
    max-width: 100%;
    display: block;
    object-fit: contain;
    cursor: help;
    flex-shrink: 0;
}

.co-info-tip__bubble {
    position: absolute;
    z-index: 50;
    left: auto;
    right: 0;
    bottom: calc(100% + 10px);
    min-width: 200px;
    max-width: min(300px, calc(100vw - 32px));
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #374151;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.45;
    box-shadow: 0 8px 24px rgba(16, 24, 40, 0.12);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.18s ease, visibility 0.18s ease;
}

.co-info-tip:hover .co-info-tip__bubble,
.co-info-tip:focus .co-info-tip__bubble,
.co-info-tip:focus-within .co-info-tip__bubble,
.co-info-tip:active .co-info-tip__bubble {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 782px) {
    .custom-cart-wrapper .cart-right,
    .aidbox-cart-subscription-totals-wrap,
    .aidbox-recurring-block,
    .aidbox-recurring-primary {
        overflow: visible;
    }

    .co-info-tip {
        z-index: 6;
    }

    .order-summary-box .co-info-tip__bubble,
    .aidbox-cart-subscription-totals-wrap .co-info-tip__bubble {
        top: calc(100% + 8px);
        bottom: auto;
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%);
        max-width: min(280px, calc(100vw - 24px));
        width: max-content;
        text-align: center;
        z-index: 80;
    }

    .aidbox-recurring-primary .co-info-tip__bubble {
        left: 0% !important;
        right: auto !important;
        transform: translateX(0%);
    }
}

@media (max-width: 600px) {
    .co-info-tip__icon {
        width: 22px;
        height: 22px;
    }

    .co-info-tip__bubble {
        max-width: min(280px, calc(100vw - 24px));
        font-size: 11px;
    }
}

.aidbox-recurring-amount {
    color: #830A97;
    font-weight: 500;
    text-align: right;
}

.aidbox-recurring-meta {
    font-size: 13px;
    color: #5C585D;
    margin-top: -6px;
    margin-bottom: 10px;
}

.aidbox-recurring-subrow {
    font-size: 14px;
    margin: 8px 0;
}

/* Match recurring detail rows to cart summary typography. */
.custom-cart-wrapper .aidbox-recurring-meta,
.custom-cart-wrapper .aidbox-recurring-subrow,
.custom-cart-wrapper .aidbox-recurring-subrow span {
    font-size: 24px;
    font-weight: 500;
    line-height: normal;
}

.aidbox-recurring-final {
    font-weight: 500;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed #e5e1eb;
}

.aidbox-recurring-final strong {
    font-weight: 500;
    color: #050106;
}

.aidbox-muted {
    color: #888;
    font-size: 13px;
    text-align: right;
    max-width: 55%;
}

.btn-checkout {
    display: block;
    color: #fff !important;
    margin-bottom: 20px;
}

.btn-checkout:hover {
    background: #830A97;
}

.btn-continue {
    display: block;
    color: #830A97 !important;
    text-align: center;
    background: #F8E3F9 !important;
    text-decoration: none;
}

.btn-continue:hover {
    background: #ede9fe;
}

/* ── UPSELL SECTION ──────────────────────────── */
.upsell-section {
    margin-top: 50px;
}

.upsell-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.upsell-header h3 {
    font-size: 20px;
    font-weight: 700;
}

.upsell-header a {
    color: #7c3aed;
    font-size: 14px;
    text-decoration: none;
}

.upsell-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}

.upsell-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.upsell-image-wrap {
    position: relative;
    padding: 12px;
}

.upsell-image-wrap img {
    width: 100%;
    height: 130px;
    object-fit: contain;
}

.stock-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #dcfce7;
    color: #15803d;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 600;
}

.wishlist-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #aaa;
}

.wishlist-btn:hover {
    color: #7c3aed;
}

.upsell-info {
    padding: 12px;
}

.upsell-info h5 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
}

.upsell-info small {
    font-size: 11px;
    color: #888;
    display: block;
    margin-bottom: 6px;
}

.upsell-price {
    color: #7c3aed;
    font-weight: 700;
    font-size: 14px;
    display: block;
    margin-bottom: 10px;
}

.add-to-cart-btn {
    width: 100%;
    background: #7c3aed;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px;
    font-size: 13px;
    cursor: pointer;
    font-weight: 600;
}

.add-to-cart-btn:hover {
    background: #6d28d9;
}

/* ── BACK TO TOP ─────────────────────────────── */
.back-to-top {
    text-align: center;
    margin: 40px 0 20px;
}

.back-to-top a {
    color: #555;
    font-size: 14px;
    text-decoration: none;
}


.custom-cart-wrapper .line-total span.woocommerce-Price-amount.amount,
.cart-item-unit-price span.woocommerce-Price-amount.amount {
    color: #830A97 !important;
}

/* ══════════════════════════════════════════════
    RESPONSIVE — 1379px–1599px viewports
    Match desktop cart layout (same as ~1920 reference): full-width
    summary column and item spacing, not the tighter laptop scale.
 ══════════════════════════════════════════════ */
@media (max-width: 1599px) {
    .cart-right {
        flex: 0 0 480px;
        min-width: 0;
    }

    .cart-item-brand {
        margin-bottom: 10px;
    }

    .cart-item-name {
        padding-bottom: 10px;
    }

    .order-summary-box h3 {
        font-size: 22px;
        font-weight: 700;
        margin-bottom: 30px;
    }

    .order-note-toggle {
        font-size: 22px;
        padding: 20px 0;
    }

    .order-summary-box .gst-note {
        font-size: 22px;
        margin: 30px 0;
    }

    .order-summary-box .gst-note a.gst-note__shipping {
        font-size: 22px !important;
        text-decoration: underline !important;
    }

    .summary-row {
        font-size: 22px;
        margin: 12px 0 34px;
    }

    .custom-cart-wrapper .aidbox-recurring-meta,
    .custom-cart-wrapper .aidbox-recurring-subrow,
    .custom-cart-wrapper .aidbox-recurring-subrow span {
        font-size: 22px;
        font-weight: 500;
    }
}

/* ── RESPONSIVE — laptop ~1280 (client primary) + tablet + mobile ── */
@media (max-width: 1360px) {
    .custom-cart-wrapper {
        gap: 16px;
    }

    .custom-cart-wrapper .cart-right {
        flex: 0 0 clamp(300px, 36vw, 520px);
    }

    h6.shipping-banner {
        padding-bottom: 18px;
        font-size: clamp(0.95rem, 1.1vw + 0.75rem, 1.1rem);
    }

    .custom-cart-wrapper .cart-item-card {
        gap: 28px;
        padding: 12px 28px 12px 12px;
        border-radius: 18px;
        margin-bottom: 16px;
    }

    .custom-cart-wrapper .cart-item-image {
        padding: 28px 14px;
        border-radius: 14px;
    }

    .custom-cart-wrapper .cart-item-image img {
        width: 140px;
    }

    .custom-cart-wrapper .cart-item-brand {
        margin-bottom: 14px;
        font-size: 15px;
    }

    .custom-cart-wrapper .cart-item-name {
        font-size: clamp(1rem, 0.5vw + 0.9rem, 1.05rem) !important;
        padding-bottom: 14px;
    }

    .custom-cart-wrapper .cart-item-unit-price {
        font-size: 15px;
        padding-bottom: 14px;
    }

    .custom-cart-wrapper .cart-item-meta {
        font-size: 15px;
        padding-bottom: 14px;
    }

    .custom-cart-wrapper .qty-controls {
        gap: 14px;
        margin-top: 12px;
    }

    .custom-cart-wrapper .cart-item-total {
        min-width: 96px;
    }

    .custom-cart-wrapper .line-total {
        font-size: 17px;
    }

    .custom-cart-wrapper .order-summary-box {
        padding: 24px;
        border-radius: 18px;
        top: 16px;
    }

    .custom-cart-wrapper .order-summary-box h3 {
        font-size: 18px;
        margin-bottom: 14px;
    }

    .order-note-toggle {
        font-size: 20px;
        padding: 20px 0;
    }

    .custom-cart-wrapper .summary-row {
        font-size: 18px;
        margin: 10px 0 16px;
    }

    .custom-cart-wrapper .aidbox-recurring-meta {
        font-size: 16px;
    }

    .custom-cart-wrapper .aidbox-recurring-subrow {
        font-size: 18px;
    }

    .custom-cart-wrapper .aidbox-recurring-meta,
    .custom-cart-wrapper .aidbox-recurring-subrow,
    .custom-cart-wrapper .aidbox-recurring-subrow span {
        font-size: 18px;
        font-weight: 500;
    }

    .order-summary-box .gst-note {
        font-size: 18px;
        margin: 30px 0;
    }

    .order-summary-box .gst-note a.gst-note__shipping {
        font-size: 18px !important;
        text-decoration: underline !important;
    }

    .custom-cart-wrapper .upsell-section {
        margin-top: 36px;
    }

    .custom-cart-wrapper .upsell-header h3 {
        font-size: 18px;
    }

    .custom-cart-wrapper .upsell-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 14px;
    }

    .custom-cart-wrapper .back-to-top {
        margin: 28px 0 16px;
    }
}

@media (max-width: 1180px) {
    .custom-cart-wrapper .cart-right {
        flex: 0 0 clamp(280px, 34vw, 480px);
    }

    .custom-cart-wrapper .cart-item-card {
        gap: 22px;
        padding: 12px 20px 12px 12px;
    }

    .custom-cart-wrapper .cart-item-image img {
        width: 124px;
    }

    .custom-cart-wrapper .upsell-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .custom-cart-wrapper {
        flex-direction: column;
        gap: 20px;
    }

    .custom-cart-wrapper .cart-left,
    .custom-cart-wrapper .cart-right {
        flex: none;
        width: 100%;
        max-width: 100%;
    }

    .custom-cart-wrapper .order-summary-box {
        position: static;
        padding: 22px;
    }

    .custom-cart-wrapper .cart-item-card {
        gap: 20px;
        padding: 14px 18px 14px 14px;
        align-items: flex-start;
    }

    .custom-cart-wrapper .cart-item-details {
        min-width: 0;
    }

    .custom-cart-wrapper .cart-item-name {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .custom-cart-wrapper .cart-item-total {
        text-align: right;
        min-width: 100px;
        flex-shrink: 0;
    }

    .custom-cart-wrapper .btn-checkout,
    .custom-cart-wrapper .btn-continue {
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .custom-cart-wrapper .upsell-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .custom-cart-wrapper .upsell-header {
        flex-wrap: wrap;
        gap: 10px;
    }
}

@media (max-width: 720px) {
    .custom-cart-wrapper .cart-item-card {
        flex-wrap: wrap;
        gap: 16px;
        padding: 14px;
    }

    .custom-cart-wrapper .cart-item-image {
        flex: 0 0 auto;
        padding: 20px 12px;
    }

    .custom-cart-wrapper .cart-item-image img {
        width: 112px;
    }

    .custom-cart-wrapper .cart-item-details {
        flex: 1 1 0;
        min-width: 0;
    }

    .custom-cart-wrapper .cart-item-total {
        flex: 1 1 100%;
        text-align: right;
        padding-top: 4px;
        min-width: 0;
    }

    .custom-cart-wrapper .qty-controls {
        flex-wrap: wrap;
        gap: 12px;
    }

    .custom-cart-wrapper .order-note-field textarea {
        min-height: 88px;
        font-size: 16px;
    }

    .custom-cart-wrapper .add-to-cart-btn {
        min-height: 44px;
        font-size: 14px;
    }
}

@media (max-width: 600px) {
    .custom-cart-wrapper {
        gap: 16px;
    }

    h6.shipping-banner {
        padding-bottom: 14px;
        line-height: 1.25;
    }

    .custom-cart-wrapper .cart-item-card {
        border-radius: 16px;
        margin-bottom: 14px;
    }

    .custom-cart-wrapper .cart-item-image {
        padding: 16px 10px;
    }

    .custom-cart-wrapper .cart-item-image img {
        width: 100px;
    }

    .custom-cart-wrapper .cart-item-brand {
        margin-bottom: 10px;
        font-size: 14px;
    }

    .custom-cart-wrapper .cart-item-name {
        padding-bottom: 10px;
    }

    .custom-cart-wrapper .cart-item-unit-price,
    .custom-cart-wrapper .cart-item-meta {
        font-size: 14px;
        padding-bottom: 10px;
    }

    .custom-cart-wrapper .qty-pill .qty-btn {
        min-width: 48px;
        min-height: 44px;
    }

    .custom-cart-wrapper .qty-delete {
        padding: 8px;
        min-width: 44px;
        min-height: 44px;
    }

    .custom-cart-wrapper .order-summary-box {
        padding: 18px;
        border-radius: 16px;
    }

    .custom-cart-wrapper .order-summary-box h3 {
        font-size: 15px;
    }

    .custom-cart-wrapper .summary-row {
        font-size: 14px;
    }

    .custom-cart-wrapper .aidbox-recurring-meta,
    .custom-cart-wrapper .aidbox-recurring-subrow,
    .custom-cart-wrapper .aidbox-recurring-subrow span {
        font-size: 14px;
        font-weight: 500;
    }

    .custom-cart-wrapper .upsell-section {
        margin-top: 28px;
    }

    .custom-cart-wrapper .upsell-header h3 {
        font-size: 17px;
    }

    .custom-cart-wrapper .upsell-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 400px) {
    .custom-cart-wrapper .cart-item-image img {
        width: 88px;
    }

    .custom-cart-wrapper .cart-item-details {
        min-width: 0;
    }

    .custom-cart-wrapper .line-total {
        font-size: 16px;
    }

    .custom-cart-wrapper .order-summary-box {
        padding: 14px;
    }

    .custom-cart-wrapper .upsell-image-wrap img {
        height: 120px;
    }
}

@supports (padding: max(0px)) {
    @media (max-width: 900px) {
        .custom-cart-wrapper {
            padding-left: max(0px, env(safe-area-inset-left));
            padding-right: max(0px, env(safe-area-inset-right));
        }
    }
}

/* ── AJAX LOADING ─────────────────────────────── */
.is-loading {
    opacity: 0.75;
    cursor: progress;
}

.cart-btn-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(124, 58, 237, 0.25);
    border-top-color: #7c3aed;
    border-radius: 999px;
    animation: cart-spin 0.6s linear infinite;
    vertical-align: middle;
}

.cart-btn-spinner--light {
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
}

@keyframes cart-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.icon-rotate a {
    flex-direction: row-reverse;
}