/* ==========================================================================
   Bausteine des neuen Designs: Knöpfe, Badges, runde Symbolknöpfe, Entfernen, Spinner

   So sind die Styles aufgeteilt (bei neuen Bereichen bitte beibehalten):

   1. style.css            Farben, Radien, Schatten (--flow-*) auf :root und alles,
                           was im Kopf jeder Seite sofort sichtbar ist. Lädt überall.
   2. flow-base.css        Diese Datei: Bausteine, die mehrere Bereiche teilen. Lädt
                           nie allein, sondern als Abhängigkeit (cantana-flow-base).
   3. flow-<name>.css      Eine Datei je Komponente (z. B. flow-minicart.css). Was erst
                           nach einem Klick sichtbar wird, lädt nicht blockierend,
                           siehe cantana_defer_style() in functions-mini-cart.php.
   4. checkout-flow.css,   Seiten der Bestellstrecke, nur dort geladen
      cart-checkout.css    (cantana_enqueue_flow_assets in functions-quote-request.php).

   Die Bausteine gelten innerhalb von .cantana-flow. Auf den Seiten der Strecke
   ist das die Body-Klasse; eine Komponente auf anderen Seiten trägt die Klasse an
   ihrem Wurzelelement (z. B. der Mini-Cart). Das Präfix hebt die Regeln zugleich
   über Basels Button-Regeln.

   JavaScript: eine Datei je Komponente, im Footer mit defer.
   ========================================================================== */

.cantana-flow [hidden] {
    display: none !important;
}

.cantana-flow .screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}

/* --- Buttons ------------------------------------------------------------- */

.cantana-flow .flow-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 50px;
    margin: 0;
    padding: 0 28px;
    border: 1px solid transparent;
    border-radius: 35px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0;
    text-align: center;
    text-decoration: none;
    text-transform: none;
    cursor: pointer;
    transition: background-color .2s, border-color .2s, color .2s, box-shadow .2s, transform .2s;
}

.cantana-flow .flow-btn svg { flex: none; }

/* Varianten mit doppelter Klasse (0,3,0), damit sie Basels Button-Regeln auf jeder
   Seite der Strecke schlagen, ohne Selektor-Listen pro Seite. */
.cantana-flow .flow-btn.flow-btn--primary {
    background-color: var(--flow-green);
    border-color: var(--flow-green);
    color: #000;
    box-shadow: 0 2px 10px rgb(103 209 39 / 28%);
}

.cantana-flow .flow-btn.flow-btn--primary:hover,
.cantana-flow .flow-btn.flow-btn--primary:focus-visible {
    background-color: var(--flow-green-hover);
    border-color: var(--flow-green-hover);
    color: #000;
    box-shadow: 0 6px 18px rgb(103 209 39 / 36%);
}

.cantana-flow .flow-btn.flow-btn--primary:active { transform: scale(.98); }

.cantana-flow .flow-btn.flow-btn--secondary {
    min-height: 46px;
    padding: 0 20px;
    background: var(--flow-surface);
    border-color: var(--flow-green-deep);
    color: var(--flow-green-deep);
    box-shadow: none;
}

.cantana-flow .flow-btn.flow-btn--secondary:hover,
.cantana-flow .flow-btn.flow-btn--secondary.is-active {
    background: var(--flow-green-soft);
    color: var(--flow-green-deep);
}

.cantana-flow .flow-btn.flow-btn--ghost {
    min-height: 40px;
    padding: 0;
    background: none;
    border: 0;
    color: var(--flow-green-deep);
    box-shadow: none;
}

.cantana-flow .flow-btn.flow-btn--ghost:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.cantana-flow .flow-btn--block { width: 100%; }

.cantana-flow .flow-btn:focus-visible {
    outline: 2px solid var(--flow-green-deep);
    outline-offset: 2px;
}

/* Ladeanzeige im Knopf (Klasse is-loading per JS): Spinner vor dem Text, ein
   Symbol im Knopf weicht ihm. Ring in Textfarbe, passt auf Lime und auf Weiß. */
.cantana-flow .flow-btn .flow-spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid rgb(0 0 0 / 15%);
    border-top-color: currentColor;
}

.cantana-flow .flow-btn:not(.is-loading) .flow-spinner,
.cantana-flow .flow-btn.is-loading svg {
    display: none;
}

.cantana-flow .flow-btn.is-loading { cursor: progress; }

/* --- Badges -------------------------------------------------------------- */

.cantana-flow .flow-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: var(--flow-radius-pill);
    background: var(--flow-green);
    color: #000;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.5;
    letter-spacing: 0;
    text-transform: none;
}

.cantana-flow .flow-badge--neutral {
    background: var(--flow-surface-muted);
    border: 1px solid var(--flow-line);
    color: var(--flow-muted);
    font-weight: 600;
}

/* --- Runde Symbolknöpfe --------------------------------------------------- */

/* Runde Symbolknöpfe (Pfeil in der Zeile, Schließen und Download im Panel) */
.cantana-flow button.flow-icon-btn {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    min-width: 0;
    height: 40px;
    min-height: 0;
    margin: 0;
    padding: 0;
    background: var(--flow-surface);
    border: 1px solid var(--flow-line);
    border-radius: 50%;
    box-shadow: none;
    color: var(--flow-text);
    cursor: pointer;
    transition: border-color .2s, background-color .2s;
}

.cantana-flow button.flow-icon-btn:hover { border-color: var(--flow-green-deep); }

.cantana-flow button.flow-icon-btn:focus-visible {
    outline: 2px solid var(--flow-green-deep);
    outline-offset: 2px;
}

/* --- Entfernen ------------------------------------------------------------ */

/* Mülleimer ohne Rahmen und Kreis, überall gleich: Anfrageseite, Mini-Cart,
   Muster-Warenkorb (dort mit dem Wort „Entfernen“), Kasse. Symbol aus
   cantana_flow_trash_icon(). Die Bereiche setzen nur noch Lage und Außenabstand.
   Links behalten die Klasse .remove: daran hängen die Skripte von WooCommerce und
   woocommerce-quotation, und WooCommerce färbt a.remove sonst rot mit !important. */
.cantana-flow :is(a.remove, button).flow-remove {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: auto;
    min-width: 40px;
    height: auto;
    min-height: 40px;
    padding: 0;
    background: none;
    border: 0;
    border-radius: 8px;
    box-shadow: none;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    color: var(--flow-muted) !important;
    text-decoration: none;
    cursor: pointer;
    transition: color .16s;
}

.cantana-flow :is(a.remove, button).flow-remove::before,
.cantana-flow :is(a.remove, button).flow-remove::after { display: none; }

.cantana-flow :is(a.remove, button).flow-remove svg { flex: none; }

.cantana-flow :is(a.remove, button).flow-remove:hover,
.cantana-flow :is(a.remove, button).flow-remove:focus-visible {
    background: none;
    color: var(--flow-red) !important;
}

.cantana-flow :is(a.remove, button).flow-remove:focus-visible {
    outline: 2px solid var(--flow-green-deep);
    outline-offset: -2px;
}

/* --- Ladeanzeige --------------------------------------------------------- */

.cantana-flow .flow-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--flow-green-soft);
    border-top-color: var(--flow-green-deep);
    border-radius: 50%;
    animation: flowSpin .8s linear infinite;
}

@keyframes flowFadeIn { from { opacity: 0; } }
@keyframes flowDrawerIn { from { opacity: 0; transform: translateX(48px); } }
@keyframes flowSpin { to { transform: rotate(360deg); } }
