/* ╔══════════════════════════════════════════════╗
   ║  JJW MINI-CART  v3.0 — Playful Light          ║
   ╚══════════════════════════════════════════════╝ */

.jd-cart__body { display:flex; flex-direction:column; flex:1; overflow:hidden; min-height:0; }

.jd-cart__list-wrap {
    flex:1; overflow-y:auto; min-height:0; padding:0 24px;
    scrollbar-width:thin; scrollbar-color:rgba(0,0,0,0.08) transparent;
}
.jd-cart__list-wrap::-webkit-scrollbar { width:4px; }
.jd-cart__list-wrap::-webkit-scrollbar-thumb { background:rgba(0,0,0,0.08); border-radius:4px; }

/* ── Item list ─────────────────────────────── */
.jmc__list { list-style:none; margin:0; padding:0; }

.jmc__item {
    display:flex; align-items:flex-start; gap:14px;
    padding:16px 0; border-bottom:1px solid var(--jj-border);
    position:relative;
    transition:opacity 0.3s ease, transform 0.3s ease;
}
.jmc__item:last-child { border-bottom:none; }

/* Thumb */
.jmc__thumb {
    flex-shrink:0; width:72px; height:72px;
    overflow:hidden; border-radius:var(--jj-radius-sm);
    background:var(--jj-blue-light);
}
.jmc__thumb a { display:block; width:100%; height:100%; }
.jmc__thumb img {
    width:100%; height:100%; object-fit:cover; display:block;
    transition:transform 0.4s var(--jj-ease-smooth);
}
.jmc__thumb:hover img { transform:scale(1.06); }

/* Details */
.jmc__details { flex:1; min-width:0; display:flex; flex-direction:column; gap:8px; padding-right:30px; }
.jmc__name {
    font-family:var(--jj-font); font-size:14px; font-weight:700;
    color:var(--jj-text); line-height:1.3;
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.jmc__name a { color:inherit; text-decoration:none; }
.jmc__name a:hover { color:var(--jj-blue); }

.jmc__details .variation,
.jmc__details .variation p { font-family:var(--jj-font); font-size:12px; color:var(--jj-text-light); margin:0; }

/* Qty + Price */
.jmc__qty-price { display:flex; align-items:center; gap:12px; }

.jmc__qty-wrap {
    display:flex; align-items:center;
    background:var(--jj-blue-light);
    border-radius:var(--jj-radius-pill);
    overflow:hidden;
    height:32px;
}

.jmc__qty-btn {
    display:flex; align-items:center; justify-content:center;
    width:32px; height:32px;
    background:none; border:none;
    color:var(--jj-blue); cursor:pointer; padding:0; outline:none;
    transition:all 0.2s var(--jj-ease);
    font-size:0;
}
.jmc__qty-btn:hover { background:var(--jj-blue); color:#fff; }
.jmc__qty-btn:active { transform:scale(0.9); }
.jmc__qty-btn svg { display:block; width:12px; height:12px; stroke:currentColor; fill:none; stroke-width:2.5; stroke-linecap:round; }

.jmc__qty-val {
    font-family:var(--jj-font); font-size:14px; font-weight:700;
    color:var(--jj-text); min-width:24px; text-align:center;
    user-select:none;
}

.jmc__qty-wrap.is-loading .jmc__qty-btn { pointer-events:none; opacity:0.4; }

/* Price */
.jmc__price {
    font-family:var(--jj-font); font-size:14px; font-weight:700;
    color:var(--jj-text-mid);
}
.jmc__price .woocommerce-Price-amount { color:inherit; font-family:inherit; }
.jmc__price del { color:var(--jj-text-faint); margin-right:4px; font-size:12px; }
.jmc__price ins { text-decoration:none; color:var(--jj-pink); background:none; }

/* Remove */
.jmc__remove {
    position:absolute; top:16px; right:0;
    display:flex; align-items:center; justify-content:center;
    width:26px; height:26px;
    background:none; border:1px solid var(--jj-border);
    border-radius:var(--jj-radius-sm);
    color:var(--jj-text-faint); cursor:pointer; padding:0; outline:none;
    transition:all 0.25s var(--jj-ease);
}
.jmc__remove:hover { color:var(--jj-pink); border-color:var(--jj-pink); background:var(--jj-pink-light); transform:scale(1.1); }
.jmc__remove svg { display:block; width:10px; height:10px; stroke:currentColor; fill:none; pointer-events:none; }

.jmc__item.is-removing { opacity:0; transform:translateX(20px); pointer-events:none; }


/* ── Subtotal ──────────────────────────────── */
.jmc__total {
    display:flex; align-items:center; justify-content:space-between;
    padding:16px 24px;
    border-top:1px solid var(--jj-border);
    flex-shrink:0; position:sticky; bottom:0; z-index:2;
    background:var(--jj-cream);
}
.jmc__total-label { font-family:var(--jj-font); font-size:13px; color:var(--jj-text-light); }
.jmc__total-price { font-family:var(--jj-font); font-size:18px; font-weight:700; color:var(--jj-text); }
.jmc__total-price .woocommerce-Price-amount { color:inherit; }


/* ── Footer buttons ────────────────────────── */
.jd-cart__footer {
    padding:16px 24px;
    padding-bottom:calc(16px + env(safe-area-inset-bottom,0px));
    display:flex; flex-direction:column; gap:8px;
    flex-shrink:0;
}
.jd-cart__footer[hidden] { display:none; }

.jd-cart__btn {
    display:flex; align-items:center; justify-content:center;
    height:48px; border-radius:var(--jj-radius);
    font-family:var(--jj-font); font-size:14px; font-weight:700;
    text-decoration:none; cursor:pointer; border:none;
    transition:all 0.25s var(--jj-ease);
}

.jd-cart__btn--view {
    background:var(--jj-blue-light); color:var(--jj-blue);
}
.jd-cart__btn--view:hover { background:var(--jj-blue); color:#fff; box-shadow:var(--jj-shadow-blue); }

.jd-cart__btn--checkout {
    background:linear-gradient(135deg, var(--jj-pink), var(--jj-blue));
    color:#fff;
}
.jd-cart__btn--checkout:hover {
    box-shadow:0 6px 24px rgba(210,23,118,0.3);
    transform:translateY(-1px);
}


/* ── Empty state ───────────────────────────── */
.jmc__empty {
    flex:1; display:flex; flex-direction:column;
    align-items:center; justify-content:center;
    padding:48px 24px; text-align:center;
}
.jmc__empty-aura {
    width:140px; height:140px;
    background:radial-gradient(circle, var(--jj-pink-light) 0%, transparent 70%);
    border-radius:50%; position:absolute;
    animation:jmc-float 3s ease-in-out infinite;
}
@keyframes jmc-float {
    0%,100% { transform:translateY(0) scale(1); }
    50%     { transform:translateY(-8px) scale(1.05); }
}
.jmc__empty-icon {
    position:relative; z-index:1;
    color:var(--jj-pink); opacity:0.3;
    margin-bottom:20px;
}
.jmc__empty-icon svg { display:block; stroke:currentColor; fill:none; }
.jmc__empty-title {
    font-family:var(--jj-font); font-size:16px; font-weight:700;
    color:var(--jj-text); margin:0 0 8px;
}
.jmc__empty-sub {
    font-family:var(--jj-font); font-size:13px;
    color:var(--jj-text-light); margin:0 0 24px; max-width:220px;
}
.jmc__shop-btn {
    display:inline-flex; align-items:center; gap:8px;
    height:44px; padding:0 28px;
    background:linear-gradient(135deg, var(--jj-blue), var(--jj-pink));
    color:#fff; border:none; border-radius:var(--jj-radius-pill);
    font-family:var(--jj-font); font-size:14px; font-weight:700;
    text-decoration:none; cursor:pointer;
    transition:all 0.3s var(--jj-ease);
}
.jmc__shop-btn:hover { transform:translateY(-2px); box-shadow:var(--jj-shadow-pink); }
.jmc__shop-btn svg { display:block; stroke:currentColor; fill:none; transition:transform 0.3s ease; }
.jmc__shop-btn:hover svg { transform:translateX(3px); }


/* ── Loading ───────────────────────────────── */
.jd-cart__body.is-loading { position:relative; pointer-events:none; }
.jd-cart__body.is-loading::after {
    content:''; position:absolute; inset:0;
    background:rgba(255,253,247,0.6); z-index:10;
}
.jd-cart__body.is-loading::before {
    content:''; position:absolute; top:50%; left:50%;
    width:24px; height:24px; margin:-12px 0 0 -12px;
    border:3px solid var(--jj-blue-light);
    border-top-color:var(--jj-pink);
    border-radius:50%; animation:jj-spin 0.7s linear infinite;
    z-index:11;
}

/* ── Responsive ────────────────────────────── */
@media (max-width:768px) {
    .jmc__thumb { width:60px; height:60px; }
    .jmc__total, .jd-cart__footer { padding-left:16px; padding-right:16px; }
    .jd-cart__list-wrap { padding:0 16px; }
    .jd-cart__btn { height:44px; }
}
