@import url('https://fonts.googleapis.com/css2?family=Raleway:ital,wght@0,100..900;1,100..900&display=swap');

* {
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

body {
  background: rgb(255, 255, 255);
  font-family: "Raleway", sans-serif;
  font-optical-sizing: auto;
  font-weight: 300;
  font-style: normal;
  display: flex;
  flex-direction: column;
}
::-webkit-scrollbar {
  display: none;
}


/* Modal simple: pedido registrado - oculto por defecto */
#modalPedidoRegistrado.modal-overlay {
  display: none !important;
}

#modalPedidoRegistrado.modal-overlay.active {
  display: flex !important;
}

.modal-pedido-card {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  max-width: 380px;
  width: 90%;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-pedido-icon {
  font-size: 4rem;
  color: #4f7029;
  margin-bottom: 1rem;
}

.modal-pedido-card h2 {
  margin: 0 0 0.75rem 0;
  font-size: 1.5rem;
  color: #333;
}

.modal-pedido-card p {
  margin: 0 0 1.5rem 0;
  color: #666;
  line-height: 1.5;
}

.btn-modal-aceptar {
  background: linear-gradient(135deg, #4f7029, #80b149);
  color: white;
  border: none;
  padding: 0.75rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-modal-aceptar:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(79, 112, 41, 0.4);
}

/* Modal de Factura - Compra Finalizada - Oculto hasta que se complete una compra */
#modalCompraFinalizada {
  display: none !important;
}

#modalCompraFinalizada.active,
#modalCompraFinalizada[style*="flex"] {
  display: flex !important;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
  padding: 20px;
}

.modal-overlay .factura-card {
  background: white;
  border-radius: 16px;
  max-width: 480px;
  width: 95%;
  min-height: 85vh;
  max-height: 95vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
}

/* Evita que estilos globales de .card estiren este modal */
#modalCompraFinalizada .factura-card {
  width: min(820px, 92vw) !important;
  max-width: 820px !important;
  min-height: 78vh !important;
  max-height: 90vh !important;
}

.modal-overlay .dismiss {
  position: absolute;
  top: 15px;
  right: 15px;
  background: #f5f5f5;
  border: none;
  font-size: 24px;
  color: #666;
  cursor: pointer;
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
  z-index: 10;
}

.modal-overlay .dismiss:hover {
  background: #e0e0e0;
  color: #333;
  transform: scale(1.1);
}

/* Encabezado de factura con colores verdes */
.factura-header {
  background: linear-gradient(135deg, #4f7029, #80b149);
  color: white;
  padding: 1.5rem 1.25rem;
  text-align: center;
  border-radius: 16px 16px 0 0;
  flex-shrink: 0;
  width: 100%;
  box-sizing: border-box;
}

.factura-logo {
  margin-bottom: 1rem;
}

/* Evita que el logo del modal herede estilos grandes de .card img */
.factura-header .factura-logo-img {
  width: 110px;
  max-width: 38vw;
  height: auto;
  display: block;
  margin: 0 auto;
  padding: 0;
  background: transparent;
  border-radius: 0;
  object-fit: contain;
}

.factura-titulo h2 {
  margin: 0 0 0.5rem 0;
  font-size: 1.8rem;
  font-weight: 700;
}

.factura-numero {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.9;
}

/* Secciones de la factura - ancho igual al modal */
.factura-section {
  padding: 1.2rem 1.25rem;
  border-bottom: 1px solid #e0e0e0;
  flex-shrink: 0;
  margin-bottom: 0;
  width: 100%;
  box-sizing: border-box;
}

.section-title {
  color: #4f7029;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 1rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #80b149;
}

/* Info del cliente en grid - ocupa todo el ancho */
.info-cliente-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem 1rem;
  width: 100%;
  box-sizing: border-box;
}

.info-cliente-grid p {
  margin: 0;
  font-size: 0.95rem;
  color: #333;
}

.info-cliente-grid strong {
  color: #4f7029;
  font-weight: 600;
}

/* Tabla de productos - ancho completo */
.productos-tabla {
  background: #f9f9f9;
  border-radius: 8px;
  padding: 1rem 0;
  max-height: 280px;
  overflow-y: auto;
  width: 100%;
  box-sizing: border-box;
}

.productos-tabla ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.productos-tabla li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem;
  margin-bottom: 0.5rem;
  background: white;
  border-radius: 6px;
  border-left: 3px solid #80b149;
}

.productos-tabla li:last-child {
  margin-bottom: 0;
}

/* Totales - ancho completo */
.factura-total {
  padding: 1.2rem 1.25rem;
  background: #f5f5f5;
  flex-shrink: 0;
  width: 100%;
  box-sizing: border-box;
}

.total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  font-size: 1rem;
}

.total-row.total-final {
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 2px solid #80b149;
  font-size: 1.3rem;
  color: #4f7029;
}

.total-row.total-final strong {
  color: #4f7029;
  font-size: 1.4rem;
}

/* Footer con check */
.factura-footer {
  padding: 1.5rem 1.25rem;
  text-align: center;
  flex-shrink: 0;
  width: 100%;
  box-sizing: border-box;
}

.check-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 1rem;
  background: #e8f5e9;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.check-icon svg {
  width: 30px;
  height: 30px;
  stroke: #4f7029;
}

.factura-footer p {
  margin: 0.5rem 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #333;
}

.mensaje-envio {
  font-size: 0.9rem !important;
  color: #666 !important;
  font-weight: normal !important;
}

/* Botón de cerrar */
.factura-actions {
  padding: 1rem 1.25rem 1.5rem;
  text-align: center;
  flex-shrink: 0;
  width: 100%;
  box-sizing: border-box;
}

.btn-cerrar-factura {
  padding: 0.8rem 3rem;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  background: linear-gradient(135deg, #4f7029, #80b149);
  color: white;
  box-shadow: 0 4px 10px rgba(79, 112, 41, 0.3);
}

.btn-cerrar-factura:hover {
  background: linear-gradient(135deg, #3d5720, #6b9639);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(79, 112, 41, 0.4);
}

/* Responsive */
@media (max-width: 768px) {
  #modalCompraFinalizada .factura-card {
    width: 95vw !important;
    max-width: 95vw !important;
    min-height: 82vh !important;
    max-height: 92vh !important;
  }

  .info-cliente-grid {
    grid-template-columns: 1fr;
  }
  
  .factura-header {
    padding: 1.5rem 1rem;
  }
  
  .factura-section {
    padding: 1rem;
  }
  
  .factura-total {
    padding: 1rem;
  }
}

/* Estilos para secciones de empresa */
.seccion-empresa {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  padding-top: 1rem;
  border-top: 2px solid #066e29;
}

.seccion-empresa h5 {
  color: #066e29;
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

/* Estilos para items de productos */
.producto-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
}

.producto-detalle {
  display: flex;
  justify-content: space-between;
  width: 100%;
  align-items: center;
}

.producto-nombre {
  flex: 1;
  color: #333;
}

.producto-precio {
  font-weight: 600;
  color: #066e29;
  margin-left: 1rem;
}

/* Estilos para totales */
.total-empresa {
  background: #e8f5e9;
  padding: 0.75rem;
  border-radius: 5px;
  margin-top: 0.5rem;
  font-size: 1rem;
}

.total-general {
  background: #066e29;
  color: white;
  padding: 1rem;
  border-radius: 5px;
  margin-top: 1rem;
  font-size: 1.2rem;
  text-align: center;
}

.fecha-compra {
  text-align: center;
  color: #666;
  font-style: italic;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px dashed #ccc;
}





nav {
  width: 100%;
  height: 80px;
  display: flex;
  border-bottom: 1px solid #dfe1e1;
  align-items: center;
  align-content: center;
  justify-content: space-around;
  background-color: #ffff;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.178);

  div {
    width: 50%;

    span {
      font-size: 16px;
    }
  }

  img {
    width: 90px;
  }

  /* Botón hamburguesa para carrito - Oculto por defecto, visible en móviles */
  .hamburger-btn {
    display: none;
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 1001;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #18a155;
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s ease;
  }

  .hamburger-btn:hover {
    background: #1a8a4a;
    transform: scale(1.1);
  }

  .hamburger-btn.active {
    background: #0b4d0b;
    z-index: 1004 !important; /* Por encima del carrito (z-index: 1002) y overlay (z-index: 1001) */
  }

  .cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4444;
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
  }
}

.all {
  width: 100%;
  height: calc(100vh - 80px); /* 100vh menos la altura del nav (80px) */
  background-color: #f1f1f1;
  display: flex;
  flex: 1; /* Ocupa todo el espacio disponible */
  overflow: hidden; /* Evita que se desborde */
}

.section-one {
  width: 80%;
  height: 100%; /* Respeta la altura del contenedor .all */
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: #f1f1f1;
  overflow: hidden; /* Evita que se desborde */
  position: relative; /* Para que el contenido interno pueda hacer scroll */

  #contenedor-productos::-webkit-scrollbar {
    width: 8px;
  }

  #contenedor-productos::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
  }

  #contenedor-productos::-webkit-scrollbar-track {
    background: transparent;
  }

}

.form {
  margin: 20px auto;
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.form-section {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
  padding: 12px;
  border: 1px solid #e6e6e6;
  border-radius: 12px;
  background: #f9fbfa;
}

.form-section-title {
  margin: 0;
  font-size: 14px;
  color: #1e7d4d;
  font-weight: 700;
  width: 100%;
}

/* Contenedor del input con ícono */
.input-group {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  padding: 0 10px;
  width: 220px;
  height: 38px;
  overflow: hidden;
}

.input-group i {
  color: #1e7d4d;
  /* verde intermedio */
  font-size: 16px;
  margin-right: 8px;
}

/* Input y select dentro del grupo */
.input-group input,
.input-group select {
  border: none;
  outline: none;
  flex: 1;
  min-width: 0;
  font-size: 14px;
  color: #333;
  background: transparent;
  box-sizing: border-box;
}

.input-group input[type="file"] {
  font-size: 12px;
  color: #666;
  cursor: pointer;
}

.input-group input[type="file"]::file-selector-button {
  border: none;
  border-radius: 6px;
  background: #e9f3e5;
  color: #1e7d4d;
  font-weight: 600;
  padding: 4px 8px;
  margin-right: 8px;
  cursor: pointer;
}

/* Flecha del select organizada y visible DENTRO del borde */
.input-group select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 24px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  background-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.input-group input::placeholder {
  color: #999;
}

/* Mismo gris suave para el texto "Seleccione..." en porcentaje, región y ciudad */
.input-group select:invalid {
  color: #999;
}

/* Evita borde azul o amarillo */
.input-group input:focus,
.input-group select:focus {
  box-shadow: none;
  outline: none;
}


/* Evita autocompletado amarillo de Chrome */
input:-webkit-autofill,
input:-webkit-autofill:focus {
  box-shadow: 0 0 0px 1000px #fff inset;
  /* fondo blanco */
  -webkit-text-fill-color: #333;
  /* color del texto */
  border-radius: 6px;
  /* mantener esquinas */
}




#catalogo {
  width: 100%;
  flex: 1; /* Ocupa todo el espacio disponible en .section-one */
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding: 20px;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0; /* Permite que el scroll funcione correctamente */
  align-content: start; /* Alinea el contenido al inicio */
}

@media (max-width: 1200px) {
  #catalogo {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  #catalogo {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    padding: 15px;
  }
}

@media (max-width: 480px) {
  #catalogo {
    grid-template-columns: 1fr;
    gap: 15px;
  }
}


h1,
h2 {
  text-align: center;
}

.producto {
  width: 370px;
  height: 220px;
  background: blue;
  margin-bottom: 15px;
  border-radius: 10px;
  text-align: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}


/*CARRITO DE COMPRAS*/
.section-two {
  width: 30%;
  background-color: #f1f1f1;
  height: 100%; /* Respeta la altura del contenedor .all */
  display: flex;
  align-items: center;
  flex-direction: column;
  overflow: hidden; /* Evita que se desborde */
}

/* Botón cerrar carrito - Oculto por defecto en desktop */
.close-cart-btn {
  display: none !important;
}

/* Overlay para móviles */
.cart-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1001; /* Debajo del botón hamburguesa (z-index: 1004) */
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cart-overlay.active {
  display: block;
  opacity: 1;
}

.carrito {
  width: 90%;
  height: 600px;/* Altura fija predeterminada más larga */
  background: #fff;
  border-radius: 12px;
  margin-top: 20px;
  border-radius: 10px 10px 0px 0px;
  max-width: 600px;
  overflow-y: auto;
  padding: 14px;
}


/* Totales abajo */
.totales {
  width: 90%;
  flex-shrink: 0; /* No se encoge, mantiene su tamaño */
  padding: 20px;
  border-top: 1px solid #eee;
  background: #fafafa;
  border-radius: 0 0 10px 10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.mensaje-envio-gratis {
  font-size: 0.85rem;
  color: #4f7029;
  background: #e8f5e0;
  padding: 8px 10px;
  border-radius: 6px;
  margin: 6px 0 4px 0;
  border-left: 4px solid #80b149;
  font-weight: 500;
}

.total-item {
  width: 100%;
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  margin-bottom: 8px;

  span,
  strong {
    margin-top: 10px;
  }
}

/* Botón de pago Proinat (FEP) */
#btnPagarB {
  width: 100%;
  padding: 12px;
  background: #80b149;
  background: linear-gradient(135deg, #a1dd5b, #4f7029, #062d19);

  border: none;
  border-radius: 8px;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.3s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);

}

#btnPagarA:hover,
#btnPagarB:hover {
  background: linear-gradient(135deg, #0a5028, #18a155, #136239);
}

#btnPagarB:disabled {
  background: #ccc;
  cursor: not-allowed;
  box-shadow: none;
}

.carrito p {
  font-size: 18px;
  font-weight: bold;
}

#listaA {
  display: none; /* Solo se usa FEP (Proinat); listaB es la única activa */
  margin: 0;
  padding: 0;
}

#listaB {
  margin: 0;
  padding: 0;
}

.cart-empty-state {
  width: 100%;
  padding: 24px 14px;
  border: 1px dashed #b9c7ad;
  border-radius: 10px;
  background: #f7faf3;
  text-align: center;
  color: #4f7029;
}

.cart-empty-icon {
  display: block;
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.cart-empty-state p {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #3f5e22;
}

.cart-empty-state small {
  display: block;
  margin-top: 6px;
  color: #6e7f60;
  font-size: 0.85rem;
}

.cart-card {
  display: flex;
  width: 330px;
  height: 100px;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-radius: 10px;
  padding: 10px 14px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  margin-bottom: 12px;
  max-width: 800px;
}

.cart-card img {
  width: 30px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
  margin-right: 12px;
}

.cart-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.cart-info h4 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  color: #062d19;
}

.cart-info .quantity {
  font-size: 14px;
  color: #177e44;
  margin: 2px 0;
}

.cart-info .note {
  font-size: 13px;
  color: #177e44;
  margin: 0;
}

.cart-price {
  font-size: 16px;
  font-weight: 600;
  color: #155231;
  margin-left: 10px;
}

.btn-eliminar {
  background: none;
  border: none;
  color: #155231;
  /* rojo elegante */
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease;
  margin-left: 10px;
}

.btn-eliminar:hover {
  color: #155231;
  transform: scale(1.2);
}



/* ===== Ajuste final: formulario fluido en tablet/laptop ===== */
@media (min-width: 768px) {
  .form {
    width: 100% !important;
    height: auto !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    align-items: stretch !important;
  }

  .form-section {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
    width: 100% !important;
    box-sizing: border-box !important;
    gap: 10px !important;
    align-items: center !important;
  }

  .form-section-title {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    margin-bottom: 2px !important;
  }

  .form-section .input-group {
    width: 100% !important;
    min-width: 0 !important;
    margin-bottom: 0 !important;
  }
}

/* ===== Ajuste visual: laptop y pantallas grandes ===== */
@media (min-width: 1024px) and (max-width: 1439px) {
  .all {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 340px !important;
    gap: 16px !important;
    padding: 12px 16px !important;
    height: calc(100vh - 80px) !important;
    align-items: stretch !important;
  }

  .section-one,
  .section-two {
    width: 100% !important;
    height: 100% !important;
  }

  .section-two {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .form-section {
    grid-template-columns: repeat(4, minmax(140px, 1fr)) !important;
  }

  #catalogo {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(210px, 1fr)) !important;
    gap: 14px !important;
    padding: 12px !important;
    align-content: start !important;
  }

  .card {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
  }

  .carrito,
  .totales {
    width: 100% !important;
    max-width: none !important;
  }

  .carrito {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: auto !important;
    margin-top: 0 !important;
  }
}

@media (min-width: 1440px) {
  .all {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 360px !important;
    gap: 18px !important;
    padding: 14px 20px !important;
  }

  .form-section {
    grid-template-columns: repeat(5, minmax(150px, 1fr)) !important;
  }

  #catalogo {
    grid-template-columns: repeat(4, minmax(220px, 1fr)) !important;
    gap: 16px !important;
  }
}

/* ===== FIX FINAL DESKTOP/LAPTOP (prioridad alta) ===== */
@media (min-width: 1024px) {
  .all {
    display: flex !important;
    gap: 16px !important;
    padding: 12px 16px !important;
    height: calc(100vh - 80px) !important;
    align-items: stretch !important;
  }

  .section-one {
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
    height: 100% !important;
  }

  .section-two {
    flex: 0 0 340px !important;
    width: 340px !important;
    min-width: 320px !important;
    max-width: 360px !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .form {
    width: 100% !important;
    height: auto !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .form-section {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(150px, 1fr)) !important;
    width: 100% !important;
    gap: 10px !important;
  }

  .form-section-title {
    grid-column: 1 / -1 !important;
  }

  .form-section .input-group {
    width: 100% !important;
    min-width: 0 !important;
    margin-bottom: 0 !important;
  }

  /* Empresario: 3 filas personalizadas */
  .form-section-empresario {
    grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
  }

  .form-section-empresario .form-section-title {
    grid-column: 1 / -1 !important;
  }

  /* Fila 1: Nombre, Cédula, Celular */
  .form-section-empresario .input-group:nth-child(2),
  .form-section-empresario .input-group:nth-child(3),
  .form-section-empresario .input-group:nth-child(4) {
    grid-column: span 4 !important;
  }

  /* Fila 2: Dirección, % (más pequeño), Región, Ciudad, Observación */
  .form-section-empresario .input-group:nth-child(5) {
    grid-column: span 3 !important;
  }

  .form-section-empresario .input-group:nth-child(6),
  .form-section-empresario .input-group:nth-child(7),
  .form-section-empresario .input-group:nth-child(8) {
    grid-column: span 2 !important;
  }

  .form-section-empresario .input-group:nth-child(9) {
    grid-column: span 3 !important;
  }

  /* Fila 3: Soporte 1 y 2 a lo ancho del contenedor */
  .form-section-empresario .input-group:nth-child(10),
  .form-section-empresario .input-group:nth-child(11) {
    grid-column: span 6 !important;
  }

  #catalogo {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(220px, 1fr)) !important;
    gap: 14px !important;
    padding: 12px !important;
    align-content: start !important;
  }

  .card {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
  }

  .carrito,
  .totales {
    width: 100% !important;
    max-width: none !important;
  }

  .carrito {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: auto !important;
    margin-top: 0 !important;
  }
}

@media (min-width: 1440px) {
  .section-two {
    flex-basis: 360px !important;
    width: 360px !important;
    max-width: 380px !important;
  }

  .form-section {
    grid-template-columns: repeat(5, minmax(150px, 1fr)) !important;
  }

  #catalogo {
    grid-template-columns: repeat(4, minmax(220px, 1fr)) !important;
  }
}

/* ===== Empresario fijo: 3 arriba + 4 abajo ===== */
@media (min-width: 768px) {
  .form-section-representante {
    display: grid !important;
    grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  .form-section-representante .form-section-title {
    grid-column: 1 / -1 !important;
  }

  .form-section-representante .input-group:nth-child(2),
  .form-section-representante .input-group:nth-child(3) {
    grid-column: span 6 !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .form-section-empresario {
    display: grid !important;
    grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  .form-section-empresario .form-section-title {
    grid-column: 1 / -1 !important;
  }

  /* Fila 1 (3 campos): Nombre, Cédula, Celular */
  .form-section-empresario .input-group:nth-child(2),
  .form-section-empresario .input-group:nth-child(3),
  .form-section-empresario .input-group:nth-child(4) {
    grid-column: span 4 !important;
  }

  /* Fila 2 (5 campos): Dirección, Porcentaje, Región, Ciudad, Observación */
  .form-section-empresario .input-group:nth-child(5),
  .form-section-empresario .input-group:nth-child(9) {
    grid-column: span 3 !important;
  }

  .form-section-empresario .input-group:nth-child(6),
  .form-section-empresario .input-group:nth-child(7),
  .form-section-empresario .input-group:nth-child(8) {
    grid-column: span 2 !important;
  }

  /* Fila 3 (2 campos): Soporte 1 y Soporte 2 */
  .form-section-empresario .input-group:nth-child(10),
  .form-section-empresario .input-group:nth-child(11) {
    grid-column: span 6 !important;
  }
}
/* ===== Ajustes finales responsive formulario ===== */
@media (max-width: 767px) {
  .form {
    width: 100% !important;
    height: auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    margin: 12px auto !important;
  }

  .form-section {
    width: 100% !important;
    padding: 10px !important;
    gap: 8px !important;
  }

  .form-section-title {
    font-size: 13px !important;
    margin-bottom: 2px !important;
  }

  .input-group {
    width: 100% !important;
    min-width: 0 !important;
    height: 36px !important;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .form {
    width: 100% !important;
    height: auto !important;
    align-items: stretch !important;
  }

  .form-section {
    width: 100% !important;
  }

  .input-group {
    width: calc(33.333% - 8px) !important;
    min-width: 200px !important;
  }
}


.pagar {
  background: #007bff;
  color: white;
  padding: 10px;
  text-align: center;
  display: block;
  text-decoration: none;
  border-radius: 8px;
  margin-top: 10px;
}

.pagar:hover {
  background: #0056b3;
}


.all-card {
  width: 350px;
  height: 200px;
  background: rgb(231, 211, 211);
  border-radius: 8px;
  border: none;
}

.description-all {
  height: 50%;

  div {
    background-color: #64928c;

    img {
      width: 160px;
    }
  }
}



/*ESTILOS DE CARD - CATALOGO*/

.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  padding: 20px;
  width: 100%;
  height: 380px;
  max-width: 280px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.all-content-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.card img {
  width: 100%;
  height: 150px;
  border-radius: 12px;
  object-fit: contain;
  background: #f8f9fa;
  padding: 10px;
  margin-bottom: 8px;
}

.card-content {
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.card-content h3 {
  width: 100%;
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  color: #333;
  line-height: 1.3;
}

.card-content p {
  display: none; /* Ocultar descripción según la imagen */
}

.card-footer {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.price {
  width: 100%;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  color: #4e9227;
  padding: 4px 0;
}

.quantity-control {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
}

.btn {
  width: 32px;
  height: 32px;
  border: 1px solid #e0e0e0;
  border-radius: 50%;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn:hover {
  transform: scale(1.1);
}

.btn-minus {
  background: #f5f5f5;
  color: #666;
  border-color: #ddd;
}

.btn-minus:hover {
  background: #e8e8e8;
}

.btn-plus {
  background: #155231;
  color: #fff;
  border-color: #155231;
}

.btn-plus:hover {
  background: #1a6b3a;
  border-color: #1a6b3a;
}

.quantity {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  min-width: 30px;
  text-align: center;
}

.card-action {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 4px;
}

.btn-agregar {
  width: 100%;
  background: #80b149;
  color: #fff;
  border: none;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(24, 161, 85, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}


.btn-agregar:hover {
  background: #0b4d0b;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(24, 161, 85, 0.4);
}

.btn-agregar:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(24, 161, 85, 0.3);
}





/*CARRITO VIJEO*/
.producto-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  padding: 16px;
  margin: 12px;
  width: 220px;
  transition: transform 0.2s;
}

.producto-card:hover {
  transform: translateY(-5px);
}

.producto-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 12px;
}

.producto-nombre {
  font-size: 1.1rem;
  font-weight: bold;
  margin-bottom: 6px;
  text-align: center;
}

.producto-precio {
  color: #e67e22;
  font-weight: bold;
  margin-bottom: 12px;
}

.producto-controles {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.producto-controles button {
  background: #f2f2f2;
  border: none;
  padding: 6px 12px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s;
}

.producto-controles button:hover {
  background: #ddd;
}

footer {
  width: 100%;
  height: 1px;
}

/* ===== Teléfonos (≤480px) ===== */
@media (max-width: 480px) {
  /* Nav fijo solo en móviles */
  nav {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
  }

  /* Mostrar botón hamburguesa */
  nav .hamburger-btn {
    display: flex !important;
    position: fixed !important;
    bottom: 20px;
    right: 20px;
    top: auto;
    z-index: 1004 !important; /* Por encima del carrito (z-index: 1002) y overlay (z-index: 1000) */
  }

  
  /* Cuando el carrito está abierto, el botón queda visible sobre él */
  .section-two.active ~ .hamburger-btn,
  .hamburger-btn.active {
    z-index: 1004 !important;
    display: flex !important;
  }

  .all {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #f1f1f1;
    position: relative;
    padding: 0;
    margin: 0;
    margin-top: 80px; /* Espacio para el nav fixed */
    height: auto; /* Altura automática para scroll natural */
    overflow: visible; /* Permitir scroll natural */
  }

  /* Ocultar section-one (catálogo) cuando el carrito está abierto */
  .section-one {
    width: 100%;
    height: auto; /* Altura automática para scroll natural */
    min-height: 100%;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    overflow: visible; /* Permitir scroll natural */
  }

  .section-one.hide-when-cart-open {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  /* Ocultar carrito por defecto, mostrarlo como panel completo cuando está activo */
  .section-two {
    position: fixed;
    top: 80px; /* Debajo del nav */
    left: 0;
    right: 0;
    bottom: 0; /* Ocupa hasta el final de la pantalla */
    width: 100%;
    height: calc(100vh - 80px); /* 100% de altura menos el nav */
    min-height: calc(100vh - 80px); /* Garantiza siempre el 100% de altura */
    max-height: calc(100vh - 80px); /* Limita al 100% de altura */
    background-color: #f1f1f1;
    z-index: 1002;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .section-two.active {
    transform: translateX(0);
  }

  /* Botón cerrar carrito en móviles */
  .close-cart-btn {
    display: none; /* Oculto por defecto, visible solo en móviles */
  }

  .section-two.active .close-cart-btn {
    display: flex;
    position: fixed;
    top: 10px; /* Debajo del nav (80px) + 15px de espacio */
    right: 1px;
    z-index: 1005;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    color: rgb(27, 4, 4);
    border: none;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
    background-color: transparent;
  }

  .section-two.active .close-cart-btn:hover {
    transform: scale(1.1);
  }

  /* Catálogo - visible solo cuando el carrito está cerrado */
  #catalogo {
    gap: 15px;
    padding: 15px;
    flex-wrap: wrap;
    display: flex;
    width: 100%;
    height: auto; /* Altura automática para scroll natural */
    align-items: center;
    margin: 0 auto;
    overflow: visible; /* Permitir scroll natural */
  }

  .card {
    max-width: 100%;
    margin: 0 auto;
    width: 80%;
    height: 380px;
  }

  .cart-card{
    width: 100%;
  }

  /* Carrito en móviles - ocupar todo el espacio */
  .carrito {
    width: 100%;
    height: auto;
    flex: 1;
    min-height: 0;
    margin-top: 0;
    padding: 70px 15px 15px 15px; /* Padding superior para la X */
    border-radius: 0;
    background: #fff;
    overflow-y: auto;
  }

  .totales {
    width: 100%;
    padding: 15px;
    padding-bottom: 90px; /* Espacio extra para el botón hamburguesa en la parte inferior */
    border-radius: 0;
    background: #fafafa;
    flex-shrink: 0; /* No se encoge */
  }

  .total-item {
    width: 100%;
  }

  /* Overlay activo */
  .cart-overlay.active {
    display: block;
  }

  .form{
    width: 100%;
    height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  /* Reducir tamaño de los input en móviles */
  .form .input-group input,
  .form .input-group select {
    height: 32px;
    font-size: 14px;
    padding: 6px 10px;
    width: 210px;
    max-width: 90vw;
    box-sizing: border-box;
  }

  .form .input-group select {
    padding-right: 24px;
    background-position: right 6px center;
  }

  .form .input-group {
    margin-bottom: 12px;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
  }

  .form .input-group i {
    font-size: 15px;
    min-width: 18px;
  }
  }
}

/* Celulares grandes (≥480px y <768px) */
@media (min-width: 480px) and (max-width: 767px) {
  /* Nav fijo solo en móviles */
  nav {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
  }

  /* Mostrar botón hamburguesa */
  nav .hamburger-btn {
    display: flex !important;
    position: fixed !important;
    bottom: 20px;
    right: 20px;
    top: auto;
    z-index: 1004 !important; /* Por encima del carrito (z-index: 1002) y overlay (z-index: 1000) */
  }

  /* Cuando el carrito está abierto, el botón queda visible sobre él */
  .hamburger-btn.active {
    z-index: 1004 !important;
    display: flex !important;
  }

  .all {
    display: flex;
    flex-direction: column;
    position: relative;
    margin-top: 80px; /* Espacio para el nav fixed */
    height: auto; /* Altura automática para scroll natural */
      overflow: visible; /* Permitir scroll natural */
  }

  /* Ocultar section-one (catálogo) cuando el carrito está abierto */
  .section-one {
    width: 100%;
    height: auto; /* Altura automática para scroll natural */
    min-height: 100%;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    overflow: visible; /* Permitir scroll natural */
  }

  .section-one.hide-when-cart-open {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
  
  /* Ocultar carrito por defecto, mostrarlo como panel completo cuando está activo */
  .section-two {
    position: fixed;
    top: 80px; /* Debajo del nav */
    left: 0;
    right: 0;
    bottom: 0; /* Ocupa hasta el final de la pantalla */
    width: 100%;
    height: calc(100vh - 80px); /* 100% de altura menos el nav */
    min-height: calc(100vh - 80px); /* Garantiza siempre el 100% de altura */
    max-height: calc(100vh - 80px); /* Limita al 100% de altura */
    background-color: #f1f1f1;
    z-index: 1002;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .section-two.active {
    transform: translateX(0);
  }

  /* Botón cerrar carrito en móviles */
  .close-cart-btn {
    display: none; /* Oculto por defecto, visible solo en móviles */
  }

  .section-two.active .close-cart-btn {
    display: flex;
    position: fixed;
    top: 10px; /* Debajo del nav (80px) + 15px de espacio */
    right: 1px;
    z-index: 1005;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    color: rgb(27, 4, 4);
    border: none;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
    background-color: transparent;
  }

  .section-two.active .close-cart-btn:hover {
    transform: scale(1.1);
  }

  .card {
    max-width: 100%;
    margin: 0 auto;
    width: 85%;
    height: 380px;
  }

  .total-item {
    width: 100%;
    display: flex;
  }

  /* Carrito en móviles - ocupar todo el espacio */
  .carrito {
    width: 100%;
    height: auto;
    flex: 1;
    min-height: 0;
    margin-top: 0;
    padding: 70px 15px 15px 15px; /* Padding superior para la X */
    border-radius: 0;
    background: #fff;
    overflow-y: auto;
  }

  

  .totales {
    width: 100%;
    padding: 15px;
    padding-bottom: 90px; /* Espacio extra para el botón hamburguesa en la parte inferior */
    border-radius: 0;
    background: #fafafa;
    flex-shrink: 0; /* No se encoge */
  }

  /* Overlay activo */
  .cart-overlay.active {
    display: block;
  }
} 

/* ========== TABLET ========== */
@media (min-width: 768px) and (max-width: 1023px) {

   /* Nav fijo solo en móviles */
   nav {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
  }

  /* Mostrar botón hamburguesa */
  nav .hamburger-btn {
    display: flex !important;
    position: fixed !important;
    bottom: 20px;
    right: 20px;
    top: auto;
    z-index: 1004 !important; /* Por encima del carrito (z-index: 1002) y overlay (z-index: 1000) */
  }

  /* Cuando el carrito está abierto, el botón queda visible sobre él */
  .hamburger-btn.active {
    z-index: 1004 !important;
    display: flex !important;
  }

  .all {
    display: flex;
    flex-direction: column;
    position: relative;
    margin-top: 100px; /* Espacio para el nav fixed */
    height: auto; /* Altura automática para scroll natural */
      overflow: visible; /* Permitir scroll natural */
  }
  /* Ocultar section-one (catálogo) cuando el carrito está abierto */
  .section-one {
    width: 100%;
    height: auto; /* Altura automática para scroll natural */
    min-height: 100%;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    overflow: visible; /* Permitir scroll natural */
  }

  .section-one.hide-when-cart-open {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  .section-two {
    position: fixed;
    top: 80px; /* Debajo del nav */
    left: 0;
    right: 0;
    bottom: 0; /* Ocupa hasta el final de la pantalla */
    width: 100%;
    height: calc(100vh - 80px); /* 100% de altura menos el nav */
    min-height: calc(100vh - 80px); /* Garantiza siempre el 100% de altura */
    max-height: calc(100vh - 80px); /* Limita al 100% de altura */
    background-color: #f1f1f1;
    z-index: 1002;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .section-two.active {
    transform: translateX(0);
  }

  /* Botón cerrar carrito en tablet */
  .close-cart-btn {
    display: none; /* Oculto por defecto, visible cuando el carrito está abierto */
  }

  .section-two.active .close-cart-btn {
    display: flex !important;
    position: fixed;
    top: 10px; /* Debajo del nav (80px) + 15px de espacio */
    right: 1px;
    z-index: 1005;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    color: rgb(27, 4, 4);
    border: none;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
    background-color: transparent;
    pointer-events: auto !important; /* Asegurar que el botón sea clickeable */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
  }

  .section-two.active .close-cart-btn:hover {
    transform: scale(1.1);
    background-color: rgba(0, 0, 0, 0.1);
  }

    /* Catálogo - visible solo cuando el carrito está cerrado */
    #catalogo {
      gap: 15px;
      padding: 15px;
      flex-wrap: wrap;
      display: flex;
      width: 100%;
      height: auto; /* Altura automática para scroll natural */
      align-items: center;
      margin: 0 auto;
      overflow: visible; /* Permitir scroll natural */
    }

  nav {
    height: 100px;
  }

  .form {
    width: 60%;
    flex-direction: column;
    align-items: stretch;
  }

  .input-group {
    width: 100%;
  }

  .card {
    max-width: 100%;
    margin: 0 auto;
    width: 43%;
    height: 370px;
  }

  .section-one {
    height: auto;
  }

  /* Configuración de .carrito y .totales para el modal en tablet */
  .section-two.active .carrito {
    width: 100%;
    height: 100%;
    flex: 1;
    min-height: 0;
    padding: 70px 15px 15px 15px;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .section-two.active .totales {
    width: 80%;
    padding: 15px;
    padding-bottom: 100px; /* Espacio extra para el botón hamburguesa y asegurar que los botones sean visibles */
    border-radius: 0;
    background: #fafafa;
    flex-shrink: 0; /* No se encoge */
    margin-bottom: 0;
  }

  .cart-card{
    width: 100%;
  }
}

/* ========== LAPTOP ========== */
@media (min-width: 1024px) and (max-width: 1200px) {
  .all {
    flex-direction: row;        
    align-items: flex-start;
    justify-content: space-between;
    height: 90vh;
    background-color: #f1f1f1;
  }

  .section-one {
    width: 58%;
    height: 100%;

  }
  .card {
    max-width: 100%;
    margin: 0 auto;
    width: 270px;
    height: 370px;
  }

  .section-two {
    width: 40%;
    height: calc(100vh - 100px); /* Altura completa menos el nav */
    max-height: calc(100vh - 100px);
    min-height: 400px;
    display: flex;
    flex-direction: column; /* Importante: apilar verticalmente */
    align-items: stretch;
    overflow: hidden;
    background-color: #f1f1f1;
  }

  .carrito {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    width: 95%;
    padding: 15px;
    box-sizing: border-box;
  }

  #catalogo {
    gap: 15px;
    padding: 15px;
    flex-wrap: wrap;
    display: flex;
    width: 100%;
    height: auto; /* Altura automática para scroll natural */
    align-items: center;
    margin: 0 auto;
    overflow: auto; /* Permitir scroll natural */
  }

  .cart-card{
    width: 100%;
  }

  .totales {
    flex-shrink: 0;
    width: 95%;
    padding: 15px;
    padding-bottom: 20px;
    box-sizing: border-box;
    background: #fafafa;
    border-top: 1px solid #eee;
    overflow: visible; /* Permitir que los botones sean completamente visibles */
    min-height: auto;
    max-height: none;
  }

  .close-cart-btn {
    display: none !important;
  }
} 

/* ========== LAPTOP ========== */
@media (min-width: 1201px) and (max-width: 1439px) {
  .all {
    flex-direction: row;        
    align-items: flex-start;
    justify-content: space-between;
    height: 90vh;
    background-color: #f1f1f1;
  }

  .section-one {
    width: 65%;
    height: 100%;

  }
  .card {
    max-width: 100%;
    margin: 0 auto;
    width: 290px;
    height: 370px;
  }

  .section-two {
    width: 35%;
    height: calc(100vh - 100px); /* Altura completa menos el nav */
    max-height: calc(100vh - 100px);
    min-height: 400px;
    display: flex;
    flex-direction: column; /* Importante: apilar verticalmente */
    align-items: stretch;
    overflow: hidden;
    background-color: #f1f1f1;
  }

  .carrito {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    width: 95%;
    padding: 15px;
    box-sizing: border-box;
  }

  #catalogo {
    gap: 15px;
    padding: 15px;
    flex-wrap: wrap;
    display: flex;
    width: 100%;
    height: auto; /* Altura automática para scroll natural */
    align-items: center;
    margin: 0 auto;
    overflow: auto; /* Permitir scroll natural */
  }

  .cart-card{
    width: 100%;
  }

  .totales {
    flex-shrink: 0;
    width: 95%;
    padding: 15px;
    padding-bottom: 20px;
    box-sizing: border-box;
    background: #fafafa;
    border-top: 1px solid #eee;
    overflow: visible; /* Permitir que los botones sean completamente visibles */
    min-height: auto;
    max-height: none;
  }

  .close-cart-btn {
    display: none !important;
  }
}

/* ========== DESKTOP GRANDE ========== */
@media (min-width: 1440px) {
  .all {
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    gap: 40px; /* espacio entre catálogo y carrito */
    padding: 20px 40px;
    background-color: #f1f1f1;
  }

  .section-one {
    width: 65%;
    max-width: 1000px;
  }

  .section-two {
    width: 25%;
    max-width: 400px;
    position: sticky;
    top: 20px;
  }

  /* Botón cerrar carrito - Oculto en desktop grande */
  .close-cart-btn {
    display: none !important;
  }

  .card {
    max-width: 100%;
    margin: 0 auto;
    width: 260px;
    height: 370px;
  }

  #catalogo {
    gap: 15px;
    padding: 15px;
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    height: auto; /* Altura automática para scroll natural */
    align-items: center;
    margin: 0 auto;
    overflow: auto; /* Permitir scroll natural */
  }

  .section-two {
    width: 35%;
    height: calc(100vh - 100px); /* Altura completa menos el nav */
    max-height: calc(100vh - 100px);
    min-height: 400px;
    display: flex;
    flex-direction: column; /* Importante: apilar verticalmente */
    align-items: stretch;
    overflow: hidden;
    background-color: #f1f1f1;
  }

}





/*---------------Modal Información Pedido---------------*/

.modal-all-cerrar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: rgba(0, 0, 0, 0);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.4s ease, background-color 0.4s ease;
}

.modal-all-cerrar.modal-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-info-card {
  width: 62%;
  height: 91%;
  background-image: url(./images/Recurso\ 3.png);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  justify-content: center;
  align-items: center;
  transform: scale(0.88);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.35s ease;
}

.modal-all-cerrar.modal-visible .modal-info-card {
  transform: scale(1);
  opacity: 1;
}

.img-info-completa {
  width: 90%;
  height: 72%;
  object-fit: cover;
  display: flex;
  justify-content: center;
  align-items: center;
  object-fit: contain; /* Mostrar imagen completa, cajas no cortadas */
}

/* Imagen del modal para móvil (oculta en escritorio) */
.img-info-movil {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

/* ===== Modal información: responsive móvil ===== */
@media (max-width: 768px) {
  .modal-info-card {
    width: 92%;
    max-width: 360px;
    height: auto;
    min-height: 70vh;
    max-height: 90vh;
    background-image: none;
    background-color: transparent;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
  }

  .modal-all-cerrar .img-info-completa {
    display: none !important;
  }

  .modal-all-cerrar .img-info-movil {
    display: block !important;
    width: 100%;
    height: auto;
    max-height: 85vh;
    object-fit: contain;
    object-position: center;
    flex-shrink: 0;
  }
}

@media (max-width: 480px) {
  .modal-info-card {
    width: 94%;
    max-width: 100%;
    min-height: 75vh;
    max-height: 92vh;
  }

  .modal-all-cerrar .img-info-movil {
    max-height: 88vh;
  }

  .modal-all-cerrar .modal-close-btn {
    top: 12px;
    right: 16px;
    font-size: 2rem;
  }
}



