/**
 * Sticky Add-to-Cart Styles — webpowers UG
 */

.wp-sticky-cart {
    position: fixed;
    left: 0;
    right: 0;
    /* Unter Consent-/Cookie-Banner bleiben (die typischerweise z-index >= 2000 nutzen).
       1030 entspricht dem Bootstrap-Bereich für fixierte Elemente. */
    z-index: 1030;
    background: #fff;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    padding: 10px 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
}

.wp-sticky-cart--bottom {
    /* Offset, damit die Leiste nicht ein unten fixiertes Consent-Banner überdeckt.
       --wp-sticky-cart-bottom kann bei Bedarf gesetzt werden. */
    bottom: var(--wp-sticky-cart-bottom, 0);
    transform: translateY(calc(100% + var(--wp-sticky-cart-bottom, 0px)));
}

/* Statusmeldung für Screenreader visuell ausblenden */
.wp-sticky-cart__status {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.wp-sticky-cart--top {
    top: 0;
    transform: translateY(-100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.wp-sticky-cart--visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.wp-sticky-cart__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    gap: 16px;
}

.wp-sticky-cart__product {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.wp-sticky-cart__img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 6px;
    border: 1px solid #eee;
    flex-shrink: 0;
}

.wp-sticky-cart__info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.wp-sticky-cart__name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.wp-sticky-cart__price {
    font-size: 16px;
    font-weight: 700;
    color: #e63946;
    line-height: 1.3;
}

.wp-sticky-cart__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.wp-sticky-cart__qty {
    width: 60px;
    height: 42px;
    border: 1px solid #ddd;
    border-radius: 6px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    -moz-appearance: textfield;
}

.wp-sticky-cart__qty::-webkit-outer-spin-button,
.wp-sticky-cart__qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.wp-sticky-cart__btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.1s ease;
    white-space: nowrap;
}

.wp-sticky-cart__btn:hover {
    opacity: 0.9;
}

.wp-sticky-cart__btn:active {
    transform: scale(0.97);
}

.wp-sticky-cart__btn--added {
    background-color: #2d6a4f !important;
}

.wp-sticky-cart__btn svg {
    flex-shrink: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .wp-sticky-cart__inner {
        padding: 0 12px;
        gap: 10px;
    }

    .wp-sticky-cart__img {
        width: 36px;
        height: 36px;
    }

    .wp-sticky-cart__name {
        font-size: 12px;
        max-width: 120px;
    }

    .wp-sticky-cart__price {
        font-size: 14px;
    }

    .wp-sticky-cart__qty {
        width: 48px;
        height: 38px;
    }

    .wp-sticky-cart__btn {
        padding: 8px 16px;
        font-size: 13px;
    }

    .wp-sticky-cart__btn span {
        display: none;
    }

    .wp-sticky-cart__btn svg {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    .wp-sticky-cart__info {
        display: none;
    }

    .wp-sticky-cart__product {
        flex: 0;
    }
}
