/* =========================================
   1. FUENTES Y VARIABLES
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@700&family=Roboto:wght@400;500&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --font-principal: 'Roboto', sans-serif;
  --font-titulos: 'Montserrat', sans-serif;
  --color-naranja: #E9531E;
  --color-azul-acero: #5E7F96;
  --color-casi-negro: #0A0A0A;
  --color-gris-medio: #6C6C6C;
  --color-blanco: #FFFFFF;
  --color-azul-corporativo: #1e3a5f;
}

html {
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font-principal);
  color: var(--color-casi-negro);
  background-color: #fcfcfc;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-titulos);
  font-weight: 700;
  color: var(--color-azul-corporativo);
}

/* =========================================
   2. TIPOGRAFÍA Y ESTILOS GENERALES
   ========================================= */

#ofertas h2,
#nosotros h2,
#productos h2,
#contacto h2 {
  font-family: 'Playfair Display', serif;
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--color-azul-corporativo);
  margin-bottom: 1rem;
}

#ofertas h2 span,
#nosotros h2 span,
#productos h2 span,
#contacto h2 span {
  color: var(--color-naranja);
  font-style: italic;
}

/* Clases de Color */
.text-color-azul {
  color: var(--color-azul-acero);
}

.text-color-gris {
  color: var(--color-gris-medio);
}

.text-color-negro {
  color: var(--color-casi-negro);
}

.text-color-naranja {
  color: var(--color-naranja) !important;
}

.text-color-azul-oscuro {
  color: var(--color-azul-corporativo);
}

.bg-dark-custom {
  background-color: var(--color-casi-negro) !important;
}

.bg-azul-custom {
  background-color: var(--color-azul-acero);
}

.bg-naranja-custom {
  background-color: var(--color-naranja);
}

.bg-light-custom {
  background-color: var(--color-gris-medio);
}

/* Botones */
.btn-primary-custom {
  background-color: var(--color-naranja);
  border-color: var(--color-naranja);
  color: var(--color-blanco);
  font-weight: 600;
  padding: 0.6rem 1.5rem;
  border-radius: 6px;
  transition: all 0.3s ease;
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
}

.btn-primary-custom:hover {
  background-color: #c94617;
  border-color: #c94617;
  color: var(--color-blanco);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(233, 83, 30, 0.3);
}

/* Inputs (Formularios mejorados) */
.form-control {
  padding: 12px 15px;
  min-height: 50px;
  border: 1px solid #ced4da;
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-control:focus {
  border-color: var(--color-naranja);
  box-shadow: 0 0 0 4px rgba(233, 83, 30, 0.15);
  outline: none;
}

/* =========================================
   3. NAVBAR
   ========================================= */
.navbar {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.navbar .navbar-brand {
  color: var(--color-azul-corporativo);
  font-family: 'Playfair Display', serif;
}

.navbar-nav .nav-link {
  font-family: var(--font-titulos);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 1px;
  color: var(--color-azul-corporativo) !important;
  transition: color 0.2s;
}

.navbar-nav .nav-link:hover {
  color: var(--color-naranja) !important;
}

/* =========================================
   4. HERO SECTION
   ========================================= */
.hero-section {
  background: linear-gradient(rgba(30, 58, 95, 0.7), rgba(30, 58, 95, 0.7)), url('./assets/Facahada-Saez.jpg');
  background-size: cover;
  background-position: center;
  min-height: 75vh;
  display: flex;
  align-items: center;
  position: relative;
}

.hero-section h1 {
  font-weight: 700;
  color: white;
}

/* =========================================
   5. SECCIÓN OFERTAS (CARRUSEL MODO OSCURO/BLUR)
   ========================================= */
#ofertas {
  background-color: #f8f9fb;
  padding-top: 4rem;
  padding-bottom: 4rem;
  border-bottom: 1px solid #e9ecef;
}

#carruselOfertas {
  box-shadow: 0 15px 35px rgba(30, 58, 95, 0.15);
  background-color: #111;
  /* Fondo muy oscuro */
  border-radius: 12px;
  overflow: hidden;
  margin: 0 auto;
  max-width: 100%;
}

/* CONTENEDOR DEL SLIDE */
.carousel-item {
  height: 500px;
  /* Altura FIJA */
  width: 100%;

  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;

  position: relative;
  overflow: hidden;
}

/* EFECTO BLUR OSCURO */
.carousel-item::before {
  content: "";
  position: absolute;
  top: -10%;
  left: -10%;
  right: -10%;
  bottom: -10%;

  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);

  z-index: 1;
}

/* IMAGEN PRINCIPAL (La Oferta) */
.carousel-offer-img {
  width: 100%;
  height: 100% !important;
  object-fit: contain;
  object-position: center;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.1));
}

/* Texto sobre la imagen */
.carousel-caption {
  z-index: 3;
  text-shadow: none;
  left: 0;
  right: 0;
  width: 100%;
}

/* NUEVA CLASE: Contenedor de Texto Centrado y COMPACTO */
.text-container-naranja {
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.5) 70%, rgba(0, 0, 0, 0) 100%);
  border-left: 5px solid var(--color-naranja);
  padding: 10px 20px;
  margin-left: 0;
  margin-right: auto;
  max-width: 400px;
  width: 90%;
  text-align: left;
}

/* Sombra de texto suave para asegurar la legibilidad */
.carousel-caption h3,
.carousel-caption p,
.text-container-naranja span {
  /* Aplicamos sombra también a los span del precio */
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8) !important;
}

/* Alineación de texto dentro del bloque compacto */
.text-container-naranja h3,
.text-container-naranja p {
  text-align: left;
}


.carousel-control-prev,
.carousel-control-next {
  z-index: 100 !important;
  width: 10%;
  cursor: pointer;
}

/* 3. Aseguramos que se vean BLANCAS (quitamos filtros anteriores) */
.carousel-control-prev-icon,
.carousel-control-next-icon {
  filter: none !important;
  opacity: 1;
  width: 3rem;
  height: 3rem;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
  background-color: rgba(0, 0, 0, 0.2);
}

/* =========================================
   6. SECCIÓN SOBRE NOSOTROS (SIMETRÍA PERFECTA)
   ========================================= */
#nosotros {
  background-color: white;
}

/* TEXTO */
.text-bio {
  color: #4a5568 !important;
  font-size: 1.05rem;
  line-height: 1.8;
}

.text-bio ul {
  list-style-type: none !important;
  list-style: none !important;
  padding-left: 0;
}

.text-bio li {
  list-style-type: none !important;
  /* Doble seguridad */
  list-style: none !important;
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.5rem;
}

.text-bio li::before {
  content: "\f00c";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  color: var(--color-naranja);
  position: absolute;
  left: 0;
}

.mt-xl {
  margin-top: 5rem !important;
}

/* --- MAGIA DE LA SIMETRÍA (SOLO PC) --- */
@media (min-width: 768px) {

  /* 1. Forzar que las filas estiren el contenido */
  #nosotros .row {
    align-items: stretch !important;
  }

  /* 2. Columna flexible */
  #nosotros .col-md-6 {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  /* 3. IMAGEN: Llenar el 100% de la altura disponible */
  #nosotros img {
    width: 100%;
    height: 100% !important;
    min-height: 350px;
    object-fit: cover;
    /* Recorta para llenar el hueco */
    border-radius: 12px;
    box-shadow: 0 15px 30px rgba(30, 58, 95, 0.15);
    transition: transform 0.3s ease;
    margin: 0;
  }

  #nosotros img:hover {
    transform: scale(1.02);
    box-shadow: 0 25px 50px rgba(232, 93, 45, 0.2);
  }

  .text-bio {
    text-align: justify !important;
  }
}

/* --- LÓGICA MÓVIL --- */
@media (max-width: 767px) {
  #nosotros img {
    width: 100%;
    height: auto;
    aspect-ratio: 4/3;
    object-fit: cover;
    border-radius: 12px;
    margin-top: 1.5rem;
    box-shadow: 0 10px 20px rgba(30, 58, 95, 0.1);
  }

  .text-bio {
    text-align: left !important;
  }
}

/* =========================================
   7. SECCIÓN PRODUCTOS
   ========================================= */
#productos {
  background-color: #f8f9fb;
}

#productos .fs-5 {
  color: #5a6c7d;
}

.product-card {
  border: none;
  border-radius: 16px;
  background: white;
  transition: all 0.3s ease;
  overflow: hidden;
}

.product-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1) !important;
}

.product-card-icon-bg {
  width: 100px;
  height: 100px;
  margin: 0 auto 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(30, 58, 95, 0.05) 0%, rgba(232, 93, 45, 0.1) 100%);
  border-radius: 50%;
}

.product-card .card-body i {
  color: var(--color-naranja);
}

.product-card .card-title {
  font-size: 1.3rem;
  color: var(--color-azul-corporativo);
}

.btn-ver-productos {
  background-color: var(--color-azul-corporativo);
  color: white;
  padding: 1rem 3rem;
  font-weight: 600;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 10px 20px rgba(30, 58, 95, 0.2);
  transition: all 0.3s ease;
  text-decoration: none;
}

.btn-ver-productos:hover {
  background-color: #162a4a;
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 15px 25px rgba(30, 58, 95, 0.3);
}

/* =========================================
   8. CONTACTO
   ========================================= */
#contacto {
  background-color: white;
}

.contact-info-box {
  padding: 2.5rem;
  border-left: 5px solid var(--color-naranja);
  background-color: #f8f9fb;
  border-radius: 8px;
  height: 100%;
}

.contact-info-box p {
  color: #5a6c7d;
}

.contact-info-box strong {
  color: var(--color-azul-corporativo);
}

.contact-info-box i {
  color: var(--color-naranja);
  font-size: 1.2rem;
  margin-right: 15px;
  width: 25px;
  text-align: center;
}

.contact-info-box a {
  color: var(--color-azul-corporativo);
  text-decoration: none;
  font-weight: 700;
  transition: color 0.2s ease;
}

.contact-info-box a:hover {
  color: var(--color-naranja);
}

#contacto iframe {
  box-shadow: 0 20px 40px rgba(30, 58, 95, 0.1);
  border-radius: 12px;
  width: 100%;
  height: 450px;
}

/* =========================================
   9. FOOTER
   ========================================= */
.footer-custom {
  background-color: var(--color-azul-corporativo);
  color: #cbd5e0;
  font-size: 0.95rem;
}

.footer-custom h6 {
  color: white;
  letter-spacing: 0.5px;
  margin-bottom: 1.5rem;
}

.footer-custom a {
  color: #cbd5e0;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-custom a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.footer-custom hr {
  opacity: 0.1;
  margin: 3rem 0;
}

/* --- CORRECCIÓN DE ALINEACIÓN DEL FOOTER EN MÓVIL --- */
@media (max-width: 768px) {

  .footer-custom {
    text-align: center !important;
  }

  .footer-custom ul {
    padding-left: 0;
    list-style-position: inside;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .footer-custom li {
    width: 100%;
    text-align: center;
    margin-bottom: 0.5rem;
  }

  .footer-custom .navbar-brand-footer {
    justify-content: center !important;
  }

  .copyright-text p {
    margin-left: 0;
    margin-right: 0;
    text-align: center;
  }
}

/* =========================================
   10. AJUSTES FINALES (RESPONSIVE)
   ========================================= */
@media (max-width: 991px) {
  .carousel-item {
    height: 400px;
  }

  .hero-section h1 {
    font-size: 2.5rem;
  }
}

@media (max-width: 768px) {

  #ofertas h2,
  #nosotros h2,
  #productos h2,
  #contacto h2 {
    font-size: 2rem;
  }

  .carousel-item {
    height: 300px;
  }

  #carruselOfertas .carousel-control-prev,
  #carruselOfertas .carousel-control-next {
    width: 10%;
  }

  .text-container-naranja {
    max-width: 350px;
    margin-left: 12%;
    margin-right: auto;
    margin-bottom: 20px;
    padding: 10px 15px 10px 15px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.5) 70%, rgba(0, 0, 0, 0) 100%);
    border-left: 5px solid var(--color-naranja);
    border-top: none;

    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    text-align: left !important;
  }

  .text-container-naranja>div {
    display: block !important;
    width: 100% !important;
    text-align: left !important;
    padding-left: 0 !important;
    margin: 0 !important;
  }

  .carousel-caption h3,
  .carousel-caption p,
  .text-container-naranja span {
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8) !important;
  }

  .text-container-naranja h3,
  .text-container-naranja p {
    text-align: left !important;
    width: 100%;
  }

  .text-container-naranja .d-inline-block {
    float: left !important;
    margin-left: 0 !important;
    margin-right: auto !important;
  }

  .contact-info-box {
    margin-bottom: 2rem;
  }
}

/* =========================================
   11. ESTILOS ESPECÍFICOS DEL PANEL ADMIN
   ========================================= */

/* Header Sticky (Fijo al hacer scroll en la tabla) */
.table-responsive thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: #212529; /* Color oscuro de bootstrap */
  color: white;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  vertical-align: middle;
}

/* Control de Imágenes dentro de la tabla (Evita imágenes gigantes) */
#offersTableBody img {
  width: 60px;
  height: 60px;
  object-fit: contain; /* Asegura que la imagen no se deforme */
  background-color: #fff;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 2px;
}

/* Ajustes de celdas para mejor alineación */
#offersTableBody td {
  font-size: 0.95rem;
  padding: 10px;
}

/* Scrollbar personalizada para el div de la tabla */
.table-responsive::-webkit-scrollbar {
  width: 8px;
}
.table-responsive::-webkit-scrollbar-track {
  background: #f1f1f1; 
}
.table-responsive::-webkit-scrollbar-thumb {
  background: #ccc; 
  border-radius: 4px;
}
.table-responsive::-webkit-scrollbar-thumb:hover {
  background: #aaa; 
}

/* =========================================
   12. CORRECCIÓN DE EMERGENCIA PARA LA TABLA
   ========================================= */

/* 1. Forzar alineación estricta entre cabecera y cuerpo */
.table {
    table-layout: fixed !important; /* CRUCIAL: Alinea las columnas */
    width: 100% !important;
    border-collapse: collapse;
}

/* 2. Asegurar que las celdas no se rompan */
.table td, .table th {
    white-space: nowrap; /* Evita que el texto salte de línea */
    overflow: hidden;
    text-overflow: ellipsis; /* Pone "..." si el texto es muy largo */
    vertical-align: middle !important; /* Centrado vertical perfecto */
    padding: 0.5rem 0.5rem !important; /* Padding controlado */
}

/* 3. Corrección específica para la columna de imágenes */
#offersTableBody img {
    display: block;
    margin: 0 auto; /* Centrar imagen horizontalmente */
    max-height: 50px; /* Altura máxima controlada */
    width: auto;
}

/* 4. Quitar bordes o espacios extraños en las filas */
.table tbody tr {
    height: auto !important; /* Deja que la altura se ajuste al contenido */
}

/* 5. Asegurar que el div contenedor maneje el scroll */
.table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
}