/* =====================
   COMPRAR.CSS - Estilos para la sección de compras
   ===================== */



.category-menu {
  background: #d6d6d6;
  border-bottom: 1px solid #000000;
  padding: 0.5rem 0;
  position: sticky;
  top: 0; /* Ahora queda pegado arriba, justo debajo del nav */
  z-index: 100;
  box-shadow: 0 2px 8px rgba(68,185,0,0.07);
}
#category-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  list-style: none;
  margin: 0;
  padding: 0;
}
#category-list li {
  background: #e9e9e9;
  border-radius: 2rem;
  padding: 0.4rem 1.2rem;
  font-size: 1rem;
  cursor: pointer;
  border: 1px solid #a5a5a5;
  color: #000000;
  transition: background 0.2s, color 0.2s;
  user-select: none;
}
#category-list li.active, #category-list li:hover {
  background: #000000;
  color: #ffffff;
}

.create-design-bar {
  display: flex;
  justify-content: center;
  margin: 1.5rem 0 0.5rem 0;
}
#create-design-btn {
  background: linear-gradient(90deg, #44b900 60%, #ff6600 100%);
  color: #fff;
  border: none;
  border-radius: 2rem;
  padding: 0.7rem 2.2rem;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(68,185,0,0.08);
  transition: background 0.2s, transform 0.2s;
  outline: none;
}
#create-design-btn:hover {
  background: linear-gradient(90deg, #ff6600 60%, #44b900 100%);
  transform: scale(1.04);
}

/* Grid de productos igual al portafolio */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  grid-auto-rows: unset; /* Permite que cada tarjeta tenga la altura de su contenido */
  gap: 40px;
  padding: 2rem 2vw 1rem 2vw;
  max-width: 1100px;
  margin: 0 auto;
}
.product-card {
  background: #fff;
  border-radius: 2rem;
  box-shadow: 0 4px 24px rgba(68,185,0,0.07);
  overflow: visible; /* Cambiado de hidden a visible */
  display: flex;
  flex-direction: column;
  transition: transform 0.18s, box-shadow 0.18s;
  cursor: pointer;
  position: relative;
  min-height: unset; /* Elimina la restricción de altura mínima */
  height: auto; /* Permite que la tarjeta crezca según el contenido */
  animation: fadeInUp 0.7s cubic-bezier(.39,.575,.56,1.000);
}
.product-card:hover {
  transform: translateY(-6px) scale(1.03);
  box-shadow: 0 8px 32px rgba(68,185,0,0.13);
}
.product-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 2rem 2rem 0 0;
  background: #e9fbe5;
  transition: filter 0.2s;
}
.product-card .card-body {
  padding: 1.1rem 1.2rem 1.2rem 1.2rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.product-card .card-title {
  font-size: 1.15rem;
  font-weight: 900;
  color: #000000;
  margin-bottom: 0.5rem;
}

.card-desc{
  color: #414141;
}
.product-card .card-category {
  font-size: 0.95rem;
  color: #000000;
  margin-bottom: 0.3rem;
}
.product-card .card-materials {
  font-size: 0.93rem;
  color: #666;
  margin-bottom: 0.5rem;
}
.product-card .card-price {
  font-size: 1.1rem;
  color: #ff6600;
  font-weight: 600;
  margin-bottom: 0.2rem;
}
.product-card .card-metros {
  font-size: 0.95rem;
  color: #222;
  margin-bottom: 0.2rem;
}
.product-card .card-total {
  font-size: 1.1rem;
  color: #44b900;
  font-weight: 700;
}
.product-card .ver-detalle-btn {
  margin-top: 0.7rem;
  background: #000000;
  color: #fff;
  border: none;
  border-radius: 1.2rem;
  padding: 0.5rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  display: block;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}
.product-card .ver-detalle-btn:hover {
  background: #000000;
  transform: scale(1.04);
}

/* Carrito flotante */
#shopping-cart-icon {
  position: fixed;
  bottom: 1.2rem;
  right: 1.2rem;
  top: unset;
  background: #fff;
  color: #000000;
  border-radius: 50px;
  box-shadow: 0 2px 12px rgba(68,185,0,0.13);
  padding: 0.7rem 1.3rem;
  font-size: 1.5rem;
  font-weight: 700;
  cursor: pointer;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.2s, color 0.2s;
}
#shopping-cart-icon:hover {
  background: #000000;
  color: #fff;
}
#cart-count {
  background: #000000;
  color: #fff;
  border-radius: 50%;
  padding: 0.2rem 0.7rem;
  font-size: 1rem;
  margin-left: 0.3rem;
}

/* Modales */
.modal {
  position: fixed;
  top: 70px; /* Subido de 20px a 70px para evitar que lo tape el nav */
  left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: opacity 0.2s;
}
.modal.hidden {
  display: none;
}
.modal-content {
  background: #fff;
  border-radius: 1.5rem;
  box-shadow: 0 8px 32px rgba(68,185,0,0.13);
  padding: 2rem 1.5rem 1.5rem 1.5rem;
  min-width: 320px;
  max-width: 700px;
  width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: fadeInScale 0.4s cubic-bezier(.39,.575,.56,1.000);
}
.modal-content .close {
  position: absolute;
  top: 10px;
  right: 1.1rem;
  font-size: 1.7rem;
  color: #000000;
  cursor: pointer;
  font-weight: 700;
  transition: color 0.2s;
}
.modal-content .close:hover {
  color: #000000;
}
.modal-content p, .modal-content ul, .modal-content li, .modal-content h3 {
  line-height: 1.7;
  margin-bottom: 0.7em;
}
.modal-content ul {
  padding-left: 1.2em;
}
.modal-content li {
  margin-bottom: 0.4em;
}
.modal-content img {
  display: block;
  margin: 0 auto 1.3rem auto;
  max-width: 100%;
  border-radius: 1rem;
}

/* Botones de los modales */
.modal-content button,
#compra-form button,
#custom-design-form button,
#edit-product-form button {
  background: linear-gradient(90deg, #44b900 60%, #ff6600 100%);
  color: #fff;
  border: none;
  border-radius: 1.2rem;
  padding: 0.4rem 1.1rem;
  font-size: 0.98rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.7rem;
  margin-bottom: 0.3rem;
  box-shadow: 0 2px 8px rgba(68,185,0,0.08);
  transition: background 0.2s, transform 0.2s;
  outline: none;
  display: inline-block;
}
.modal-content button:hover,
#compra-form button:hover,
#custom-design-form button:hover,
#edit-product-form button:hover {
  background: linear-gradient(90deg, #ff6600 60%, #44b900 100%);
  transform: scale(1.04);
}

/* Estilo para el botón de WhatsApp en el modal de carrito */
.whatsapp-btn-modal {
  position: absolute;
  right: 2.2rem;
  bottom: 1.2rem; /* Antes 2.2rem, ahora más abajo */
  background: #000000;
  color: #fff;
  border: none;
  border-radius: 2rem;
  padding: 0.7rem 2.2rem;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(37,211,102,0.13);
  transition: background 0.2s, transform 0.2s;
  outline: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  z-index: 10;
}
.whatsapp-btn-modal:hover {
  background: #1ebe5d;
  transform: scale(1.04);
}

/* Listas de materiales y edición */
#material-list, #edit-material-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-bottom: 1rem;
}
#material-list select, #edit-material-list select,
#material-list input, #edit-material-list input {
  padding: 0.3rem 0.7rem;
  border-radius: 0.7rem;
  border: 1px solid #d2f5c6;
  font-size: 1rem;
  margin-left: 0.5rem;
}
#material-list button, #edit-material-list button {
  margin-left: 0.7rem;
  background: #ff6600;
  color: #fff;
  border: none;
  border-radius: 0.7rem;
  padding: 0.3rem 1rem;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s;
}
#material-list button:hover, #edit-material-list button:hover {
  background: #44b900;
}

/* Animaciones */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

/* Responsive */
@media (max-width: 900px) {
  .product-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    grid-auto-rows: unset;
    gap: 20px;
    padding: 1rem 1vw 0.5rem 1vw;
    max-width: 98vw;
  }
  .modal-content {
    max-width: 98vw;
    width: 98vw;
  }
}
@media (max-width: 600px) {
  .product-card {
    min-height: unset;
    height: auto;
  }
  .modal-content {
    padding: 1.2rem 0.5rem 1rem 0.5rem;
    min-width: 90vw;
  }
  .category-menu {
    top: 0px;
  }
  .whatsapp-btn-modal {
    right: 1rem;
    left: unset;
    bottom: 0.5rem;
    width: auto;
    padding: 0.6rem 1.2rem;
    font-size: 1rem;
    position: absolute;
    margin: 0;
  }
  .cart-item {
    display: block;
    margin-bottom: 1.2rem;
    text-align: left;
  }
  .cart-item .cart-actions {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    margin-top: 0.7rem;
    margin-bottom: 0.3rem;
  }
  .cart-item button {
    display: block;
    width: 100%;
    margin: 0;
    font-size: 1rem;
    padding: 0.5rem 0;
    border-radius: 1.2rem;
  }
}

/* Asegura que el modal de detalle de producto esté siempre por encima del carrito */
#product-detail-modal {
  z-index: 200;
}
