/* ==========================================================================
   Warenkorb und Kasse der Musterbestellung (woocommerce/cart/*, woocommerce/checkout/*)

   Lädt nur dort (cantana_is_shop_flow_page, functions-sample-checkout.php) und baut
   auf assets/checkout-flow.css auf: Farben (--flow-*), Kopf, Karten, Knöpfe, Felder,
   Checkboxen, Auswahlkarten, Summenzeilen, Hinweis und Team kommen von dort. Hier
   stehen nur das Raster der beiden Seiten und die Teile, die es sonst nicht gibt:
   Warenkorb-Zeile mit Mengen-Knöpfen, Positionen in „Ihre Bestellung“, Zahlungsarten,
   Zustimmungen und Logos. Wrapper: .cantana-shop (.cantana-cart, .cantana-checkout).
   ========================================================================== */

.cantana-flow .cantana-shop {
    margin-bottom: 56px;
    color: var(--flow-text);
}

.cantana-flow .cantana-shop .flow-page-head { margin-bottom: 36px; }

/* Positionen und Übersicht tragen bewusst kein .shop_table: Basel wickelt jede
   .shop_table per JS in .responsive-table (woocommerceWrappTable). */

/* Notices und Login-Hinweis über dem Raster, leer ohne Abstand. */
.cantana-flow .cantana-shop__before > * { margin: 0 0 20px; }
.cantana-flow .cantana-shop__before > .woocommerce-notices-wrapper:empty { display: none; }

.cantana-flow .cantana-shop__before .woocommerce-form-login-toggle .woocommerce-info,
.cantana-flow .cantana-shop__before .woocommerce-form-coupon-toggle .woocommerce-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 14px 20px;
    background: var(--flow-surface);
    border: 1px solid var(--flow-line);
    border-radius: var(--flow-radius-pill);
    font-size: 15px;
    color: var(--flow-text);
}

.cantana-flow .cantana-shop__before .woocommerce-form-login-toggle .woocommerce-info::before { display: none; }

.cantana-flow .cantana-shop__before .woocommerce-form-login-toggle a {
    font-weight: 700;
    color: var(--flow-green-deep);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.cantana-flow .cantana-shop__before form.woocommerce-form-login {
    max-width: 640px;
    padding: 24px 28px;
    background: var(--flow-surface);
    border: 1px solid var(--flow-line);
    border-radius: 20px;
}

/* --- Raster -------------------------------------------------------------- */

.cantana-flow :is(.cantana-cart__grid, .cantana-checkout__grid) {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.cantana-flow :is(.cantana-cart__main, .cantana-cart__aside, .cantana-checkout__main, .cantana-checkout__aside) {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

@media (min-width: 992px) {
    .cantana-flow :is(.cantana-cart__grid, .cantana-checkout__grid) {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(340px, 400px);
        gap: 40px;
        align-items: start;
    }

    .cantana-flow :is(.cantana-cart__aside, .cantana-checkout__aside).is-sticky {
        position: sticky;
        top: var(--flow-sticky-top);
    }

    /* Fehler nach dem Absenden setzt WooCommerce als erstes Kind ins Formular. */
    .cantana-flow .cantana-checkout__grid > .woocommerce-NoticeGroup { grid-column: 1 / -1; }
}

.cantana-flow .cantana-checkout__grid > .woocommerce-NoticeGroup .woocommerce-error { margin: 0; }

.cantana-flow .cantana-cart__cross-sells:not(:has(*)) { display: none; }
.cantana-flow .cantana-cart__cross-sells { margin-top: 48px; }

/* --- Warenkorb: Karte „Ihre Muster“ -------------------------------------- */

.cantana-flow .flow-cart { margin: 0; }

.cantana-flow .flow-cart-item {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin: 0;
    padding: 22px 28px;
    border-bottom: 1px solid var(--flow-line);
}

.cantana-flow .flow-cart-item__thumb {
    flex: none;
    width: 90px;
    aspect-ratio: 3 / 4; /* Hochformat wie das WooCommerce-Vorschaubild (213 × 284) */
    overflow: hidden;
    border-radius: 14px;
    background: var(--flow-surface-muted);
}

.cantana-flow .flow-cart-item__thumb a { display: block; height: 100%; }

.cantana-flow .flow-cart-item__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
}

.cantana-flow .flow-cart-item__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cantana-flow .flow-cart-item__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.cantana-flow .flow-cart-item__info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cantana-flow .flow-cart-item__name {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--flow-text);
    text-decoration: none;
}

.cantana-flow a.flow-cart-item__name:hover { color: var(--flow-green-deep); }

.cantana-flow .flow-cart-item__meta {
    font-size: 14px;
    line-height: 1.4;
    color: var(--flow-muted);
}

.cantana-flow .flow-cart-item__total {
    flex: none;
    font-size: 18px;
    font-weight: 700;
    white-space: nowrap;
    color: var(--flow-green-deep);
}

.cantana-flow .flow-cart-item__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
}

.cantana-flow .flow-cart-item__unit {
    font-size: 14px;
    white-space: nowrap;
    color: var(--flow-muted);
}

.cantana-flow .flow-cart-item__unit .amount {
    font-weight: 700;
    color: var(--flow-text);
}

.cantana-flow .flow-cart-item__fixed {
    font-size: 14px;
    font-weight: 600;
}

.cantana-flow .flow-cart-item__remove { margin-left: auto; }

.cantana-flow .cantana-cart .flow-cart-item__remove a.remove {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: auto;
    height: auto;
    min-height: 40px;
    padding: 0 6px;
    background: none;
    border: 0;
    border-radius: 0;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    color: var(--flow-muted) !important;
    text-decoration: none;
}

.cantana-flow .cantana-cart .flow-cart-item__remove a.remove::before,
.cantana-flow .cantana-cart .flow-cart-item__remove a.remove::after { display: none; }

.cantana-flow .cantana-cart .flow-cart-item__remove a.remove:hover {
    background: none;
    color: var(--flow-red) !important;
}

/* Mengen-Knöpfe: Basels global/quantity-input.php (−, Feld, +), Klicks in Basels JS. */
.cantana-flow .flow-cart-item__qty .quantity {
    display: inline-flex;
    align-items: center;
    width: auto;
    height: 40px;
    margin: 0;
    padding: 0 4px;
    background: var(--flow-surface);
    border: 1px solid var(--flow-line-strong);
    border-radius: var(--flow-radius-pill);
}

/* style.css blendet .minus/.plus überall mit !important aus; hier gehören sie dazu. */
.cantana-flow .flow-cart-item__qty .quantity :is(input.minus, input.plus) {
    display: inline-block !important;
    width: 32px;
    min-width: 0;
    height: 32px;
    min-height: 0;
    margin: 0;
    padding: 0;
    background: none;
    border: 0;
    border-radius: 50%;
    box-shadow: none;
    font-size: 18px;
    font-weight: 500;
    line-height: 1;
    color: var(--flow-green-deep);
    cursor: pointer;
}

.cantana-flow .flow-cart-item__qty .quantity :is(input.minus, input.plus):hover { background: var(--flow-green-soft); }

.cantana-flow .flow-cart-item__qty .quantity input.qty {
    width: 36px;
    height: 32px;
    margin: 0;
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    color: var(--flow-text);
    -moz-appearance: textfield;
    appearance: textfield;
}

.cantana-flow .flow-cart-item__qty .quantity input.qty::-webkit-outer-spin-button,
.cantana-flow .flow-cart-item__qty .quantity input.qty::-webkit-inner-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

.cantana-flow .flow-cart-item__qty .quantity input.qty:focus { outline: none; }
.cantana-flow .flow-cart-item__qty .quantity:focus-within { border-color: var(--flow-green); box-shadow: var(--flow-ring); }

.cantana-flow .flow-cart__footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 20px;
    padding: 18px 28px;
    background: var(--flow-surface-muted);
}

.cantana-flow .flow-cart__note {
    font-size: 14px;
    color: var(--flow-muted);
}

.cantana-flow .flow-cart__coupon {
    display: flex;
    gap: 8px;
    width: 100%;
}

/* --- Warenkorb: Karte „Warenkorb-Summe“ ---------------------------------- */

.cantana-flow .cantana-shop .cart-collaterals { width: auto; margin: 0; }

/* Basel gibt .cart_totals auf dem Handy Innenabstand. */
.cantana-flow .cantana-shop .cart_totals {
    float: none;
    width: auto;
    margin: 0;
    padding: 0;
}

/* Der graue Gesamtblock (.flow-totals) ist auf der Angebotsseite mobil eine eigene,
   angesetzte Karte (checkout-flow.css); hier bleibt er Teil der Karte. */
.cantana-flow .cantana-shop .flow-totals {
    order: 0;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.cantana-flow .flow-cart-totals__rows,
.cantana-flow .flow-review__rows {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 22px 28px;
    border-bottom: 1px solid var(--flow-line);
}

.cantana-flow .cantana-shop .flow-summary__row { font-size: 15px; }

.cantana-flow .cantana-shop .flow-summary__row > span:first-child {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.cantana-flow .cantana-shop .flow-summary__row small.flow-summary__sub { font-size: 12px; }

.cantana-flow .flow-cart-totals__total {
    gap: 18px;
    padding: 24px 28px 26px;
    border-bottom: 0;
}

.cantana-flow .cantana-shop .flow-summary__row--grand { align-items: center; }

.cantana-flow .cantana-shop .flow-summary__row--grand > span:last-child { font-size: 28px; }

.cantana-flow .cantana-shop .wc-proceed-to-checkout {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0;
}

.cantana-flow .cantana-shop .wc-proceed-to-checkout .checkout-button {
    margin: 0;
    font-size: 16px;
}

/* Versandauswahl, falls eine Zone mehrere Versandarten hat. */
.cantana-flow .flow-shipping { align-items: flex-start; }

.cantana-flow .flow-shipping__methods {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
    text-align: right;
}

.cantana-flow .flow-shipping__methods label {
    margin: 0 0 0 6px;
    font-size: 14px;
    font-weight: 400;
    text-transform: none;
}

/* --- Logos „Sicher bezahlen mit“ ----------------------------------------- */

.cantana-flow .flow-paylogos {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    text-align: center;
}

.cantana-flow .flow-paylogos__label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: var(--flow-green-deep);
}

.cantana-flow .flow-paylogos__icons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px 8px;
}

.cantana-flow .flow-paylogos__icons img {
    display: block;
    width: auto;
    max-width: 100%;
    height: 26px;
    margin: 0;
}

.cantana-flow .flow-paylogos__note {
    font-size: 13px;
    color: var(--flow-muted);
}

.cantana-flow .flow-paylogos--checkout {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 14px;
    padding: 12px 16px;
    background: var(--flow-surface-muted);
    border: 1px solid var(--flow-line);
    border-radius: var(--flow-radius-card);
}

.cantana-flow .flow-paylogos--checkout .flow-paylogos__icons img { height: 22px; }

/* --- Kasse: Rechnungsdaten und Lieferadresse ----------------------------- */

.cantana-flow .cantana-checkout .flow-section { margin: 0 0 28px; }
.cantana-flow .cantana-checkout__customer { gap: 16px; }

/* Basel setzt Rechnungs-, Konto- und Lieferblock 40px auseinander; der Abstand kommt
   hier aus dem gap. Die Herkunftsfelder von WooCommerce (nur versteckte Inputs)
   sollen keinen Platz im Raster belegen. */
.cantana-flow .cantana-checkout__customer > * { margin: 0; }
.cantana-flow .cantana-checkout wc-order-attribution-inputs { display: contents; }

.cantana-flow .cantana-checkout .woocommerce-billing-fields {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cantana-flow .cantana-checkout .woocommerce-billing-fields .flow-section__title { margin: 0; }

/* Raster in Sechsteln: zwei Felder halb und halb, PLZ ein Drittel neben der Stadt. */
.cantana-flow .flow-fields.flow-fields--checkout {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 22px 20px;
    margin: 0;
}

.cantana-flow .woocommerce-billing-fields .flow-fields--checkout { padding: 28px; }

.cantana-flow .flow-fields--checkout .form-row { grid-column: 1 / -1; }
.cantana-flow .flow-fields--checkout .form-row-first { grid-column: 1 / span 3; }
.cantana-flow .flow-fields--checkout .form-row-last { grid-column: 4 / span 3; }
.cantana-flow .flow-fields--checkout :is(#billing_postcode_field, #shipping_postcode_field) { grid-column: 1 / span 2; }
.cantana-flow .flow-fields--checkout :is(#billing_city_field, #shipping_city_field) { grid-column: 3 / span 4; }

/* E-Mail und Telefon über die ID: WooCommerces Länder-Skript (address-i18n) setzt die
   Klasse des Telefonfelds beim Laden auf form-row-wide zurück. */
.cantana-flow .flow-fields--checkout #billing_email_field { grid-column: 1 / span 3; }
.cantana-flow .flow-fields--checkout #billing_phone_field { grid-column: 4 / span 3; }

/* Von WooCommerce je Land ausgeblendete Felder (z. B. Bundesland) nehmen keinen Platz. */
.cantana-flow .flow-fields--checkout .form-row[style*="display: none"],
.cantana-flow .flow-fields--checkout .form-row.hidden { display: none !important; }

.cantana-flow .flow-fields--checkout .form-row .woocommerce-input-wrapper { display: block; }

.cantana-flow .cantana-shop .woocommerce-invalid :is(.input-text, select),
.cantana-flow .cantana-shop .woocommerce-invalid .select2-selection { border-color: var(--flow-red) !important; }

.cantana-flow .cantana-shop .checkout-inline-error-message {
    margin: 6px 0 0;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    color: #b3261e;
}

/* Länderauswahl als Such-Dropdown (selectWoo): die Liste hängt am Seitenende. */
.cantana-flow .select2-container--open .select2-dropdown {
    overflow: hidden;
    border-color: var(--flow-line-strong);
    border-radius: var(--flow-radius);
}

.cantana-flow .select2-results__option--highlighted[aria-selected],
.cantana-flow .select2-results__option--highlighted[data-selected] {
    background: var(--flow-green-soft);
    color: var(--flow-green-deep);
}

/* Kundenkonto anlegen (WooCommerce-Einstellung) */
.cantana-flow .flow-account .create-account { margin: 0; padding: 0; }
.cantana-flow .flow-account .flow-fields { margin-top: 16px; }

/* Checkbox mit Text: AGB, Muster, Newsletter, Kundenkonto, Lieferadresse. Die Box
   selbst kommt aus checkout-flow.css (.cantana-shop input[type="checkbox"]). Bei den
   Zustimmungen steht die Box links außen, damit das Sternchen direkt am Text bleibt. */
.cantana-flow .cantana-shop :is(.flow-consent, .flow-account, .flow-ship) label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 0;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.55;
    letter-spacing: 0;
    text-transform: none;
    color: var(--flow-text);
    cursor: pointer;
}

.cantana-flow .cantana-shop :is(.flow-consent, .flow-account) label {
    display: block;
    position: relative;
    padding-left: 34px;
}

.cantana-flow .cantana-shop :is(.flow-consent, .flow-account) label input[type="checkbox"],
.cantana-flow .cantana-checkout #payment .flow-consent .woocommerce-form__input {
    position: absolute;
    top: 1px;
    left: 0;
    margin: 0;
}

.cantana-flow .cantana-shop :is(.flow-consent, .flow-account) a {
    color: var(--flow-green-deep);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.cantana-flow .cantana-shop :is(.flow-consent, .flow-account) .required {
    border: 0;
    color: var(--flow-green-deep);
    text-decoration: none;
}

/* „Lieferung an eine andere Adresse?“: Kopf der Klappkarte mit Checkbox statt Pfeil. */
.cantana-flow .cantana-checkout .flow-ship { margin: 0; }

.cantana-flow .cantana-checkout .flow-ship__head {
    margin: 0;
    font-size: inherit;
    text-transform: none;
}

.cantana-flow .cantana-checkout .flow-ship__toggle {
    align-items: center;
    padding: 18px 22px;
}

.cantana-flow .cantana-checkout .flow-ship__toggle input[type="checkbox"] { margin: 0; }

.cantana-flow .cantana-checkout .flow-ship .flow-collapse__panel { padding: 22px; }

.cantana-flow .cantana-checkout .woocommerce-additional-fields:not(:has(.form-row)) { display: none; }

/* --- Kasse: Zahlungsarten ------------------------------------------------ */

/* Basel (css/parts/woo-page-checkout.min.css) formatiert Zahlungsarten, Kasten und
   Bestellknopf mit .woocommerce-checkout .woocommerce-checkout-payment …; die Regeln
   hier tragen deshalb .cantana-checkout #payment davor. */

.cantana-flow .cantana-checkout .woocommerce-checkout-payment {
    margin: 0;
    padding: 0;
    background: none;
    border-radius: 0;
}

.cantana-flow .flow-pay__methods {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0 0 32px;
    padding: 0;
    border: 0;
    list-style: none;
}

.cantana-flow .flow-choice.flow-pay-option {
    flex-wrap: wrap;
    align-items: center;
    gap: 0 14px;
    margin: 0;
    padding: 0 22px;
    box-shadow: none;
    cursor: default;
}

.cantana-flow .cantana-shop .flow-pay-option .flow-choice__input { margin: 0; }

.cantana-flow .cantana-checkout #payment .flow-pay-option__label {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    margin: 0;
    padding: 20px 0;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
}

.cantana-flow .cantana-checkout #payment .flow-pay-option__label::before,
.cantana-flow .cantana-checkout #payment .flow-pay-option__label::after { content: none; }

.cantana-flow .flow-pay-option__title {
    font-size: 17px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--flow-green-deep);
}

.cantana-flow .cantana-checkout #payment .flow-pay-option__icon img {
    display: block;
    width: auto;
    max-width: 100%;
    height: 24px;
    max-height: none;
    margin: 0;
}

.cantana-flow .flow-pay-option__icon,
.cantana-flow .flow-pay-option__hint { margin-left: auto; }

.cantana-flow .flow-pay-option__hint {
    font-size: 14px;
    color: var(--flow-muted);
}

.cantana-flow .cantana-checkout #payment .flow-pay-option .payment_box {
    flex: 1 1 100%;
    position: relative;
    margin: 0;
    padding: 0 0 20px 36px;
    background: none;
    border: 0;
    font-size: 14px;
    line-height: 1.55;
    color: var(--flow-muted);
}

.cantana-flow .cantana-checkout #payment .flow-pay-option .payment_box::before { display: none; }
.cantana-flow .cantana-checkout #payment .flow-pay-option .payment_box p { margin: 0; }

/* Hinweise in den Kästen mit Symbol davor wie in der Vorlage: PayPal (Text vom Plugin,
   sein Bild weicht dem Symbol) und Vorkasse (Beschreibung aus den WooCommerce-Einstellungen). */
.cantana-flow .cantana-checkout .wc-ppcp-popup__container {
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
    text-align: left;
}

.cantana-flow .cantana-checkout .wc-ppcp-popup__container img { display: none; }

.cantana-flow .cantana-checkout #payment :is(.wc-ppcp-popup__container p, .payment_method_bacs .payment_box p) {
    position: relative;
    margin: 0;
    padding-left: 32px;
    font-size: 14px;
    line-height: 1.55;
    text-align: left;
    color: var(--flow-muted);
}

.cantana-flow .cantana-checkout #payment :is(.wc-ppcp-popup__container p, .payment_method_bacs .payment_box p)::before {
    content: "";
    position: absolute;
    top: 1px;
    left: 0;
    width: 20px;
    height: 20px;
    background: var(--flow-green-deep);
    -webkit-mask: var(--flow-pay-icon) center / contain no-repeat;
    mask: var(--flow-pay-icon) center / contain no-repeat;
}

.cantana-flow .cantana-checkout .wc-ppcp-popup__container p {
    --flow-pay-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='16' rx='2'/%3E%3Cpath d='M3 9h18M13 15h5M16 12l3 3-3 3'/%3E%3C/svg%3E");
}

.cantana-flow .cantana-checkout .payment_method_bacs .payment_box p {
    --flow-pay-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 21h18M5 21V10M10 21V10M14 21V10M19 21V10M12 3l9 5H3z'/%3E%3C/svg%3E");
}

/* Karte: Felder des PayPal-Plugins (iframes) in der Optik der übrigen Felder */
.cantana-flow .cantana-checkout .wc-ppcp-card-payment-form { padding-top: 4px; }

.cantana-flow .cantana-checkout .ppcp-card-fields--container {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin: 0 0 16px;
}

/* Das Plugin verteilt die Felder per flex und max-width je nach Breite der Karte. */
.cantana-flow .cantana-checkout .ppcp-card-fields--container .ppcp-card-field--container {
    width: auto;
    max-width: none;
    flex-basis: auto;
    margin: 0;
}

.cantana-flow .cantana-checkout .ppcp-card-fields--container.card-name-field,
.cantana-flow .cantana-checkout .ppcp-card-fields--container .ppcp-card-field--container.card-name-field,
.cantana-flow .cantana-checkout .ppcp-card-fields--container .ppcp-card-field--container.card-number-field { grid-column: 1 / -1; }

.cantana-flow .cantana-checkout .ppcp-card-field--label {
    display: block;
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--flow-muted);
}

/* PayPal lässt im iframe 6 px Luft ums Feld (für den Fokus-Ring). Ausgleichen, damit das
   Feld bündig unter der Beschriftung steht und so breit ist wie die Spalte. Die Optik im
   iframe selbst setzt cantana_shop_card_field_styles() (functions-sample-checkout.php). */
.cantana-flow .cantana-checkout :is(#ppcp-card-name, #ppcp-card-number, #ppcp-card-exp, #ppcp-card-cvv) {
    margin: -6px;
}

.cantana-flow .cantana-checkout .ppcp-card-field-error:empty { display: none; }

.cantana-flow .cantana-checkout .ppcp-card-field-error {
    margin: 6px 0 0;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    color: #b3261e;
}

/* „Karte speichern“ (nur mit Kundenkonto): Checkbox in der Optik der Zustimmungen.
   Das Plugin blendet das Label per Inline-Style ein und aus, deshalb kein display hier. */
.cantana-flow .cantana-checkout #payment .ppcp-save-card-checkbox-container {
    position: relative;
    margin: 4px 0 0;
    padding-left: 34px;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    letter-spacing: 0;
    text-transform: none;
    color: var(--flow-text);
    cursor: pointer;
}

.cantana-flow .cantana-checkout #payment .ppcp-save-card-checkbox-container input[type="checkbox"] {
    position: absolute;
    top: 0;
    left: 0;
    min-width: 0;
    min-height: 0;
    margin: 0;
    font-size: inherit;
}

.cantana-flow .cantana-checkout .ppcp-save-card-checkbox-container span { font-size: inherit; }
.cantana-flow .cantana-checkout .ppcp-save-card-checkbox-container .ppcp-checkbox-mark { display: none; }

/* --- Kasse: Zustimmungen, Summe, Knopf ----------------------------------- */

.cantana-flow .cantana-checkout .flow-pay__submit {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin: 0;
    padding: 0;
}

.cantana-flow .flow-consent {
    padding: 4px 22px;
    background: var(--flow-surface-muted);
    border: 1px solid var(--flow-line);
    border-radius: var(--flow-radius-card);
}

.cantana-flow .flow-consent .woocommerce-terms-and-conditions-wrapper { margin: 0; }

.cantana-flow .flow-consent .form-row {
    float: none;
    width: auto;
    margin: 0;
    padding: 16px 0;
    border-top: 1px solid var(--flow-line);
}

.cantana-flow .flow-consent > .woocommerce-terms-and-conditions-wrapper:first-child .form-row:first-of-type,
.cantana-flow .flow-consent > .form-row:first-child { border-top: 0; }

.cantana-flow .flow-consent .woocommerce-invalid label { color: #b3261e; }
.cantana-flow .flow-consent .woocommerce-invalid input[type="checkbox"] { border-color: var(--flow-red); }

.cantana-flow .flow-pay__total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin: 6px 0 0;
}

.cantana-flow .flow-pay__total-label {
    font-size: 16px;
    font-weight: 700;
}

.cantana-flow .flow-pay__total-label small {
    margin-left: 6px;
    font-size: 13px;
    font-weight: 400;
    color: var(--flow-muted);
}

.cantana-flow .flow-pay__total-amount {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.02em;
    white-space: nowrap;
    color: var(--flow-green-deep);
}

.cantana-flow .flow-pay__total-amount .amount { color: inherit; }

/* WooCommerce tauscht beim Wechsel der Zahlungsart den Text des Knopfs (.text()),
   der Pfeil steht deshalb im CSS. */
.cantana-flow .cantana-checkout #payment #place_order {
    width: 100%;
    margin: 0;
    padding: 0 28px;
    font-size: 16px;
    letter-spacing: 0;
}

.cantana-flow .cantana-checkout #payment #place_order:hover { opacity: 1; }

.cantana-flow .cantana-checkout #payment #place_order::after {
    content: "";
    width: 18px;
    height: 18px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
}

.cantana-flow .cantana-checkout #payment #place_order:disabled,
.cantana-flow .cantana-checkout #payment #place_order.disabled {
    opacity: .6;
    cursor: not-allowed;
}

.cantana-flow .flow-pay__back {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--flow-green-deep);
    text-decoration: none;
}

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

/* --- Kasse: Karte „Ihre Bestellung“ -------------------------------------- */

/* Die Reihenfolge der Anfragekarte (.flow-summary { order: 2 }) gilt hier nicht. */
.cantana-flow .cantana-checkout__summary { order: 0; margin: 0; }

.cantana-flow .cantana-checkout .woocommerce-checkout-review-order { margin: 0; padding: 0; background: none; }

.cantana-flow .flow-review__items {
    margin: 0;
    padding: 0;
    list-style: none;
}

.cantana-flow .flow-review-item {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0;
    padding: 18px 28px;
    border-bottom: 1px solid var(--flow-line);
}

.cantana-flow .flow-review-item__thumb {
    position: relative;
    flex: none;
    width: 54px;
    aspect-ratio: 3 / 4;
    border-radius: 12px;
    background: var(--flow-surface-muted);
}

.cantana-flow .flow-review-item__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    border-radius: 12px;
}

.cantana-flow .flow-review-item__qty {
    position: absolute;
    top: -7px;
    right: -7px;
    display: grid;
    place-items: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border: 2px solid var(--flow-surface);
    border-radius: var(--flow-radius-pill);
    background: var(--flow-green-deep);
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    color: #fff;
}

.cantana-flow .flow-review-item__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.cantana-flow .flow-review-item__name {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
}

.cantana-flow .flow-review-item__meta {
    font-size: 13px;
    line-height: 1.4;
    color: var(--flow-muted);
}

.cantana-flow .flow-review-item__price {
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.cantana-flow .flow-review-item__unit {
    font-size: 12px;
    font-weight: 400;
    color: var(--flow-muted);
}

.cantana-flow .flow-review__rows { padding: 20px 28px; }

.cantana-flow .flow-review__totals { border-bottom: 0; }

/* Kopf für das Handy: Summe rechts, Pfeil im Kreis (Muster wie die Bestellseite). */
.cantana-flow .flow-review__toggle-total {
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.25;
}

.cantana-flow .flow-review__toggle-amount {
    font-size: 17px;
    font-weight: 700;
    color: var(--flow-green-deep);
}

.cantana-flow .flow-review__toggle-note {
    font-size: 12px;
    color: var(--flow-muted);
}

.cantana-flow .flow-review__chevron {
    flex: none;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--flow-green-soft);
    color: var(--flow-green-deep);
}

/* --- Tablet und Handy ---------------------------------------------------- */

@media (max-width: 991px) {
    /* Kasse: „Ihre Bestellung“ und der Hinweis zuerst, das Team entfällt. */
    .cantana-flow .cantana-checkout__aside { order: -1; gap: 16px; }
    .cantana-flow .cantana-checkout__aside .flow-team { display: none; }

    .cantana-flow .cantana-checkout__summary-head { display: none; }

    .cantana-flow .cantana-shop .flow-summary__toggle {
        min-height: 72px;
        padding: 16px 18px;
        background: var(--flow-surface);
    }

    .cantana-flow .cantana-checkout__summary:not(.is-collapsed) .flow-summary__toggle { border-bottom: 1px solid var(--flow-line); }

    .cantana-flow .flow-review-item { padding: 16px 18px; }
    .cantana-flow .flow-review__rows { padding: 16px 18px; }

    /* Warenkorb: Summe unter den Positionen, Team darunter. */
    .cantana-flow .cantana-cart__aside { gap: 16px; }
}

@media (max-width: 767px) {
    .cantana-flow .cantana-shop .flow-page-head { margin-bottom: 24px; }

    .cantana-flow .cantana-shop__before .woocommerce-form-login-toggle .woocommerce-info { border-radius: var(--flow-radius-card); }
    .cantana-flow .cantana-shop { margin-bottom: 40px; }

    .cantana-flow .flow-cart-item {
        gap: 14px;
        padding: 18px;
    }

    .cantana-flow .flow-cart-item__thumb {
        width: 60px;
        border-radius: 12px;
    }

    .cantana-flow .flow-cart-item__body { gap: 12px; }
    .cantana-flow .flow-cart-item__name { font-size: 15px; }
    .cantana-flow .flow-cart-item__total { font-size: 17px; }

    .cantana-flow .flow-cart-item__remove {
        flex: 1 1 100%;
        display: flex;
        justify-content: flex-end;
        margin: -4px 0 -10px;
    }

    .cantana-flow .flow-cart__footer {
        flex-direction: column;
        align-items: flex-start;
        padding: 18px;
    }

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

    .cantana-flow :is(.flow-cart-totals__rows, .flow-cart-totals__total) { padding-right: 18px; padding-left: 18px; }
    .cantana-flow .cantana-shop .flow-summary__row--grand > span:last-child { font-size: 26px; }

    .cantana-flow .cantana-checkout .flow-section { margin-bottom: 20px; }
    .cantana-flow .woocommerce-billing-fields .flow-fields--checkout { padding: 20px; }
    .cantana-flow .flow-fields.flow-fields--checkout { gap: 20px 12px; }
    .cantana-flow .cantana-checkout .flow-ship__toggle { padding: 16px 18px; }
    .cantana-flow .cantana-checkout .flow-ship .flow-collapse__panel { padding: 18px; }

    .cantana-flow .flow-choice.flow-pay-option { padding: 0 18px; }
    .cantana-flow .cantana-checkout #payment .flow-pay-option .payment_box { padding-left: 0; }

    .cantana-flow .flow-consent { padding: 2px 18px; }
    .cantana-flow .flow-pay__total-amount { font-size: 24px; }
}

@media (max-width: 575px) {
    /* Namen und Kontakt untereinander, PLZ und Stadt bleiben nebeneinander. */
    .cantana-flow .flow-fields--checkout :is(.form-row-first, .form-row-last, #billing_email_field, #billing_phone_field) { grid-column: 1 / -1; }
    .cantana-flow .flow-fields--checkout :is(#billing_postcode_field, #shipping_postcode_field) { grid-column: 1 / span 3; }
    .cantana-flow .flow-fields--checkout :is(#billing_city_field, #shipping_city_field) { grid-column: 4 / span 3; }
}
