/* ==========================================================================
   BRILED - Modal "Dotaz na prodejce" / "Zeptat se odborníka" (V1)
   Liquid-glass inspirovaný overlay (blur + translucence + koncentrické
   zaoblení) nad nativním Shoptet formulářem, brand paleta #1D1D1B/#D61118.
   ========================================================================== */

.aem-overlay {
  position: fixed;
  inset: 0;
  z-index: 100050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(29, 29, 27, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .24s ease, visibility 0s linear .24s;
}

.aem-overlay--show {
  opacity: 1;
  visibility: visible;
  transition: opacity .24s ease, visibility 0s linear 0s;
}

html.aem-lock-scroll,
html.aem-lock-scroll body {
  overflow: hidden;
}

.aem-card {
  position: relative;
  width: 100%;
  max-width: 460px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(29, 29, 27, 0.28), 0 2px 8px rgba(29, 29, 27, 0.12);
  padding: 28px 28px 24px;
  font-family: 'DM Sans', Arial, sans-serif;
  color: #1D1D1B;
  outline: none;
  transform: scale(.96) translateY(8px);
  transition: transform .28s cubic-bezier(.22, 1, .36, 1);
}

.aem-overlay--show .aem-card {
  transform: scale(1) translateY(0);
}

.aem-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: rgba(29, 29, 27, 0.06);
  border-radius: 50%;
  color: #1D1D1B;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, transform .1s ease;
}
.aem-close:hover { background: rgba(214, 17, 24, 0.12); color: #D61118; }
.aem-close:active { transform: scale(.92); }

.aem-head { margin: 0 44px 18px 0; }

.aem-title {
  font-family: 'Bebas Neue', Impact, Arial, sans-serif;
  font-size: 30px;
  letter-spacing: .02em;
  line-height: 1.1;
  margin: 0 0 6px;
  color: #1D1D1B;
}

.aem-subtitle {
  font-size: 14px;
  color: #6b6b69;
  margin: 0;
}

.aem-body { min-height: 60px; }

.aem-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 0;
  font-size: 14px;
  color: #6b6b69;
}

.aem-spinner {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 2px solid rgba(29, 29, 27, 0.15);
  border-top-color: #D61118;
  animation: aemSpin .7s linear infinite;
}

@keyframes aemSpin {
  to { transform: rotate(360deg); }
}

/* --- Nativní formulář (fetchnutý z :dotaz/), restylovaný --- */
.aem-form fieldset { border: 0; margin: 0; padding: 0; }

.aem-form .form-legend {
  font-size: 12px;
  color: #6b6b69;
  margin: 0 0 14px;
}

.aem-form .form-group { margin: 0 0 16px; }

.aem-form label {
  display: block;
  font-family: 'DM Sans', Arial, sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #1D1D1B;
  margin: 0 0 6px;
}

/* required-asterisk--before (u legendy "Povinná pole") má vlastní ::before
   z nativního Shoptet main.css - u té varianty nepřidávat druhou hvězdičku */
.aem-form .required-asterisk:not(.required-asterisk--before)::after { content: " *"; color: #D61118; }

.aem-form .form-control {
  width: 100%;
  box-sizing: border-box;
  min-height: 44px;
  padding: 10px 14px;
  border: 1.5px solid #e2e2e0;
  border-radius: 10px;
  background: #fff;
  font-family: 'DM Sans', Arial, sans-serif;
  font-size: 15px;
  color: #1D1D1B;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.aem-form .form-control:focus {
  outline: none;
  border-color: #D61118;
  box-shadow: 0 0 0 3px rgba(214, 17, 24, 0.14);
}

.aem-form textarea.form-control { min-height: 110px; resize: vertical; }

.aem-form .no-display { display: none !important; }

.aem-form .consents .label {
  font-size: 12.5px;
  color: #6b6b69;
  margin: 0;
}
.aem-form .consents a { color: #D61118; }

.aem-form .submit-wrapper { margin: 20px 0 0; }

.aem-form button[type="submit"],
.aem-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 12px 20px;
  border: 0;
  border-radius: 10px;
  background: #D61118;
  color: #fff !important;
  font-family: 'DM Sans', Arial, sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .01em;
  cursor: pointer;
  transition: background-color .15s ease, transform .1s ease;
}
.aem-form button[type="submit"]:hover,
.aem-btn:hover { background: #b60d13; }
.aem-form button[type="submit"]:active,
.aem-btn:active { transform: scale(.98); }
.aem-form button[type="submit"]:disabled { opacity: .65; cursor: default; }

.aem-btn--loading { position: relative; color: transparent !important; }
.aem-btn--loading::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  animation: aemSpin .7s linear infinite;
}

.aem-form-error {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(214, 17, 24, 0.08);
  color: #a30d13;
  font-size: 13px;
}
.aem-form-error a { color: inherit; text-decoration: underline; }

/* --- Success / error stav --- */
.aem-success { text-align: center; padding: 12px 0 4px; }

.aem-success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #1aa053;
  color: #fff;
  font-size: 24px;
  margin-bottom: 14px;
}

.aem-success-title {
  font-family: 'Bebas Neue', Impact, Arial, sans-serif;
  font-size: 24px;
  margin: 0 0 8px;
  color: #1D1D1B;
}

.aem-success-text {
  font-size: 14px;
  color: #6b6b69;
  margin: 0 0 20px;
}

.aem-success--error .aem-success-title { color: #a30d13; }

.aem-success .aem-btn { max-width: 220px; margin: 0 auto; }

/* --- Redukovaný pohyb --- */
@media (prefers-reduced-motion: reduce) {
  .aem-overlay,
  .aem-card,
  .aem-spinner,
  .aem-btn--loading::after {
    transition: none !important;
    animation: none !important;
  }
}

/* --- Mobil: bottom sheet --- */
@media (max-width: 767px) {
  .aem-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .aem-card {
    max-width: none;
    width: 100%;
    max-height: 88vh;
    border-radius: 20px 20px 0 0;
    padding: 24px 20px 20px;
    transform: translateY(100%);
  }
  .aem-overlay--show .aem-card {
    transform: translateY(0);
  }
  .aem-title { font-size: 26px; }
}
