/* ==========================================================================
   Paarzeit Flyout Cart – State- & Animations-CSS
   --------------------------------------------------------------------------
   Layout/Farben des Markups kommen aus Tailwind-Token-Klassen (Theme-Build).
   Diese Datei enthält nur, was Tailwind nicht abdeckt:
   - Öffnen/Schließen-States
   - Button-Resets gegen die globalen Theme-Button-Styles (!important)
   - Progressbar & Stufen-Pins
   - Zähler-Badge im Header (übernimmt 1:1 den bisherigen Sitecart-Look)
   Alle Farben kommen aus den theme.json-Presets (Annas Token-Set).
   ========================================================================== */

/* --- Öffnen / Schließen ------------------------------------------------- */
#pzfc-flyout.is-open {
    transform: translateX(0);
}

#pzfc-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

body.pzfc-scroll-lock {
    overflow: hidden !important;
}

#pzfc-flyout,
#pzfc-items {
    overscroll-behavior: contain;
}

/* --- Button-Reset im Flyout ----------------------------------------------
   Das Theme stylt alle <button> global als grünen Pill-Button (!important).
   Der ID-Selektor gewinnt die Spezifität und setzt das zurück. */
#pzfc-flyout button {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    min-width: 0 !important;
    color: var(--wp--preset--color--semantic-text-main) !important;
    font-weight: inherit !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background-color 0.2s ease, color 0.2s ease !important;
}

/* Schließen-Button (×) */
#pzfc-close {
    font-size: 32px !important;
    line-height: 1 !important;
    padding: 0 5px !important;
}
#pzfc-close:hover {
    color: var(--wp--preset--color--semantic-highlight-headsup) !important;
}

/* Entfernen-Button (Mülleimer) – großzügiges Touch-Target */
#pzfc-flyout .pzfc-remove {
    position: absolute !important;
    top: 8px;
    right: -8px;
    width: 44px !important;
    height: 44px !important;
    z-index: 10;
}
#pzfc-flyout .pzfc-remove img {
    width: 18px;
    height: 18px;
    display: block;
    object-fit: contain;
}
@media (hover: hover) {
    #pzfc-flyout .pzfc-remove:hover {
        background-color: var(--wp--preset--color--core-transparent-light-grey) !important;
        border-radius: 50% !important;
    }
}
#pzfc-flyout .pzfc-remove:active {
    transform: scale(0.9);
}

/* Mengen-Stepper */
#pzfc-flyout .pzfc-qty {
    display: flex;
    align-items: center;
    border: 1px solid var(--wp--preset--color--semantic-text-main);
    border-radius: 4px;
    background: var(--wp--preset--color--semantic-navbar-cart);
}
#pzfc-flyout .pzfc-qty button {
    width: 40px !important;
    height: 40px !important;
    font-size: 18px !important;
}
@media (hover: hover) {
    #pzfc-flyout .pzfc-qty button:hover {
        background-color: var(--wp--preset--color--core-transparent-light-grey) !important;
    }
}
#pzfc-flyout .pzfc-qty button:active {
    background-color: var(--wp--preset--color--semantic-navbar-hover-click) !important;
}
#pzfc-flyout .pzfc-qty span {
    font-size: 14px;
    font-weight: 600;
    min-width: 28px;
    text-align: center;
    user-select: none;
}

/* --- Rabatt-Progressbar -------------------------------------------------- */
.pzfc-progress-bg {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 9px;
    background: var(--wp--preset--color--semantic-navbar-hover-click);
    border-radius: 5px;
    transform: translateY(-50%);
    z-index: 1;
}

.pzfc-progress-fill {
    height: 100%;
    background: linear-gradient(
        90deg,
        var(--wp--preset--color--semantic-buttons-primary-inactive) 0%,
        var(--wp--preset--color--semantic-buttons-primary-active) 100%
    );
    border-radius: 5px;
    transition: width 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.pzfc-tier {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%) scale(1.15);
    z-index: 2;
    background: var(--wp--preset--color--semantic-navbar-cart);
    border: 1px solid var(--wp--preset--color--semantic-buttons-primary-active);
    color: var(--wp--preset--color--core-grey);
    font-size: 11px;
    font-weight: 700;
    padding: 3px 6px;
    border-radius: 12px;
    white-space: nowrap;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pzfc-tier.active {
    background: var(--wp--preset--color--semantic-buttons-primary-active);
    border-color: var(--wp--preset--color--semantic-buttons-primary-active);
    color: var(--wp--preset--color--semantic-buttons-primary-text);
    box-shadow: 0 4px 10px var(--wp--preset--color--action-primary-transparent);
    z-index: 3;
}

/* Rabatt-Hervorhebungen in den Botschaften (<b> in den Settings-Texten) */
.pzfc-discount-msg b {
    color: var(--wp--preset--color--semantic-buttons-primary-active);
}

/* Summenzeile bei aktivem Rabatt einfärben */
#pzfc-total-row.pzfc-savings,
#pzfc-total-row.pzfc-savings > span {
    color: var(--wp--preset--color--semantic-buttons-primary-active);
    transition: color 0.3s ease;
}

/* --- Header-Trigger & Zähler-Badge -----------------------------------------
   Übernimmt exakt den bisherigen Look (Sitecart-Plugin), damit sich im
   Header visuell nichts ändert. Wird per JS mit .is-visible eingeblendet. */

/* 44px-Touch-Target wie bisher: Das Badge (top/right: 0) positioniert sich
   relativ zu dieser Box und sitzt dadurch oben rechts NEBEN dem 28px-Icon. */
.pz-cart-trigger {
    width: 44px;
    height: 44px;
    position: relative;
    transition: color 0.2s ease, transform 0.2s ease;
}

.pz-cart-trigger:hover {
    transform: scale(1.05);
}
.pz-cart-count {
    position: absolute;
    top: 0;
    right: 0;
    background-color: var(--wp--preset--color--surface-highlight);
    color: var(--wp--preset--color--text-inverse);
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    min-width: 20px;
    height: 20px;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--wp--preset--color--text-inverse);
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
}

.pz-cart-count.is-visible {
    opacity: 1;
    transform: scale(1);
}

/* --- Animationen ---------------------------------------------------------- */
.pzfc-spinner {
    display: inline-block;
    animation: pzfc-spin 1s linear infinite;
}
@keyframes pzfc-spin {
    100% { transform: rotate(360deg); }
}

.pzfc-shake {
    animation: pzfc-shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}
@keyframes pzfc-shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
}

/* --- Scrollbar im Artikelbereich ------------------------------------------ */
#pzfc-items::-webkit-scrollbar { width: 6px; }
#pzfc-items::-webkit-scrollbar-track { background: transparent; }
#pzfc-items::-webkit-scrollbar-thumb {
    background: var(--wp--preset--color--semantic-hover);
    border-radius: 10px;
}
