/* ================================
   RESETEO GENERAL
================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  background-color: #f5f9f6;
  color: #333;
}

img {
  max-width: 100%;
  display: block;
  border-radius: 8px;
}

/* ================================
   ENCABEZADO FIJO
================================== */
header {
  background-color: #007a42;
  color: white;
  text-align: center;
  padding: 15px 20px;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
}

header h1 {
  font-size: 1.6rem;
  letter-spacing: 1px;
  margin-bottom: 5px;
}

nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 25px;
  flex-wrap: wrap;
}

nav a {
  color: white;
  font-weight: bold;
  text-decoration: none;
  transition: color 0.3s;
}

nav a:hover {
  color: #ffe600;
}

/* ================================
   SECCIÓN HERO (INICIO)
================================== */
.hero {
  background: linear-gradient(rgba(0, 122, 66, 0.8), rgba(0, 122, 66, 0.8)),
              url('img/fondo-solar.jpg') center/cover no-repeat;
  color: white;
  text-align: center;
  padding: 140px 20px 120px;
  margin-top: 60px;
}

.hero-content h2 {
  font-size: 2.2rem;
  margin-bottom: 10px;
}

.hero-content p {
  font-size: 1.1rem;
  margin-bottom: 25px;
}

.btn-principal {
  background: #ffe600;
  color: #007a42;
  padding: 12px 30px;
  border-radius: 8px;
  font-weight: bold;
  transition: all 0.3s;
  text-decoration: none;
}

.btn-principal:hover {
  background: white;
  transform: scale(1.05);
}

/* ================================
   BOTÓN SUBIR
================================== */
#btnSubir {
  display: none;
  position: fixed;
  bottom: 25px;
  right: 25px;
  background: #00a64f;
  color: white;
  border: none;
  border-radius: 50%;
  padding: 14px;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
  z-index: 999;
  transition: background 0.3s, transform 0.2s;
}

#btnSubir:hover {
  background: #007a42;
  transform: scale(1.1);
}

/* ================================
   SECCIONES GENERALES
================================== */
section {
  padding: 100px 20px 70px;
}

.max-content {
  max-width: 1150px;
  margin: 0 auto;
}

/* Fondo alternado */
.section-products:nth-of-type(even),
.section-installation:nth-of-type(even),
.section-maintenance:nth-of-type(even),
.section-quote:nth-of-type(even) {
  background: #ecf9f1;
}

/* ================================
   TÍTULOS Y TEXTOS DE SECCIÓN
================================== */
section h2 {
  text-align: center;
  color: #007a42;
  margin-bottom: 10px;
  font-size: 1.9rem;
  font-weight: bold;
}

section p {
  text-align: center;
  margin-bottom: 25px;
  font-size: 1rem;
  color: #444;
}

/* ================================
   BOTONES GENERALES
================================== */
button {
  padding: 10px 20px;
  background-color: #00a64f;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
}

button:hover {
  background-color: #007a42;
  transform: scale(1.03);
}

/* ================================
   FORMULARIOS
================================== */
form {
  background-color: #ffffff;
  padding: 25px 30px;
  margin-top: 25px;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 15px;
  animation: aparecerForm 0.4s ease;
}

form h3 {
  text-align: center;
  color: #007a42;
  margin-bottom: 10px;
  font-size: 1.3rem;
}

input,
select,
textarea {
  width: 100%;
  padding: 12px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 15px;
  transition: border 0.3s, box-shadow 0.3s;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #00a64f;
  box-shadow: 0 0 4px rgba(0, 166, 79, 0.4);
}

textarea {
  resize: vertical;
  min-height: 90px;
}

form button[type="submit"] {
  align-self: center;
  padding: 12px 35px;
  border-radius: 8px;
  background: #00a64f;
  color: #fff;
  font-weight: bold;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.3s, transform 0.3s;
}

form button[type="submit"]:hover {
  background: #007a42;
  transform: scale(1.05);
}

@keyframes aparecerForm {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ================================
   CATÁLOGO ESTILO TIENDA
================================== */
.catalogo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 25px;
  margin-top: 25px;
}

.catalogo-item {
  background: #fff;
  border: 1px solid #d4ecdf;
  border-radius: 10px;
  padding: 15px;
  text-align: center;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s, box-shadow 0.3s;
}

.catalogo-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.12);
}

.catalogo-item img {
  width: 100%;
  height: 170px;
  object-fit: cover;
  border-radius: 8px;
}

.catalogo-item h4 {
  color: #007a42;
  margin: 10px 0 5px;
  font-weight: bold;
  font-size: 1.05rem;
}

.catalogo-item p {
  font-size: 14px;
  color: #555;
  line-height: 1.4;
  margin-bottom: 10px;
}

.catalogo-item .precio {
  color: #00a64f;
  font-weight: bold;
  font-size: 1rem;
  margin: 8px 0;
  display: block;
}

.catalogo-item .cantidad {
  width: 70px;
  text-align: center;
  border-radius: 5px;
  border: 1px solid #ccc;
  padding: 6px;
}

/* ================================
   TABS (PESTAÑAS)
================================== */
.tabs {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 25px;
  flex-wrap: wrap;
}

.tab-btn {
  background: #00a64f;
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.3s, transform 0.2s;
}

.tab-btn:hover {
  background: #007a42;
  transform: scale(1.05);
}

.tab-btn.active {
  background: #ffe600;
  color: #007a42;
  box-shadow: 0 0 8px rgba(255, 230, 0, 0.5);
}

.tab-content {
  display: none;
  animation: aparecerTab 0.4s ease;
}

.tab-content.active {
  display: block;
}

@keyframes aparecerTab {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ================================
   RESUMEN TOTAL
================================== */
.resumen-total {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-top: 30px;
  padding: 15px;
  background: #f0fff5;
  border: 1px solid #cce9d8;
  border-radius: 8px;
}

.resumen-total .btn-ver-total {
  background: #00a64f;
  color: white;
  border-radius: 5px;
  padding: 10px 20px;
  font-weight: bold;
}

.resumen-total .total {
  font-size: 18px;
  font-weight: bold;
  color: #007a42;
}

/* ================================
   BOTÓN HACER COTIZACIÓN
================================== */
.btn-hacer-cotizacion {
  display: block;
  margin: 25px auto 0;
  background: #00a64f;
  color: white;
  border-radius: 8px;
  padding: 12px 35px;
  font-weight: bold;
  font-size: 16px;
  transition: all 0.3s;
}

.btn-hacer-cotizacion:hover {
  background: #007a42;
  transform: scale(1.05);
}

/* ================================
   MODAL DE CONFIRMACIÓN
================================== */
.modal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-color: rgba(0,0,0,0.6);
  justify-content: center;
  align-items: center;
  z-index: 3000;
}

.modal-content {
  background: white;
  padding: 25px 30px;
  border-radius: 10px;
  width: 90%;
  max-width: 400px;
  text-align: center;
  animation: aparecer 0.3s ease;
}

@keyframes aparecer {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.modal-content h3 {
  color: #007a42;
  margin-bottom: 15px;
}

#resumenPedido {
  text-align: left;
  font-size: 15px;
  color: #444;
  margin-bottom: 15px;
}

.modal-buttons {
  display: flex;
  justify-content: space-around;
  gap: 15px;
  margin-top: 15px;
}

.btn-confirmar,
.btn-cancelar {
  padding: 10px 18px;
  border-radius: 8px;
  color: white;
  font-weight: bold;
  cursor: pointer;
}

.btn-confirmar { background: #00a64f; }
.btn-cancelar { background: #999; }

.btn-confirmar:hover { background: #007a42; }
.btn-cancelar:hover { background: #666; }

/* ================================
   FOOTER
================================== */
footer {
  background-color: #007a42;
  color: white;
  text-align: center;
  padding: 35px 20px;
  margin-top: 40px;
}

footer .social-media {
  display: flex;
  justify-content: center;
  gap: 25px;
  margin-bottom: 15px;
}

footer .social-media img {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s;
}

footer .social-media img:hover {
  transform: scale(1.1);
}

/* ================================
   RESPONSIVE
================================== */
@media (max-width: 768px) {
  header h1 {
    font-size: 1.2rem;
  }

  nav ul {
    flex-direction: column;
    gap: 12px;
  }

  .catalogo-grid {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  }

  .resumen-total {
    flex-direction: column;
    gap: 10px;
  }

  form {
    padding: 20px;
  }

  form h3 {
    font-size: 1.1rem;
  }

  .modal-content {
    width: 90%;
    padding: 20px;
  }

  .btn-hacer-cotizacion {
    width: 100%;
  }

  .tabs {
    flex-direction: column;
    gap: 10px;
  }
}
