/* ==========================================================================
   UGT METRO DE MADRID - PORTADA SINDICAL DIGITAL
   Diseño Plano Geométrico & Banda Roja UGT con Trapecios (Sin Tarjetas Redondeadas)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@700;800;900&family=Space+Grotesk:wght@500;700&family=Inter:wght@400;600;700&display=swap');

:root {
  /* Brand Flat Colors */
  --ugt-red: #E52330;
  --ugt-red-dark: #C4121E;
  
  --metro-blue: #0038A8;
  --metro-blue-dark: #002575;

  --flat-black: #0A0E17;
  --flat-white: #FFFFFF;
  --flat-light: #F4F6F9;
  
  --border-dark: #0A0E17;
  --border-light: #E2E8F0;

  --transition-fast: 0.15s ease-out;
}

/* Reset & Base Elements */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border-radius: 0 !important; /* Estricto: 0 bordes redondeados */
}

html, body {
  font-family: 'Inter', system-ui, sans-serif;
  background-color: var(--flat-white);
  color: var(--flat-black);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  min-height: 100vh;
  background: var(--flat-white);
}

/* ==========================================================================
   1. Header Superior Plano (Fondo Blanco)
   ========================================================================== */

.header-flat {
  background: var(--flat-white);
  padding: 2.25rem 1.5rem 3.5rem;
  position: relative;
  z-index: 5;
}

.header-container {
  max-width: 1140px;
  margin: 0 auto;
}

.brand-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 2px solid var(--flat-black);
}

.logos-group {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.logo-img {
  height: 52px;
  width: auto;
  object-fit: contain;
}

.flat-divider {
  width: 2px;
  height: 38px;
  background: var(--flat-black);
}

.btn-qr-small {
  background: var(--flat-black);
  color: var(--flat-white);
  border: 2px solid var(--flat-black);
  width: auto !important;
  max-width: max-content !important;
  flex: 0 0 auto !important;
  padding: 0.55rem 1.15rem !important;
  font-size: 0.85rem !important;
  letter-spacing: 1px;
  align-self: center;
}

.btn-qr-small:hover {
  background: var(--ugt-red);
  color: var(--flat-white);
}

.title-flat-box {
  text-align: left;
}

.flat-title {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(2.6rem, 6.5vw, 4.5rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -1px;
  color: var(--flat-black);
  text-transform: uppercase;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.flat-title i {
  color: var(--ugt-red);
}

.flat-subtitle {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 2px;
  color: var(--metro-blue);
  text-transform: uppercase;
}

/* ==========================================================================
   2. Banda Roja UGT Central con Cortes Trapezoidales
   ========================================================================== */

.ugt-red-band {
  background-color: var(--ugt-red);
  clip-path: polygon(0 45px, 100% 0, 100% calc(100% - 45px), 0 100%);
  padding: 5.5rem 1.5rem 6.5rem;
  margin-top: -1.5rem;
  position: relative;
  z-index: 10;
}

.band-content-container {
  max-width: 1140px;
  margin: 0 auto;
}

.flat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.75rem;
}

.flat-box {
  background: var(--flat-white);
  border: 3px solid var(--flat-black);
  padding: 2.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 10px 10px 0px var(--flat-black);
}

.box-header {
  margin-bottom: 1.5rem;
}

.box-badge {
  display: inline-block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 0.35rem 0.85rem;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.badge-blue {
  background: var(--metro-blue);
  color: var(--flat-white);
}

.badge-dark {
  background: var(--flat-black);
  color: var(--flat-white);
}

.box-header h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--flat-black);
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.box-header p {
  font-size: 0.92rem;
  color: #4A5568;
}

/* Teléfonos Display */
.phone-big-display {
  background: var(--flat-light);
  border: 2px solid var(--flat-black);
  padding: 1.25rem;
  text-align: center;
  margin-bottom: 1.25rem;
}

.phone-big-display .num {
  font-family: 'Outfit', sans-serif;
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--metro-blue);
}

.phone-big-display .sep {
  font-size: 1.8rem;
  color: #A0AEC0;
  margin: 0 0.4rem;
}

.fax-line-flat {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.95rem;
  color: var(--flat-black);
  margin-bottom: 1rem;
}

.phone-exterior-display {
  margin-bottom: 1.25rem;
}

.phone-ext-link {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(1.5rem, 3.5vw, 2.4rem);
  font-weight: 900;
  color: var(--ugt-red);
  text-decoration: none;
  display: block;
  line-height: 1;
}

.phone-ext-link:hover {
  color: var(--flat-black);
}

.info-list-flat {
  margin-bottom: 1rem;
}

.info-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--flat-black);
  margin-bottom: 0.5rem;
  word-break: break-all;
}

.info-row i {
  color: var(--ugt-red);
}

.info-row a {
  color: var(--flat-black);
  text-decoration: none;
  font-weight: inherit;
  transition: var(--transition-fast);
}

.info-row a:hover {
  color: var(--ugt-red);
}

/* Botones Planos */
.box-actions {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 2px solid var(--flat-black);
}

.box-actions.dual {
  display: flex;
  gap: 0.6rem;
}

.btn-flat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.85rem 1.4rem;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 1px;
  cursor: pointer;
  text-decoration: none;
  text-transform: uppercase;
  transition: var(--transition-fast);
  border: 2px solid var(--flat-black);
  width: 100%;
}

.btn-black {
  background: var(--flat-black);
  color: var(--flat-white);
  flex: 1;
}

.btn-black:hover {
  background: var(--ugt-red);
  border-color: var(--flat-black);
}

.btn-white {
  background: var(--flat-white);
  color: var(--flat-black);
}

.btn-white:hover {
  background: var(--flat-black);
  color: var(--flat-white);
}

.btn-white-border {
  background: var(--flat-white);
  color: var(--flat-black);
  border-color: var(--flat-black);
  flex: 1;
}

.btn-white-border:hover {
  background: var(--ugt-red);
  color: var(--flat-white);
}

.btn-red {
  background: var(--ugt-red);
  color: var(--flat-white);
}

.btn-red:hover {
  background: var(--flat-black);
}

.btn-outline-black {
  background: var(--flat-white);
  color: var(--flat-black);
}

.btn-outline-black:hover {
  background: var(--flat-black);
  color: var(--flat-white);
}

/* ==========================================================================
   3. Sección Inferior Plana: Encuéntranos en Madrid
   ========================================================================== */

.location-flat-section {
  background: var(--flat-white);
  padding: 3.5rem 1.5rem 4rem;
  position: relative;
  z-index: 5;
}

.location-container {
  max-width: 1140px;
  margin: 0 auto;
}

.location-flat-grid {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  background: var(--flat-white);
  border: 3px solid var(--flat-black);
  box-shadow: 10px 10px 0px var(--flat-black);
  transition: var(--transition-fast);
}

.location-details-box {
  padding: 2.5rem;
  background: var(--flat-white);
  border-right: 3px solid var(--flat-black);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.section-tag-flat {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 1.5px;
  color: var(--flat-white);
  background: var(--metro-blue);
  display: inline-block;
  padding: 0.35rem 0.85rem;
  margin-bottom: 1.25rem;
}

.section-title-flat {
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  font-weight: 900;
  color: var(--flat-black);
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

.address-flat {
  background: var(--flat-light);
  border: 2px solid var(--flat-black);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.address-flat .street {
  font-family: 'Outfit', sans-serif;
  font-weight: 900;
  font-size: 1.15rem;
  color: var(--ugt-red);
}

.address-flat .sub {
  font-size: 0.9rem;
  color: #4A5568;
}

.address-flat .zip {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  color: var(--metro-blue);
  margin-top: 6px;
}

.transport-flat-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1.75rem;
}

.t-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.t-pill {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--flat-white);
  padding: 0.2rem 0.6rem;

}

.pill-l1 {
  background: #00A3E0; /* Azul Celeste Oficial Línea 1 Metro */
}

.pill-l6 {
  background: #9E9E9E; /* Gris Oficial Línea 6 Circular Metro */
}

.pill-emt {
  background: #005F9E; /* Azul Corporativo Oficial EMT Madrid */
}

.location-actions-flat {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.location-actions-flat .btn-flat {
  flex: 1;
  min-width: 140px;
}

.map-flat-wrapper {
  min-height: 400px;
  height: 100%;
}

#leafletMap {
  width: 100%;
  height: 100%;
  min-height: 400px;
}

/* Globos Informativos del Mapa (Leaflet) */
.leaflet-popup-content-wrapper {
  border-radius: 0 !important;
  border: 2px solid var(--flat-black);
  box-shadow: 6px 6px 0px var(--flat-black);
  background: var(--flat-white);
}

.leaflet-popup-tip-container {
  margin-top: -2px;
}

.leaflet-popup-tip {
  background: var(--flat-white);
  border: none !important;
  border-right: 2px solid var(--flat-black) !important;
  border-bottom: 2px solid var(--flat-black) !important;
  box-shadow: none !important;
}

/* ==========================================================================
   4. Footer Plano
   ========================================================================== */

.footer-flat {
  background: var(--flat-black);
  color: var(--flat-white);
  padding: 2rem 1.5rem;
  text-align: center;
}

.footer-container p {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.85rem;
  letter-spacing: 1px;
}

.footer-container a {
  color: var(--ugt-red);
  text-decoration: none;
  font-weight: 700;
}

.footer-container a:hover {
  text-decoration: underline;
}

/* Modales Planos */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 14, 23, 0.75);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-fast);
  padding: 1rem;
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.modal-content-flat {
  background: var(--flat-white);
  border: 4px solid var(--flat-black);
  box-shadow: 12px 12px 0px var(--flat-black);
  padding: 2.25rem;
  max-width: 420px;
  width: 100%;
  text-align: center;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--flat-black);
  border: none;
  color: var(--flat-white);
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.modal-close:hover {
  background: var(--ugt-red);
}

.modal-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.6rem;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--flat-black);
}

.modal-subtitle {
  font-size: 0.88rem;
  color: #4A5568;
  margin-top: 6px;
}

.qr-box {
  background: var(--flat-white);
  border: 2px solid var(--flat-black);
  padding: 1rem;
  display: inline-block;
  margin: 1.25rem 0;
}

#qrCanvas img, #qrCanvas canvas {
  width: 200px;
  height: 200px;
}

.qr-footnote {
  font-size: 0.85rem;
  font-weight: 600;
}

.qr-footnote i {
  color: #16A34A;
}

/* Toast Notification Plano */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1100;
  pointer-events: none;
}

.toast {
  background: var(--flat-black);
  color: var(--flat-white);
  border: 2px solid var(--flat-white);
  padding: 0.85rem 1.4rem;
  box-shadow: 6px 6px 0px var(--ugt-red);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  transform: translateY(100px);
  transition: transform 0.3s ease-out;
  pointer-events: auto;
}

.toast.show {
  transform: translateY(0);
}

.toast-icon {
  color: #4ADE80;
}

/* Adaptabilidad Móvil (< 880px y < 480px) */
@media (max-width: 880px) {
  .header-flat {
    padding: 1.5rem 1rem 2.5rem;
  }

  .brand-top-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
  }

  .btn-qr-small {
    padding: 0.45rem 0.9rem !important;
    font-size: 0.8rem !important;
  }

  .logo-img {
    height: 40px;
  }

  .flat-title {
    font-size: 2rem;
  }

  .header-container,
  .band-content-container,
  .location-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
  }

  .ugt-red-band {
    clip-path: polygon(0 25px, 100% 0, 100% calc(100% - 25px), 0 100%);
    padding: 4rem 1rem 4.5rem;
    overflow-x: hidden;
  }

  .location-flat-section {
    padding: 2.5rem 1rem 3rem;
  }

  .flat-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .flat-box,
  .location-flat-grid {
    width: 100%;
    max-width: 100%;
    box-shadow: 6px 6px 0px var(--flat-black);
    box-sizing: border-box;
  }

  .flat-box {
    padding: 1.35rem;
  }

  .location-flat-grid {
    grid-template-columns: 1fr;
  }

  .location-details-box {
    border-right: none;
    border-bottom: 3px solid var(--flat-black);
    padding: 1.35rem;
  }

  .location-actions-flat {
    flex-direction: column;
  }

  .map-flat-wrapper, #leafletMap {
    min-height: 280px;
  }

  .toast-container {
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
  }
}

/* Pantallas móviles compactas (< 400px) */
@media (max-width: 400px) {
  .header-flat {
    padding: 1.25rem 0.65rem 2rem;
  }

  .ugt-red-band {
    clip-path: polygon(0 20px, 100% 0, 100% calc(100% - 20px), 0 100%);
    padding: 3.25rem 0.65rem 3.75rem;
  }

  .location-flat-section {
    padding: 2.25rem 0.65rem 2.75rem;
  }

  .flat-box,
  .location-details-box {
    padding: 1rem 0.75rem;
  }

  .flat-box,
  .location-flat-grid {
    box-shadow: 4px 4px 0px var(--flat-black);
    border-width: 2px;
  }

  .logos-group {
    gap: 0.6rem;
  }

  .logo-img {
    height: 28px;
  }

  .flat-divider {
    height: 20px;
  }

  .flat-title {
    font-size: 1.45rem;
    gap: 0.35rem;
  }

  .flat-subtitle {
    font-size: 0.82rem;
    letter-spacing: 1px;
  }

  .box-header h2,
  .section-title-flat {
    font-size: 1.3rem;
  }

  .phone-big-display {
    padding: 0.85rem 0.4rem;
  }

  .phone-big-display .num {
    font-size: 1.35rem;
  }

  .phone-ext-link {
    font-size: 1.45rem;
  }

  .btn-flat {
    padding: 0.7rem 0.6rem;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
  }

  .dual-actions {
    flex-direction: column;
  }

  .dual-actions .btn-square {
    width: 100%;
    height: 42px;
  }

  .info-row {
    font-size: 0.85rem;
  }

  .address-flat {
    padding: 0.9rem 0.75rem;
  }

  .address-flat .street {
    font-size: 0.98rem;
  }
}
