/* Fuentes y base */
/* Reset básico para evitar márgenes por defecto */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow-x: hidden;   /* evita scroll lateral */
  overflow-y: auto;     /* solo scroll si hace falta */
  background: #f8f9fa;  /* gris claro opcional */
}

/* Contenedor principal de la factura */
#factura-container {
  margin: 0 auto;                 /* centrado */
  padding: 0.5rem;
  box-sizing: border-box;
  background: #fff;
  max-width: 1200px;              /* ancho máximo en PC */
  min-height: auto;
  border-radius: 12px;
}

/* Evita espacio extra al final del body */
#factura-container > *:last-child {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

/* Escala adaptativa para móviles (solo visual, no afecta PDF) */
@media (max-width: 768px) {
  #factura-container {
    transform: scale(0.8);
    transform-origin: top center;
  }
}
@media (max-width: 480px) {
  #factura-container {
    transform: scale(0.6);
    transform-origin: top center;
  }
}
/* Contenedor de la factura */
@media (max-width: 640px) {
  #factura-container {
    transform: scale(0.8);
    transform-origin: top center;
    margin: 0 auto;   /* sigue centrado */
  }
}

/* Contenedor padre inmediato que tiene main: debe tener altura completa */
.flex-1 {
  height: 100%;
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
  padding-bottom: 0;
}


/* Ajustar main para que tome toda la altura disponible */
main {
  flex-grow: 1;      /* que ocupe el espacio restante */
  height:100%;      /* para que tome toda la altura del contenedor padre */
  min-height: 0;     /* importante para que flex funcione bien */
  padding-top: 1rem;
  max-width: 1200px;
  margin: 0 auto;
  overflow-y: auto;
  background-color: rgba(34, 104, 77, 0.241);  /* para scroll vertical si hay contenido extra */
}

body {
  font-family: 'Roboto', sans-serif;
  background-color: #f9fafb;
  color: #1f2937; /* texto gris oscuro */
  margin: 0;
  padding: 0;
}


/* Header */
header {
  background-color: #1f553c; /* Verde oscuro */
  color: #e7f0e7;
}

header .text-xl {
  font-weight: 700;
}

header button {
  background: transparent;
  border: none;
  color: #d1e7d2;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s ease-in-out;
}

header button:hover {
  color: #a1c893;
}

/* Navbar categorías */
nav {
  background-color: #d1e7d2; /* verde claro */
  border-bottom: 2px solid #1f553c;
}

nav button {
  background: transparent;
  border: none;
  padding-bottom: 0.25rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #3f7042;
}

nav button:hover {
  color: #1f553c;
}

nav button.active-category {
  color: #1f553c;
  border-bottom: 4px solid #1f553c;
}

.tabs {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
  gap: 0;
  padding: 0.2rem 0;
}


/* Tarjetas de servicios unificadas */
.service-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  background-color: #fcfcfc8b;
  border-radius: 0.75rem;
  box-shadow: 0 2px 5px rgba(31, 85, 60, 0.1); /* sombra más ligera */
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  min-height: 270px;
  padding: 0;
}

.service-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 20px rgba(34, 58, 47, 0.611);
  border-color: #761f26; /* borde rojo al hover */
}

.service-card img {
  width: 100%;
  height: 130px; /* altura reducida */
  object-fit: cover;
  border-bottom: 2px solid #1f553c;
  transition: transform 0.3s ease;
}

.service-card:hover img {
  transform: scale(1.05);
}

.service-card h3 {
  color: #191a19;
  text-align: center;
  font-weight: 600;
  font-size: 1rem;
  margin: 1rem 1rem 0.5rem 1rem;
  flex-shrink: 0;
}

.service-card p {
  font-size: 0.9rem;
  text-align: center;
  color: #555d50;
  line-height: 1.4;
  margin: 0 1rem 1.5rem 1rem;
  flex-grow: 1;
}

/* Botones */
button,
button[type='submit'] {
  background-color: #1f553c;
  color: #e7f0e7;
  padding: 0.6rem 1.25rem;
  border-radius: 0.5rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background-color 0.25s ease;
}

button:hover,
button[type='submit']:hover {
  background-color: #d1c18ceb;
  border-radius: 30px;
}

/* Formularios */
form label {
  font-weight: 600;
  color: #1f553c;
  margin-bottom: 0.25rem;
  display: block;
}

form textarea {
  width: 100%;
  border: 1px solid #9ca3af;
  border-radius: 0.5rem;
  padding: 0.5rem;
  font-size: 1rem;
  resize: vertical;
  transition: border-color 0.25s ease;
}

form textarea:focus {
  outline: none;
  border-color: #1f553c;
  box-shadow: 0 0 5px rgba(31, 85, 60, 0.5);
}

/* Enlaces */
a {
  color: #13746f;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
  margin-top: 8px;
}

a:hover {
  color: #f8ffd8;
  text-decoration: underline;
}


/* Responsividad para navbar */
@media (max-width: 640px) {
  nav {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  nav button {
    margin-bottom: 0.25rem;
    padding: 0.25rem 0.5rem;
  }
}

/* Scrollbar bonito para main */
main::-webkit-scrollbar {
  width: 10px;
}

main::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 5px;
}

main::-webkit-scrollbar-thumb {
  background-color: #1f553c;
  border-radius: 5px;
}

/* Para evitar texto seleccionado al pulsar rápido en navbar */
nav button {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
