﻿/* === RESET Y BASE === */
* {
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background: #f4f7f8;
  color: #333;
  padding-top: 160px; /* espacio para header fijo */
}

/* === HEADER FIJO CON BARRA DE BÚSQUEDA === */
header {
  background-color: #1a73e8;
  color: white;
  padding: 15px 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

header h1, .logo {
  margin: 0;
  font-size: 1.5em;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

nav a {
  color: white;
  text-decoration: none;
  font-weight: bold;
}

nav a:hover {
  text-decoration: underline;
}

/* === BUSCADOR === */
.buscador {
  flex-basis: 100%;
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.buscador input[type=text] {
  flex: 1;
  padding: 8px;
  font-size: 1em;
  border: 1px solid #ccc;
  border-radius: 5px;
}

.buscador button {
  padding: 8px 16px;
  background-color: #ffffff;
  color: #1a73e8;
  border: none;
  border-radius: 5px;
  font-weight: bold;
  cursor: pointer;
}

.buscador button:hover {
  background-color: #e5e5e5;
}

/* === CONTENEDOR GENERAL === */
.container,
main.contenido {
  max-width: 900px;
  margin: 40px auto;
  background: white;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

h2, h3 {
  color: #1a73e8;
  margin-bottom: 10px;
}

ul {
  padding-left: 20px;
}

/* === FORMULARIOS Y GRUPOS === */
.form-group {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  margin-bottom: 12px;
  gap: 10px;
}

.form-group label {
  flex: 1 0 200px;
  margin-bottom: 6px;
  font-weight: bold;
}

.form-group .input-area {
  flex: 2 0 300px;
}

.form-group .input-area input,
.form-group .input-area select,
.form-group .input-area textarea {
  width: 100%;
  padding: 8px;
  margin-bottom: 5px;
  border: 1px solid #ccc;
  border-radius: 6px;
}

.form-group .description {
  flex: 1 0 200px;
  font-size: 0.9em;
  color: #555;
}

.form-group img {
  max-width: 100px;
  height: auto;
  margin-top: 4px;
  border-radius: 5px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

/* === BOTONES === */
input[type=submit] {
  background: #1a73e8;
  color: white;
  padding: 12px 25px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  width: 100%;
  margin-top: 20px;
}

input[type=submit]:hover {
  background: #0b5ec7;
}

/* === TABLA DE RESULTADOS === */
.tabla-productos {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  background-color: white;
}

.tabla-productos th,
.tabla-productos td {
  border: 1px solid #ddd;
  padding: 12px;
  text-align: left;
  vertical-align: top;
}

.tabla-productos th {
  background-color: #f0f0f0;
  color: #333;
  font-weight: bold;
}

.tabla-productos img {
  max-width: 100px;
  max-height: 100px;
  object-fit: contain;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* === PIE DE PÁGINA === */
footer {
  text-align: center;
  font-size: 0.85em;
  color: #777;
  margin: 40px 0 20px 0;
}

/* === RESPONSIVE === */
@media (max-width: 700px) {
  header {
    flex-direction: column;
    align-items: flex-start;
  }

  nav {
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
  }

  .buscador {
    flex-direction: column;
  }

  .container {
    margin: 10px;
    padding: 15px;
  }

  h2, h3 {
    font-size: 1.1em;
    margin: 10px 0 5px 0;
  }

  .form-group {
    flex-direction: column;
    align-items: stretch;
    margin-bottom: 15px;
    gap: 6px;
  }

  .form-group label {
    font-size: 0.95em;
    margin-bottom: 4px;
    flex: none;
  }

  .form-group .input-area {
    flex: none;
    width: 100%;
  }

  .form-group .input-area input,
  .form-group .input-area select,
  .form-group .input-area textarea {
    padding: 8px;
    font-size: 1em;
    margin-bottom: 6px;
  }

  .form-group .description {
    margin-top: 5px;
    font-size: 0.85em;
    flex: none;
  }

  .form-group img {
    max-width: 100%;
    height: auto;
    margin-top: 6px;
  }

  input[type=submit] {
    width: 100%;
    padding: 12px;
    font-size: 1em;
    margin-top: 20px;
  }
}
/* === LOGO Y COLOR CORRECTO === */
.logo a {
  color: white;
  text-decoration: none;
  font-weight: bold;
  font-size: 1.3em;
}

/* === HEADER FIJO === */
header {
  background-color: #1a73e8;
  color: white;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* === NAV === */
nav {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

nav a {
  color: white;
  text-decoration: none;
  font-weight: bold;
}

nav a:hover {
  text-decoration: underline;
}

/* === ESPACIO PARA HEADER FIJO === */
body {
  padding-top: 120px; /* Ajustar si el header tiene más altura */
}

/* === RESPONSIVE HEADER PARA MÓVILES === */
@media (max-width: 700px) {
  header {
    flex-direction: column;
    align-items: flex-start;
    padding: 15px;
  }

  .logo a {
    font-size: 1.2em;
    margin-bottom: 10px;
  }

  nav {
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }

  nav a {
    margin: 4px 0;
  }
}

.menu-toggle {
  display: none;
  font-size: 1.5em;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  margin-left: auto;
}

@media (max-width: 700px) {
  .menu-toggle {
    display: block;
  }

  nav.barra-navegacion {
    display: none;
    flex-direction: column;
    width: 100%;
    margin-top: 10px;
  }

  nav.barra-navegacion.show {
    display: flex;
  }

  nav.barra-navegacion a {
    padding: 10px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
  }
}

/* === WHATSAPP FLOTANTE === */
#boton-whatsapp {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #25d366;
  color: white;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  font-size: 28px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 999;
}

#formulario-whatsapp {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 300px;
  background: white;
  border: 1px solid #ccc;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  padding: 15px;
  display: none;
  z-index: 999;
}

#formulario-whatsapp input,
#formulario-whatsapp textarea {
  width: 100%;
  margin-bottom: 10px;
  padding: 8px;
  border-radius: 5px;
  border: 1px solid #ccc;
}

#formulario-whatsapp button {
  background: #25d366;
  border: none;
  color: white;
  width: 100%;
  padding: 10px;
  font-weight: bold;
  border-radius: 5px;
  cursor: pointer;
}

#contenedor-whatsapp:hover #formulario-whatsapp {
  display: block;
}

/* === MEJORAS TABLA PRODUCTOS RESPONSIVE === */
.tabla-contenedor {
  width: 100%;
  overflow-x: auto;
  margin-bottom: 18px;
  box-shadow: 0 3px 12px rgba(26,115,232,0.06);
  background: #f9fafd;
  border-radius: 10px;
}

.tabla-productos {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  background: white;
}

.tabla-productos th, .tabla-productos td {
  border: 1px solid #ddd;
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
  white-space: normal;
  word-break: break-word;
}

.tabla-productos th {
  background: #e6f0fa;
  color: #1a73e8;
  font-weight: bold;
  white-space: nowrap;
  font-size: 1.08em;
}

.tabla-productos td.checkbox-codigo {
  text-align: center;
  vertical-align: middle;
  width: 42px;
  background: #f4f7f8;
}
.tabla-productos td.descripcion-ampliada {
  font-size: 0.6em;
  line-height: 1.2;
}
/* General para todas las celdas */
.tabla-productos td {
  background: #fff;
  font-size: 0.98em;
}

/* Código compacto y azul */
.tabla-productos td.codigo, .tabla-productos th.codigo {
  font-weight: bold;
  font-size: 0.8em;
  color: #244982;
  min-width: 80px;
  max-width: 110px;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

/* Precio alineado, monoespaciado y no-wrap */
.tabla-productos td.precio, .tabla-productos th.precio {
  white-space: nowrap;
  text-align: right;
  font-family: 'Roboto Mono', 'Consolas', monospace;
  font-size: 1.05em;
  color: #1456ad;
  min-width: 96px;
  max-width: 140px;
}

/* Imagen centrada */
.tabla-productos td.imagen, .tabla-productos th.imagen {
  text-align: center;
  vertical-align: middle; /* 🔥 Esto es lo que faltaba */
  min-width: 110px;
}

.tabla-productos img {
  max-width: 100px;
  max-height: 100px;
  object-fit: contain;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* === COMPACTAR ALTURA DE FILAS === */
.tabla-productos th, .tabla-productos td {
  padding-top: 6px;
  padding-bottom: 6px;
  line-height: 1.15;
}

/* Zebra */
.tabla-productos tbody tr:nth-child(even) td {
  background: #f6f8fb;
}

/* Responsive: padding menor y font-size menor en móviles */
@media (max-width: 700px) {
  .tabla-productos th, .tabla-productos td { padding: 7px 5px; }
  .tabla-productos { font-size: 0.97em; }
}

/* Menú desplegable (submenu) */
nav.barra-navegacion .submenu {
  position: relative;
}

nav.barra-navegacion .submenu-content {
  display: none;
  position: absolute;
  background-color: #060952d7;
  top: 100%;
  left: 0;
  min-width: 200px;
  z-index: 999;
}

nav.barra-navegacion .submenu-content a {
  display: block;
  padding: 10px;
  color: white;
  text-decoration: none;
}

nav.barra-navegacion .submenu-content a:hover {
  background-color: #155acb;
}

nav.barra-navegacion .submenu:hover .submenu-content {
  display: block;
}

.header-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
@media (max-width: 700px) {
  .header-top {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 100%;
    gap: 0 !important;
    position: relative;
  }
  .menu-toggle {
    display: block !important;
    margin-left: 0 !important;
    margin-right: 10px !important;
    padding: 4px 12px;
    font-size: 1.7em;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    align-self: center;
    z-index: 1001;
    order: 1;
  }
  .logo {
    margin-bottom: 0;
    order: 2;
  }
  nav.barra-navegacion {
    display: none !important;
    flex-direction: column !important;
    width: 100% !important;
    margin-top: 8px !important;
    background: #1a73e8 !important;
    border-radius: 0 0 10px 10px !important;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08) !important;
    position: static !important;
    left: 0 !important;
    top: auto !important;
    padding-bottom: 8px !important;
  }
  nav.barra-navegacion.show {
    display: flex !important;
  }
  nav.barra-navegacion a {
    width: 100%;
    padding: 14px 24px;
    border-top: 1px solid rgba(255,255,255,0.13);
    color: #fff;
    font-size: 1.08em;
  }
}
.menu-toggle {
  display: none;
}

.grecaptcha-badge {
    left: 0 !important;
    right: auto !important;
}
.cotizacion-imagen {
  text-align: center;
  margin-bottom: 30px;
}
.cotizacion-imagen img {
  max-width: 100%;
  height: auto;
  border: 2px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
/* Galería de proyectos */
.galeria-imagenes {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
  margin-top: 2rem;
}

.proyecto {
  max-width: 350px;
  width: 100%;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  background-color: #fff;
  text-align: center;
}

.proyecto img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  object-fit: cover;
  max-height: 220px;
}

.proyecto h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  color: #004c75;
}

.proyecto p {
  font-size: 0.95rem;
  color: #444;
  margin-top: 0.5rem;
}

/* Agrega al final de /css/estilos_cocimec.css — Estilos del Panel de Cliente */
.wrap{max-width:1100px;margin:24px auto;padding:0 16px}
.grid{display:grid;grid-template-columns:1fr 1fr 1fr;gap:16px}
@media (max-width:1000px){ .grid{grid-template-columns:1fr;}}
.card{background:#fff;border:1px solid #ddd;border-radius:12px;padding:18px}
.btn{display:inline-block;padding:10px 16px;border:0;border-radius:10px;background:#1a73e8;color:#fff;text-decoration:none}
.btn.secondary{background:#5f6368}
.btn.danger{background:#c62828}
.muted{color:#666}
.cols{display:grid;grid-template-columns:1fr 1fr;gap:14px}
@media (max-width:760px){ .cols{grid-template-columns:1fr;}}
.addr{border:1px solid #eee;border-radius:10px;padding:10px;margin:8px 0}
.addr .tag{display:inline-block;font-size:.8rem;color:#fff;background:#1a73e8;border-radius:999px;padding:2px 8px;margin-right:6px}
.row-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}
form.inline{display:inline}
.field{margin-bottom:10px}
label{display:block;font-size:.92rem;margin-bottom:4px}
input[type="text"],input[type="tel"]{width:100%;padding:10px;border:1px solid #bbb;border-radius:8px}
.legend{font-weight:600;margin:6px 0}
.alert{margin:10px 0;padding:10px;border-radius:8px;font-size:.95rem}
.alert.ok{background:#e8fff2;color:#1f8a4c;border:1px solid #b7f0cf}
.alert.err{background:#ffe8e8;color:#8a1f1f;border:1px solid #f2c2c2}
details > summary{cursor:pointer;font-weight:600;margin:6px 0}
