/* ===== Layout principal: B izquierda / C derecha ===== */
.contenedor-A {
  display: flex;
  width: 90%;
  margin: 0 auto;
}

.contenedor-B {
  display: flex;
  width: 100%;
}

.contenedor-B1 {
  width: 95%;
}

.contenedor-C {
  width: 40%;
}

/* Desktop: separación y padding */
@media (min-width: 769px) {
  .contenedor-A {
    margin-top: 40px;
    gap: 60px;
  }

  .contenedor-B {
    padding: 0 20px;
  }

  .contenedor-C {
    padding: 0 20px;
  }
}

/* ===== Tablas sección entradas y productos ===== */
.contenedor-B2 table,
.contenedor-B6 table {
  width: 100%;
  border-collapse: collapse;
}

/* ===== Flyer, banner y eventos relacionados ===== */
.contenedor-B3 img {
  width: 100%;
  height: auto;
  display: block;
  margin-bottom: 20px;
}

.contenedor-C1 img,
.evento-relacionado-imagen img {
  width: 100%;
  height: auto;
  display: block;
}

/* ===== Video del evento ===== */
.contenedor-B4 iframe {
  width: 100%;
  max-height: 400px;
}

/* ===== Lista de eventos relacionados ===== */
.eventos-lista {
  margin: 0;
  padding: 0;
}

/* ===== Modal de productos asociados ===== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex !important;
}

.modal-content {
  background: white;
  border-radius: 8px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  position: relative;
}

.modal-header {
  background: #E91E8C;
  color: white;
  padding: 25px 30px;
  border-radius: 8px 8px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.5rem;
}

.modal-close {
  background: transparent;
  border: none;
  color: white;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.modal-body {
  padding: 30px;
}

.modal-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 20px;
}

.modal-btn {
  padding: 15px 35px;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.modal-btn-primary {
  background: #E91E8C;
  color: white;
}

.modal-btn-primary:hover {
  background: #c71872;
}

.modal-btn-secondary {
  background: #f0f0f0;
  color: #333;
}

.modal-btn-secondary:hover {
  background: #ddd;
}

/* ===== Botón compartir y menú desplegable ===== */
#shareMenu {
  display: none;
  position: absolute;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 10px;
  z-index: 1000;
}

#shareMenu.active {
  display: block;
}

/* ===== Responsive: en mobile todo en una columna ===== */
@media (max-width: 768px) {
  .contenedor-A {
    flex-direction: column;
  }

  .contenedor-B {
    flex-direction: column;
  }

  .contenedor-C {
    width: 100%;
  }

  /* Tabla de entradas en mobile: 2 filas por entrada */
  .contenedor-B2 table,
  .contenedor-B2 table tbody,
  .contenedor-B2 table thead,
  .contenedor-B2 table tr,
  .contenedor-B2 table td,
  .contenedor-B2 table th {
    display: block !important;
    width: 100% !important;
  }

  .contenedor-B2 table thead {
    display: none !important;
  }

  .contenedor-B2 table tbody tr {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows: auto auto !important;
    gap: 8px !important;
    margin-bottom: 15px !important;
    padding: 10px !important;
    border: 1px solid #ddd !important;
    border-radius: 8px !important;
    background-color: #f9f9f9 !important;
    width: 100% !important;
  }

  /* Primera celda: Tipo de entrada (ocupa primera columna) */
  .contenedor-B2 table tbody tr td:nth-child(1) {
    grid-column: 1 !important;
    grid-row: 1 !important;
    font-weight: bold !important;
    font-size: 14px !important;
    width: auto !important;
  }

  .contenedor-B2 table tbody tr td:nth-child(1)::before {
    content: "TIPO: " !important;
    display: block !important;
    font-size: 11px !important;
    font-weight: normal !important;
    color: #666 !important;
    margin-bottom: 2px !important;
  }

  /* Segunda celda: Precio (ocupa segunda columna) */
  .contenedor-B2 table tbody tr td:nth-child(2) {
    grid-column: 2 !important;
    grid-row: 1 !important;
    text-align: left !important;
    font-weight: bold !important;
    font-size: 16px !important;
    color: #E91E8C !important;
    width: auto !important;
  }

  .contenedor-B2 table tbody tr td:nth-child(2)::before {
    content: "PRECIO: " !important;
    display: block !important;
    font-size: 11px !important;
    font-weight: normal !important;
    color: #666 !important;
    margin-bottom: 2px !important;
  }

  /* Ocultar flechas del input number en mobile - entradas y productos */
  .contenedor-B2 input[type="number"]::-webkit-inner-spin-button,
  .contenedor-B2 input[type="number"]::-webkit-outer-spin-button,
  .contenedor-B6 input[type="number"]::-webkit-inner-spin-button,
  .contenedor-B6 input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
  }

  .contenedor-B2 input[type="number"],
  .contenedor-B6 input[type="number"] {
    -moz-appearance: textfield !important;
  }

  /* Botón de comprar ancho completo */
  .contenedor-B2 .single_add_to_cart_button {
    width: 100% !important;
  }

  /* Tercera celda: Cantidad - horizontal con label y contador */
  .contenedor-B2 table tbody tr td:nth-child(3) {
    grid-column: 1 / 3 !important;
    grid-row: 2 !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    width: auto !important;
  }

  .contenedor-B2 table tbody tr td:nth-child(3)::before {
    content: "CANTIDAD:" !important;
    display: inline !important;
    font-size: 11px !important;
    font-weight: normal !important;
    color: #666 !important;
    margin: 0 !important;
  }

  /* Tabla de productos asociados en mobile: todo centrado */
  .contenedor-B6 table,
  .contenedor-B6 table tbody,
  .contenedor-B6 table thead,
  .contenedor-B6 table tr,
  .contenedor-B6 table td,
  .contenedor-B6 table th {
    display: block !important;
    width: 100% !important;
  }

  .contenedor-B6 table thead {
    display: none !important;
  }

  .contenedor-B6 table tbody tr {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 10px !important;
    margin-bottom: 20px !important;
    padding: 15px !important;
    border: 1px solid #ddd !important;
    border-radius: 8px !important;
    background-color: #f9f9f9 !important;
    width: 100% !important;
  }

  /* Primera celda: Imagen centrada */
  .contenedor-B6 table tbody tr td:nth-child(1) {
    width: auto !important;
  }

  .contenedor-B6 table tbody tr td:nth-child(1) img {
    max-width: 150px !important;
    height: auto !important;
  }

  /* Segunda celda: Nombre del producto centrado y resaltado */
  .contenedor-B6 table tbody tr td:nth-child(2) {
    width: 100% !important;
    font-weight: bold !important;
    font-size: 16px !important;
  }

  /* Tercera celda: Precio centrado */
  .contenedor-B6 table tbody tr td:nth-child(3) {
    width: 100% !important;
    font-weight: bold !important;
    color: #E91E8C !important;
    font-size: 18px !important;
  }

  /* Cuarta celda: Cantidad centrada */
  .contenedor-B6 table tbody tr td:nth-child(4) {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
  }

  /* Input de cantidad centrado en productos asociados mobile */
  .contenedor-B6 input[type="number"] {
    text-align: center !important;
    max-width: 80px !important;
  }

  /* Botón de productos asociados ancho completo */
  .contenedor-B6 button[type="submit"] {
    width: 100% !important;
    display: block !important;
  }
}
