/* ===== SECCIÓN RESUMEN DE CARRITO Y PAGO ===== */
.resumen-carrito-section {
  width: 100%;
  max-width: 600px;
  margin: clamp(1.5rem, 4vw, 2.5rem) auto 0 auto;
  padding: 0 clamp(0.5rem, 2vw, 1rem);
  display: none; /* Inicialmente oculto */
  flex-direction: column;
  align-items: center;
  animation: fadeIn 0.8s var(--transition-smooth);
  background: none;
}

.resumen-carrito-section.mostrar {
  display: flex;
}

.resumen-pago {
  background: linear-gradient(135deg, var(--tertiary-bg) 0%, var(--secondary-bg) 100%);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-xl);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  margin: 0 auto clamp(1rem, 3vw, 1.5rem) auto;
  width: 100%;
  max-width: 520px;
  text-align: center;
  color: var(--text-white);
  border: clamp(1px, 0.3vw, 1.7px) solid var(--accent-gold);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1.5rem, 3vw, 2rem);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-smooth);
}

.resumen-pago::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, var(--accent-gold), var(--accent-green), var(--accent-blue), var(--accent-gold));
  border-radius: var(--border-radius-lg);
  z-index: -1;
  opacity: 0;
  transition: opacity var(--transition-smooth);
}

.resumen-pago:hover::before {
  opacity: 0.3;
}

.resumen-pago:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.resumen-pago h2 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.01em;
  background: linear-gradient(90deg, var(--accent-gold), var(--accent-green));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0;
  line-height: 1.2;
}

.resumen-pago span {
  font-size: clamp(1.8rem, 5vw, 2.2rem);
  font-weight: 900;
  font-family: var(--font-display);
  letter-spacing: 0.01em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  background: linear-gradient(90deg, var(--text-white), var(--accent-gold));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.btn-pago {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-green) 90%);
  color: #fff;
  font-weight: 700;
  font-family: var(--font-display);
  border: none;
  padding: clamp(1rem, 3vw, 1.3rem) clamp(2rem, 6vw, 3.5rem);
  border-radius: var(--border-radius-md);
  font-size: clamp(1rem, 3vw, 1.25rem);
  margin-top: 0.2rem;
  margin-bottom: 0.3rem;
  box-shadow: 0 8px 32px rgba(50, 100, 64, 0.15);
  cursor: pointer;
  transition: all var(--transition-smooth);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9em;
  position: relative;
  overflow: hidden;
  min-height: 54px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-pago::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn-pago:hover::before {
  left: 100%;
}

.btn-pago:hover {
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-blue) 100%);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.25);
  transform: scale(1.05) translateY(-3px);
}

.btn-pago:active {
  transform: scale(1.02) translateY(-1px);
  transition: transform 0.1s;
}

/* ===== MODAL DE PAGO MERCADOPAGO ===== */
.modal-mp {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.9));
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s var(--transition-smooth);
}

.modal-mp.activo {
  opacity: 1;
  visibility: visible;
}

.modal-mp-contenido {
  background: linear-gradient(135deg, var(--text-white), rgba(255, 255, 255, 0.95));
  padding: clamp(1.5rem, 5vw, 2rem);
  border-radius: var(--border-radius-lg);
  max-width: 450px;
  width: calc(100% - 2rem);
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  text-align: center;
  transform: scale(0.8) translateY(20px);
  transition: transform 0.4s var(--transition-smooth);
  border: 2px solid var(--accent-gold);
}

.modal-mp.activo .modal-mp-contenido {
  transform: scale(1) translateY(0);
}

.modal-mp-cerrar {
  position: absolute;
  top: clamp(10px, 3vw, 15px);
  right: clamp(15px, 4vw, 20px);
  font-size: clamp(24px, 5vw, 28px);
  font-weight: bold;
  cursor: pointer;
  color: #999;
  transition: all var(--transition-smooth);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}

.modal-mp-cerrar:hover {
  color: #333;
  background: rgba(0, 0, 0, 0.05);
  transform: scale(1.1);
}

.modal-mp h2 {
  margin-bottom: clamp(1rem, 3vw, 1.5rem);
  color: var(--secondary-bg);
  font-size: clamp(1.3rem, 4vw, 1.6rem);
  font-family: var(--font-display);
  font-weight: 700;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-green));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

#mp-btn-container {
  margin: clamp(1rem, 3vw, 1.5rem) 0;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Personalización del botón de MercadoPago */
#mp-btn-container .mercadopago-button {
  background: linear-gradient(135deg, #00b4d8, #0077b6) !important;
  border: none !important;
  border-radius: var(--border-radius-md) !important;
  padding: clamp(12px, 3vw, 16px) clamp(20px, 5vw, 32px) !important;
  font-size: clamp(14px, 3vw, 16px) !important;
  font-weight: bold !important;
  width: 100% !important;
  transition: all var(--transition-smooth) !important;
  cursor: pointer !important;
  color: white !important;
  min-height: 50px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  box-shadow: 0 4px 16px rgba(0, 180, 216, 0.3) !important;
}

#mp-btn-container .mercadopago-button:hover {
  transform: translateY(-3px) scale(1.02) !important;
  box-shadow: 0 8px 24px rgba(0, 180, 216, 0.4) !important;
  background: linear-gradient(135deg, #0077b6, #00b4d8) !important;
}

#mp-btn-container .mercadopago-button:active {
  transform: translateY(-1px) scale(1.01) !important;
}

/* ===== LOADER MODERNO ===== */
.loader-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.9));
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s var(--transition-smooth);
}

.loader-container.mostrar {
  opacity: 1;
  visibility: visible;
}

.loader {
  width: clamp(40px, 8vw, 60px);
  height: clamp(40px, 8vw, 60px);
  border: clamp(3px, 1vw, 5px) solid rgba(255, 255, 255, 0.1);
  border-top: clamp(3px, 1vw, 5px) solid var(--accent-gold);
  border-right: clamp(3px, 1vw, 5px) solid var(--accent-green);
  border-radius: 50%;
  animation: spin 1.2s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
  position: relative;
}

.loader::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 70%;
  height: 70%;
  border: 2px solid transparent;
  border-top: 2px solid var(--accent-blue);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: spin-reverse 0.8s linear infinite;
}

@keyframes spin {
  0% { 
    transform: rotate(0deg) scale(1); 
  }
  50% { 
    transform: rotate(180deg) scale(1.1); 
  }
  100% { 
    transform: rotate(360deg) scale(1); 
  }
}

@keyframes spin-reverse {
  0% { transform: translate(-50%, -50%) rotate(360deg); }
  100% { transform: translate(-50%, -50%) rotate(0deg); }
}

#loader-text {
  color: var(--text-white);
  margin-top: clamp(1rem, 3vw, 1.5rem);
  font-size: clamp(14px, 3vw, 16px);
  text-align: center;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.5px;
  animation: pulse 2s ease-in-out infinite;
  max-width: 80%;
}

@keyframes pulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

/* ===== CLASE OCULTAR ===== */
.oculto {
  display: none !important;
}

/* ===== RESPONSIVE BREAKPOINTS ===== */

/* Tablets */
@media (max-width: 768px) {
  .resumen-pago {
    margin: 0 auto 1rem auto;
    gap: 1.5rem;
  }
  
  .btn-pago {
    gap: 0.6em;
    min-height: 48px;
  }
  
  .modal-mp-contenido {
    width: calc(100% - 1rem);
    margin: 0.5rem;
  }
}

/* Móviles grandes */
@media (max-width: 480px) {
  .resumen-carrito-section {
    padding: 0 0.5rem;
  }
  
  .resumen-pago {
    padding: 1.5rem 1rem;
    gap: 1.25rem;
    border-width: 1px;
  }
  
  .resumen-pago h2 {
    font-size: 1.4rem;
  }
  
  .resumen-pago span {
    font-size: 1.6rem;
  }
  
  .btn-pago {
    padding: 0.9rem 1.8rem;
    font-size: 0.95rem;
    gap: 0.5em;
    min-height: 44px;
  }
  
  .modal-mp-contenido {
    padding: 1.5rem 1rem;
    border-radius: 12px;
  }
  
  .modal-mp h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
  }
  
  #mp-btn-container {
    margin: 1rem 0;
    min-height: 50px;
  }
}

/* Móviles pequeños */
@media (max-width: 320px) {
  .resumen-pago {
    padding: 1.25rem 0.75rem;
    gap: 1rem;
  }
  
  .resumen-pago h2 {
    font-size: 1.2rem;
  }
  
  .resumen-pago span {
    font-size: 1.4rem;
  }
  
  .btn-pago {
    padding: 0.8rem 1.5rem;
    font-size: 0.9rem;
    min-height: 40px;
  }
  
  .modal-mp-contenido {
    width: calc(100% - 0.5rem);
    padding: 1.25rem 0.75rem;
  }
  
  .modal-mp-cerrar {
    width: 35px;
    height: 35px;
    font-size: 20px;
  }
  
  #loader-text {
    font-size: 13px;
  }
}

/* Mejoras para dispositivos táctiles */
@media (hover: none) and (pointer: coarse) {
  .resumen-pago:hover,
  .btn-pago:hover,
  .modal-mp-cerrar:hover {
    transform: none;
  }
  
  .btn-pago:hover::before {
    left: -100%;
  }
  
  .resumen-pago:hover::before {
    opacity: 0;
  }
  
  /* Feedback táctil para botones */
  .btn-pago:active {
    transform: scale(0.98);
    transition: transform 0.1s;
  }
  
  .modal-mp-cerrar:active {
    transform: scale(0.95);
  }
}

/* Modo landscape en móviles */
@media (max-width: 768px) and (orientation: landscape) {
  .resumen-carrito-section {
    margin-top: 1rem;
  }
  
  .resumen-pago {
    gap: 1rem;
    padding: 1.5rem;
  }
  
  .modal-mp-contenido {
    max-height: 90vh;
    overflow-y: auto;
  }
}

/* Accesibilidad mejorada */
@media (prefers-reduced-motion: reduce) {
  .loader {
    animation-duration: 2s;
  }
  
  .loader::before {
    animation-duration: 3s;
  }
  
  .btn-pago::before {
    transition: none;
  }
  
  .btn-pago:hover::before {
    left: -100%;
  }
  
  #loader-text {
    animation: none;
    opacity: 1;
  }
}