:root {
  --vino: #98A1BC;
  --vino-oscuro: #555879;
  --blanco: #ffffff;
  --plata: #dddddd;
  --gris-oscuro: #222222;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Montserrat', sans-serif;
  color: var(--gris-oscuro);
  background-color: var(--blanco);
}


.header {
  background-color: var(--vino-oscuro);
  color: var(--blanco);
  padding: 1.5rem 2rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas:
    "menu logo cart"
    "nav nav nav";
  align-items: center;
  position: relative;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.menu-toggle {
  grid-area: menu;
  font-size: 1.8rem;
  cursor: pointer;
  color: var(--blanco);
  display: none;
}

a{
  text-decoration: none;
}

.logo {
  grid-area: logo;
  font-size: 1.8rem;
  font-weight: 700;
  text-align: center;
}

.cart {
  grid-area: cart;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.3rem;
}

.menu-links {
  grid-area: nav;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  padding-top: 1rem;
}

.menu-links a {
  color: var(--blanco);
  text-decoration: none;
  font-weight: 500;
  position: relative;
  transition: color 0.3s ease;
}

.menu-links a::after {
  content: '';
  position: absolute;
  width: 0%;
  height: 2px;
  bottom: -4px;
  left: 0;
  background-color: var(--plata);
  transition: width 0.3s ease;
}

.menu-links a:hover {
  color: var(--plata);
}

.menu-links a:hover::after {
  width: 100%;
}


.cart-count {
  background-color: var(--blanco);
  color: var(--vino);
  font-weight: bold;
  padding: 0.2rem 0.5rem;
  border-radius: 50%;
  font-size: 0.9rem;
}

.hero {
  position: relative;
  background: url('../media/catalogo/') center/cover no-repeat;
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-overlay {
  background-color: rgba(0, 0, 0, 0.608);
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-content {
  text-align: center;
  color: white;
  padding: 2rem;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
}


.btn {
  background-color: var(--blanco);
  color: var(--vino);
  padding: 0.75rem 1.5rem;
  text-decoration: none;
  font-weight: bold;
  border-radius: 4px;
}

.benefits {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  padding: 3rem 1rem;
  background-color: #f7f7f7;
}

.benefit {
  max-width: 300px;
  margin: 1rem;
  text-align: center;
}


.star-product h2 {
  text-align: center;
  margin-bottom: 1.3rem;
  font-size: 2rem;
  color: var(--gris-oscuro);
}

.star-product-card {
  background-color: white;
  border-radius: 16px;
  overflow: hidden;
  max-width: 400px;
  margin: 0 auto;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;

}

.star-product-card:hover {
  transform: scale(1.03);
}

.star-product-card img {
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  display: block;
}


.star-product {
  padding: 1.3rem 1rem;
  background-color: var(--blanco);
}

.star-product .card-info {
  padding: 1.5rem 1rem;
}

.star-product .desc{
  margin-bottom: 15px;
}

.star-product .tags{
  margin-bottom: 1.5rem;
}


.btn-secondary {
  background-color: var(--vino);
  color: var(--blanco);
  padding: 0.75rem 1.5rem;
  text-decoration: none;
  font-weight: bold;
  border-radius: 4px;
}

.footer {
  background-color: var(--vino);
  color: var(--plata);
  text-align: center;
  padding: 2rem;
}

.footer-links a {
  color: var(--plata);
  margin: 0 1rem;
  text-decoration: none;
  font-size: 0.9rem;
}


.reviews {
  background-color: var(--vino-oscuro);
  padding: 3rem 1rem;
  text-align: center;
}

.reviews h2 {
  color: var(--blanco);
  margin-bottom: 2rem;
}
.review-slider {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 1rem;
  cursor: grab;
  user-select: none;
  scrollbar-width: none; /* Firefox */
}

.review-slider::-webkit-scrollbar {
  display: none; /* Chrome, Safari */
}

.review-slider.grabbing {
  cursor: grabbing;
}

.review-card {
  min-width: 250px;
  background-color: var(--blanco);
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  scroll-snap-align: start;
  flex-shrink: 0;
  font-size: 0.95rem;
  line-height: 1.4;
  transition: transform 0.3s ease;
}



.mattress-slider-container {
  background-color: #f7f7f7;
  padding: 2rem 0;
}

.mattress-slider-container h2 {
  color: var(--gris-oscuro);
  text-align: center;
  margin-bottom: 1rem;
}


.mattress-slider {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  gap: 1.5rem;
  padding: 0 1rem;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
}


.mattress-slider select,
.mattress-slider option {
  pointer-events: auto;
  user-select: text;
}



.mattress-card {
  background-color: white;
  border-radius: 16px;
  overflow: hidden;
  flex: 0 0 80%;
  max-width: 80%;
  scroll-snap-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
}

.mattress-card:hover {
  transform: scale(1.03);
}

.mattress-card img {
  width: 100%;
  display: block;
  height: auto;
}

.card-info {
  padding: 1rem;
  text-align: center;
}

.card-info h3 {
  margin-bottom: 0.5rem;
  color: var(--gris-oscuro);
}

.card-info .price {
  color: var(--vino);
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.tags {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.tags span {
  background-color: var(--plata);
  color: var(--gris-oscuro);
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.8rem;
}

.btn-add {
  background-color: var(--vino);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
}

.btn-add:hover {
  background-color: var(--vino-oscuro);
}



.size-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.size-label {
  font-size: 0.9rem;
  color: var(--gris-oscuro);
  margin: 0;
  white-space: nowrap;
}

.size-select {
  padding: 0.4rem 0.6rem;
  border: 2px solid var(--vino);
  border-radius: 8px;
  font-size: 0.9rem;
  background-color: white;
  color: var(--gris-oscuro);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D'10'%20height%3D'6'%20viewBox%3D'0%200%2010%206'%20fill%3D'none'%20xmlns%3D'http%3A//www.w3.org/2000/svg'%3E%3Cpath%20d%3D'M1%201L5%205L9%201'%20stroke%3D'%23222222'%20stroke-width%3D'2'%20/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 12px;
  cursor: pointer;
  max-width: 200px;
}



/* Desktop: mostrar hasta 3 cards */
@media (min-width: 768px) {
  .mattress-card {
    flex: 0 0 calc(33.333% - 1rem);
    max-width: calc(33.333% - 1rem);
  }
}




@media (max-width: 768px) {
  .review-slider {
    scroll-snap-type: x mandatory;
    overflow-x: auto;
    display: flex;
  }

  .review-card {
    scroll-snap-align: center;
    flex: 0 0 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Evita desbordes y asegura wrap */
  .review-card p {
    white-space: normal;
    word-break: break-word;
  }
}



/* Responsive */
@media (max-width: 768px) {


  .hero h1 {
    font-size: 2rem;
  }

  .benefits {
    flex-direction: column;
    align-items: center;
  }
}


@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(40px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.6s ease-out;
}

.animate.visible {
  opacity: 1;
  transform: translateY(0);
}




@media (max-width: 768px) {
  .hero-content {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}



@media (max-width: 768px) {
  .header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: var(--vino);
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "menu logo cart"
      "nav nav nav";
    row-gap: 1rem;
  }

  .menu-toggle {
    display: block;
  }

  .menu-links {
    background-color: var(--vino-oscuro);
    grid-area: nav;
    width: 100%;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: all 0.4s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
  }

  .menu-links.show {
    max-height: 300px;
    opacity: 1;
    padding: 1rem 0;
  }

  .logo {
    font-size: 1.5rem;
  }
}





@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}




.catalogue-header {
  text-align: center;
  padding: 3rem 1rem;
}

.catalogue-header h1 {
  font-size: 2.5rem;
  color: var(--vino-oscuro);
  margin-bottom: 0.5rem;
}

.catalogue-header .subtitle {
  font-size: 1.1rem;
  color: var(--gris-oscuro);
}

.catalogue-grid {
  display: grid;
  gap: 2rem;
  padding: 2rem 1rem;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.catalogue-card {
  background-color: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
}

.catalogue-card:hover {
  transform: scale(1.02);
}

.catalogue-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.catalogue-card .card-info {
  padding: 1rem;
  text-align: center;
}

.catalogue-card h3 {
  font-size: 1.3rem;
  color: var(--gris-oscuro);
  margin-bottom: 0.5rem;
}

.catalogue-card .price {
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--vino);
  margin-bottom: 0.5rem;
}

.catalogue-card .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  margin-bottom: 1rem;
}

.catalogue-card .tags span {
  background-color: var(--plata);
  color: var(--gris-oscuro);
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.8rem;
}

.catalogue-card .size-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.catalogue-card .size-label {
  font-size: 0.9rem;
  color: var(--gris-oscuro);
}

.catalogue-card .size-select {
  padding: 0.4rem 0.6rem;
  border: 2px solid var(--vino);
  border-radius: 8px;
  font-size: 0.9rem;
  background-color: white;
  color: var(--gris-oscuro);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D'10'%20height%3D'6'%20viewBox%3D'0%200%2010%206'%20fill%3D'none'%20xmlns%3D'http://www.w3.org/2000/svg'%3E%3Cpath%20d%3D'M1%201L5%205L9%201'%20stroke%3D'%23222222'%20stroke-width%3D'2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 12px;
}

.catalogue-card .btn-add {
  margin: 0 auto 1rem;
  background-color: var(--vino);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: bold;
  font-size: 1rem;
  text-decoration: none;
  display: inline-block;
  transition: background-color 0.3s ease;
}

.catalogue-card .btn-add:hover {
  background-color: var(--vino-oscuro);
}


.catalogue-header {
  text-align: center;
  padding: 3rem 1rem 2rem;
}

.catalogue-header h1 {
  font-size: 2rem;
  color: var(--gris-oscuro);
}

.catalogue-header p {
  color: var(--gris-oscuro);
  font-size: 1rem;
}

.mattress-slider-section {
  padding: 2rem 1rem;
}

.block-light {
  background-color: #f7f7f7;
}

.block-plain {
  background-color: white;
}

.mattress-slider-section h2 {
  text-align: center;
  color: var(--gris-oscuro);
  margin-bottom: 1rem;
}



#close-chat-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #fff;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: #333;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  box-shadow: 0 1px 4px #0002;
  z-index: 10;
}




#chat-bubble {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9999;
  background: #b51f2f;
  color: white;
  border-radius: 100%;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px #0002;
  cursor: pointer;
  font-size: 2rem;
}

#chat-box {
  display: none;
  position: fixed;
  right: 24px;
  bottom: 100px;
  width: 350px;
  max-width: 90vw;
  background: white;
  border-radius: 20px;
  box-shadow: 0 4px 24px #0003;
  z-index: 9999;
  padding: 0;
  transition: all .2s;
}

#chat-box .close-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #fff;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: #b51f2f;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  box-shadow: 0 1px 4px #0002;
  z-index: 10;
  line-height: 1;
  text-align: center;
}

#chat-box .close-btn:hover {
  background: #ffeff0;
}

#chat-box form {
  display: flex;
  border-top: 1px solid #eee;
}

#chat-box input[type="text"] {
  flex: 1;
  border: none;
  padding: 1em;
  font-size: 1em;
  outline: none;
}

#chat-box button[type="submit"] {
  border: none;
  background: #b51f2f;
  color: #fff;
  padding: 1em 1.5em;
  font-size: 1em;
  cursor: pointer;
}

#chat-box #chat-messages {
  height: 280px;
  overflow-y: auto;
  padding: 1em;
  font-size: 1em;
}

@media (max-width: 600px) {
  #chat-box {
    width: 98vw;
    max-width: 98vw;
    right: 1vw;
    bottom: 76px;
    border-radius: 12px;
    font-size: 0.95em;
  }
  #chat-bubble {
    width: 54px;
    height: 54px;
    font-size: 1.5rem;
    right: 12px;
    bottom: 12px;
  }
  #chat-box #chat-messages {
    height: 180px;
    padding: .8em;
  }
}
/* Burbujas estilo mensajería */
.chat-bubble {
  max-width: 75%;
  padding: 0.7em 1.1em;
  border-radius: 18px;
  margin-bottom: 0.6em;
  display: inline-block;
  font-size: 1em;
  line-height: 1.45;
  word-break: break-word;
  box-shadow: 0 1px 8px #0001;
}

.bubble-user {
  background: #f1f2f7;
  color: #333;
  align-self: flex-end;
  margin-left: 25%;
  text-align: right;
}

.bubble-ai {
  background: #ebecf0;
  color: #20232a;
  align-self: flex-start;
  margin-right: 25%;
  text-align: left;
}

/* Contenedor de mensajes flex */
#chat-messages {
  display: flex;
  flex-direction: column;
}

/* Loader de 3 puntitos (ola) */
.typing-indicator {
  display: inline-block;
  min-width: 36px;
  margin: 0 0 0.5em 0;
  height: 22px;
  vertical-align: middle;
}
.typing-indicator span {
  display: inline-block;
  width: 7px; height: 7px;
  background: #bbb;
  border-radius: 50%;
  margin: 0 1.5px;
  opacity: 0.7;
  animation: bounce 1.2s infinite both;
}
.typing-indicator span:nth-child(2){ animation-delay: .17s;}
.typing-indicator span:nth-child(3){ animation-delay: .34s;}

@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0);}
  40% { transform: translateY(-8px);}
}
