/* ==========================================================================
   NEFROVET - ESTILOS CSS RESPONSIVE INTEGRADOS (ESCRITORIO & MÓVIL)
   Especialistas en salud renal de perros y gatos
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. VARIABLES DE TEMA & DESIGN TOKENS
   -------------------------------------------------------------------------- */
:root {
  --color-primary: #9e1b24;          /* Borgoña institucional */
  --color-primary-hover: #82151d;
  --color-primary-light: #fbebee;
  --color-secondary: #004b74;        /* Azul clínico */
  --color-secondary-light: #cde5ff;
  --color-whatsapp: #25d366;
  --color-whatsapp-dark: #128c7e;
  
  --color-bg: #f8f9fb;
  --color-surface: #ffffff;
  --color-surface-dim: #eceef1;
  --color-surface-low: #f2f4f6;
  --color-border: #e2e5e9;
  --color-border-light: #f0f2f5;

  --color-text-main: #1f2937;
  --color-text-muted: #5f6b7c;
  --color-text-subtle: #353535;

  --font-heading: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 16px -2px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 10px 25px -3px rgba(15, 23, 42, 0.08);

  --transition-fast: 0.18s ease-in-out;
  --transition-normal: 0.25s ease-in-out;
}

/* --------------------------------------------------------------------------
   2. RESET & BASE
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0 1.25rem;
  margin: 0 auto;
  max-width: 1240px;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--color-text-main);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

p {
  color: var(--color-text-muted);
}

a {
  color: inherit;
  text-decoration: none;
  transition: all var(--transition-fast);
}

img, svg {
  display: block;
  max-width: 100%;
}

/* --------------------------------------------------------------------------
   3. HEADER & NAVEGACIÓN
   -------------------------------------------------------------------------- */
header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 0;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--color-border);
  gap: 1.25rem;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  width: 100%;
  justify-content: flex-start;
}

.header-logo {
  height: auto;
  width: 100px;
  object-fit: contain;
  flex-shrink: 0;
}

.header-titles {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.header-titles h1 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-text-main);
}

.header-titles .subtitle {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

/* Línea de Urgencias */
.phone-urgencias {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: 0.6rem 1.2rem;
  box-shadow: var(--shadow-sm);
  font-size: 0.875rem;
  white-space: nowrap;
}

.live-indicator {
  position: relative;
  display: flex;
  width: 10px;
  height: 10px;
}

.live-indicator .pulse {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-full);
  background-color: var(--color-primary);
  opacity: 0.75;
  animation: pulse-ring 1.8s cubic-bezier(0.24, 0, 0.38, 1) infinite;
}

.live-indicator .dot {
  position: relative;
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background-color: var(--color-primary);
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(2.2); opacity: 0; }
  100% { transform: scale(0.95); opacity: 0; }
}

.phone-urgencias .label {
  color: var(--color-text-muted);
  font-weight: 500;
}

.phone-urgencias .number {
  color: var(--color-primary);
  font-weight: 700;
  font-family: var(--font-heading);
}

.phone-urgencias:hover {
  border-color: var(--color-primary);
  box-shadow: 0 2px 10px rgba(158, 27, 36, 0.12);
}

/* --------------------------------------------------------------------------
   4. LAYOUT PRINCIPAL (MAIN)
   -------------------------------------------------------------------------- */
main {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
  margin-bottom: 3rem;
}

/* Tarjetas contenedor */
.card-panel {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2.25rem 2rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

/* Panel Izquierdo: Estado del Portal */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--color-surface-dim);
  color: var(--color-secondary);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  margin-bottom: 1.25rem;
  align-self: flex-start;
}

.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  background-color: var(--color-secondary);
  border-radius: var(--radius-full);
}

.panel-maintenance h2 {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--color-text-main);
  margin-bottom: 1.25rem;
  line-height: 1.15;
}

.panel-maintenance .lead-text {
  font-size: 1.05rem;
  color: var(--color-text-muted);
  margin-bottom: 2rem;
  line-height: 1.7;
}

/* Barra de progreso de actualización */
.progress-box {
  background-color: var(--color-surface-low);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-top: auto;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.progress-label {
  color: var(--color-text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.progress-percent {
  color: var(--color-primary);
  font-weight: 700;
}

.progress-bar-bg {
  width: 100%;
  height: 8px;
  background-color: var(--color-surface-dim);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.progress-bar-fill {
  height: 100%;
  width: 1%;
  background: linear-gradient(90deg, var(--color-primary) 0%, #c4323d 100%);
  border-radius: var(--radius-full);
  transition: width 1s ease-in-out;
}

.progress-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--color-text-subtle);
}

/* Panel Derecho: Servicio Activo y Canales */
.service-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.service-icon-bubble {
  width: 48px;
  height: 48px;
  background-color: var(--color-primary-light);
  color: var(--color-primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.service-icon-bubble svg {
  width: 26px;
  height: 26px;
  fill: currentColor;
}

.service-title-group h3 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-primary);
  letter-spacing: 0.05em;
}

.service-title-group h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-text-main);
}

.service-desc {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  margin-bottom: 1.75rem;
  line-height: 1.6;
}

/* Botones de Acción (CTAs) */
.cta-group {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 2rem;
}

.btn-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.9rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  text-align: center;
}

.btn-cta svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.btn-whatsapp {
  background-color: #1f2937;
  color: #ffffff;
  border-color: #1f2937;
}

.btn-whatsapp svg {
  fill: #ffffff;
}

.btn-whatsapp:hover {
  background-color: #111827;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-email {
  background-color: var(--color-secondary-light);
  color: var(--color-secondary);
}

.btn-email svg {
  fill: var(--color-secondary);
}

.btn-email:hover {
  background-color: #b9d9fc;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 75, 116, 0.12);
}

/* Ficha de Información de Contacto / Horarios */
.info-card-box {
  background-color: var(--color-surface-low);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.info-row {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: flex-start;
  gap: 0.85rem;
}

.info-row svg {
  width: 24px;
  height: 24px;
  fill: var(--color-text-muted);
  margin-top: 2px;
}

.info-row-content p {
  font-size: 0.825rem;
  line-height: 1.4;
  margin: 0;
}

.info-row-content .info-title {
  font-weight: 700;
  color: var(--color-text-main);
  font-size: 0.875rem;
  margin-bottom: 0.15rem;
}

.location-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--color-border);
  font-size: 0.825rem;
}

.location-notice .priority-tag {
  color: var(--color-primary);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.location-notice .address-text {
  color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   5. SECCIÓN INFERIOR: UNIDADES ESPECIALIZADAS DISPONIBLES
   -------------------------------------------------------------------------- */
.services-section {
  margin-bottom: 3.5rem;
}

.services-section-header {
  margin-bottom: 1.5rem;
}

.services-section-header .tagline {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.services-section-header h3 {
  font-size: 1.35rem;
  font-weight: 700;
}

.specialty-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.specialty-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-normal);
}

.specialty-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: #cfd5dc;
}

.specialty-card .card-icon {
  width: 40px;
  height: 40px;
  background-color: var(--color-surface-dim);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  margin-bottom: 1rem;
}

.specialty-card .card-icon svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.specialty-card h4 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.specialty-card p {
  font-size: 0.875rem;
  line-height: 1.55;
  margin-bottom: 1.25rem;
  flex: 1;
}

.specialty-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-primary);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.specialty-link:hover {
  text-decoration: underline;
  gap: 0.55rem;
}

/* --------------------------------------------------------------------------
   6. FOOTER INSTITUCIONAL
   -------------------------------------------------------------------------- */
footer {
  margin-top: auto;
  border-top: 1px solid var(--color-border);
  padding: 2rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  font-size: 0.85rem;
  color: var(--color-text-subtle);
}

.footer-copy {
  text-align: center;
}

.footer-copy strong {
  color: var(--color-text-muted);
}

.footer-social {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.footer-social span {
  font-weight: 600;
  color: var(--color-text-muted);
}

.social-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.social-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  transition: all var(--transition-fast);
}

.social-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.social-btn:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   7. MEDIA QUERIES RESPONSIVE (TABLET & ESCRITORIO)
   ========================================================================== */

/* --- Tablet / Pantallas Medianas (min-width: 640px) --- */
@media (min-width: 640px) {
  header {
    flex-direction: column;
  }
  
  .header-brand {
    width: auto;
    flex-direction: column;
  }

  .header-logo{
    width: 150px;
  }

  .header-titles{
    text-align: center;
  }

  .cta-group {
    flex-direction: column;
  }

  .btn-cta {
    flex: 1;
  }

  .specialty-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  footer {
    flex-direction: row;
  }

  .footer-copy {
    text-align: left;
  }
}

/* --- Escritorio / Desktop (min-width: 1024px) --- */
@media (min-width: 1024px) {
  body {
    padding: 0 2rem;
  }

  header {
    padding: 2rem 0;
    margin-bottom: 3rem;
    flex-direction: row;
  }

  .header-brand{
    flex-direction: row;
  }

  .header-logo {
    height: auto;
  }

  .header-titles h1 {
    font-size: 1.35rem;
  }

  .header-titles .subtitle {
    font-size: 0.925rem;
  }

  /* Grid Panorámico: 60% izquierda (Estado) / 40% derecha (Atención y Citas) */
  main {
    grid-template-columns: 1.25fr 0.95fr;
    gap: 2.25rem;
    align-items: stretch;
  }

  .panel-maintenance h2 {
    font-size: 2.75rem;
  }

  .specialty-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .location-notice {
    font-size: 0.875rem;
  }
}

/* --- Pantallas Extra Grandes (min-width: 1280px) --- */
@media (min-width: 1280px) {
  main {
    gap: 3rem;
  }
  
  .card-panel {
    padding: 2.75rem 2.5rem;
  }
}

@media(max-width:640px){
  .header-brand{
    flex-direction: column;
  }
  .header-titles{
    text-align: center;
  }  
}

/* --- Ajustes específicos para móviles muy pequeños (max-width: 420px) --- */
@media (max-width: 420px) {
  body {
    padding: 0 0.85rem;
  }

  .card-panel {
    padding: 1.5rem 1.15rem;
  }

  .panel-maintenance h2 {
    font-size: 1.85rem;
    text-align: center;
  }

  .phone-urgencias {
    width: 100%;
    justify-content: center;
  }

  .location-notice {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }
  
  .services-section-header h3, .services-section-header p{
    text-align: center;
  }
  
  .service-header{
    flex-direction: column!important;
    justify-content: center;
  }
  
}
