/**
 * Cookie modal – levý dolní roh, zavřít + minimalizace.
 * Načítá se pouze na HP (index.html).
 */

/* Kontejner modalu – fixed v levém dolním rohu, širší a nižší */
.remax-cookie-modal {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  z-index: 999999;
  font-family: "Open Sans", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #343434;
  overflow: hidden;
  transition: transform 0.25s ease, opacity 0.25s ease, max-height 0.3s ease;
}

.remax-cookie-modal.remax-cookie-modal--hidden {
  display: none;
}

/* Plovoucí widget pro opětovné otevření („Spravovat souhlas“) */
.remax-cookie-modal-toggle {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  border: none;
  background: #ffffff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  font-family: "Open Sans", sans-serif;
  font-size: 14px;
  color: #333;
  cursor: pointer;
  z-index: 999998;
}

.remax-cookie-modal-toggle--hidden {
  display: none;
}

/* Na stránce Zásady cookies se tlačítko „Spravovat souhlas“ nezobrazuje */
.remax-cookie-modal-toggle--hidden-on-policy-page {
  display: none !important;
}

.remax-cookie-modal-toggle:hover,
.remax-cookie-modal-toggle:focus {
  color: #1E73BE;
  background-color: rgba(30, 115, 190, 0.08);
  text-decoration: none;
  text-decoration-color: #1E73BE;
}

/* Hlavička – bílé pozadí, nadpis na střed */
.remax-cookie-modal__header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.25rem;
  background: #fff;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.remax-cookie-modal__title {
  flex: 1;
  font-weight: 700;
  font-size: 0.95rem;
  color: #1a1a1a;
  margin: 0;
  min-width: 0;
  line-height: 1.3;
  text-align: center;
}

.remax-cookie-modal__header-buttons {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.remax-cookie-modal__btn-close {
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  background: transparent;
  color: #666;
  cursor: pointer;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}

.remax-cookie-modal__btn-close:hover {
  background: #eee;
  color: #333;
}

.remax-cookie-modal__btn-close svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Tělo – scrollovatelné, nižší výška */
.remax-cookie-modal__body {
  padding: 0 1.25rem 0.75rem;
  max-height: 55vh;
  min-height: 0;
  overflow-y: auto;
  flex: 1 1 auto;
}

.remax-cookie-modal__intro {
  margin: 0 0 0.75rem;
  color: #555;
  font-size: 13px;
  line-height: 1.45;
}

.remax-cookie-modal__intro p {
  margin: 0 0 0.35em;
}

.remax-cookie-modal__intro p:last-child {
  margin-bottom: 0;
}

/* Detailní nastavení – skryté v úvodu, zobrazí se po kliknutí na "Nastavit cookies" */
.remax-cookie-modal__details {
  display: none;
  margin-top: 0.5rem;
}
.remax-cookie-modal--details-visible .remax-cookie-modal__details {
  display: block;
}

.remax-cookie-modal__collapse-link {
  display: block;
  margin-top: 0.5rem;
  padding: 0;
  border: none;
  background: none;
  background-color: transparent;
  color: #1E88E5;
  text-decoration: underline;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}
.remax-cookie-modal__collapse-link:hover,
.remax-cookie-modal__collapse-link:focus {
  color: #1565C0;
  background: none;
  background-color: transparent;
}

/* Kategorie – podle předlohy: světle šedé sekce s zaoblením */
.remax-cookie-modal__category {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  overflow: hidden;
  background: #ececec;
}

.remax-cookie-modal__category summary {
  list-style: none;
  padding: 0.6rem 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 13px;
  color: #222;
}

.remax-cookie-modal__category summary::-webkit-details-marker {
  display: none;
}

.remax-cookie-modal__category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}

.remax-cookie-modal__category-title {
  flex: 1;
  min-width: 0;
}

.remax-cookie-modal__category-badge {
  font-size: 11px;
  font-weight: 600;
  color: #2e7d32;
  white-space: nowrap;
}

.remax-cookie-modal__category-toggle {
  flex-shrink: 0;
  margin-left: auto;
}

/* Toggle přepínač – na konci řádku, dle předlohy (modrý pruh, bílý kroužek) */
.remax-cookie-modal__toggle {
  display: inline-block;
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  background: #ccc;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s;
  vertical-align: middle;
}

.remax-cookie-modal__toggle.remax-cookie-modal__toggle--on {
  background: #1E73BE;
}

.remax-cookie-modal__toggle::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  transition: transform 0.2s;
}

.remax-cookie-modal__toggle.remax-cookie-modal__toggle--on::after {
  transform: translateX(20px);
}

.remax-cookie-modal__toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.remax-cookie-modal__category-desc {
  padding: 0.5rem 1rem 0.6rem;
  font-size: 12px;
  color: #555;
  line-height: 1.4;
  border-top: 1px solid #ddd;
  margin-top: 0;
  background: #f5f5f5;
}

.remax-cookie-modal__category-desc p {
  margin: 0 0 0.5em;
}

.remax-cookie-modal__category-desc p:last-child {
  margin-bottom: 0;
}

/* Sekce 7.1 na stránce Zásady cookies – stejné styly, odsazení v dokumentu */
.remax-consent-inline {
  margin-top: 0.75rem;
  margin-bottom: 1rem;
}

/* Complianz často skrývá manage-consent container – naše sekce 7.1 musí být vidět */
.remax-cookie-js #remax-consent-nojavascript {
  display: none !important;
}
.remax-cookie-js #remax-consent-settings.remax-consent-inline {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  height: auto !important;
  max-height: none !important;
}

/* Tlačítka – každé na poloviční šířku boxu */
.remax-cookie-modal__actions {
  padding: 0.5rem 1.25rem 0.75rem;
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  flex-shrink: 0;
}

.remax-cookie-modal__actions .remax-cookie-modal__btn {
  flex: 1 1 50%;
  min-width: 0;
  box-sizing: border-box;
}

.remax-cookie-modal__btn {
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.2s, color 0.2s;
  font-family: inherit;
}

.remax-cookie-modal__btn--primary {
  background: #1E73BE;
  color: #fff;
}

.remax-cookie-modal__btn--primary:hover {
  background: #185a9a;
}

.remax-cookie-modal__btn--secondary {
  background: #fff !important;
  background-color: #fff !important;
  color: #333 !important;
  border: 1px solid #ccc;
}

.remax-cookie-modal__btn--secondary:hover,
.remax-cookie-modal__btn--secondary:focus,
.remax-cookie-modal__btn--secondary:active {
  background: #f5f5f5 !important;
  background-color: #f5f5f5 !important;
  border-color: #999;
  color: #333 !important;
}

/* Odkazy – na střed widgetu */
.remax-cookie-modal__links {
  padding: 0 1.25rem 0.75rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 1rem;
  flex-shrink: 0;
}

.remax-cookie-modal__link {
  color: #1E88E5;
  text-decoration: underline;
  font-size: 13px;
}

.remax-cookie-modal__link:hover {
  color: #1565C0;
}

/* Mobil – cookie widget celý na stránku, bez přetečení */
@media (max-width: 768px) {
  .remax-cookie-modal {
    left: 12px !important;
    right: 12px !important;
    bottom: 12px !important;
    width: auto !important;
    max-width: none !important;
    max-height: 82vh !important;
    border-radius: 10px;
  }
  .remax-cookie-modal__header {
    padding: 0.7rem 1rem !important;
  }
  .remax-cookie-modal__title {
    font-size: 0.9rem !important;
  }
  .remax-cookie-modal__body {
    max-height: 45vh !important;
    padding: 0 1rem 0.6rem !important;
  }
  .remax-cookie-modal__actions {
    padding: 0.5rem 1rem 0.7rem !important;
    flex-wrap: wrap !important;
  }
  .remax-cookie-modal__actions .remax-cookie-modal__btn {
    flex: 1 1 100% !important;
    min-width: 0 !important;
  }
  .remax-cookie-modal-toggle {
    left: 12px !important;
    bottom: 12px !important;
    max-width: calc(100vw - 24px);
    font-size: 13px !important;
    padding: 0.4rem 0.9rem !important;
  }
}
