/* ===============================
   CSS TÉRMINOS Y CONDICIONES DE COMPRA
   Archivo: CSS/terminos.css
   =============================== */

/* ========== SECCIÓN PRINCIPAL ========== */
.terminos-compra {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 1px solid #dee2e6;
  border-radius: 12px;
  padding: 25px;
  margin: 25px 0;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

.terminos-compra::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #007bff, #28a745);
}

/* ========== HEADER DE TÉRMINOS ========== */
.terminos-header {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  color: #2c3e50;
  gap: 12px;
  flex-wrap: wrap;
}

.terminos-header i {
  font-size: 24px;
  color: #007bff;
  margin-right: 12px;
}

.terminos-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

/* ========== BOTÓN POLÍTICAS ========== */
#btn-politicas {
  margin-left: auto;
  padding: 0.5rem 0.9rem;
  border: 1px solid #0d6efd;
  background: #0d6efd;
  color: #fff;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

#btn-politicas:hover {
  background: #0b5ed7;
  border-color: #0b5ed7;
  transform: translateY(-1px);
}

#btn-politicas:active {
  transform: translateY(0);
}

/* ========== GRID DE TÉRMINOS ========== */
.terminos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

/* ========== ITEMS INDIVIDUALES ========== */
.termino-item {
  background: white;
  padding: 18px;
  border-radius: 8px;
  border-left: 4px solid #007bff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.termino-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.termino-item:nth-child(2) {
  border-left-color: #28a745;
}

.termino-item:nth-child(3) {
  border-left-color: #ffc107;
}

.termino-item:nth-child(4) {
  border-left-color: #dc3545;
}

/* ========== ICONOS Y TÍTULOS ========== */
.termino-icono {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  font-weight: 600;
  color: #2c3e50;
}

.termino-icono i {
  margin-right: 8px;
  width: 20px;
  text-align: center;
}

.termino-descripcion {
  color: #6c757d;
  font-size: 14px;
  line-height: 1.5;
}

.termino-descripcion strong {
  color: #2c3e50;
}

.termino-descripcion small {
  color: #adb5bd;
  font-style: italic;
}

/* ========== SECCIÓN IMPORTANTE ========== */
.terminos-importante {
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 8px;
  padding: 15px;
  margin-top: 20px;
  display: flex;
  align-items: flex-start;
}

.terminos-importante i {
  color: #f39c12;
  font-size: 18px;
  margin-right: 10px;
  margin-top: 2px;
}

.terminos-importante-texto {
  font-size: 14px;
  color: #856404;
}

.terminos-importante strong {
  color: #b45309;
}

/* ========== MODAL DE POLÍTICAS ========== */
#modal-politicas {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.5);
  padding: 24px;
  z-index: 1000;
  backdrop-filter: blur(2px);
}

#modal-politicas[hidden] {
  display: none;
}

.modal-politicas-container {
  max-width: 760px;
  width: 100%;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
  background: #f8f9fa;
}

.modal-header i {
  color: #0d6efd;
  font-size: 18px;
}

.modal-header h4 {
  margin: 0;
  font-size: 16px;
  color: #2c3e50;
  font-weight: 600;
}

#cerrar-modal {
  margin-left: auto;
  border: none;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
  color: #6c757d;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

#cerrar-modal:hover {
  background: #e9ecef;
  color: #2c3e50;
}

.modal-content {
  padding: 18px 20px;
  max-height: 70vh;
  overflow: auto;
  line-height: 1.55;
}

.modal-content ol {
  padding-left: 18px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.modal-content li {
  color: #495057;
}

.modal-content strong {
  color: #2c3e50;
}

.modal-content em {
  color: #6c757d;
  font-style: italic;
}

.resumen-practico {
  margin-top: 16px;
  padding: 12px;
  background: #f8f9fa;
  border: 1px solid #eee;
  border-radius: 8px;
}

.resumen-practico ul {
  margin: 8px 0 0 18px;
  color: #495057;
}

.resumen-practico strong {
  color: #0d6efd;
}

.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 14px 20px;
  border-top: 1px solid #eee;
  background: #f8f9fa;
}

#aceptar-politicas {
  padding: 0.5rem 0.9rem;
  border: 1px solid #0d6efd;
  background: #0d6efd;
  color: #fff;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

#aceptar-politicas:hover {
  background: #0b5ed7;
  border-color: #0b5ed7;
}

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 768px) {
  .terminos-compra {
    padding: 20px 15px;
    margin: 20px 10px;
  }
  
  .terminos-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }
  
  .terminos-header h3 {
    font-size: 18px;
  }
  
  #btn-politicas {
    margin-left: 0;
    align-self: stretch;
    text-align: center;
  }
  
  .terminos-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .termino-item {
    padding: 15px;
  }
  
  .termino-descripcion {
    font-size: 13px;
  }
  
  #modal-politicas {
    padding: 15px;
  }
  
  .modal-politicas-container {
    max-width: 100%;
  }
  
  .modal-header {
    padding: 12px 15px;
  }
  
  .modal-header h4 {
    font-size: 14px;
  }
  
  .modal-content {
    padding: 15px;
    font-size: 14px;
  }
  
  .modal-footer {
    padding: 12px 15px;
  }
}

@media (max-width: 480px) {
  .terminos-compra {
    margin: 15px 5px;
    padding: 15px 12px;
  }
  
  .terminos-header i {
    font-size: 20px;
  }
  
  .terminos-header h3 {
    font-size: 16px;
  }
  
  .termino-item {
    padding: 12px;
  }
  
  .termino-icono {
    font-size: 13px;
  }
  
  .termino-descripcion {
    font-size: 12px;
  }
}

/* ========== ACCESIBILIDAD ========== */
@media (prefers-reduced-motion: reduce) {
  .termino-item,
  #btn-politicas,
  #cerrar-modal,
  #aceptar-politicas {
    transition: none;
  }
  
  .termino-item:hover {
    transform: none;
  }
  
  .modal-politicas-container {
    animation: none;
  }
}

