.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin: 20px 0 0;
}

/* Los catálogos no seleccionados no se muestran */
.product-grid[hidden] {
  display: none;
}

.cake__card{
  background-color: #EDF2F7;
  border-radius: 20px;
  padding: 0 15px 15px 15px;
  margin: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;

  box-shadow: 0 6px 15px rgba(0,0,0,0.1);

  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cake__card:hover{
  transform: translateY(-5px);
  box-shadow: 0 12px 25px rgba(0,0,0,0.15);
}

.cake__card h3{
  font-size: 1.2rem;
  font-weight: 600;
  text-align: center;
}

.card__img {
  width: 100%;
  max-width: 180px;
  height: 180px;

  margin: 0 auto;
  object-fit: contain;
}

.card__top {
  width: 100%;
  margin: 0;

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.card__price {
  width: 100%;

  margin: 0;
  padding: 0;

  color: #28a745;
  font-size: 1.6rem;
  font-weight: 700;
  text-align: center;

  white-space: nowrap;
}

.card__quantity {
  width: auto;
  margin: 0;

  display: flex;
  align-items: center;
  justify-content: center;
}

.quantity_selector {
  display: inline-flex;
  align-items: center;

  width: max-content;
  overflow: hidden;

  background-color: white;
  border: 1px solid #b8c0cc;
  border-radius: 9px;

  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.quantity_button {
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;

  padding: 0;
  border: none;

  display: grid;
  place-items: center;

  background-color: #f1f3f5;
  color: #111;

  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;

  flex: 0 0 42px;
}

.quantity_value {
  width: 48px;
  min-width: 48px;
  height: 42px;

  padding: 0;
  margin: 0;

  border: none;
  outline: none;

  background-color: white;
  text-align: center;
  font-size: 1rem;

  flex: 0 0 48px;

  appearance: textfield;
  -moz-appearance: textfield;
}

.quantity_value::-webkit-inner-spin-button,
.quantity_value::-webkit-outer-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.quantity_button {
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  font-size: 1.2rem;
}

.quantity_button:focus{
  border: 3px solid #000;
}

.card__description{
  margin: 0 auto;
  font-size: 0.9rem;
  color: #444;
  text-align: justify;
  line-height: 1.4;
  padding: 0 20px;
}

.card__description span{
  font-weight: 700;
}

.button__container{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0 10px;
  padding: 0;
}

.button__container button{
  flex: 1;
  min-width: 90px;
  border-radius: 10px;
  border: none;
  font-weight: 500;
  padding: 10px 20px;
  margin: 0 0;
}

.button__compra{
  background-color: #28a745;
  color: aliceblue;
  transition: background-color 0.3s ease,
              font-weight 0.3 ease;
}

.button__compra:hover{
  background-color: #40c057;
  font-weight: 700;
}

.button__reservar{
  background-color: #44c;
  color: aliceblue;
  transition: background-color 0.3s ease,
              font-weight 0.3 ease;
}
.button__reservar:hover{
  background-color: #7788dd;
  font-weight: 700;
}

.button__info{
  margin: 0;
  grid-column: span 2;
  background-color: #f9f9ff;
  color: #1A202C;
    transition: background-color 0.3s ease,
                font-weight 0.3 ease;
}

.button__info:hover{
  background-color: #FDFEFF;
  font-weight: 700;
}

@keyframes aparecer{
  from{
    opacity: 0;
    transform: translateY(10px);
  }
  to{
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1000px){
  .card__top {
    width: 50%;
    margin: auto;

    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  .card__price {
    width: 100%;
    font-size: 1.5rem;
    text-align: center;
    white-space: nowrap;
  }

  .card__quantity {
    width: 100%;
    margin: 0;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;

    flex-wrap: nowrap;
  }

  .card__description {
    padding: 0 10px;
    text-align: left;
    line-height: 1.45;
  }

  .quantity_label {
    flex-shrink: 0;
  }

  .quantity_selector {
    flex-shrink: 0;
  }
}


/* Integración con el navegador de catálogo responsive. */
@media (max-width: 820px) {
  .product-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    margin: 14px 0 0;
  }

  .cake__card {
    box-sizing: border-box;
    width: min(100%, 520px);
    margin-inline: auto;
  }
}

@media (max-width: 430px) {
  .cake__card {
    border-radius: 16px;
    padding-inline: 12px;
  }

  .cake__card h3 {
    font-size: 1.08rem;
  }

  .card__img {
    height: 165px;
  }

  .button__container {
    gap: 8px;
    margin-inline: 0;
  }

  .button__container button {
    min-width: 0;
    padding: 10px 8px;
  }
}
