/* ─── Overlay ──────────────────────────────────────────────────────── */

.hzm-sidecart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1049;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.hzm-sidecart-overlay--visible {
    opacity: 1;
    visibility: visible;
}

/* ─── Sidecart Panel ──────────────────────────────────────────────── */

.hzm-sidecart {
    position: fixed;
    top: 0;
    right: 0;
    width: 420px;
    height: 100%;
    z-index: 1050;
    background: #fff;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.hzm-sidecart--open {
    transform: translateX(0);
}

body.hzm-sidecart-open {
    overflow: hidden;
    padding-right: var(--scrollbar-width, 0px);
}

/* ─── Header ──────────────────────────────────────────────────────── */

.hzm-sidecart__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #dee2e6;
    flex-shrink: 0;
}

.hzm-sidecart__title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.hzm-sidecart__close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #495057;
    display: flex;
    align-items: center;
    border-radius: 4px;
    transition: background 0.15s;
}

.hzm-sidecart__close:hover {
    background: #f1f3f5;
}

/* ─── Body (scrollable) ───────────────────────────────────────────── */

.hzm-sidecart__body {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.hzm-sidecart__body--loading {
    opacity: 0.5;
    pointer-events: none;
}

/* ─── Products List ───────────────────────────────────────────────── */

.hzm-sidecart__products {
    flex: 1;
    padding: 0;
}

.hzm-sidecart__item {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid #f1f3f5;
    position: relative;
    transition: opacity 0.2s ease;
}

.hzm-sidecart__item--removing {
    opacity: 0.3;
    pointer-events: none;
}

.hzm-sidecart__item-image {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 4px;
    overflow: hidden;
    background: #f8f9fa;
}

.hzm-sidecart__item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hzm-sidecart__item-info {
    flex: 1;
    min-width: 0;
}

.hzm-sidecart__item-name {
    font-weight: 600;
    font-size: 14px;
    color: #212529;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

.hzm-sidecart__item-name:hover {
    color: #495057;
}

.hzm-sidecart__item-attributes {
    font-size: 12px;
    color: #6c757d;
    margin-top: 2px;
}

.hzm-sidecart__item-attr + .hzm-sidecart__item-attr::before {
    content: ' · ';
}

.hzm-sidecart__item-price {
    font-size: 14px;
    font-weight: 600;
    margin-top: 4px;
    color: #212529;
}

/* ─── Quantity Controls ───────────────────────────────────────────── */

.hzm-sidecart__item-qty {
    display: flex;
    align-items: center;
    gap: 0;
    margin-top: 8px;
}

.hzm-sidecart__qty-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #dee2e6;
    background: #fff;
    cursor: pointer;
    padding: 0;
    color: #495057;
    transition: background 0.15s, border-color 0.15s;
}

.hzm-sidecart__qty-btn:hover:not(:disabled) {
    background: #f1f3f5;
    border-color: #adb5bd;
}

.hzm-sidecart__qty-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.hzm-sidecart__qty-btn--minus {
    border-radius: 4px 0 0 4px;
}

.hzm-sidecart__qty-btn--plus {
    border-radius: 0 4px 4px 0;
}

.hzm-sidecart__qty-btn .material-icons {
    font-size: 16px;
}

.hzm-sidecart__qty-value {
    min-width: 32px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-top: 1px solid #dee2e6;
    border-bottom: 1px solid #dee2e6;
    font-size: 13px;
    font-weight: 600;
    background: #f8f9fa;
}

/* ─── Remove Button ───────────────────────────────────────────────── */

.hzm-sidecart__item-remove {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #adb5bd;
    transition: color 0.15s;
    display: flex;
    align-items: center;
}

.hzm-sidecart__item-remove:hover {
    color: #dc3545;
}

.hzm-sidecart__item-remove .material-icons {
    font-size: 20px;
}

/* ─── Footer ──────────────────────────────────────────────────────── */

.hzm-sidecart__footer {
    padding: 16px 20px;
    border-top: 1px solid #dee2e6;
    flex-shrink: 0;
    background: #f8f9fa;
}

.hzm-sidecart__subtotal {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #6c757d;
    margin-bottom: 4px;
}

.hzm-sidecart__total {
    display: flex;
    justify-content: space-between;
    font-size: 16px;
    font-weight: 700;
    color: #212529;
    padding-top: 8px;
    margin-bottom: 16px;
    border-top: 1px solid #dee2e6;
}

.hzm-sidecart__checkout-btn {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    display: block;
    margin-bottom: 8px;
    color: #fff;
}

.hzm-sidecart__checkout-btn:hover {
    color: #fff;
}

.hzm-sidecart__cart-btn {
    width: 100%;
    padding: 8px;
    font-size: 13px;
    text-align: center;
    display: block;
}

/* ─── Empty State ─────────────────────────────────────────────────── */

.hzm-sidecart__empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #6c757d;
    text-align: center;
}

.hzm-sidecart__empty-icon {
    font-size: 64px;
    color: #dee2e6;
    margin-bottom: 16px;
}

.hzm-sidecart__empty p {
    font-size: 15px;
    margin: 0;
}

/* ─── Responsive ──────────────────────────────────────────────────── */

@media (max-width: 576px) {
    .hzm-sidecart {
        width: 100%;
    }
}
