body {
  font-family: "Poppins", sans-serif;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  color: #333;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
}

main {
  flex: 1;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo img {
  height: 50px;
}

/* === PRODUCTO === */
.producto-container {
  max-width: 1200px;
  margin: 40px auto;
  background: white;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  padding: 40px;
  position: relative;
  overflow: hidden;
}

.producto-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #2e5d34, #4CAF50, #2e5d34);
}

.producto-titulo {
  font-size: 2.2em;
  color: #2e5d34;
  margin-bottom: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.producto-meta {
  color: #666;
  font-size: 1.1em;
  margin-bottom: 25px;
  padding: 12px 16px;
  background: #f8f9fa;
  border-radius: 12px;
  border-left: 4px solid #2e5d34;
}

.media-container {
  display: flex;
  gap: 30px;
  margin-bottom: 30px;
}

.media-item {
  flex: 1;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 420px;
  min-height: 250px;
}

/* Contenedor para la imagen */
.media-item .image-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 15px;
  background: white;
}

.media-item .image-container img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

/* Contenedor responsive para el video - Técnica de relación de aspecto */
.media-item .video-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 15px;
  background: black;
  position: relative;
}

.media-item .video-wrapper::before {
  content: "";
  display: block;
  padding-top: 56.25%;
  /* 16:9 */
}

.media-item .video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.media-item.placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #6c757d;
  text-align: center;
  padding: 20px;
  background: #f9f9f9;
}

.media-item.placeholder i {
  font-size: 3em;
  margin-bottom: 15px;
  color: #adb5bd;
}

.producto-descripcion {
  line-height: 1.7;
  text-align: justify;
  margin: 25px 0;
  font-size: 1.05em;
  color: #495057;
  background: #f8f9fa;
  padding: 20px;
  border-radius: 12px;
  border-left: 3px solid #e9ecef;
}

.precio-stock-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin: 25px 0;
}

.precio-item,
.stock-item {
  flex: 1;
  min-width: 200px;
  padding: 16px;
  border-radius: 12px;
  background: white;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid #e9ecef;
}

.precio-item h3,
.stock-item h3 {
  font-size: 0.95em;
  color: #6c757d;
  margin: 0 0 8px 0;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.precio-valor {
  font-size: 1.8em;
  font-weight: 700;
  color: #2e5d34;
  margin: 0;
}

.stock-valor {
  font-size: 1.2em;
  font-weight: 600;
  margin: 0;
}

.stock-disponible {
  color: #28a745;
}

.stock-agotado {
  color: #dc3545;
  font-weight: 600;
}

hr {
  border-top: 2px solid #e9ecef;
  margin: 40px 0;
  opacity: 0.7;
}

/* Botones */
.btn-custom {
  border-radius: 12px;
  padding: 14px 32px;
  font-size: 1.1em;
  transition: all 0.3s ease;
  font-weight: 600;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border: none;
}

.btn-volver {
  background: linear-gradient(135deg, #6c757d, #495057);
  color: #fff;
}

.btn-volver:hover {
  background: linear-gradient(135deg, #5a6268, #343a40);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.btn-agregar {
  background: linear-gradient(135deg, #2e5d34, #234a2a);
  color: #fff;
}

.btn-agregar:hover {
  background: linear-gradient(135deg, #28522e, #1a361f);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(46, 93, 52, 0.3);
}

.btn-quitar {
  background: linear-gradient(135deg, #dc3545, #c82333);
  color: white;
}

.btn-quitar:hover {
  background: linear-gradient(135deg, #e4606d, #bd2130);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(220, 53, 69, 0.3);
}

.btn-custom:disabled {
  opacity: 0.7;
  transform: none;
  cursor: not-allowed;
}

.notificacion {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #4caf50;
  color: white;
  padding: 16px 32px;
  border-radius: 8px;
  font-size: 1.1em;
  z-index: 9999;
  display: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#carrito-popup {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  width: 320px;
  background: white;
  border: 1px solid #ccc;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  padding: 12px;
  border-radius: 6px;
  z-index: 10000;
  margin-top: 4px;
}

#carrito-popup.visible {
  display: block;
}

#carrito-popup .producto {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f0f0f0;
}

#carrito-popup .producto:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

#carrito-popup .producto img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  margin-right: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

#carrito-popup .producto-info {
  flex-grow: 1;
}

#carrito-popup .producto-info span {
  display: block;
  font-size: 0.95em;
}

#carrito-popup .producto-info span:nth-child(1) {
  font-weight: bold;
  color: #222;
}

#carrito-popup .producto-info span:nth-child(2) {
  color: #555;
}

#carrito-popup .producto-info span:nth-child(3) {
  color: #888;
  font-size: 0.9em;
}

@media (max-width: 992px) {
  .media-container {
    flex-direction: column;
  }

  .media-item {
    min-height: 350px;
  }

  .producto-container {
    padding: 25px;
    margin: 20px;
  }
}

@media (max-width: 768px) {
  .media-item {
    min-height: 250px;
  }

  /* Técnica responsive específica para móviles */
  .video-wrapper::before {
    padding-top: 56.25%;
    /* Mantiene 16:9 en móviles también */
  }

  .producto-titulo {
    font-size: 1.8em;
  }

  .precio-stock-container {
    flex-direction: column;
  }

  .btn-custom {
    width: 100%;
  }

  .header-container {
    flex-direction: column;
    gap: 15px;
  }

  .nav-menu ul {
    flex-wrap: wrap;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .media-item {
    min-height: 200px;
  }

  .producto-container {
    padding: 20px;
    margin: 15px;
  }

  .producto-titulo {
    font-size: 1.6em;
  }

  .precio-valor {
    font-size: 1.5em;
  }
}