/* imovest consent banner + modal styles */
/* EDPB 03/2022: buttons must have equal visual weight */

#imov-consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 99999;
  background: #fff;
  border-top: 3px solid #e3323a;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.5;
}

.imov-consent-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px 20px;
}

.imov-consent-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 6px 0;
  color: #222;
}

.imov-consent-text {
  margin: 0 0 12px 0;
  color: #444;
  font-size: 13px;
}

/* Three buttons — equal visual weight per EDPB */
.imov-consent-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.imov-btn {
  flex: 1 1 100px;
  padding: 9px 16px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid #e3323a;
  transition: background 0.15s, color 0.15s;
  text-align: center;
  line-height: 1.2;
  white-space: nowrap;
}

.imov-btn-primary {
  background: #e3323a;
  color: #fff;
}

.imov-btn-primary:hover,
.imov-btn-primary:focus {
  background: #c02028;
  color: #fff;
  outline: 2px solid #222;
  outline-offset: 2px;
}

.imov-btn-secondary {
  background: #fff;
  color: #e3323a;
}

.imov-btn-secondary:hover,
.imov-btn-secondary:focus {
  background: #fdf0f0;
  outline: 2px solid #e3323a;
  outline-offset: 2px;
}

/* Modal overlay */
#imov-consent-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.imov-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
}

.imov-modal-box {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 8px;
  max-width: 580px;
  width: 94%;
  max-height: 88vh;
  overflow-y: auto;
  padding: 24px 24px 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.25);
}

.imov-modal-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 8px;
  color: #222;
}

.imov-modal-intro {
  font-size: 13px;
  color: #555;
  margin: 0 0 16px;
}

/* Category rows */
.imov-category {
  border-top: 1px solid #eee;
  padding: 12px 0;
}

.imov-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.imov-category-info {
  flex: 1;
  min-width: 0;
}

.imov-category-info strong {
  font-size: 14px;
  color: #222;
  display: block;
  margin-bottom: 3px;
}

.imov-category-info p {
  font-size: 12px;
  color: #666;
  margin: 0;
  line-height: 1.4;
}

.imov-always-on {
  font-size: 11px;
  color: #888;
  white-space: nowrap;
  font-style: italic;
  flex-shrink: 0;
}

/* Toggle switch */
.imov-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.imov-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.imov-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #ccc;
  border-radius: 24px;
  transition: background 0.2s;
}

.imov-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}

.imov-toggle input:checked + .imov-slider {
  background: #e3323a;
}

.imov-toggle input:checked + .imov-slider::before {
  transform: translateX(20px);
}

.imov-toggle input:focus + .imov-slider {
  outline: 2px solid #e3323a;
  outline-offset: 2px;
}

/* Modal footer buttons */
.imov-modal-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  border-top: 1px solid #eee;
  padding-top: 14px;
}

/* Footer modify-prefs link */
#imov-modify-prefs {
  color: inherit;
  font-size: 13px;
  text-decoration: underline;
  opacity: 0.8;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

#imov-modify-prefs:hover {
  opacity: 1;
}

/* Footer cookie preferences button — desktop footer bar */
.imov-modify-prefs-footer {
  color: inherit;
  font-size: inherit;
  text-decoration: underline;
  opacity: 0.8;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  vertical-align: baseline;
}

.imov-modify-prefs-footer:hover,
.imov-modify-prefs-footer:focus {
  opacity: 1;
  outline: none;
}

/* ---- Floating cookie preferences button (mobile only) ---- */
/* Visible on all pages — GDPR Art. 7(3): withdrawal as easy as giving consent */
#imov-cookie-fab {
  display: none; /* shown only in mobile media query below */
  position: fixed;
  bottom: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #63616c;
  color: #fff;
  border: 2px solid rgba(255,255,255,0.25);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  z-index: 200;
  box-shadow: 0 2px 10px rgba(0,0,0,0.35);
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.2s;
}

#imov-cookie-fab:hover,
#imov-cookie-fab:focus {
  background: #44424b;
  outline: 2px solid #e3323a;
  outline-offset: 2px;
}

/* Cookie table responsive wrapper (used in politica-cookies.php) */
.imov-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* -------- Mobile -------- */
/* Show FAB on mobile/tablet (matches app.css breakpoint for hidden footer) */
@media screen and (max-width: 64em) {
  #imov-cookie-fab {
    display: flex;
    bottom: 68px; /* contact bar is always present on mobile — push FAB above it */
  }
  /* Hide when consent banner is visible — spacer pushes content, FAB would overlap */
  #imov-consent-banner ~ * #imov-cookie-fab,
  #imov-consent-banner:not([style*="display: none"]) + #imov-cookie-fab {
    display: none;
  }
}

@media (max-width: 640px) {
  .imov-consent-inner {
    padding: 12px 14px;
  }
  .imov-consent-title {
    font-size: 14px;
  }
  .imov-consent-text {
    font-size: 12px;
    margin-bottom: 10px;
  }
  .imov-consent-buttons {
    flex-direction: column;
    gap: 6px;
  }
  .imov-btn {
    flex: none;
    width: 100%;
    padding: 10px 14px;
  }
  .imov-modal-footer {
    flex-direction: column;
  }
  .imov-modal-box {
    padding: 16px 14px 12px;
    max-height: 92vh;
  }
}
