/* spotforteam — estilos globales, variables y layout base */

:root {
  --color-primary: #1A6B3A;
  --color-primary-light: #2E9E58;
  --color-accent: #F5C518;
  --color-dark: #0D1B14;
  --color-surface: #F8FAF9;
  --color-surface-2: #EDF3EF;
  --color-text: #1C2B23;
  --color-text-muted: #5A7566;
  --color-border: #D0DDD4;
  --color-white: #FFFFFF;
  --header-h: 72px;
  --header-h-mobile: 60px;
  --shadow-header: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.08);
  --radius-btn: 8px;
  --radius-card: 12px;
  --transition: 200ms ease;
  --font-display: "Barlow Condensed", system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-surface);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--color-primary-light);
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 0.5em;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
}

h2 {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
}

h3 {
  font-size: 1.25rem;
}

p {
  margin: 0 0 1em;
}

ul {
  margin: 0;
  padding-left: 1.25rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Cabecera */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--color-white);
  height: var(--header-h);
  display: flex;
  align-items: center;
  box-shadow: none;
  transition: box-shadow var(--transition);
}

.site-header.is-scrolled {
  box-shadow: var(--shadow-header);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: space-between;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  color: var(--color-primary);
  flex-shrink: 0;
}

.logo svg {
  width: 36px;
  height: 36px;
  color: var(--color-primary);
}

.nav-desktop {
  display: none;
  align-items: center;
  gap: 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-desktop a {
  font-weight: 500;
  color: var(--color-text);
  font-size: 0.95rem;
}

.nav-desktop a:hover {
  color: var(--color-primary);
}

.header-tools {
  display: none;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  justify-content: flex-end;
  min-width: 0;
}

.city-pill {
  position: relative;
  border: 1.5px solid var(--color-border);
  background: var(--color-surface);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 180px;
}

.city-pill__dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0.35rem;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-btn);
  box-shadow: var(--shadow-card);
  min-width: 220px;
  max-height: 280px;
  overflow-y: auto;
  z-index: 50;
  list-style: none;
  padding: 0.35rem 0;
}

.city-pill.is-open .city-pill__dropdown {
  display: block;
}

.city-pill__dropdown button {
  width: 100%;
  text-align: left;
  padding: 0.5rem 1rem;
  border: none;
  background: none;
  font: inherit;
  cursor: pointer;
  color: var(--color-text);
}

.city-pill__dropdown button:hover,
.city-pill__dropdown button:focus-visible {
  background: var(--color-surface-2);
  outline: none;
}

.global-search-wrap {
  position: relative;
  flex: 1;
  max-width: 280px;
}

.global-search-wrap input {
  width: 100%;
  padding: 0.5rem 0.75rem 0.5rem 2.25rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-btn);
  font-size: 0.95rem;
}

.global-search-wrap .search-icon {
  position: absolute;
  left: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--color-text-muted);
  pointer-events: none;
}

.search-suggestions {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 0.25rem;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-btn);
  box-shadow: var(--shadow-card);
  list-style: none;
  padding: 0.25rem 0;
  z-index: 60;
  max-height: 200px;
  overflow-y: auto;
}

.search-suggestions.is-visible {
  display: block;
}

.search-suggestions li button {
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.75rem;
  border: none;
  background: none;
  font: inherit;
  cursor: pointer;
}

.search-suggestions li button:hover {
  background: var(--color-surface-2);
}

.btn-account {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-btn);
  background: var(--color-white);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-text);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}

.btn-account:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.burger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.burger span {
  display: block;
  height: 3px;
  width: 24px;
  background: var(--color-dark);
  border-radius: 2px;
}

@media (min-width: 1160px) {
  .nav-desktop {
    display: flex;
  }

  .header-tools {
    display: flex;
  }

  .burger {
    display: none;
  }
}

/* Drawer movil */
.drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(13, 27, 20, 0.5);
  z-index: 1100;
}

.drawer-overlay.is-open {
  display: block;
}

.drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: min(300px, 92vw);
  height: 100%;
  background: var(--color-white);
  z-index: 1110;
  transform: translateX(-100%);
  transition: transform 250ms ease;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
  overflow-y: auto;
  padding: 1rem 1.25rem 2rem;
}

.drawer.is-open {
  transform: translateX(0);
}

.drawer__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  border: none;
  background: var(--color-surface-2);
  border-radius: 50%;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.drawer .global-search-wrap {
  max-width: none;
  margin-top: 3rem;
  margin-bottom: 1.5rem;
}

.drawer-nav {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
}

.drawer-nav a {
  display: block;
  padding: 0.65rem 0;
  font-weight: 600;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
}

/* Mismo corte que .nav-desktop / .burger: >=1160 barra completa, sin drawer */
@media (min-width: 1160px) {
  .drawer,
  .drawer-overlay {
    display: none !important;
  }
}

/* Footer */
.site-footer {
  background: var(--color-dark);
  color: rgba(255, 255, 255, 0.88);
  padding: 3rem 0 1.5rem;
  margin-top: 4rem;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.9);
}

.site-footer a:hover {
  color: var(--color-accent);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .footer-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.footer-col .logo {
  color: var(--color-white);
  margin-bottom: 0.75rem;
}

.footer-col .logo svg {
  color: var(--color-white);
}

/* Footer uses <img> for the mark; external SVG ignores text color — force white */
.footer-col .logo img {
  filter: brightness(0) invert(1);
}

.footer-col p {
  font-size: 0.95rem;
  opacity: 0.9;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-social {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.footer-social a {
  display: inline-flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
}

.footer-social a:hover {
  background: var(--color-primary-light);
  color: var(--color-white);
}

.footer-map iframe {
  border-radius: var(--radius-btn);
  width: 100%;
  margin-top: 0.75rem;
}

.footer-bar {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.85rem;
}

.payment-icons {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.payment-icons svg {
  height: 24px;
  width: auto;
  opacity: 0.85;
}

/* Cookie banner */
.cookie-banner {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: rgba(13, 27, 20, 0.96);
  color: var(--color-white);
  padding: 1.25rem 1.5rem;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.2);
}

.cookie-banner.is-visible {
  display: block;
}

.cookie-banner__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  justify-content: space-between;
}

.cookie-banner p {
  margin: 0;
  flex: 1;
  min-width: 220px;
  font-size: 0.95rem;
}

.cookie-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(13, 27, 20, 0.55);
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.is-open {
  display: flex;
}

.modal {
  background: var(--color-white);
  border-radius: var(--radius-card);
  max-width: 420px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
}

.modal--wide {
  max-width: 480px;
}

.modal h2 {
  margin-top: 0;
}

.cookie-toggles label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-border);
  font-weight: 500;
}

/* Login modal tabs */
.auth-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.auth-tabs button {
  flex: 1;
  padding: 0.6rem;
  border: 1.5px solid var(--color-border);
  background: var(--color-surface);
  border-radius: var(--radius-btn);
  font-weight: 600;
  cursor: pointer;
}

.auth-tabs button.is-active {
  background: var(--color-primary);
  color: var(--color-white);
  border-color: var(--color-primary);
}

/* Animaciones scroll */
.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Agente IA flotante */
.ai-fab {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-white);
  border: none;
  box-shadow: 0 4px 20px rgba(26, 107, 58, 0.45);
  cursor: pointer;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition), background var(--transition);
}

.ai-fab:hover {
  background: var(--color-primary-light);
  transform: scale(1.05);
}

.ai-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(380px, 100vw);
  height: 100%;
  background: var(--color-white);
  z-index: 1200;
  box-shadow: -4px 0 32px rgba(0, 0, 0, 0.15);
  transform: translateX(100%);
  transition: transform 280ms ease;
  display: flex;
  flex-direction: column;
}

.ai-panel.is-open {
  transform: translateX(0);
}

.ai-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  font-weight: 700;
  font-family: var(--font-display);
}

.ai-panel__messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.msg {
  max-width: 90%;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  font-size: 0.92rem;
  line-height: 1.45;
}

.msg--bot {
  align-self: flex-start;
  background: var(--color-surface-2);
  color: var(--color-text);
}

.msg--user {
  align-self: flex-end;
  background: var(--color-primary);
  color: var(--color-white);
}

.msg time {
  display: block;
  font-size: 0.7rem;
  opacity: 0.75;
  margin-top: 0.35rem;
}

.ai-panel__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0 1rem 0.75rem;
}

.chip {
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  font-size: 0.8rem;
  cursor: pointer;
}

.chip:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.ai-panel__input-row {
  display: flex;
  gap: 0.5rem;
  padding: 1rem;
  border-top: 1px solid var(--color-border);
}

.ai-panel__input-row input {
  flex: 1;
  padding: 0.65rem 0.85rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-btn);
  font-size: 1rem;
}

.ai-panel__input-row button {
  padding: 0.65rem 1rem;
  background: var(--color-primary);
  color: var(--color-white);
  border: none;
  border-radius: var(--radius-btn);
  font-weight: 600;
  cursor: pointer;
}

.ai-typing {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  padding: 0 1rem 0.5rem;
}

@media (max-width: 1023px) {
  .site-header {
    height: var(--header-h-mobile);
  }
}
