/* ==========================================================================
   Hubtechnik – Angebot anfordern  |  Sticky Banner + Popup
   ========================================================================== */

/* --------------------------------------------------------------------------
   Reset für Plugin-Elemente
   -------------------------------------------------------------------------- */
#huba-sticky-banner *,
#huba-overlay * {
  box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   Sticky Banner
   -------------------------------------------------------------------------- */
.huba-sticky-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9990;
  background: #ffffff;
  border-top: 3px solid #d80000;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.14);
  padding: 12px 24px;
  transform: translateY(110%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              opacity   0.35s ease;
}

.huba-sticky-banner.huba-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.huba-banner-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.huba-banner-product {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

#huba-banner-img {
  width: 46px;
  height: 46px;
  object-fit: cover;
  border-radius: 7px;
  flex-shrink: 0;
  background: #f2f2f2;
}

#huba-banner-title {
  font-size: 15px;
  font-weight: 700;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 380px;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.huba-btn-primary,
#huba-sticky-banner .huba-btn-primary,
#huba-overlay .huba-btn-primary {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: #d80000 !important;
  background-color: #d80000 !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 8px !important;
  padding: 12px 26px !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  line-height: 1 !important;
  letter-spacing: 0.2px !important;
  box-shadow: none !important;
  text-decoration: none !important;
  transition: background 0.2s, transform 0.15s;
}

.huba-btn-primary:hover,
#huba-sticky-banner .huba-btn-primary:hover,
#huba-overlay .huba-btn-primary:hover {
  background: #b80000 !important;
  background-color: #b80000 !important;
  color: #ffffff !important;
  transform: translateY(-1px);
}

.huba-btn-primary:active,
#huba-sticky-banner .huba-btn-primary:active,
#huba-overlay .huba-btn-primary:active {
  transform: translateY(0);
}

.huba-btn-primary:disabled,
#huba-overlay .huba-btn-primary:disabled {
  background: #ccc !important;
  background-color: #ccc !important;
  cursor: not-allowed !important;
  transform: none !important;
}

.huba-btn-full {
  width: 100%;
  padding: 14px;
  font-size: 15px;
  margin-top: 6px;
}

/* --------------------------------------------------------------------------
   Overlay
   -------------------------------------------------------------------------- */
.huba-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

/* --------------------------------------------------------------------------
   Popup
   -------------------------------------------------------------------------- */
.huba-popup {
  background: #ffffff;
  border-radius: 14px;
  width: 100%;
  max-width: 510px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
  animation: hubaPopupIn 0.25s cubic-bezier(0.34, 1.3, 0.64, 1);
}

@keyframes hubaPopupIn {
  from { transform: scale(0.93) translateY(16px); opacity: 0; }
  to   { transform: scale(1)    translateY(0);    opacity: 1; }
}

.huba-popup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px 16px;
  border-bottom: 1px solid #f0f0f0;
  position: sticky;
  top: 0;
  background: #ffffff;
  z-index: 5;
}

.huba-popup-head h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
  color: #1a1a1a;
}

.huba-close {
  background: none;
  border: none;
  cursor: pointer;
  color: #888;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.18s, color 0.18s;
  padding: 0;
  flex-shrink: 0;
}

.huba-close svg {
  width: 18px;
  height: 18px;
}

.huba-close:hover {
  background: #f2f2f2;
  color: #1a1a1a;
}

.huba-popup-body {
  padding: 20px 22px 24px;
}

/* --------------------------------------------------------------------------
   Formular-Felder
   -------------------------------------------------------------------------- */
.huba-field {
  margin-bottom: 15px;
}

.huba-field label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #444;
  margin-bottom: 6px;
}

.huba-field label .req {
  color: #d80000;
  margin-left: 2px;
}

.huba-field label .opt {
  font-weight: 400;
  color: #999;
  font-size: 12px;
  margin-left: 2px;
}

.huba-field input[type="text"],
.huba-field input[type="email"],
.huba-field input[type="tel"],
.huba-field textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid #d8d8d8;
  border-radius: 8px;
  font-size: 14px;
  color: #1a1a1a;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
  line-height: 1.5;
}

.huba-field input:focus,
.huba-field textarea:focus {
  outline: none;
  border-color: #d80000;
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.12);
}

.huba-field textarea {
  resize: vertical;
  min-height: 88px;
}

.huba-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* --------------------------------------------------------------------------
   Produkt-Selector
   -------------------------------------------------------------------------- */
.huba-product-selector {
  position: relative;
}

.huba-sel-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1.5px solid #d8d8d8;
  border-radius: 10px;
  cursor: pointer;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
  user-select: none;
}

.huba-sel-display:hover,
.huba-sel-display.open {
  border-color: #d80000;
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.1);
}

.huba-sel-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.huba-sel-inner img {
  width: 38px;
  height: 38px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
  background: #f2f2f2;
}

.huba-sel-inner span {
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.huba-arrow {
  width: 18px;
  height: 18px;
  color: #777;
  flex-shrink: 0;
  transition: transform 0.22s;
}

.huba-sel-display.open .huba-arrow {
  transform: rotate(180deg);
}

/* Dropdown */
.huba-dropdown {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1.5px solid #d8d8d8;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.13);
  z-index: 20;
  overflow: hidden;
}

.huba-search-row {
  padding: 10px 10px 8px;
  border-bottom: 1px solid #f0f0f0;
}

.huba-search-row input {
  width: 100%;
  padding: 8px 11px;
  border: 1.5px solid #d8d8d8;
  border-radius: 7px;
  font-size: 13px;
  font-family: inherit;
  color: #1a1a1a;
  transition: border-color 0.2s;
}

.huba-search-row input:focus {
  outline: none;
  border-color: #d80000;
}

.huba-product-list {
  max-height: 210px;
  overflow-y: auto;
}

.huba-product-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  cursor: pointer;
  transition: background 0.14s;
}

.huba-product-item:hover {
  background: #fafafa;
}

.huba-product-item.huba-selected {
  background: #fff5f4;
}

.huba-product-item img {
  width: 34px;
  height: 34px;
  object-fit: cover;
  border-radius: 5px;
  flex-shrink: 0;
  background: #f2f2f2;
}

.huba-product-item span {
  font-size: 13px;
  color: #1a1a1a;
  font-weight: 500;
  line-height: 1.3;
}

.huba-loading {
  padding: 18px;
  text-align: center;
  color: #aaa;
  font-size: 13px;
  margin: 0;
}

/* --------------------------------------------------------------------------
   Spam-Honeypot (komplett versteckt)
   -------------------------------------------------------------------------- */
.huba-hp {
  position: absolute;
  left: -9999px;
  top:  -9999px;
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
  height: 0;
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   Rückmeldung nach Absenden
   -------------------------------------------------------------------------- */
.huba-msg {
  padding: 12px 15px;
  border-radius: 8px;
  margin-bottom: 14px;
  font-size: 14px;
  line-height: 1.5;
}

.huba-msg.huba-success {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.huba-msg.huba-error {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

/* --------------------------------------------------------------------------
   Mobile
   -------------------------------------------------------------------------- */
@media (max-width: 600px) {
  /* Banner */
  .huba-banner-inner {
    flex-direction: column;
    align-items: stretch;
  }

  #huba-banner-title {
    max-width: 100%;
  }

  /* Popup – fast vollbild, kein Überscrollen */
  .huba-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .huba-popup {
    max-height: 92vh;
    border-radius: 16px 16px 0 0;
  }

  /* Kompakterer Header */
  .huba-popup-head {
    padding: 13px 16px 11px;
  }

  .huba-popup-head h2 {
    font-size: 16px;
  }

  /* Weniger Innenabstand im Body */
  .huba-popup-body {
    padding: 12px 14px 16px;
  }

  /* Felder enger */
  .huba-field {
    margin-bottom: 9px;
  }

  .huba-field label {
    font-size: 11px;
    margin-bottom: 3px;
  }

  .huba-field input[type="text"],
  .huba-field input[type="email"],
  .huba-field input[type="tel"],
  .huba-field textarea {
    padding: 8px 10px;
    font-size: 14px;
    border-radius: 6px;
  }

  /* Vorname / Nachname bleiben nebeneinander */
  .huba-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  /* Produkt-Selector kompakter */
  .huba-sel-display {
    padding: 7px 10px;
  }

  .huba-sel-inner img {
    width: 30px;
    height: 30px;
  }

  .huba-sel-inner span {
    font-size: 13px;
  }

  /* Textarea kleiner */
  .huba-field textarea {
    min-height: 60px;
  }

  /* Button */
  .huba-btn-full {
    padding: 12px !important;
    font-size: 14px !important;
    margin-top: 4px;
  }
}
