
/* =====================================================
   KEMZY GLOBAL STORE
   SHARED SHOPPING CART
===================================================== */

.cart-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.cart-overlay {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgba(7, 27, 61, .55);
    opacity: 0;
    transition: opacity .3s ease;
}

.cart-overlay.is-visible {
    opacity: 1;
}

.cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 9999;

    display: flex;
    flex-direction: column;

    width: min(460px, 100%);
    height: 100vh;
    height: 100dvh;

    padding: 28px;
    background: #FFFFFF;

    box-shadow: -15px 0 50px rgba(7, 27, 61, .15);

    transform: translateX(105%);
    visibility: hidden;

    transition:
        transform .35s ease,
        visibility .35s ease;
}

.cart-drawer.is-open {
    transform: translateX(0);
    visibility: visible;
}

.cart-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 22px;
    border-bottom: 1px solid #E2E8F0;
}

.cart-drawer-header h2 {
    margin-top: 7px;
    color: #071B3D;
    font-family: 'Manrope', sans-serif;
    font-size: 24px;
    font-weight: 800;
}

.cart-drawer-header h2 span {
    color: #64748B;
    font-size: 15px;
}

.cart-close {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid #E2E8F0;
    border-radius: 50%;
    background: #F4F7FC;
    color: #071B3D;
    cursor: pointer;
    transition: .25s ease;
}

.cart-close:hover {
    background: #071B3D;
    color: #FFFFFF;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}

.cart-item {
    display: grid;
    grid-template-columns: 82px 1fr;
    gap: 15px;
    padding: 18px 0;
    border-bottom: 1px solid #E2E8F0;
}

.cart-item-image {
    width: 82px;
    height: 92px;
    object-fit: cover;
    border-radius: 12px;
    background: #F4F7FC;
}

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

.cart-item-details h3 {
    margin-bottom: 6px;
    color: #071B3D;
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    font-weight: 700;
}

.cart-item-price {
    color: #1264E8;
    font-size: 14px;
    font-weight: 700;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 13px;
}

.cart-quantity {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 5px 9px;
    border: 1px solid #E2E8F0;
    border-radius: 7px;
}

.cart-quantity button {
    display: grid;
    place-items: center;
    width: 23px;
    height: 23px;
    border: none;
    background: transparent;
    color: #071B3D;
    cursor: pointer;
}

.cart-quantity button:disabled {
    opacity: .35;
    cursor: not-allowed;
}

.cart-quantity span {
    min-width: 14px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
}

.cart-item-actions {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.cart-item-whatsapp {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border: 1px solid rgba(37, 211, 102, .28);
    border-radius: 50%;
    background: #EAFBF0;
    color: #128C4A;
    transition: background .2s ease, color .2s ease, transform .2s ease;
}

.cart-item-whatsapp:hover {
    background: #25D366;
    color: #FFFFFF;
    transform: translateY(-2px);
}

.cart-item-whatsapp svg {
    width: 17px;
    height: 17px;
}

.cart-remove {
    border: none;
    background: transparent;
    color: #DC3545;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.cart-empty {
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.cart-empty:not([hidden]) {
    display: flex;
}

.cart-empty > i {
    width: 55px;
    height: 55px;
    margin-bottom: 18px;
    color: #1264E8;
}

.cart-empty h3 {
    margin-bottom: 8px;
    color: #071B3D;
    font-family: 'Manrope', sans-serif;
    font-size: 19px;
}

.cart-empty p {
    max-width: 260px;
    margin-bottom: 20px;
    color: #64748B;
    font-size: 14px;
    line-height: 1.6;
}

.cart-empty button {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    background: #1264E8;
    color: #FFFFFF;
    font-weight: 700;
    cursor: pointer;
}

.cart-drawer-footer {
    padding-top: 20px;
    border-top: 1px solid #E2E8F0;
}

.cart-subtotal-row,
.cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #071B3D;
}

.cart-subtotal-row {
    font-size: 14px;
}

.cart-total-row {
    margin-top: 18px;
    font-size: 17px;
    font-weight: 800;
}

.cart-total-row strong {
    color: #1264E8;
    font-size: 21px;
}

.cart-total-note {
    margin-top: 9px;
    color: #64748B;
    font-size: 12px;
    line-height: 1.5;
}

.cart-checkout-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin-top: 20px;
    padding: 15px;
    border: none;
    border-radius: 9px;
    background: #1264E8;
    color: #FFFFFF;
    font-weight: 700;
}

.cart-checkout-button:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.cart-continue-button {
    width: 100%;
    margin-top: 12px;
    padding: 13px;
    border: 1px solid #E2E8F0;
    border-radius: 9px;
    background: #FFFFFF;
    color: #071B3D;
    font-weight: 700;
    cursor: pointer;
}

.cart-empty[hidden],
.cart-drawer-footer[hidden],
.cart-overlay[hidden] {
    display: none !important;
}

body.cart-open {
    overflow: hidden;
}

@media (max-width: 480px) {
    .cart-drawer {
        padding: 22px 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cart-drawer,
    .cart-overlay {
        transition: none;
    }
}
