/* --------------------------------------------------------------------------
   Cart Drawer (slide from right) + mini-cart rows
   -------------------------------------------------------------------------- */
.cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    visibility: hidden;
    transition: visibility 0.4s;
}

.cart-drawer.active {
    visibility: visible;
}

.cart-drawer-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    backdrop-filter: blur(2px);
    transition: opacity 0.4s;
}

.cart-drawer.active .cart-drawer-overlay {
    opacity: 1;
}

.cart-drawer-content {
    position: absolute;
    top: 0;
    right: -100%;
    width: 90%;
    max-width: 480px;
    height: 100%;
    background: var(--color-white);
    transition: right 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.05);
}

.cart-drawer.active .cart-drawer-content {
    right: 0;
}

.cart-drawer-header {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 40px 30px 25px 30px;
    background: var(--color-white);
    box-shadow: 0 4px 5px 0 rgba(0, 0, 0, 0.1);
    /* #0000001A shadow */
    z-index: 10;
}

.cart-drawer-header p {
    margin: 0;
    font-family: "Poppins", sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: var(--color-black);
}

.cart-items-count {
    font-family: "Inter", sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #8D8D8D;
}

.cart-drawer-close {
    position: absolute;
    top: 5px;
    right: 5px;
    background: none;
    border: none;
    padding: 10px;
    cursor: pointer;
}

.cart-drawer-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 30px;
}

/* Free Shipping Progress Bar */
.cart-free-shipping-progress {
    flex-shrink: 0;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f2f2f2;
}

.cart-free-shipping-progress:empty {
    display: none;
}

.cart-free-shipping-progress__text {
    margin: 0 0 8px 0;
    font-family: "Inter", sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #4a4a4a;
    line-height: 1.4;
}

.cart-free-shipping-progress__track {
    width: 100%;
    height: 8px;
    background-color: #E8E8E8;
    border-radius: 4px;
    overflow: hidden;
}

.cart-free-shipping-progress__fill {
    height: 100%;
    background-color: var(--color-green);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.cart-free-shipping-success {
    margin: 0 0 20px 0;
    font-family: "Poppins", sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-green);
}

/* Mini Cart Item Styling — scrollable line items only */
.cart-drawer-body ul.cart_list {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.cart-drawer-body li.mini_cart_item {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    /* image width, info width, right-side price/remove */
    grid-template-rows: auto 1fr;
    grid-template-areas:
        "image info price"
        "image qty trash";
    gap: 0 15px;
    padding-bottom: 25px;
    margin-bottom: 25px;
    border-bottom: 1px solid #f8f8f8;
    align-items: end;
    /* align qty and trash to the bottom row */
}

/* Unwrap the anchor so children participate in grid */
.cart-drawer-body .mini_cart_item>a:not(.remove) {
    display: contents;
    text-decoration: none;
}

.cart-drawer-body .mini_cart_item img.attachment-woocommerce_thumbnail {
    grid-area: image;
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 0;
    margin: 0;
    align-self: start;
}

.mini-cart-item-info {
    grid-area: info;
    display: flex;
    flex-direction: column;
    align-self: start;
    gap: 4px;
}

.mini-cart-item-price {
    grid-area: price;
    justify-self: end;
    align-self: start;
    text-align: right;
    white-space: nowrap;
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 500;
    color: var(--site-heading-color);
    line-height: 1.2;
}

.mini-cart-item-price .amount,
.mini-cart-item-price bdi {
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
}

.mini-cart-item-price__current,
.mini-cart-item-price__old {
    display: block;
}

.mini-cart-item-price__old {
    margin-top: 2px;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 400;
    color: #c5c5c5;
    text-decoration: line-through;
}

.mini-cart-item-title {
    font-family: "Poppins", sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #1C1C1C;
    line-height: 1.3;
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
}

.mini-cart-variation-badge {
    display: inline-block;
    margin-top: 0;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 999px;
    background: #f3f3f3;
    color: #333;
    vertical-align: middle;
}

.cart-drawer-body .woocommerce-mini-cart .variation {
    display: none !important;
}

.spectrum-label-text {
    font-size: 13px;
    color: #8D8D8D;
    font-family: "Inter", sans-serif;
    font-weight: 400;
    text-transform: capitalize;
}

/* Quantity Controls in Mini Cart */
.mini-cart-qty {
    grid-area: qty;
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid var(--color-separator);
    border-radius: 6px;
    width: fit-content;
    overflow: hidden;
    margin-top: 15px;
}

.qty-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: var(--color-white);
    border: none;
    padding: 0;
}

.qty-btn:hover {
    background: #f9f9f9;
}

.qty-btn img {
    width: 8px !important;
    height: 8px !important;
}

.qty-val {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Poppins", sans-serif;
    font-size: 16px;
    font-weight: 500;
    color: var(--color-green);
    border-left: 1px solid var(--color-separator);
    border-right: 1px solid var(--color-separator);
}

.cart-drawer-body .mini_cart_item .remove {
    grid-area: trash;
    text-decoration: none;
    line-height: 0;
    position: static;
    display: inline-flex;
    margin-bottom: 5px;
    /* Visual baseline alignment with qty */
}

.mini-cart-remove-icon {
    width: 20px !important;
    height: 20px !important;
    object-fit: contain;
}

.cart-drawer-body .mini_cart_item .remove:hover {
    opacity: 0.7;
}

/* Gift wrap — row above checkout button (optional two columns with subtotal gift hint) */
.airpouches-mini-cart-gift-wrap {
    border-top: 1px solid #e5e5e5;
    border-bottom: 1px solid #e5e5e5;
    margin: 0 0 12px;
    padding: 0;
}

.airpouches-mini-cart-gift-wrap--with-hint {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px 8px;
    align-items: center;
}

.airpouches-mini-cart-gift-wrap--with-hint .airpouches-mini-cart-gift-wrap__col--hint {
    border-left: 1px solid #e5e5e5;
    padding-left: 14px;
    box-sizing: border-box;
}

.airpouches-mini-cart-gift-wrap__col--wrap .airpouches-gift-wrap-add {
    width: 100%;
}

/* Gift wrap already in cart: only the "until gift" hint remains */
.airpouches-mini-cart-gift-wrap--hint-only {
    padding: 12px 0;
}

.airpouches-mini-cart-gift-wrap__hint {
    margin: 0;
    font-family: "Inter", sans-serif;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.35;
    color: #3e3e3e;
    text-align: center;
}

.airpouches-mini-cart-gift-wrap__hint .woocommerce-Price-amount {
    font-weight: 600;
}

@media (max-width: 420px) {
    .airpouches-mini-cart-gift-wrap--with-hint {
        grid-template-columns: 1fr;
    }

    .airpouches-mini-cart-gift-wrap--with-hint .airpouches-mini-cart-gift-wrap__col--hint {
        border-left: none;
        border-top: 1px solid #e5e5e5;
        padding-left: 0;
        padding-top: 10px;
    }

    .airpouches-mini-cart-gift-wrap__hint {
        text-align: center;
        padding: 0 8px 10px;
    }
}

.airpouches-mini-cart-gift-wrap .airpouches-gift-wrap-add {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 12px;
    margin: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: "Inter", sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #3e3e3e;
    box-sizing: border-box;
    transition: background 0.15s ease;
}

.airpouches-mini-cart-gift-wrap .airpouches-gift-wrap-add:hover:not(:disabled) {
    background: #f9f9f9;
}

.airpouches-mini-cart-gift-wrap .airpouches-gift-wrap-add:disabled {
    opacity: 0.55;
    cursor: wait;
}

.airpouches-mini-cart-gift-wrap .airpouches-gift-wrap-add__icon {
    font-size: 18px;
    font-weight: 400;
    line-height: 1;
}

.cart-drawer-body .total {
    flex-shrink: 0;
    padding: 25px 0 10px;
    border-top: 1px solid #f2f2f2;
    display: flex;
    justify-content: space-between;
    font-family: "Poppins", sans-serif;
    font-size: 16px;
    font-weight: 500;
    color: #3E3E3E;
    margin-bottom: 0;
}

.cart-drawer-body .total strong {
    font-weight: 500;
}

/* Column: scrollable ul + pinned totals/checkout/footer */
.cart-drawer-body .widget_shopping_cart_content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.cart-drawer-body .airpouches-mini-cart-gift-wrap {
    flex-shrink: 0;
}

/* Empty cart: no ul — fill drawer body area without collapsing layout */
.cart-drawer-body .woocommerce-mini-cart__empty-message {
    flex: 1;
    min-height: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.cart-drawer-footer {
    padding: 0 30px 40px;
}

.cart-drawer-body .buttons {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 0;
}

.cart-drawer-body .buttons a.button:not(.checkout) {
    display: none !important;
}

.cart-drawer-body .buttons a.checkout {
    width: 100%;
    padding: 18px;
    border-radius: 5px;
    font-family: "Poppins", sans-serif;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-decoration: none;
    box-sizing: border-box;
    background: var(--color-green) !important;
    color: var(--color-white) !important;
}

.cart-drawer-body .buttons a.checkout::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    background: url('../images/lock-white.svg') no-repeat center center;
    background-size: contain;
}

/* Payment logos below checkout button */
.cart-drawer-body .cart-drawer-payment-logos {
    flex-shrink: 0;
}

.cart-drawer-payment-logos {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
    justify-content: space-between;
}

@media screen and (max-width: 500px) {
    .cart-drawer-header {
        padding: 40px 10px 15px 10px;
    }

    .cart-drawer-body {
        padding: 20px 10px;
    }

    .cart-drawer-footer {
        padding: 0 10px 20px;
    }
}