/* ═══════════════════════════════════════════════════════════════════
   mini_cart.css — ASOS-style sliding mini-cart dropdown
   ═══════════════════════════════════════════════════════════════════ */

/* ── Cart Wrapper (relative anchor for the dropdown) ─────────────── */
.cart-wrapper {
    position: relative;
}

/* ── Cart Icon Toggle Button ─────────────────────────────────────── */
.cart-icon-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    line-height: 1;
}

/* ── Mini Cart Panel ─────────────────────────────────────────────── */
#mini-cart-panel {
    position: absolute;
    top: calc(100% + 15px);
    right: -10px;
    width: 380px;
    max-width: 95vw;
    height: auto;
    max-height: calc(100vh - 120px);
    background: #fff;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    border: 1px solid #eaeaea;
    border-radius: 6px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.2, 0, 0, 1), visibility 0.25s;
    visibility: hidden;
    overflow: hidden;
    pointer-events: none;
}

#mini-cart-panel.mc-open {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
}

/* ── Overlay ─────────────────────────────────────────────────────── */
#mini-cart-overlay {
    display: none !important;
}

/* ── Header ──────────────────────────────────────────────────────── */
.mc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.mc-header-title {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #111;
    margin: 0;
}

.mc-header-count {
    font-weight: 400;
    font-size: 0.875rem;
    color: #666;
    text-transform: none;
    letter-spacing: 0;
    margin-left: 0.4em;
}

.mc-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    border-radius: 50%;
    transition: background 0.2s;
    font-size: 1.2rem;
    line-height: 1;
}

.mc-close-btn:hover {
    background: #f4f4f4;
}

/* ── Confirmation Banner ("It's in the bag") ─────────────────────── */
.mc-confirmation {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 1.25rem;
    background: #e6f7ef;
    color: #016b3e;
    font-size: 0.82rem;
    font-weight: 600;
    flex-shrink: 0;
    overflow: hidden;
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    transition: max-height 0.4s ease, padding 0.3s ease, opacity 0.3s ease;
}

.mc-confirmation.mc-show {
    max-height: 60px;
    padding: 0.7rem 1.25rem;
    opacity: 1;
}

.mc-confirmation svg {
    flex-shrink: 0;
    color: #01824d;
}

/* ── Items Scrollable Area ───────────────────────────────────────── */
.mc-items {
    flex: 1;
    overflow-y: auto;
    padding: 0.25rem 0;
    scrollbar-width: thin;
    scrollbar-color: #e0e0e0 transparent;
}

.mc-items::-webkit-scrollbar {
    width: 4px;
}

.mc-items::-webkit-scrollbar-track {
    background: transparent;
}

.mc-items::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 2px;
}

/* ── Single Cart Item ────────────────────────────────────────────── */
.mc-item {
    display: flex;
    gap: 0.9rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f2f2f2;
    position: relative;
    transition: opacity 0.25s ease;
    animation: mc-item-in 0.3s ease;
}

@keyframes mc-item-in {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mc-item.mc-removing {
    opacity: 0;
    transform: scale(0.96);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.mc-item-image {
    width: 72px;
    height: 94px;
    object-fit: cover;
    background: #f8f8f8;
    flex-shrink: 0;
    border: 1px solid #eee;
}

.mc-item-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.mc-item-price {
    font-size: 0.95rem;
    font-weight: 700;
    color: #111;
    margin-bottom: 0.2rem;
}

.mc-item-name {
    font-size: 0.82rem;
    color: #333;
    line-height: 1.45;
    margin-bottom: 0.35rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mc-item-meta {
    font-size: 0.75rem;
    color: #777;
    margin-bottom: 0.5rem;
}

.mc-item-remove {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #aaa;
    padding: 0.2rem;
    transition: color 0.2s;
    line-height: 1;
}

.mc-item-remove:hover {
    color: #111;
}

/* ── Empty State ─────────────────────────────────────────────────── */
.mc-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    text-align: center;
    flex: 1;
}

.mc-empty svg {
    opacity: 0.25;
    margin-bottom: 1rem;
}

.mc-empty p {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.mc-empty a {
    display: inline-block;
    padding: 0.7rem 1.6rem;
    background: #111;
    color: #fff;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    transition: background 0.2s;
}

.mc-empty a:hover {
    background: #333;
}

/* ── Footer ──────────────────────────────────────────────────────── */
.mc-footer {
    border-top: 1px solid #eee;
    padding: 1rem 1.25rem;
    flex-shrink: 0;
    background: #fff;
}

.mc-subtotal-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.92rem;
    color: #444;
    margin-bottom: 1rem;
}

.mc-subtotal-label {
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    color: #666;
}

.mc-subtotal-val {
    font-weight: 700;
    font-size: 1rem;
    color: #111;
}

.mc-btn-group {
    display: flex;
    gap: 0.6rem;
}

.mc-btn-bag {
    flex: 1;
    padding: 0.85rem 0.5rem;
    background: #fff;
    border: 2px solid #111;
    color: #111;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    display: block;
}

.mc-btn-bag:hover {
    background: #111;
    color: #fff;
}

.mc-btn-checkout {
    flex: 1.4;
    padding: 0.85rem 0.5rem;
    background: #01824d;
    border: 2px solid #01824d;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s;
    display: block;
}

.mc-btn-checkout:hover {
    background: #006b3f;
    border-color: #006b3f;
    color: #fff;
}

/* ── Free Delivery Banner (bottom) ───────────────────────────────── */
.mc-delivery-banner {
    font-size: 0.78rem;
    color: #555;
    text-align: center;
    padding: 0.65rem 1.25rem;
    /* border-top: 1px solid #f0f0f0; */
    background: #fafafa;
    flex-shrink: 0;
}

.mc-delivery-banner strong {
    color: #111;
}

.mc-delivery-banner a {
    color: #01824d;
    text-decoration: underline;
}

/* ── Loading Spinner ─────────────────────────────────────────────── */
.mc-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
    flex: 1;
}

.mc-spinner::after {
    content: '';
    width: 30px;
    height: 30px;
    border: 3px solid #eee;
    border-top-color: #111;
    border-radius: 50%;
    animation: mc-spin 0.7s linear infinite;
}

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

/* ── Cart Badge (always visible) ─────────────────────────────────── */
.cart-badge {
    position: absolute;
    top: -7px;
    right: -8px;
    background: #01824d;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    padding: 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    pointer-events: none;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cart-badge.mc-bump,
.cart-badge-dot.mc-bump {
    transform: scale(1.4);
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
    #mini-cart-panel {
        right: -15px;
        width: 340px;
        max-width: 92vw;
    }
}