/* === Stillasgruppen B2B — Cart Drawer === */

#sg-cart-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9998;
    transition: opacity 0.3s;
}
#sg-cart-overlay.open {
    display: block;
}

#sg-cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 380px;
    max-width: 92vw;
    height: 100vh;
    background: #fff;
    box-shadow: -6px 0 32px rgba(0, 0, 0, 0.18);
    z-index: 9999;
    display: none;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    visibility: hidden;
}
#sg-cart-drawer.open {
    display: flex;
    transform: translateX(0);
    visibility: visible;
}

/* Header */
.sg-cart-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}
.sg-cart-drawer-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #111;
}
.sg-cart-drawer-close {
    background: none;
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    color: #888;
    padding: 0 4px;
    transition: color 0.15s;
}
.sg-cart-drawer-close:hover {
    color: #111;
}

/* Body — scrollbar */
.sg-cart-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

/* Empty */
.sg-cart-empty {
    color: #888;
    font-size: 0.95rem;
    text-align: center;
    padding: 32px 0;
}

/* Item list */
.sg-cart-items {
    list-style: none;
    margin: 0;
    padding: 0;
}
.sg-cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}
.sg-cart-item:last-child {
    border-bottom: none;
}
.sg-cart-item-img img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 3px;
    display: block;
    border: 1px solid #eee;
}
.sg-cart-item-info {
    flex: 1;
    min-width: 0;
}
.sg-cart-item-name {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #111;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sg-cart-item-meta {
    display: block;
    font-size: 0.82rem;
    color: #777;
    margin-top: 3px;
}
.sg-cart-item-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
}
.sg-cart-item-total {
    font-size: 0.9rem;
    font-weight: 700;
    color: #111;
}
.sg-cart-item-remove {
    color: #bbb;
    font-size: 1.1rem;
    line-height: 1;
    text-decoration: none;
    transition: color 0.15s;
}
.sg-cart-item-remove:hover {
    color: #e33;
}

/* Footer */
.sg-cart-drawer-footer {
    padding: 16px 20px;
    border-top: 1px solid #eee;
    flex-shrink: 0;
}
.sg-cart-subtotal {
    display: flex;
    justify-content: space-between;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 14px;
    color: #111;
}
.sg-cart-btn-checkout {
    display: block;
    width: 100%;
    padding: 13px;
    background: #F07E26;
    color: #fff;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: 3px;
    text-decoration: none;
    margin-bottom: 8px;
    transition: background 0.15s;
}
.sg-cart-btn-checkout:hover {
    background: #c06010;
    color: #fff;
    text-decoration: none;
}
.sg-cart-btn-cart {
    display: block;
    width: 100%;
    padding: 10px;
    background: #f5f5f5;
    color: #333;
    text-align: center;
    font-size: 0.88rem;
    font-weight: 500;
    border-radius: 3px;
    text-decoration: none;
    border: 1px solid #ddd;
    transition: background 0.15s;
}
.sg-cart-btn-cart:hover {
    background: #e8e8e8;
    color: #111;
    text-decoration: none;
}

/* Body scroll lock */
body.sg-cart-open {
    overflow: hidden;
}

@media (max-width: 480px) {
    #sg-cart-drawer {
        width: 100vw;
        max-width: 100vw;
    }
}
