/* Product Modal Styles - Actualizado */
.product-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.product-modal.active {
  opacity: 1;
  visibility: visible;
}

.product-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

.product-modal-content {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 1000px;
  max-height: 110vh;
  overflow: hidden;
  position: relative;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.product-modal.active .product-modal-content {
  transform: scale(1);
}

.product-modal-close {
  position: absolute;
  top: 5px; 
  right: 5px; 
  width: 25px;
  height: 25px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all 0.3s ease;
  padding: 5px; /* Reducido padding */
}

.product-modal-close:hover {
  background: rgba(0, 0, 0, 0.9);
  transform: scale(1.1);
}

/* Botón oculto para captura */
#captureModalBtn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 25px;
  height: 25px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 17px;
  opacity: 0;
  z-index: 10;
  transition: opacity 0.3s ease;
}

#captureModalBtn:hover {
  opacity: 1 !important;
}

.product-modal-body {
  padding: 2px; /* Padding reducido a 3px */
  max-height: calc(90vh - 60px);
  overflow-y: auto;
}

.product-modal-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 5px;
  align-items: start;
  padding: 3px; /* Padding de 3px */
}

/* Left Side - Images */
.product-modal-left {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 5px 0 5px 5px; 
}

.product-main-image {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-main-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.product-image-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); 
  gap: 5px; /* Gap reducido a 5px */
  padding: 0 5px; /* Padding de 5px */
}

.product-image-thumb {
  max-width: 100%;
  height:auto;
  aspect-ratio: 1;
  object-fit: contain;
  display: block;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.3s ease;
}

.product-image-thumb:hover {
  border-color: #170ad8;
  transform: scale(1.05);
}

/* Right Side - Content */
.product-modal-right {
  display: flex;
  flex-direction: column;
  gap: 5px; /* Gap reducido a 5px */
  position: relative;
  padding: 0; 
}

.product-badge {
  position: absolute;
  top: -20px;
  right: 0;
  padding: 8px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.sale-badge {
  background: #dc3545;
  color: white;
}

.featured-badge {
  background: #ffc107;
  color: #212529;
}

.product-modal-title {
  font-size: 22px;
  font-weight: 600;
  color: #333;
  margin: 0;
  line-height: 1.3;
  margin-rigth: 20px;
}

.product-description {
  font-family: Poppins, sans-serif;
  font-size: 1rem;
  color: #020101;
  line-height: 1.3;
}

.product-description p {
  margin: 8px 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.product-pricing {
  background: #f8f9fa;
  padding: 3px;
  border-radius: 8px;
  text-align: cener;
  border: 1px solid #170ad8;
}

.product-installments {
  font-size: 18px;
  font-weight: 700;
  color: #170ad8;
  margin-bottom: 8px;
}

.product-price,
.product-sale-price {
  font-size: 18px;
  font-weight: 500;
  color: #333;
}

.product-original-price {
  font-size: 16px;
  color: #999;
  text-decoration: line-through;
}

.product-sale-price {
  color: #dc3545;
}

.product-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.product-btn {
  padding: 6px 30px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  
}

.product-btn-primary {
  background: #170ad8;
  color: white;
}

.product-btn-primary:hover {
  background: #0f0899;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(23, 10, 216, 0.3);
}

.product-btn-whatsapp {
  background: #25d366;
  color: white;
}

.product-btn-whatsapp:hover {
  background: #1da851;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37, 211, 102, 0.3);
}

.product-stock {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #28a745;
  font-weight: 500;
  font-size: 12px;
  padding: 8px;
  background: rgba(40, 167, 69, 0.1);
  border-radius: 8px;
}

/* Notification */
.product-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #28a745;
  color: white;
  padding: 15px 20px;
  border-radius: 8px;
  font-weight: 600;
  z-index: 10000;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.product-notification.show {
  transform: translateX(0);
}

/* Responsive Design - 992px */
@media (max-width: 992px) {
  .product-modal-content {
    max-width: 92%;
  }
  
  .product-modal-title {
    font-size: 19px;
  }
  
  .product-description {
    font-size: 1.2rem;
  }
  
  .product-installments {
    font-size: 18px;
  }
  
  .product-btn {
    padding: 10px 16px;
    font-size: 14px;
  }
}

/* Responsive Design - 768px */
@media (max-width: 768px) {

  .product-modal-content {
    max-width: 450px;
  }

  .product-modal-grid {
    grid-template-columns: 1fr;
    gap: 5px;
    padding: 4px;
  }

  .product-main-image img {
    max-heigth: 380px;
  }

  .product-modal-body {
    padding: 8px;
  }

  .product-modal-title {
    font-size: 18px;
  }

  .product-description {
    font-size: 1.2rem;
  }

  .product-installments {
    font-size: 17px;
  }

  .product-actions {
    position: sticky;
    flex-direction: row;
    justify-content: space-evenly;
    bottom: 0;
    background: white;
    padding: 5px 0 0 0;
    margin: 0;
    border-top: 1px solid #e1e5e9;
  }

  
  
  /* Ocultar galería de imágenes en móviles */
  .product-image-gallery {
    display: none;
  }
  
  .product-btn {
    width:202px;
    heigth: 30px;
    padding: 4px 12px;
    font-size: 14px;
    font-weight: 500;
  }
  
  /* Ocultar stock en móviles */
  .product-stock {
    display: none;
  }
}

/* Responsive Design - 576px */
@media (max-width: 576px) {

  .product-main-image img {
    max-heigth: 320px;
  }

  .product-modal-overlay {
    padding: 5px;
  }

  .product-modal-content {
    border-radius: 10px;
    max-width: 450px;
  }

  .product-modal-body {
    padding: 5px;
  }
  
  .product-modal-grid {
    gap: 0px;
    padding: 2px;
  }

  .product-modal-title {
    font-size: 16px;
    margin-top: 5px;
  }

  .product-description {
    font-size: 1.2rem;
  }

  .product-description p {
    margin: 6px 0;
    gap: 6px;
  }

  .product-installments {
    font-size: 16px;
  }

  .product-pricing {
    padding: 6px;
  }

  .product-actions {
    padding: 12px 0 0 0;
    margin: 6px;
  }
  
  .product-btn {
    padding: 5px 10px;
    font-size: 13px;
    border-radius: 8px;
    font-weight: 400;
  }
  
  .product-modal-close {
    top: 8px;
    right: 8px;
    width: 25px;
    height: 25px;
    font-size: 16px;
  }
  
  .product-badge {
    top: -15px;
    padding: 6px 6px;
    font-size: 8px;
  }
}

/* Responsive Design - 400px */
@media (max-width: 400px) {
  .product-modal-content {
    border-radius: 8px;
  }

  .product-modal-body {
    padding: 3px;
  }
  
  .product-modal-grid {
    gap: 8px;
    padding: 2px;
  }

  .product-modal-title {
    font-size: 16px;
  }

  .product-description {
    font-size: 0.8rem;
  }

  .product-description p {
    margin: 5px 0;
    gap: 5px;
  }

  .product-installments {
    font-size: 14px;
  }

  .product-pricing {
    padding: 5px;
  }

  .product-actions {
    padding: 10px 0 0 0;
    margin: 10px -10px -10px -10px;
  }
  
  .product-btn {
    padding: 8px 10px;
    font-size: 12px;
    border-radius: 6px;
  }
  
  .product-modal-close {
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    font-size: 14px;
  }
  
  .product-badge {
    top: -12px;
    padding: 5px 5px;
    font-size: 7px;
  }
  
  .product-main-image {
    border-radius: 8px;
  }
  
  .product-modal-left,
  .product-modal-right {
    padding: 3px;
  }
}