/* Cart Drawer Overlay */
.nutman-cart-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.nutman-cart-drawer-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

/* Cart Drawer Panel */
.nutman-cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 400px;
    max-width: 90vw;
    height: 100%;
    background: #fff;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
}

/* Admin bar offset */
.admin-bar .nutman-cart-drawer {
    top: 32px;
    height: calc(100% - 32px);
}

.admin-bar .nutman-cart-drawer-overlay {
    top: 32px;
    height: calc(100% - 32px);
}

@media screen and (max-width: 782px) {
    .admin-bar .nutman-cart-drawer {
        top: 46px;
        height: calc(100% - 46px);
    }
    .admin-bar .nutman-cart-drawer-overlay {
        top: 46px;
        height: calc(100% - 46px);
    }
}

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

/* Header */
.nutman-cart-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e5e5;
    background: #332d2a;
}

.nutman-cart-drawer__title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #d4a843;

    font-size: 24px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nutman-cart-drawer__close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #d4a843;
    line-height: 1;
}

.nutman-cart-drawer__close:hover {
    color: #fff;
}

/* Body */
.nutman-cart-drawer__body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* Empty State */
.nutman-cart-drawer__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #999;
    text-align: center;
}

.nutman-cart-drawer__empty svg {
    margin-bottom: 16px;
    color: #ccc;
}

.nutman-cart-drawer__empty p {
    font-size: 15px;
    margin: 0;
}

/* Items List */
.nutman-cart-drawer__items {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nutman-cart-drawer__item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
}

.nutman-cart-drawer__item-image {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    background: #f5f5f5;
}

.nutman-cart-drawer__item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.nutman-cart-drawer__item-name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #332d2a;
    text-decoration: none;
    margin-bottom: 4px;
    line-height: 1.3;
}

.nutman-cart-drawer__item-name:hover {
    color: #d4a843;
}

.nutman-cart-drawer__item-price {
    font-size: 14px;
    color: #666;
    display: block;
    margin-bottom: 8px;
}

/* Quantity Controls */
.nutman-cart-drawer__item-qty {
    display: inline-flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.nutman-cart-drawer__qty-btn {
    background: #f5f5f5;
    border: none;
    width: 28px;
    height: 28px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #332d2a;
    transition: background 0.2s;
}

.nutman-cart-drawer__qty-btn:hover {
    background: #e0e0e0;
}

.nutman-cart-drawer__qty-value {
    width: 32px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #332d2a;
}

/* Remove Button */
.nutman-cart-drawer__item-remove {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 20px;
    color: #bbb;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.nutman-cart-drawer__item-remove:hover {
    color: #c00;
}

/* Footer */
.nutman-cart-drawer__footer {
    padding: 16px 20px;
    border-top: 1px solid #e5e5e5;
    background: #faf9f7;
}

.nutman-cart-drawer__subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 16px;
    font-weight: 700;
    color: #332d2a;
}

/* Buttons */
.nutman-cart-drawer__btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    margin-bottom: 8px;
    border: none;
    transition: background 0.2s, color 0.2s;
    box-sizing: border-box;
}

.nutman-cart-drawer__btn:last-child {
    margin-bottom: 0;
}

.nutman-cart-drawer__btn--checkout {
    background: #d4a843;
    color: #fff;
}

.nutman-cart-drawer__btn--checkout:hover {
    background: #c0952e;
    color: #fff;
}

.nutman-cart-drawer__btn--cart {
    background: #332d2a;
    color: #fff;
}

.nutman-cart-drawer__btn--cart:hover {
    background: #4a433f;
    color: #fff;
}

.nutman-cart-drawer__btn--continue {
    background: transparent;
    color: #666;
    border: 1px solid #ddd;
}

.nutman-cart-drawer__btn--continue:hover {
    background: #f5f5f5;
    color: #332d2a;
}

/* Cart Count Badge */
.nutman-cart-trigger {
    position: relative;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.nutman-cart-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 11px;
    font-weight: 700;
    background: #ccc;
    color: #fff;
    border-radius: 9px;
    line-height: 1;
    position: absolute;
    top: -6px;
    right: -10px;
}

.nutman-cart-count--has-items {
    background: #d4a843;
}

/* Loading state */
.nutman-cart-drawer__item.is-loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Mobile */
@media (max-width: 480px) {
    .nutman-cart-drawer {
        width: 100%;
        max-width: 100%;
    }
}
