/* ============================================================= */
/* TU CSS ORIGINAL + SCROLL HORIZONTAL + FLECHAS MODERNAS MÓVIL */
/* ============================================================= */

/* Estilos base para los contenedores me gusta no me gusta */
.thumb-up-container,
.thumb-down-container {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
  position: absolute;
  top: 450px;
  white-space: nowrap;
}

.thumb-up-container {
  left: 50%;
  transform: translateX(-60%);
}

.thumb-down-container {
  right: 50%;
  transform: translateX(60%);
}

.thumb-up-container.show-thumb-up {
  opacity: 1;
  visibility: visible;
  animation: slideUp 0.5s ease;
}

.thumb-down-container.show-thumb-down {
  opacity: 1;
  visibility: visible;
  animation: slideDown 0.5s ease;
}

@keyframes slideUp {
  0% {
    transform: translateY(10px) translateX(-60%);
    opacity: 0;
  }

  100% {
    transform: translateY(0) translateX(-60%);
    opacity: 1;
  }
}

@keyframes slideDown {
  0% {
    transform: translateY(-10px) translateX(60%);
    opacity: 0;
  }

  100% {
    transform: translateY(0) translateX(60%);
    opacity: 1;
  }
}

.stars,
.waves {
  font-size: 14px;
  color: white;
  background-color: black;
  border: 2px solid #ffc451;
  padding: 10px 20px;
  border-radius: 10px;
  text-align: center;
}

.like-btn:disabled,
.dislike-btn:disabled {
  background-color: #6c757d;
  border-color: #6c757d;
  opacity: 0.6;
  cursor: not-allowed;
}

.category-buttons,
.rating-section {
  margin-bottom: 14px !important;
}

/* ================== SCROLL HORIZONTAL + FLECHAS MODERNAS (solo móvil) ================== */
#cafeterias-container {
  position: relative;
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: 16px;
  padding: 16px 12px 16px 12px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}

#cafeterias-container::-webkit-scrollbar {
  display: none;
}

/* Flechas izquierda y derecha - solo en móvil */
.scroll-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  cursor: pointer;
  opacity: 0.8;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.scroll-arrow:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.8);
  transform: translateY(-50%) scale(1.1);
}

.scroll-arrow.left {
  left: 10px;
}

.scroll-arrow.right {
  right: 10px;
}

/* Solo mostrar flechas en móvil */
@media (min-width: 768px) {
  .scroll-arrow {
    display: none !important;
  }
}

/* Tarjetas en móvil */
#cafeterias-container .card {
  flex: 0 0 auto;
  width: 78vw;
  max-width: 300px;
  scroll-snap-align: center;
}

/* En tablet y escritorio vuelve al grid original */
@media (min-width: 768px) {
  #cafeterias-container {
    flex-wrap: wrap;
    justify-content: center;
    overflow-x: visible;
    scroll-snap-type: none;
    gap: 20px;
    padding: 20px;
  }

  #cafeterias-container .card {
    width: 48%;
    scroll-snap-align: none;
  }
}

@media (min-width: 1200px) {
  #cafeterias-container .card {
    width: 23%;
  }
}

/* Móvil: todo más pequeño y elegante */
@media (max-width: 767px) {
  .card-img-top-cafeterias {
    height: 65px;
    margin-top: 45px;
  }

  .card-title-img-cafeterias {
    font-size: 0.82rem;
    padding: 6px 10px;
  }

  .category-section,
  .description-section,
  .rating-section,
  .card-text-title,
  .card-text-map {
    font-size: 0.76rem !important;
  }

  .category-buttons .btn,
  .tooltip-button,
  .like-btn,
  .dislike-btn {
    padding: 6px 9px !important;
    font-size: 11.5px !important;
  }

  .tooltip-button i {
    font-size: 1.1rem !important;
  }

  .card .close-btn {
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    font-size: 18px;
  }

  .thumb-up-container,
  .thumb-down-container {
    top: 360px;
  }

  .stars,
  .waves {
    font-size: 12.5px;
    padding: 7px 14px;
  }
}

/* ================== TU CSS ORIGINAL 100% INTACTO ================== */
.card {
  text-shadow: 3px 3px 10px rgba(0, 0, 0, 0.4);
  background-color: #b3e0ff !important;
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  max-width: 280px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  height: auto;
  position: relative;
}

.card:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

@media (min-width: 576px) {
  .card {
    width: calc(33.333% - 20px);
  }
}

.card-img-top-cafeterias {
  max-width: 80%;
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  margin: 0 auto;
  display: block;
  margin-bottom: 10px;
  margin-top: 70px;
}

.card-title-img-cafeterias {
  margin: 0 auto;
  font-size: 0.9rem;
  font-weight: bold;
  text-align: center;
  color: white;
  background-color: black;
  padding: 5px 10px;
  width: auto;
  max-width: 80%;
  border-radius: 8px;
  box-sizing: border-box;
  display: block;
  word-wrap: break-word;
}

.card-body {
  padding: 15px;
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
}

.card-title {
  font-size: 1.25rem;
  font-weight: bold;
  margin-bottom: 10px;
  text-align: center !important;
  color: white;
  background-color: black;
  border: 2px solid #6f4f37;
  padding: 10px;
  max-width: 80%;
  margin: 0 auto;
  display: block;
  box-sizing: border-box;
  border-radius: 8px;
}

.card-text {
  font-size: 0.875rem;
  margin-bottom: 10px;
}

.card-body a {
  font-weight: bold;
  text-align: center !important;
}

.card-body a:hover {
  text-decoration: underline;
}

@media (max-width: 767px) {
  .card {
    width: 90%;
  }
}

@media (min-width: 768px) {
  .card {
    width: 48%;
  }
}

@media (min-width: 1200px) {
  .card {
    width: 23%;
  }
}

.valoracion i {
  color: gray;
}

.valoracion .fas {
  color: #ffd700;
}

.tooltip-button {
  display: inline-block;
  margin-right: 5px;
  padding: 5px 10px;
  font-size: 18px;
  text-transform: capitalize;
}

.tooltip-button i {
  font-size: 1.2rem;
}

.tooltip-button:hover {
  opacity: 0.8;
  cursor: pointer;
}

@media (max-width: 768px) {
  .tooltip-button {
    font-size: 10px;
    padding: 4px 8px;
  }
}

.card .close-btn {
  position: absolute;
  top: 10px;
  right: 120px;
  background-color: black;
  border: none;
  color: #ff0000;
  font-size: 20px;
  cursor: pointer;
}

#openModalCategory,
#openModalBarrio {
  width: 100%;
  background-color: brown;
  color: white;
  border: none;
  padding: 10px 20px;
  text-align: center;
  font-size: 16px;
  cursor: pointer;
  border-radius: 5px;
  box-sizing: border-box;
  margin: 10px 0;
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  overflow: auto;
}

.modal-content {
  position: relative;
  /* esto permite que el botón .close se coloque encima correctamente */
  background-color: #fefefe;
  margin: 15% auto;
  padding: 40px;
  border: 1px solid #888;
  width: 80%;
  max-width: 400px;
  border-radius: 8px;
}

.close , .closep {
  color: black;
  font-size: 20px;
  font-weight: bold;
  position: absolute;
  top: 10px;
  right: 15px;
  background: brown;
  border: 2px solid black;
  border-radius: 50%;
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 0;
  z-index: 10;
  /* suficiente dentro de modal-content */
  box-shadow: none;
  transition: all 0.2s ease;
}

.close:hover {
  background: darkred;
  color: white;
  transform: scale(1.1);
}

.category-list,
.barrio-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.category-btn,
.barrio-btn {
  background-color: brown;
  color: white;
  padding: 10px 15px;
  border: none;
  font-size: 16px;
  cursor: pointer;
  border-radius: 5px;
  width: calc(50% - 10px);
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .modal-content {
    width: 80%;
    margin: 45% auto;
  }

  .category-btn,
  .barrio-btn {
    font-size: 14px;
  }
}