/* ═══════════════════════════════════════════════════
   MercadoRD — Estilos de Subsecciones
   Archivo: css/subsections.css
═══════════════════════════════════════════════════ */

.subsection-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
  animation: fadeIn 0.25s ease-out;
}

.subsection-overlay.show {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.subsection-panel {
  background: #fff;
  border-radius: 12px;
  width: 90%;
  max-width: 900px;
  max-height: 85vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.subsection-header {
  position: sticky;
  top: 0;
  background: linear-gradient(90deg, #003087, #0a4ab8);
  color: #fff;
  padding: 24px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(0, 48, 135, 0.3);
  z-index: 10;
}

.subsection-header h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
}

.subsection-close {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.subsection-close:hover {
  background: rgba(255, 255, 255, 0.25);
}

.subsection-content {
  padding: 32px;
  flex: 1;
}

.subsection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.subsection-card {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.2s;
  cursor: pointer;
  border: 2px solid transparent;
}

.subsection-card:hover {
  background: #f0f3f8;
  border-color: #003087;
  transform: translateY(-2px);
}

.subsection-card-icon {
  font-size: 32px;
}

.subsection-card-title {
  font-weight: 700;
  font-size: 16px;
  color: #1a1a2e;
}

.subsection-card-desc {
  font-size: 13px;
  color: #666;
  line-height: 1.5;
}

.subsection-card-link {
  color: #003087;
  font-weight: 600;
  font-size: 12px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}

.subsection-card-link:hover {
  text-decoration: underline;
}

.subsection-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.subsection-list-item {
  padding: 12px 0;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  transition: background 0.2s;
}

.subsection-list-item:last-child {
  border-bottom: none;
}

.subsection-list-item:hover {
  background: #f8f9fa;
  margin: 0 -20px;
  padding: 12px 20px;
}

.subsection-list-icon {
  font-size: 18px;
  margin-top: 2px;
  flex-shrink: 0;
}

.subsection-list-content {
  flex: 1;
}

.subsection-list-title {
  font-weight: 600;
  font-size: 14px;
  color: #1a1a2e;
  margin-bottom: 2px;
}

.subsection-list-desc {
  font-size: 12px;
  color: #888;
}

.subsection-section {
  margin-bottom: 32px;
}

.subsection-section-title {
  font-size: 18px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #e0e0e0;
}

.subsection-info-box {
  background: linear-gradient(90deg, #e3f2fd, #f3e5f5);
  border-left: 4px solid #003087;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 24px;
  font-size: 13px;
  color: #333;
  line-height: 1.6;
}

.subsection-info-box strong {
  color: #003087;
}

.subsection-button {
  background: linear-gradient(90deg, #003087, #0a4ab8);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px 20px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.subsection-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 48, 135, 0.3);
}

.subsection-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid #e0e0e0;
}

.subsection-tab {
  background: none;
  border: none;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  color: #888;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
}

.subsection-tab.active {
  color: #003087;
  border-bottom-color: #003087;
}

.subsection-tab:hover {
  color: #1a1a2e;
}

@media (max-width: 768px) {
  .subsection-panel {
    width: 95%;
    max-height: 95vh;
  }

  .subsection-header {
    padding: 16px 20px;
  }

  .subsection-content {
    padding: 20px;
  }

  .subsection-grid {
    grid-template-columns: 1fr;
  }
}
