/* ==========================================================================
   Cart slide-out modal
   ========================================================================== */

#cart-dropdown.cart-dropdown {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    width: min(100%, 440px);
    z-index: 101;
    pointer-events: none;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

#cart-dropdown.cart-dropdown.open {
    transform: translateX(0);
    z-index: 9999999999;
    pointer-events: auto;
}

#cart-dropdown .cart-content-wrap {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #fff;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}

/* Header */
#cart-dropdown .cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-shrink: 0;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid #ececec;
    background: #fafafa;
}

#cart-dropdown .cart-header__title-wrap {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

#cart-dropdown .cart-header .header-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: #191919;
    line-height: 1.3;
}

#cart-dropdown .cart-modal-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    height: 1.5rem;
    padding: 0 0.4rem;
    border-radius: 999px;
    background: var(--color-primary, #febb16);
    color: #191919;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
}

#cart-dropdown .cart-header .cart-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 1px solid #e4e4e4;
    border-radius: 50%;
    background: #fff;
    color: #555;
    font-size: 1rem;
    line-height: 1;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

#cart-dropdown .cart-header .cart-close:hover {
    background: var(--color-primary, #febb16);
    border-color: var(--color-primary, #febb16);
    color: #191919;
}

/* Body */
#cart-dropdown .cart-body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 0;
    overflow: hidden;
}

#cart-dropdown .cart-item-list {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0.85rem 1rem 1rem;
    list-style: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}

#cart-dropdown .cart-item-list::-webkit-scrollbar {
    width: 6px;
}

#cart-dropdown .cart-item-list::-webkit-scrollbar-thumb {
    background: #d8d8d8;
    border-radius: 999px;
}

/* Cart item card */
#cart-dropdown .cart-item {
    display: block;
    width: 100%;
    margin: 0 0 0.75rem;
    padding: 0;
    border: 0;
    box-sizing: border-box;
}

#cart-dropdown .cart-item:last-child {
    margin-bottom: 0;
}

#cart-dropdown .cart-modal-item {
    position: relative;
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 0.85rem;
    width: 100%;
    padding: 0.85rem;
    border: 1px solid #ececec;
    border-radius: 12px;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#cart-dropdown .cart-modal-item:hover {
    border-color: #e0e0e0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

#cart-dropdown .cart-modal-item__thumb,
#cart-dropdown .cart-item .item-img {
    display: block;
    width: 72px;
    margin: 0;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 10px;
    background: #f7f7f7;
    aspect-ratio: 1;
}

#cart-dropdown .cart-modal-item__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#cart-dropdown .cart-modal-item__body {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    min-width: 0;
    width: 100%;
}

#cart-dropdown .cart-modal-item__top {
    padding-right: 1.75rem;
}

#cart-dropdown .cart-modal-item__title,
#cart-dropdown .cart-item .item-title {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.35;
    color: #191919;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

#cart-dropdown .cart-modal-item__title a,
#cart-dropdown .cart-item .item-title a {
    color: inherit;
    text-decoration: none;
}

#cart-dropdown .cart-modal-item__title a:hover,
#cart-dropdown .cart-item .item-title a:hover {
    color: var(--color-primary, #febb16);
}

#cart-dropdown .cart-modal-item__remove,
#cart-dropdown .cart-item .item-action .close-btn {
    position: absolute;
    top: 0.55rem;
    right: 0.55rem;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #9a9a9a;
    font-size: 0.85rem;
    line-height: 1;
    transition: background 0.2s ease, color 0.2s ease;
}

#cart-dropdown .cart-modal-item__remove:hover,
#cart-dropdown .cart-item .item-action .close-btn:hover {
    background: #fff0f0;
    color: #e50046;
}

#cart-dropdown .cart-modal-item__price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.5rem;
    font-size: 0.9rem;
    line-height: 1.2;
}

#cart-dropdown .cart-modal-item__price .old-price {
    color: #9a9a9a;
    text-decoration: line-through;
    font-size: 0.8rem;
}

#cart-dropdown .cart-modal-item__price .new-price {
    font-weight: 700;
    color: #191919;
}

#cart-dropdown .cart-modal-item__price .no-vat-sign {
    font-size: 0.72rem;
    font-weight: 600;
    color: #8a8278;
}

#cart-dropdown .cart-modal-item__actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.15rem;
}

#cart-dropdown .cart-modal-item__qty,
#cart-dropdown .cart-item .item-quantity {
    position: static;
    transform: none;
    display: inline-flex;
    align-items: center;
    width: auto !important;
    max-width: 100%;
    height: 2rem;
    padding: 0 0.2rem;
    border: 1px solid #e4e4e4;
    border-radius: 999px;
    background: #fafafa;
}

#cart-dropdown .cart-modal-item__qty .qtybtn,
#cart-dropdown .cart-item .item-quantity .qtybtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    line-height: 1;
    font-size: 1rem;
    font-weight: 600;
    color: #555;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

#cart-dropdown .cart-modal-item__qty .qtybtn:hover,
#cart-dropdown .cart-item .item-quantity .qtybtn:hover {
    background: var(--color-primary, #febb16);
    color: #191919;
}

#cart-dropdown .cart-modal-item__qty input.product-quantity,
#cart-dropdown .cart-item .item-quantity input.product-quantity {
    width: 2.25rem;
    height: 1.5rem;
    padding: 0;
    border: 0;
    background: transparent;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 700;
    color: #191919;
    -moz-appearance: textfield;
}

#cart-dropdown .cart-modal-item__qty input.product-quantity::-webkit-outer-spin-button,
#cart-dropdown .cart-modal-item__qty input.product-quantity::-webkit-inner-spin-button,
#cart-dropdown .cart-item .item-quantity input.product-quantity::-webkit-outer-spin-button,
#cart-dropdown .cart-item .item-quantity input.product-quantity::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#cart-dropdown .cart-modal-item__update,
#cart-dropdown .cart-item .update-form-cart {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Empty state */
#cart-dropdown .cart-modal-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    list-style: none;
}

#cart-dropdown .cart-modal-empty__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 4.5rem;
    height: 4.5rem;
    margin-bottom: 1rem;
    border-radius: 50%;
    background: #f7f7f7;
    color: #c8c8c8;
    font-size: 1.75rem;
}

#cart-dropdown .cart-modal-empty__title {
    margin: 0 0 0.5rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: #191919;
}

#cart-dropdown .cart-modal-empty__text {
    margin: 0 0 1.25rem;
    max-width: 16rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #777;
}

#cart-dropdown .cart-modal-empty__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 12rem;
    padding: 0.65rem 1.25rem;
    border-radius: 999px;
    font-weight: 600;
}

/* Footer */
#cart-dropdown .cart-footer {
    flex-shrink: 0;
    padding: 1rem 1.25rem 1.25rem;
    border-top: 1px solid #ececec;
    background: #fafafa;
}

#cart-dropdown .cart-footer .cart-subtotal {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 0 1rem;
    padding: 0;
    font-size: 1rem;
    color: #191919;
}

#cart-dropdown .cart-footer .cart-subtotal .subtotal-title {
    font-weight: 600;
    color: #555;
}

#cart-dropdown .cart-footer .cart-subtotal .subtotal-amount {
    font-size: 1.2rem;
    font-weight: 800;
    color: #191919;
}

#cart-dropdown .cart-footer .group-btn {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}

#cart-dropdown .cart-footer .group-btn .axil-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    padding: 0.65rem 1rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

#cart-dropdown .cart-footer .group-btn .viewcart-btn {
    border: 1px solid #e4e4e4;
    background: #fff;
    color: #191919;
}

#cart-dropdown .cart-footer .group-btn .checkout-btn {
    background: var(--color-primary, #febb16);
    color: #191919;
}

#cart-dropdown .cart-footer .group-btn .axil-btn:hover {
    opacity: 0.92;
}

/* Backdrop */
body.open .closeMask {
    height: 100%;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.45);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 6;
    transition: opacity 0.3s ease;
}

/* Dark mode */
.active-dark-mode #cart-dropdown .cart-content-wrap {
    background: #1e1e24;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.45);
}

.active-dark-mode #cart-dropdown .cart-header {
    background: #25252d;
    border-bottom-color: #333;
}

.active-dark-mode #cart-dropdown .cart-header .header-title {
    color: #f5f5f5;
}

.active-dark-mode #cart-dropdown .cart-header .cart-close {
    background: #2a2a32;
    border-color: #3a3a44;
    color: #ccc;
}

.active-dark-mode #cart-dropdown .cart-modal-item {
    background: #25252d;
    border-color: #333;
}

.active-dark-mode #cart-dropdown .cart-modal-item__title,
.active-dark-mode #cart-dropdown .cart-modal-item__price .new-price,
.active-dark-mode #cart-dropdown .cart-footer .cart-subtotal .subtotal-amount {
    color: #f5f5f5;
}

.active-dark-mode #cart-dropdown .cart-footer {
    background: #25252d;
    border-top-color: #333;
}

.active-dark-mode #cart-dropdown .cart-footer .group-btn .viewcart-btn {
    background: #2a2a32;
    border-color: #3a3a44;
    color: #f5f5f5;
}

@media only screen and (max-width: 575px) {
    #cart-dropdown.cart-dropdown {
        width: 100%;
    }

    #cart-dropdown .cart-footer .group-btn {
        grid-template-columns: 1fr;
    }
}
