﻿/* Bas-stil för korgikonen */
#shopping-cart {
    z-index:999999;
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--c-brand); 
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

    #shopping-cart:hover {
        z-index:999999;
        /*background: #244c8a;*/
        transform: translateY(-2px);
    }

    /* FontAwesome ikon */
    #shopping-cart::before {
        content: "\f07a"; /* fa-shopping-cart */
        font-family: "Font Awesome 6 Free";
        font-weight: 900;
        font-size: 18px;
        color: #fff;
    }

    /* Toggle overlay */
    #shopping-cart .veiw-cart-toggle {
        position: absolute;
        inset: 0;
        cursor: pointer;
    }

    /* Länk i mobil */
    #shopping-cart .avieworder {
        display: none;
        width: 100%;
        height: 100%;
    }

    /* Badge för antal */
    #shopping-cart .productcount {
        position: absolute;
        top: -3px;
        right: -3px;
        background: var(--c-drkblue); 
        color: #fff;
        font-size: 12px;
        font-weight: 700;
        width: 22px;
        height: 22px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
       /* box-shadow: 0 0 0 2px #fff;  */
    }

/* Animation */
@keyframes shoppingcartExpand {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dropdown container */
#shopping-cart .cart-details-container {
    position: absolute;
    z-index: 50;
    top: 55px;
    right: 0;
    width: 360px;
    max-height: 70vh;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(0,0,0,.2);
    padding: 15px;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    transform: translateY(-10px);
}

#shopping-cart.expanded .cart-details-container {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    animation: shoppingcartExpand 0.3s ease;
}

/* Stäng-knapp */
#shopping-cart .cart-details-container .close-cart-details {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    cursor: pointer;
}

    #shopping-cart .cart-details-container .close-cart-details img {
        width: 100%;
    }

/* Titel */
#shopping-cart .cart-details-container .cart-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
    display: block;
}

/* Produkter */
#shopping-cart .cart-details-container .products {
    max-height: 400px;
    overflow-y: auto;
}

#shopping-cart .cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

    #shopping-cart .cart-item:last-child {
        border-bottom: none;
    }

    /* Ta bort knapp */
    #shopping-cart .cart-item .remove-button {
        width: 18px;
        height: 18px;
        cursor: pointer;
    }

        #shopping-cart .cart-item .remove-button img {
            width: 100%;
        }

    /* Bild */
    #shopping-cart .cart-item .image {
        width: 48px;
        height: 48px;
        border-radius: 6px;
        overflow: hidden;
        flex-shrink: 0;
        border: 1px solid #ddd;
    }

        #shopping-cart .cart-item .image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

    /* Info */
    #shopping-cart .cart-item .name {
        flex: 1;
        font-weight: 600;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    #shopping-cart .cart-item .description {
        font-size: 12px;
        color: #777;
    }

    /* Pris & antal */
    #shopping-cart .cart-item .quantity,
    #shopping-cart .cart-item .price {
        font-size: 14px;
        font-weight: 600;
        color: var(--c-brand);
    }

    #shopping-cart .cart-item .price .non-discount-price { display: none; }
    #shopping-cart .cart-item.campaign .price .non-discount-price {display:inline; text-decoration:line-through;}
    /* Totalsumma */
    #shopping-cart .total-price { margin-top: 12px; padding-top: 10px; border-top: 1px solid #eee; display: flex; justify-content: space-between; font-size: 16px; font-weight: 600; }

/* Checkout-knapp */
#shopping-cart .button.go-to-checkout {
    display: block;
    width: 100%;
    text-align: center;
    margin-top: 12px;
    padding: 12px 0;
    background: var(--c-accent);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.2s ease;
}

    #shopping-cart .button.go-to-checkout:hover {
        filter: contrast(1.1);
    }

/* Anpassningar för mindre skärmar */
@media screen and (max-width: 1300px) {
    #shopping-cart {
        right: 10px;
    }
}

@media screen and (max-width: 860px) {
    #head .inner #shopping-cart {
        display: none;
    }
}

@media screen and (max-width: 420px) {
    #shopping-cart .cart-details-container {
        position: fixed;
        left: 10px;
        right: 10px;
        top: 60px;
        max-height: 80%;
        overflow: auto;
        width: auto;
    }
}
