* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-padding-top: 70px;
  scroll-behavior: smooth;
}

.custom-navbar .navbar-nav .nav-link:hover {
  color: rgb(4, 64, 4) !important;
  transition: color 0.3s ease; 
}

/* Scrol para centrar contenidos */
#nuestra_historia,
#quienes_somos,
#mision {
  scroll-margin-top: 70px;
}

body {
  background-color: #f6f0d7;
  margin-top: 60px;
  overflow-x: hidden;
}

body h1 {
  color: rgb(4, 64, 4);
  font-style: italic;
  text-align: center;
  margin: 20px 0 10px 0;
}

#nosotros p,
.div2 p,
.div4 p,
.div6 p,
.description p {
  text-align: justify;
  text-justify: inter-word;
  -webkit-hyphens: auto;
  -ms-hyphens: auto;
  hyphens: auto; 
}

body p.lema {
  font-family: "Rouge Script", cursive;
  text-align: center;
  color: #f6f0d7;
  margin-bottom: 10px;
  font-size: 1.8rem;
  background-image: url("../img/pincelada.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 35% 100%;
  
}

.custom-navbar {
  background-color: #c5d89d !important;
}

#carouselExampleAutoplaying img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  object-position: center;
}

#ubicacion h3 {
  text-align: center;
  color: #333;
  margin-bottom: 20px;
}

#ubicacion iframe {
  width: 100%;
  height: 400px;
  border: none;
  border-radius: 15px;
  box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.1);
  display: block;
}

.div5 {
  border-radius: 15px;
  overflow: hidden;
  transform: translateZ(0);
}

/* carusel infinito */

.carousel-control-next,
.carousel-control-prev {
  touch-action: manipulation;
  -webkit-user-select: none; 
  -moz-user-select: none;   
  -ms-user-select: none;   
  user-select: none;         
  outline: none; 
}

body div .nuestros_productos {
  text-align: center;
  color: #e4dec4;
  margin-top: 30px;
}

#carouselExample {
  background-color: #9cab84;
  overflow: hidden;
  position: relative;
  padding: 60px 0;
  width: 100%;
}

#carouselExample::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background: linear-gradient(
    to top,
    rgba(248, 249, 250, 0),
    #f6f0d7
  ); 
  z-index: 1;
}

#carouselExample::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background: linear-gradient(
    to bottom,
    rgba(248, 249, 250, 0),
    #f6f0d7
  );
  z-index: 1;
}

#carouselExample .carousel-inner {
  display: flex;
  padding: 30px 0;

  overflow: hidden;
  scroll-behavior: smooth;
  white-space: nowrap;
}

#carouselExample .carousel-item {
  display: block;
  margin-right: 0;
  flex: 0 0 25%;
  transition: transform 0.5s ease;
}

#carouselExample .cards-wrapper {
  padding: 0 10px;
}

#carouselExample .card {
  width: 80% !important;
  border: none;
  border-radius: 15px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  background-color: #fff;
}

.carrusel_infinite .carousel-inner {
  display: flex;
  flex-wrap: nowrap;
  padding: 30px 0;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.carrusel_infinite .carousel-inner::-webkit-scrollbar {
  display: none;
}

.carrusel_infinite .carousel-item {
  display: block !important;
  flex: 0 0 25%;
  min-width: 25%;
  transition: transform 0.3s ease;
}

.carrusel_infinite .carousel-item .card-text {
  font-size: 0.9rem;
  color: #333;
  text-align: center;
  width: 100%;
  margin-bottom: 0;
  display: block;
}

.carrusel_infinite img {
  width: 100%;
  pointer-events: none;
  -webkit-user-select: none; 
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
/* Scrolls de parrafos */
.div2,
.div4 {
  max-height: 450px;
  overflow-y: auto;
  padding-right: 15px;
}

.div2::-webkit-scrollbar,
.div4::-webkit-scrollbar {
  width: 6px;
}

.div2::-webkit-scrollbar-thumb,
.div4::-webkit-scrollbar-thumb {
  background-color: #9cab84;
  border-radius: 10px;
}

.div2::-webkit-scrollbar-track,
.div4::-webkit-scrollbar-track {
  background: transparent;
}

/* Estlos tarjetas desplegables */

.tabContainer input {
  display: none;
}

.row {
  display: flex;
  color: white;
  flex-wrap: nowrap;
}

.icon {
  height: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 10px;
}

.description {
  opacity: 0;
  visibility: hidden;
  background: rgba(0, 0, 0, 0.6);
  width: 100%;
  padding: 20px;
  transition: all 0.3s ease;
}

.description h3,
.description p {
  color: white;
  font-size: 1.2rem;
  text-transform: uppercase;
}

#one {
  background-image: url("../img/produccion1.jpeg");
}
#two {
  background-image: url("../img/produccion2.jpeg");
}
#three {
  background-image: url("../img/produccion3.jpeg");
}
#four {
  background-image: url("../img/produccion4.jpeg");
}

/* Formulario */

textarea {
  background-image: url("../img/logo_textarea.svg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  background-attachment: local;
  background-color: white;
}

#contactForm .btn-primary {
  background-color: #4a6741;
  border-color: #3d5435;
  font-weight: bold;
}

#contacto p, 
#contacto label {
  text-align: left;
  margin-bottom: 5px;
}

#mensajeExito {
  display: none;
}

footer {
  background-color: #9cab84;
  color: #333;
  padding: 10px 0;
}

footer p {
  text-align: center;
}

/* Estilos para dispositivos móviles */

@media (max-width: 768px) {
  .grid-container {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: repeat(12, auto);
    grid-column-gap: 0px;
    grid-row-gap: 4px;
    padding-left: 20px;
    padding-right: 20px;
  }

 body p.lema {
    position: relative; 
    font-size: min(6vw, 1.8rem ) !important;
    white-space: nowrap !important;
    overflow: hidden;
    text-align: center;
    padding: 0px 5px;
    background-image: none !important;
  }

  .lema::before {
    content: "";
    position: absolute;
   top: -5px;  
    left: -10px;   
    width: calc(100% + 20px); 
    height: calc(100% + 10px); 
    background-image: url("../img/pincelada.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100% 100%;
    z-index: -1;
  }
  /* carousel nuestra historia*/
  .div1 {
    grid-area: 1 / 1 / 3 / 2;
    margin-top: 15px;
  }
  .div2 {
    grid-area: 3 / 1 / 5 / 2;
    max-height: 350px;
    overflow-y: auto;
    padding-right: 15px;
    margin-top: 25px;
    margin-bottom: 40px;
  }
  /* acordeon */
  .div3 {
    grid-area: 5 / 1 / 7 / 2;
    width: 100%;
    height: 350px;
    display: flex;
    overflow: hidden;
    margin-top: 20px;
    margin-bottom: 20px;
  }
  .div4 {
    grid-area: 7 / 1 / 9 / 2;
    max-height: 270px;
    overflow-y: auto;
    padding-right: 15px;
    margin-top: 15px;
    margin-bottom: 40px;
  }
  .div5 {
    grid-area: 9 / 1 / 11 / 2;
    margin-top: 40px;
    margin-bottom: 20px;
  }
  .div6 {
    grid-area: 11 / 1 / 13 / 2;
    max-height: 350px;
    overflow-y: auto;
    padding-right: 15px;
    margin-top: 40px;
    margin-bottom: 40px;
  }
  .grid-container img,
  .grid-container .carousel {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
  }

  #nosotros {
    margin: 60px 20px 60px 20px;
  }

  #ubicacion {
    margin-left: 20px;
    margin-right: 20px;
  }

  #ubicacion iframe {
    height: 80vh;
    margin-bottom: 20px;
  }

  #contacto {
    padding: 20px;
    margin-top: 50px;
    margin-bottom: 50px;
  }

  #contacto h2{
    text-align: center;
    color: #333;
    margin-bottom: 40px;
  }

  #contacto form {
    margin-top: 20px;
  }

  #contactForm .btn-primary {
    padding: 10px 30px;
  }

  /* Contenedor de las tarjetas */
  .tabContainer {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 100%;
    gap: 8px;
    justify-content: center;
    align-items: stretch;
  }

  .tabContainer input {
    display: none;
  }

.carrusel_infinite .carousel-item {
    flex: 0 0 85%; 
    min-width: 85%;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .card {
    display: flex;
    flex: 1;
    height: 100%;
    min-width: 0;
    border-radius: 10px;
    background-position: center;
    background-size: cover;
    cursor: pointer;
    overflow: hidden;
    transition: flex 0.6s cubic-bezier(0.28, -0.03, 0, 0.99);
    align-items: flex-end;
    position: relative;
  }

  .tabContainer input:checked + .card {
    flex: 5;
  }

  .description {
    opacity: 0;
    visibility: hidden;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    width: 100%;
    padding: 15px 10px;
    transition: opacity 0.3s ease;
    position: absolute;
    bottom: 0;
    left: 0;
  }

  /* Descripción solo en la tarjeta expandida */
  .tabContainer input:checked + .card .description {
    opacity: 1 !important;
    visibility: visible !important;
  }

  .description h3 {
    font-size: 1rem;
    margin: 0;
    color: white;
    text-transform: uppercase;
  }
  .description p {
    font-size: 0.8rem;
    margin: 0;
    color: white;
    line-height: 1.2;
  }
  /* carruosel infinito */

  #carouselExample .carousel-item {
    flex: 0 0 85%;
    margin-top: 35px;
    margin-bottom: 40px;
  }

  #carouselExample .card img {
    height: 50vh;
    width: 100%;
    object-fit: cover;
    display: block;
  }

  /* Scrol para centrar contenidos */
  #titulo {
    margin-top: 70px;
  }

  body p.lema {
    margin-top: 20px;
    margin-bottom: 30px;
  }

  #nuestra_historia,
  #quienes_somos,
  #mision {
    scroll-margin-top: 10px;
  }
}

/* Estilos para tablets y pantallas medianas */

@media (min-width: 769px) and (max-width: 1024px) {
  .grid-container,
  #nosotros,
  #ubicacion,
  #contacto {
    width: 100%;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 20px;
    padding-right: 20px;
    box-sizing: border-box;
  }

  .grid-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
    overflow: hidden;
    padding: 0 20px;
    align-items: start;
  }

  #nosotros {
    margin-top: 50px;
    margin-bottom: 50px;
  }

  .div2,
  .div4,
  .div6 {
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-height: none;
    overflow-y: auto;
    padding-right: 15px
  }

  .scroll-content {
  max-height: 250px; 
  overflow-y: auto;
  padding-right: 15px;
}

.scroll-content::-webkit-scrollbar {
  width: 6px;
}

.scroll-content::-webkit-scrollbar-thumb {
  background-color: #9cab84;
  border-radius: 10px;
}

  .div1, .div2, .div3, .div4, .div5, .div6 {
    margin-top: 40px;
    margin-bottom: 40px;
  }



  .div2 p, .div4 p, .div6 p {
  margin-bottom: 0;
}

  .div2 {
    order: 1;
  }
  .div1 {
    order: 2;
  }
  .div3 {
    order: 3;
  }
  .div4 {
    order: 4;
  }
  .div6 {
    order: 5;
  }
  .div5 {
    order: 6;
  }

  .grid-container img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  }

  .grid-container p {
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
  }

  #contactForm .btn-primary {
    padding: 10px 30px;
  }

  #contacto {
    padding: 20px;
  }

  #contacto form {
    padding: 0 100px;
  }

  /* acordeon*/

  .div3 {
    width: 100%;
    height: 350px;
    display: flex;
    overflow: hidden;
    margin-bottom: 20px;
  }

  /* Contenedor de las tarjetas */
  .tabContainer {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 100%;
    gap: 8px;
    justify-content: center;
    align-items: stretch;
  }

  .tabContainer input {
    display: none;
  }

  .card {
    display: flex;
    flex: 1;
    height: 100%;
    min-width: 0;
    border-radius: 10px;
    background-position: center;
    background-size: cover;
    cursor: pointer;
    overflow: hidden;
    transition: flex 0.6s cubic-bezier(0.28, -0.03, 0, 0.99);
    align-items: flex-end;
    position: relative;
  }

    .carrusel_infinite .card img {
  height: 250px;
  object-fit: cover;
}

  .tabContainer input:checked + .card {
    flex: 5;
  }

  .description {
    opacity: 0;
    visibility: hidden;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    width: 100%;
    padding: 15px 10px;
    transition: opacity 0.3s ease;
    position: absolute;
    bottom: 0;
    left: 0;
  }

  .tabContainer input:checked + .card .description {
    opacity: 1 !important;
    visibility: visible !important;
  }

  .description h3 {
    font-size: 1rem;
    margin: 0;
    color: white;
    text-transform: uppercase;
  }
  .description p {
    font-size: 0.8rem;
    margin: 0;
    color: white;
    line-height: 1.2;
  }
}

/* Estilos para pantallas grandes */

@media (min-width: 1025px) {
  .grid-container,
  #nosotros,
  #ubicacion,
  #contacto {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    padding-left: 20px;
    padding-right: 20px;
    box-sizing: border-box;
  }

  .grid-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    max-width: 1200px;
    margin: 0 auto;

    column-gap: 60px;
    row-gap: 300px;
    width: 85%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 0;
    align-items: center;
  }

  .div2 {
    order: 1;
  }
  .div1 {
    order: 2;
  }
  .div3 {
    order: 3;
  }
  .div4 {
    order: 4;
  }
  .div6 {
    order: 5;
  }
  .div5 {
    order: 6;
  }

  .div2,
  .div4,
  .div6 {
    font-size: 1.1rem;
    line-height: 1.7;
  }

  .grid-container img {
    width: 100%;
    height: 450px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  }

  .grid-container p {
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
  }

  #carouselExampleAutoplaying img {
    height: 400px;
    object-fit: cover;
    object-position: center 30%;
  }
  #carouselExampleAutoplaying .carousel-item:nth-child(1) img {
    object-position: 40%;
  }


  #nosotros {
    margin-top: 30px;
    margin-bottom: 50px;
  }

  #ubicacion {
    margin-top: 100px;
    margin-bottom: 50px;
  }

  #ubicacion iframe {
    height: 500px;
  }

  #contactForm .btn-primary {
    padding: 10px 30px;
  }

  #contacto {
    padding: 20px;
    margin-bottom: 40px;
  }

  #contacto h2 {
    text-align: center;
    color: #333;
    margin-bottom: 40px;
  }

  #contacto p{
    padding-left: 100px;
    color: #555;
    margin-bottom: 20px;
  }

  #contacto form {
    padding: 0 100px;
  }

  /* Animacion fade in out*/

  .revelar {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
  }
  .revelar.active {
    opacity: 1;
    transform: translateY(0);
  }

  /* Contenedor del acordeón (div3) */
  .div3 {
    width: 100%;
    height: 450px;
    display: flex;
    overflow: hidden;
  }

  .tabContainer {
    display: flex;
    width: 100%;
    height: 100%;
    gap: 10px;
  }

  .tabContainer input {
    display: none;
  }

.carrusel_infinite .carousel-item {
    flex: 0 0 25%;
    min-width: 25%;
    scroll-snap-align: start;
  }

  .card {
    display: flex;
    cursor: pointer;
    align-items: flex-end;
    flex: 1;
    height: 100%;
    min-width: 0;
    border-radius: 12px;
    background-position: center;
    background-size: cover;
    transition: flex 0.6s cubic-bezier(0.28, -0.03, 0, 0.99);
  }

  .carrusel_infinite .card img {
  height: 420px;
  object-fit: cover;
}

  /* Tarjeta abierta */
  .tabContainer input:checked + .card {
    flex: 5;
  }

  .description {
    opacity: 0;
    visibility: hidden;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    width: 100%;
    padding: 15px 10px;
    transition: opacity 0.3s ease;
    position: absolute;
    bottom: 0;
    left: 0;
  }

  .tabContainer input:checked + .card .description {
    opacity: 1 !important;
    visibility: visible !important;
  }

  .description h3 {
    font-size: 1rem;
    margin: 0;
    color: white;
    text-transform: uppercase;
  }
  .description p {
    font-size: 0.8rem;
    margin: 0;
    color: white;
    line-height: 1.2;
  }
}

.tabContainer input:checked + .card .description {
  opacity: 1;
  pointer-events: auto;
}

.card:not(:checked) {
  filter: brightness(0.8);
}
