/* -- Slideout Cart --------------------------------------------------------*/

/* ── Cart toggle button ────────────────────────────────────────────────── */
#sc-toggle {
		position:fixed;
    bottom: 32px;
    right: 32px;
    z-index: 9000;
    background: #0071a1;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    transition: background 0.2s, transform 0.2s;
}
#sc-toggle:hover { background: #005177; transform: scale(1.07); }
#sc-toggle svg   { width: 24px; height: 24px; }

#sc-count {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #e74c3c;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ── Overlay ───────────────────────────────────────────────────────────── */
#sc-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 9001;
}
#sc-overlay.sc-open { display: block; }

/* ── Panel ─────────────────────────────────────────────────────────────── */
#sc-panel {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: 380px;
    max-width: 100vw;
    background: #fff;
    z-index: 9002;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    box-shadow: -4px 0 24px rgba(0,0,0,0.12);
}
#sc-panel.sc-open { transform: translateX(0); }

/* ── Header ────────────────────────────────────────────────────────────── */
#sc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
}
#sc-header h2 { margin: 0; font-size: 1.1rem; }

#sc-close {
    background: none;
    border: none;
    font-size: 26px;
    cursor: pointer;
    color: #555;
    line-height: 1;
    padding: 0 4px;
}
#sc-close:hover { color: #000; }

/* ── Body (scrollable items) ───────────────────────────────────────────── */
#sc-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
}

.sc-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    transition: opacity 0.2s;
}
.sc-item-img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}
.sc-item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 0.88rem;
}
.sc-item-name      { font-weight: 600; }
.sc-item-variation { color: #777; font-size: 0.82rem; }
.sc-item-qty       { color: #555; }
.sc-item-price     { font-weight: 600; color: #0071a1; }

.sc-item-remove {
    background: none;
    border: none;
    font-size: 20px;
    color: #aaa;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 2px;
}
.sc-item-remove:hover { color: #c00; }

.sc-loading, .sc-error { color: #888; font-size: 0.9rem; }

#sc-empty { text-align: center; color: #888; padding: 32px 0; }

/* ── Footer ────────────────────────────────────────────────────────────── */
#sc-footer {
    padding: 20px 24px;
    border-top: 1px solid #eee;
    display: flex;
    flex-direction: column;
    gap: 12px;
		flex-shrink: 0;
}
#sc-subtotal-row {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    font-size: 1rem;
}
#sc-checkout-btn {
    display: block;
    background: #0071a1;
    color: #fff !important;
    text-align: center;
    padding: 12px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s;
}
#sc-checkout-btn:hover { background: #005177; }

#sc-cart-link {
    display: block;
    text-align: center;
    font-size: 0.88rem;
    color: #0071a1;
    text-decoration: underline;
}

/* ── Prevent body scroll when cart is open ─────────────────────────────── */
body.sc-no-scroll { overflow: hidden; }

/* ── Mobile ────────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    #sc-panel { width: 100vw; }
    #sc-toggle { bottom: 20px; right: 20px; }
		#vp-modal { margin-left:30px; margin-right:30px; }
}

@media (max-width: 768px) {

    /* ── Panel slides up from bottom instead of right ────────────────── */
    #sc-panel {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        height: 85vh;
        max-height: 85vh;
        border-radius: 16px 16px 0 0;
        transform: translateY(100%);
        transition: transform 0.3s ease;
        flex-direction: column;
    }

    #sc-panel.sc-open {
        transform: translateY(0);
    }

    /* ── Header stays fixed at top of panel ──────────────────────────── */
    #sc-header {
        flex-shrink: 0;
    }

    /* ── Body scrolls, fills available space between header and footer ── */
    #sc-body {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch; /* smooth momentum scroll on iOS */
        overscroll-behavior: contain;      /* prevents page scroll bleeding through */
        min-height: 0;                     /* critical — allows flex child to shrink */
    }

    /* ── Footer always visible at bottom ─────────────────────────────── */
    #sc-footer {
        flex-shrink: 0;
        padding-bottom: max(20px, env(safe-area-inset-bottom)); /* iPhone notch/home bar */
    }

    /* ── Toggle button repositioned so it doesn't overlap panel ─────── */
    #sc-toggle {
        bottom: 20px;
        right: 20px;
    }

}
	