/**
 * Smart Residence — Footer middle (despre noi + hartă + contact)
 * Design premium, responsive pe orice ecran. Se încarcă global (header.twig).
 * Toate regulile sunt scopate sub #footer .footer_middle ca să nu „scape".
 */

:root {
  --sr-footer-accent: var(--sr-band-cyan, #28c7d0);
  --sr-footer-gradient: var(--sr-band-gradient-h, linear-gradient(90deg, #4fffb0 0%, #28c7d0 52%, #3ee6c8 100%));
  --sr-footer-ink: var(--global-palette4, #1f2937);
  --sr-footer-muted: color-mix(in srgb, var(--global-palette4, #1f2937) 62%, transparent);
  --sr-footer-card: #ffffff;
  --sr-footer-border: var(--border-color, #e3e6ea);
  --sr-footer-shadow: 0 10px 30px rgba(17, 24, 39, 0.10);
  --sr-footer-shadow-hover: 0 16px 40px rgba(17, 24, 39, 0.16);
  --sr-footer-radius: 16px;
}

/* ---- Secțiune (fără a atinge padding-ul .container — 50px ca restul site) */
#footer .footer_middle {
  border-top: 1px solid var(--sr-footer-border);
  --sr-fm-h5: 20px;
  --sr-fm-text: 14px;
  --sr-fm-lh: 1.5;
  --sr-fm-phone: 18px;
  --sr-fm-email: 16px;
  --sr-fm-map: 14px;
  --sr-fm-city: 14px;
  --sr-fm-street: 14px;
  --sr-fm-hours: 14px;
}

/* Tipografie — ca test (h5 20px/500), titluri clar deasupra telefonului */
#footer .footer_middle h5 {
  margin-top: 0 !important;
  margin-bottom: 18px !important;
  font-family: var(--global-heading-font-family, Roboto) !important;
  font-size: var(--sr-fm-h5) !important;
  font-weight: 500 !important;
  line-height: 1.2 !important;
  color: #111827 !important;
  letter-spacing: 0;
  min-height: 0 !important;
  display: block !important;
  align-items: unset !important;
}

#footer .footer_middle h5::after {
  content: "";
  display: block;
  width: 32px;
  height: 3px;
  margin-top: 10px;
  border-radius: 2px;
  background: var(--sr-footer-gradient);
}

#footer .footer_middle p,
#footer .footer_middle li,
#footer .footer_middle a:not(.mobile_togglemenu),
#footer .footer_middle .column a:not(.mobile_togglemenu) {
  font-size: var(--sr-fm-text) !important;
  line-height: var(--sr-fm-lh) !important;
  color: #111827 !important;
}

#footer .footer_middle .column a:not(.mobile_togglemenu) {
  text-decoration: none !important;
  transition: color 0.2s ease;
}

#footer .footer_middle .column a:not(.mobile_togglemenu):hover {
  color: #374151 !important;
  text-decoration: none !important;
}

#footer .footer_middle .column .footer-toggle {
  margin-bottom: 0;
}

#footer .footer_middle .column li + li {
  margin-top: 10px;
}

/* ---- Grilă coloana stângă (despre + contact) ---------------------------- */
#footer .footer_middle .middle-content {
  gap: 36px 44px;
  align-items: start;
}

/* ---- Despre noi : adresă ------------------------------------------------- */
#footer .footer_middle .middle-content .footer_aboutus_cms__info {
  margin-bottom: 12px;
}

#footer .footer_middle .middle-content .footer_aboutus_cms__city {
  position: relative;
  margin: 0 0 5px;
  padding-left: 26px;
  font-size: var(--sr-fm-city) !important;
  font-weight: 410;
  line-height: 1.3;
  color: #111827;
  letter-spacing: 0.01em;
}

/* Pin de locație — inline SVG, fără request suplimentar */
#footer .footer_middle .middle-content .footer_aboutus_cms__city::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  background: #111827;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5A2.5 2.5 0 1 1 12 6.5a2.5 2.5 0 0 1 0 5z'/%3E%3C/svg%3E") no-repeat center / contain;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5A2.5 2.5 0 1 1 12 6.5a2.5 2.5 0 0 1 0 5z'/%3E%3C/svg%3E") no-repeat center / contain;
}

#footer .footer_middle .middle-content .footer_aboutus_cms__street {
  margin: 0;
  padding-left: 26px;
  font-size: var(--sr-fm-street) !important;
  line-height: 1.5;
  color: #111827;
  opacity: 1 !important;
}

/* ---- Despre noi : card hartă Google ------------------------------------- */
#footer .footer_middle .middle-content .footer_aboutus_cms__map-wrap {
  position: relative;
  width: 100%;
  max-width: 280px;
  border: 1px solid var(--sr-footer-border);
  border-radius: var(--sr-footer-radius);
  overflow: hidden;
  background: var(--sr-footer-card);
  box-shadow: var(--sr-footer-shadow);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

#footer .footer_middle .middle-content .footer_aboutus_cms__map-wrap:hover {
  transform: translateY(-3px);
  box-shadow: var(--sr-footer-shadow-hover);
}

#footer .footer_middle .middle-content .footer_aboutus_cms__map {
  display: block;
  width: 100%;
  height: 118px;
  aspect-ratio: auto;
  border: 0;
  margin: 0;
  filter: saturate(1.02);
}

/* Bara de acțiune sub hartă — rămâne în flux (harta de deasupra e clicabilă) */
#footer .footer_middle .middle-content .footer_aboutus_cms__map-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  border-top: 1px solid var(--sr-footer-border);
  background: var(--sr-footer-card);
  font-size: var(--sr-fm-map) !important;
  font-weight: 410;
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--sr-footer-ink) !important;
  text-decoration: none !important;
  transition: background 0.25s ease, color 0.25s ease;
}

#footer .footer_middle .middle-content .footer_aboutus_cms__map-link::after {
  content: "";
  width: 16px;
  height: 16px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M14 3v2h3.59l-9.3 9.29 1.42 1.42L19 6.41V10h2V3z'/%3E%3Cpath d='M19 19H5V5h7V3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7h-2z'/%3E%3C/svg%3E") no-repeat center / contain;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M14 3v2h3.59l-9.3 9.29 1.42 1.42L19 6.41V10h2V3z'/%3E%3Cpath d='M19 19H5V5h7V3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7h-2z'/%3E%3C/svg%3E") no-repeat center / contain;
  transition: transform 0.25s ease;
}

#footer .footer_middle .middle-content .footer_aboutus_cms__map-link:hover {
  background: var(--global-palette1, #111827);
  color: #ffffff !important;
  text-decoration: none !important;
}

#footer .footer_middle .middle-content .footer_aboutus_cms__map-link:hover::after {
  transform: translate(2px, -2px);
}

/* ---- Despre noi : rețele sociale ---------------------------------------- */
/* Reactivează rândul social (ascuns global în sr-brand.css + sr-mobile.css). */
#footer .footer_middle .middle-content .footer_aboutus_cms .footer-social {
  display: flex !important;
  margin-top: 24px;
  gap: 12px;
  flex-wrap: wrap;
}

#footer .footer_middle .middle-content .footer_aboutus_cms .footer-social li {
  margin: 0;
  padding: 0;
}

#footer .footer_middle .middle-content .footer_aboutus_cms .footer-social li + li {
  padding-left: 0;
}

#footer .footer_middle .middle-content .footer_aboutus_cms .footer-social li a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--sr-footer-card);
  border: 1px solid var(--sr-footer-border);
  box-shadow: 0 2px 6px rgba(17, 24, 39, 0.05);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

#footer .footer_middle .middle-content .footer_aboutus_cms .footer-social li a img {
  width: 18px;
  height: 18px;
  margin: 0;
  transition: transform 0.25s ease;
}

#footer .footer_middle .middle-content .footer_aboutus_cms .footer-social li a:hover {
  transform: translateY(-3px);
  border-color: transparent;
  background: var(--sr-footer-gradient);
  box-shadow: 0 10px 22px rgba(40, 199, 208, 0.35);
}

#footer .footer_middle .middle-content .footer_aboutus_cms .footer-social li a:hover img {
  transform: scale(1.08);
}

/* ---- Contact ------------------------------------------------------------ */
/* Telefon + e-mail mereu vizibile (fără accordion „+" ca la coloanele de
   linkuri). custom.js adaugă un toggle pe orice .column h5 pe mobil — îl
   neutralizăm doar pentru blocul de contact. */
#footer .footer_middle .middle-content .footer_contact .footer-toggle {
  display: block !important;
}
#footer .footer_middle .middle-content .footer_contact h5 .mobile_togglemenu {
  display: none !important;
}
#footer .footer_middle .middle-content .footer_contact h5.toggle {
  cursor: default;
}

#footer .footer_middle .middle-content .footer_contact h5 {
  margin-bottom: 22px;
}

#footer .footer_middle .middle-content .footer_contact .contact {
  margin-bottom: 16px;
}

/* Iconițe contact ca „badge" rotunjit */
#footer .footer_middle .middle-content .footer_contact .contact > img,
#footer .footer_middle .middle-content .footer_contact .footer-toggle > .d-flex > img {
  width: 40px;
  height: 40px;
  padding: 9px;
  flex: 0 0 auto;
  border-radius: 12px;
  background: #f3f4f6;
  border: 1px solid var(--sr-footer-border);
  box-sizing: border-box;
  object-fit: contain;
}

#footer .footer_middle .middle-content .footer_contact .contact-phone-text,
#footer .footer_middle .middle-content .footer_contact .contact-phone-text a {
  font-size: var(--sr-fm-phone) !important;
  font-weight: 500 !important;
  color: #111827;
  transition: color 0.2s ease;
}

#footer .footer_middle .middle-content .footer_contact .contact-phone-text a:hover {
  color: #374151;
  text-decoration: none;
}

#footer .footer_middle .middle-content .footer_contact .footer_contact__hours {
  margin: 8px 0 0;
  padding-left: 56px;
  font-size: var(--sr-fm-hours) !important;
  color: #111827;
}

#footer .footer_middle .middle-content .footer_contact hr {
  margin: 18px 0;
  border: 0;
  border-top: 1px solid var(--sr-footer-border);
  opacity: 1;
}

/* Rândul de email — distanțare clară față de program (fără linie despărțitoare) */
#footer .footer_middle .middle-content .footer_contact .footer_contact__email {
  margin-top: 20px;
}

#footer .footer_middle .middle-content .footer_contact .contact-email-text a {
  font-size: var(--sr-fm-phone) !important;
  font-weight: 500;
  color: #111827;
  overflow-wrap: break-word;
  transition: color 0.2s ease;
}

#footer .footer_middle .middle-content .footer_contact .contact-email-text a:hover {
  color: #374151;
  text-decoration: none;
}

/* ======================================================================== */
/*  DESKTOP — 5 coloane: locație, contact, asistență, cont, legal         */
/* ======================================================================== */
@media (min-width: 992px) {
  /* Desfacem wrapper-ul Bootstrap ca despre + contact să fie coloane egale */
  #footer .footer_middle > .container > .row > .col-sm-6.middle-content {
    display: contents !important;
  }

  #footer .footer_middle > .container > .row {
    display: grid !important;
    grid-template-columns:
      minmax(0, 1.22fr)
      minmax(0, 0.9fr)
      minmax(0, 0.68fr)
      minmax(0, 0.62fr)
      minmax(0, 0.82fr) !important;
    column-gap: clamp(18px, 2.2vw, 36px) !important;
    row-gap: 20px !important;
    align-items: start !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  #footer .footer_middle > .container > .row > .position-footer-middle,
  #footer .footer_middle > .container > .row > .footer-column {
    grid-column: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    align-self: start !important;
    height: auto !important;
  }

  #footer .footer_middle .middle-content .footer_aboutus_cms,
  #footer .footer_middle .middle-content .footer_contact {
    align-self: start !important;
    height: auto !important;
    min-height: 0 !important;
  }

  /* Separator subtil între despre noi și contact */
  #footer .footer_middle .middle-content .footer_contact {
    padding: 0 0 0 clamp(20px, 2.5vw, 32px) !important;
    border-left: 1px solid var(--sr-footer-border) !important;
  }

  #footer .footer_middle .middle-content .footer_contact::after {
    display: none !important;
  }

  #footer .footer_middle .footer_aboutus_cms__map-wrap {
    max-width: 280px;
  }

  #footer .footer_middle h5 {
    min-height: 0 !important;
    display: block !important;
    align-items: unset !important;
  }
}

/* Footer middle — desktop: linkuri 19px, telefon/program +3px față de 16/13/14 */
@media (min-width: 992px) {
  #footer .footer_middle {
    --sr-fm-text: 14px;
    --sr-fm-lh: 1.5;
    --sr-fm-city: 14px;
    --sr-fm-street: 14px;
    --sr-fm-hours: 14px;
    --sr-fm-map: 14px;
    --sr-fm-phone: 16px;
  }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
  #footer .footer_middle {
    --sr-fm-h5: 20px;
  }
}

@media (min-width: 1200px) {
  #footer .footer_middle {
    --sr-fm-h5: 20px;
  }
}

@media (min-width: 1680px) {
  #footer .footer_middle {
    --sr-fm-h5: 20px;
  }
}

@media (min-width: 1900px) {
  #footer .footer_middle {
    --sr-fm-h5: 20px;
  }
}

/* Ecrane late — padding compact, tipografia vine din variabilele de mai sus */
@media (min-width: 1400px) {
  #footer .footer_middle {
    padding-top: 44px !important;
    padding-bottom: 44px !important;
  }

  #footer .footer_middle h5 {
    margin-bottom: 14px !important;
  }

  #footer .footer_middle .column li + li {
    margin-top: 7px !important;
  }
}

/* ======================================================================== */
/*  RESPONSIVE                                                              */
/* ======================================================================== */

/* Tabletă — linkurile pe 3 coloane, apoi locația + contact */
@media (min-width: 768px) and (max-width: 991.98px) {
  #footer .footer_middle > .container > .row {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    column-gap: 24px !important;
    row-gap: 28px !important;
    align-items: start !important;
  }

  #footer .footer_middle > .container > .row > .col-sm-6.middle-content {
    display: grid !important;
    grid-column: 1 / -1 !important;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr) !important;
    gap: 24px !important;
    align-items: start !important;
  }

  #footer .footer_middle > .container > .row > .footer-column {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  #footer .footer_middle .middle-content .footer_contact {
    padding: 0 0 0 24px !important;
    border-left: 1px solid var(--sr-footer-border) !important;
  }
}

/* Tabletă / mobil mare — coloanele se stivuiesc sub 768px */
@media (max-width: 991.98px) {
  #footer .footer_middle {
    --sr-fm-h5: 20px;
    --sr-fm-text: 14px;
    --sr-fm-lh: 1.45;
    --sr-fm-email: 16px;
    --sr-fm-map: 14px;
    --sr-fm-city: 14px;
    --sr-fm-street: 14px;
    --sr-fm-hours: 14px;
  }

  #footer .footer_middle h5,
  #footer .footer_middle h5.toggle {
    margin-bottom: 10px !important;
    min-height: 0 !important;
  }

  #footer .footer_middle .column li + li {
    margin-top: 6px !important;
  }

  #footer .footer_middle .middle-content .footer_contact h5 {
    margin-bottom: 14px !important;
  }

  #footer .footer_middle .middle-content .footer_contact .contact {
    margin-bottom: 12px;
  }

  #footer .footer_middle .middle-content .footer_contact .contact > img,
  #footer .footer_middle .middle-content .footer_contact .footer-toggle > .d-flex > img {
    width: 34px;
    height: 34px;
    padding: 7px;
  }

  #footer .footer_middle .middle-content .footer_contact .footer_contact__hours {
    margin-top: 6px;
  }

  #footer .footer_middle .middle-content .footer_contact .footer_contact__email {
    margin-top: 14px;
  }

  /* Fără linii turcoaz / accent pe mobil */
  #footer .footer_middle h5::after {
    display: none !important;
  }

  #footer .footer_middle .middle-content .footer_contact {
    padding: 0 !important;
    border-left: none !important;
  }

  #footer .footer_middle .middle-content .footer_contact::after {
    display: none !important;
  }

  #footer .footer_middle .middle-content {
    gap: 28px;
  }

  #footer .footer_middle > .container > .row > .footer-column + .footer-column {
    margin-top: 4px;
  }

  #footer .footer_middle .middle-content .footer_aboutus_cms__map-wrap {
    max-width: 100%;
  }
  #footer .footer_middle .middle-content .footer_contact .footer_contact__hours {
    padding-left: 0;
  }

  /* „+" accordion — la marginea dreaptă a rândului */
  #footer .footer_middle .column h5.toggle {
    display: flex !important;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    position: relative;
    padding-right: 0;
    box-sizing: border-box;
  }

  #footer .footer_middle .column h5.toggle .mobile_togglemenu {
    position: absolute !important;
    right: 0 !important;
    left: auto !important;
    top: 50% !important;
    transform: translateY(-50%);
    margin-left: 0;
    width: auto !important;
    height: auto !important;
    line-height: 1 !important;
    flex-shrink: 0;
  }
}

/* Telefon — o singură coloană */
@media (max-width: 767.98px) {
  #footer .footer_middle {
    --sr-fm-h5: 16px;
    --sr-fm-text: 14px;
    --sr-fm-lh: 1.42;
    --sr-fm-email: 14px;
    --sr-fm-map: 14px;
    --sr-fm-city: 14px;
    --sr-fm-street: 14px;
    --sr-fm-hours: 13px;
  }

  #footer .footer_middle h5,
  #footer .footer_middle h5.toggle {
    margin-bottom: 8px !important;
  }

  #footer .footer_middle > .container > .row {
    display: flex !important;
    flex-direction: column !important;
    gap: 22px !important;
  }

  #footer .footer_middle > .container > .row > .col-sm-6.middle-content {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }
}

/* Telefon */
@media (max-width: 575px) {
  #footer .footer_middle {
    --sr-fm-h5: 16px;
    --sr-fm-text: 12px;
    --sr-fm-email: 12px;
    --sr-fm-map: 12px;
    --sr-fm-city: 12px;
    --sr-fm-street: 12px;
    --sr-fm-hours: 12px;
  }

  #footer .footer_middle .middle-content .footer_aboutus_cms__map {
    height: 104px;
    aspect-ratio: auto;
  }
  #footer .footer_middle .middle-content .footer_aboutus_cms .footer-social li a {
    width: 40px;
    height: 40px;
  }
  #footer .footer_middle .middle-content .footer_contact .contact-phone-text a {
    font-size: var(--sr-fm-phone) !important;
  }
  #footer .footer_middle .middle-content .footer_aboutus_cms__map-link {
    font-size: var(--sr-fm-map) !important;
  }
}

/* Telefon + email — tabletă/mobil; desktop ≥992 folosește --sr-fm-phone din blocul de mai sus */
@media (min-width: 576px) and (max-width: 991.98px) {
  #footer .footer_middle {
    --sr-fm-phone: 14px;
  }
}

@media (max-width: 575.98px) {
  #footer .footer_middle {
    --sr-fm-phone: 12px;
  }
}

#footer .footer_middle .middle-content .footer_contact .contact-phone-text,
#footer .footer_middle .middle-content .footer_contact .contact-phone-text a,
#footer .footer_middle .middle-content .footer_contact .contact-email-text a {
  font-size: var(--sr-fm-phone) !important;
}
