/* =============================================
   Cart Drawer — Panel, Header, Body, States
   Scoped under .hd3-cart-drawer
   ============================================= */

/* ── Panel ── */
.hd3-cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 85vw;
    height: 100%;
    background: #ffffff;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.hd3-cart-drawer.active {
    transform: translateX(0);
}

/* ── Header ── */
.hd3-cart-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.hd3-cart-drawer__title {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    color: var(--text-dark);
    margin: 0;
}

.hd3-cart-drawer__count {
    font-weight: 300;
    opacity: 0.5;
    margin-left: 4px;
}

.hd3-cart-drawer__close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: #1a1a1a;
    opacity: 0.6;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.hd3-cart-drawer__close:hover {
    opacity: 1;
    background: #f5f5f5;
}

.hd3-cart-drawer__close svg,
.hd3-cart-drawer__remove svg {
    width: 16px;
    height: 16px;
    stroke-width: 1.9;
}

/* ── Body (scrollable) ── */
.hd3-cart-drawer__body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* ── Empty State ── */
.hd3-cart-drawer__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    text-align: center;
    flex: 1;
}

.hd3-cart-drawer__empty svg {
    color: #6c7f62;
    width: 46px;
    height: 46px;
    margin-bottom: 14px;
    stroke-width: 1.5;
}

.hd3-cart-drawer__empty-title {
    font-family: var(--semantic-font-heading, 'Inter', sans-serif);
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #1a1a1a;
    margin: 0 0 8px;
}

.hd3-cart-drawer__empty-text {
    font-family: var(--semantic-font-body, 'Inter', sans-serif);
    font-size: 0.78rem;
    color: #999;
    margin: 0 0 24px;
}

.hd3-cart-drawer__shop-btn {
    display: inline-block;
    padding: 12px 32px;
    background: #1a1a1a;
    color: #ffffff;
    font-family: var(--semantic-font-body, 'Inter', sans-serif);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-decoration: none;
    transition: background 0.2s ease;
}

.hd3-cart-drawer__shop-btn:hover {
    background: #333;
    color: #ffffff;
}

/* ── Loading state ── */
.hd3-cart-drawer__loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    flex: 1;
}

.hd3-cart-drawer__spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #e8e8e8;
    border-top-color: #1a1a1a;
    border-radius: 50%;
    animation: hd3-cart-spin 0.6s linear infinite;
}

@keyframes hd3-cart-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ── Error Toast ── */
.hd3-cart-drawer__toast {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: #1a1a1a;
    color: #fff;
    font-family: var(--semantic-font-body, 'Inter', sans-serif);
    font-size: 0.72rem;
    padding: 8px 16px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition:
        opacity 0.25s ease,
        transform 0.25s ease;
    z-index: 10;
}

.hd3-cart-drawer__toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── Responsive ── */
@media (max-width: 479px) {
    .hd3-cart-drawer {
        width: 100%;
        max-width: 100%;
    }
}

@media (min-width: 480px) {
    .hd3-cart-drawer {
        width: 400px;
        max-width: 85vw;
    }
}

@media (min-width: 768px) {
    .hd3-cart-drawer {
        width: 420px;
    }
}