/* NOVAChild — Checkout-Enhancements (Baustein B3, B1, B2) */

/* ============================================================
 * B3 — Floating Labels (Shopify-Feel)
 * NOVA nutzt bereits .d-flex.flex-column-reverse als Wrapper.
 * Wir ergaenzen ein Floating-Verhalten: Label startet als Placeholder-Attitude
 * im Input, wandert bei Focus/Befuellung nach oben als kleiner Hint.
 * ========================================================== */

.mmhp-floating {
  position: relative;
  padding-top: 0;
}

.mmhp-floating > label {
  position: absolute;
  left: 14px;
  top: 14px;
  padding: 0 4px;
  margin: 0;
  color: #6c757d;
  font-size: 14px;
  line-height: 1;
  pointer-events: none;
  transition: transform 130ms ease, font-size 130ms ease, color 130ms ease, background-color 130ms ease;
  max-width: calc(100% - 28px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  z-index: 2;
}

.mmhp-floating > input.form-control,
.mmhp-floating > input {
  height: 48px;
  padding: 18px 14px 6px 14px;
  font-size: 15px;
  line-height: 1.2;
}

/* Label floated bei Focus oder gefuelltem Feld */
.mmhp-floating > input:focus + label,
.mmhp-floating > input:not(:placeholder-shown) + label,
.mmhp-floating:focus-within > label {
  transform: translateY(-14px) scale(0.82);
  color: #495057;
  background-color: #fff;
  font-size: 14px;
}

/* Bei Fehler-State Label rot */
.mmhp-floating > input.is-invalid + label {
  color: #d72c0d;
}

/* Entfernt das NOVA-Standard-"pt-0" damit Label korrekt floaten kann */
.mmhp-floating > label.pt-0 {
  padding-top: 0 !important;
}

/* ============================================================
 * A2-CSS — Inline-Validation-Fehler
 * ========================================================== */

.mmhp-inline-error {
  color: #d72c0d;
  font-size: 12px;
  margin-top: 4px;
  line-height: 1.3;
}

input.is-invalid,
input.is-invalid:focus {
  border-color: #d72c0d !important;
  box-shadow: 0 0 0 0.15rem rgba(215, 44, 13, 0.15) !important;
}

/* ============================================================
 * B1 — Order-Summary Mobile Collapsed-Bar
 * Wird per JS aktiviert (siehe mobile-summary.js)
 * ========================================================== */

@media (max-width: 767.98px) {
  .mmhp-mobile-summary-bar {
    position: sticky;
    top: 0;
    z-index: 1020;
    background: #fff;
    border-bottom: 1px solid #dee2e6;
    padding: 10px 16px;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  }
  .mmhp-mobile-summary-bar.is-open .mmhp-mobile-summary-chevron {
    transform: rotate(180deg);
  }
  .mmhp-mobile-summary-chevron {
    transition: transform 200ms ease;
    display: inline-block;
  }
  .mmhp-mobile-summary-body {
    display: none;
    background: #f8f9fa;
    padding: 14px 16px;
    border-bottom: 1px solid #dee2e6;
  }
  .mmhp-mobile-summary-bar.is-open + .mmhp-mobile-summary-body {
    display: block;
  }
}

/* ============================================================
 * B2 — Sticky Pay-Button Mobile
 * ========================================================== */

@media (max-width: 767.98px) {
  .mmhp-sticky-cta {
    position: sticky;
    bottom: 0;
    z-index: 1020;
    background: #fff;
    padding: 12px 16px;
    border-top: 1px solid #dee2e6;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.08);
  }
  .mmhp-sticky-cta .btn {
    width: 100%;
    height: 48px;
    font-size: 16px;
  }
  /* Auf iOS: wenn Tastatur offen, verbergen wir die Sticky-CTA */
  .mmhp-keyboard-open .mmhp-sticky-cta {
    display: none;
  }
}

/* ============================================================
 * Allgemeine Checkout-Feinarbeit (leichter Shopify-Touch)
 * ========================================================== */

body.is-checkout .form-control {
  border-radius: 6px;
  border-color: #ced4da;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

body.is-checkout .form-control:focus {
  border-color: #2c6ecb;
  box-shadow: 0 0 0 0.15rem rgba(44, 110, 203, 0.15);
}

body.is-checkout .btn-primary,
body.is-checkout button[type="submit"].btn {
  border-radius: 6px;
  min-height: 44px;
  padding: 10px 20px;
  font-weight: 500;
}
