/* ═══════════════════════════════════════════════════════════════
   Academia Europa · Oferta Formativa · Frontend CSS
   ═══════════════════════════════════════════════════════════════ */

:root {
  --ae-red:      #CC1F1F;
  --ae-red-lt:   #FCEBEB;
  --ae-red-dk:   #A81818;
  --ae-dark:     #1A1A1A;
  --ae-mid:      #555;
  --ae-muted:    #888;
  --ae-light:    #F7F7F7;
  --ae-border:   #E8E8E8;
  --ae-white:    #FFFFFF;
  --ae-green:    #1A7A3D;
  --ae-green-lt: #E8F5EE;
  --ae-blue:     #1A5FA8;
  --ae-blue-lt:  #EBF3FC;
  --ae-radius:   10px;
  --ae-shadow:   0 2px 12px rgba(0,0,0,.07);
  --ae-shadow-h: 0 6px 24px rgba(0,0,0,.12);
}

.aeof { font-family: 'Inter', sans-serif; color: var(--ae-dark); }
.aeof *, .aeof *::before, .aeof *::after { box-sizing: border-box; }

/* ── Banner intro ───────────────────────────────────────────── */
.aeof-banner {
  background: var(--ae-dark);
  border-radius: var(--ae-radius);
  margin-bottom: 32px;
  overflow: hidden;
  position: relative;
}

.aeof-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(204,31,31,.25) 0%, transparent 60%);
  pointer-events: none;
}

.aeof-banner__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 36px 40px;
}

.aeof-banner__eyebrow {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,.55);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin: 0 0 8px;
}

.aeof-banner__title {
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  margin: 0 0 8px;
  line-height: 1.2;
}

.aeof-banner__desc {
  font-size: 14px;
  color: rgba(255,255,255,.75);
  margin: 0;
  line-height: 1.6;
  max-width: 480px;
}

.aeof-banner__desc strong { color: #fff; }

.aeof-banner__stats {
  display: flex;
  gap: 32px;
  flex-shrink: 0;
}

.aeof-banner__stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.aeof-banner__num {
  font-size: 32px;
  font-weight: 800;
  color: var(--ae-red);
  line-height: 1;
}

.aeof-banner__lbl {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,.5);
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* ── Controles: buscador + tabs ─────────────────────────────── */
.aeof-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
}

/* Buscador — lupa fija, sin solaparse con el texto */
.aeof-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.aeof-search-ico {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  fill: var(--ae-muted);
  pointer-events: none;
  z-index: 1;
  flex-shrink: 0;
}

.aeof-search {
  width: 100%;
  padding: 12px 16px 12px 52px !important; /* !important para override de Elementor */
  border: 1.5px solid var(--ae-border) !important;
  border-radius: 8px !important;
  font-size: 14px !important;
  font-family: inherit !important;
  color: var(--ae-dark) !important;
  background: var(--ae-white) !important;
  transition: border-color .2s, box-shadow .2s;
  box-shadow: none !important;
  outline: none !important;
  appearance: none;
  -webkit-appearance: none;
  line-height: 1.5 !important;
  height: auto !important;
}

.aeof-search:focus {
  border-color: var(--ae-red) !important;
  box-shadow: 0 0 0 3px rgba(204,31,31,.08) !important;
}

.aeof-search::placeholder { color: var(--ae-muted); }

/* ── Tabs de categoría ───────────────────────────────────────── */
.aeof-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* Reset total para neutralizar estilos de Elementor en botones */
.aeof #aeof-wrap .aeof-tab,
.aeof-tab {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 8px 16px !important;
  border: 1.5px solid var(--ae-border) !important;
  border-radius: 6px !important;
  background: var(--ae-white) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  font-family: inherit !important;
  color: var(--ae-mid) !important;
  cursor: pointer !important;
  transition: all .15s !important;
  white-space: nowrap !important;
  text-decoration: none !important;
  line-height: 1 !important;
  box-shadow: none !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  letter-spacing: normal !important;
  text-transform: none !important;
}

.aeof #aeof-wrap .aeof-tab:hover,
.aeof-tab:hover,
.aeof #aeof-wrap .aeof-tab:focus,
.aeof-tab:focus {
  border-color: var(--ae-red) !important;
  color: var(--ae-red) !important;
  background: var(--ae-white) !important;
  box-shadow: none !important;
}

.aeof #aeof-wrap .aeof-tab--active,
.aeof-tab--active {
  background: var(--ae-red) !important;
  border-color: var(--ae-red) !important;
  color: var(--ae-white) !important;
}

.aeof #aeof-wrap .aeof-tab--active:hover,
.aeof-tab--active:hover,
.aeof #aeof-wrap .aeof-tab--active:focus,
.aeof-tab--active:focus {
  background: var(--ae-red-dk) !important;
  border-color: var(--ae-red-dk) !important;
  color: #fff !important;
  box-shadow: none !important;
}

.aeof-tab__count {
  font-size: 11px !important;
  font-weight: 700 !important;
  background: rgba(0,0,0,.1) !important;
  padding: 1px 6px !important;
  border-radius: 10px !important;
  line-height: 1.4 !important;
  color: inherit !important;
}

.aeof-tab--active .aeof-tab__count {
  background: rgba(255,255,255,.25) !important;
}

/* ── No results ─────────────────────────────────────────────── */
.aeof-no-results {
  text-align: center;
  padding: 48px 24px;
  color: var(--ae-muted);
}

.aeof-no-results svg {
  width: 40px;
  height: 40px;
  fill: var(--ae-border);
  margin-bottom: 12px;
}

.aeof-no-results p { font-size: 15px; margin: 0; }

/* ── Sección ────────────────────────────────────────────────── */
.aeof-section { margin-bottom: 48px; }

.aeof-section__header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--ae-border);
}

.aeof-section__icon {
  width: 40px;
  height: 40px;
  background: var(--ae-red);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
}

.aeof-section__icon svg {
  width: 22px;
  height: 22px;
}

.aeof-section__title {
  font-size: 20px;
  font-weight: 800;
  color: var(--ae-dark);
  margin: 0 0 4px;
  line-height: 1.2;
}

.aeof-section__sub {
  font-size: 13px;
  color: var(--ae-muted);
  margin: 0;
  line-height: 1.5;
}

/* ── Grid de cards ──────────────────────────────────────────── */
.aeof-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* ── Card ───────────────────────────────────────────────────── */
.aeof-card {
  background: var(--ae-white);
  border: 1.5px solid var(--ae-border);
  border-radius: var(--ae-radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow .2s, transform .2s, border-color .2s;
  position: relative;
}

.aeof-card:hover {
  box-shadow: var(--ae-shadow-h);
  transform: translateY(-2px);
  border-color: #D8D8D8;
}

.aeof-card--destacado {
  border-color: var(--ae-red);
  border-width: 2px;
}

.aeof-card--destacado::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--ae-red);
  border-radius: var(--ae-radius) var(--ae-radius) 0 0;
}

/* Card top row */
.aeof-card__top {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-height: 22px;
}

.aeof-card__codigo {
  font-size: 10px;
  font-weight: 700;
  color: var(--ae-muted);
  font-family: monospace;
  letter-spacing: .04em;
  background: var(--ae-light);
  padding: 2px 8px;
  border-radius: 4px;
}

.aeof-card__badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.aeof-card__badge--green { background: var(--ae-green-lt); color: var(--ae-green); }
.aeof-card__badge--star  { background: #FFF8E1; color: #A0740A; }

/* Nombre */
.aeof-card__nombre {
  font-size: 14px;
  font-weight: 700;
  color: var(--ae-dark);
  line-height: 1.35;
  margin: 0;
  flex: 1;
}

/* Descripción */
.aeof-card__desc {
  font-size: 12px;
  color: var(--ae-mid);
  line-height: 1.6;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Meta row */
.aeof-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: auto;
}

.aeof-card__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--ae-muted);
  font-weight: 500;
}

.aeof-card__meta-item svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
  flex-shrink: 0;
}

/* Nivel badges */
.aeof-nivel {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: .04em;
}

.aeof-nivel--cp1 { background: #E8F5EE; color: #1A7A3D; }
.aeof-nivel--cp2 { background: #EBF3FC; color: #1A5FA8; }
.aeof-nivel--cp3 { background: #F3EBF9; color: #6A1FA8; }
.aeof-nivel--a1,
.aeof-nivel--a2  { background: #FFF8E1; color: #A0740A; }
.aeof-nivel--b1,
.aeof-nivel--b2  { background: #FFF3E0; color: #C05A00; }
.aeof-nivel--n2,
.aeof-nivel--n3  { background: #FCE8E8; color: #A81818; }

/* PDF button */
.aeof-card__pdf {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  background: var(--ae-red);
  color: var(--ae-white);
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  text-decoration: none;
  transition: background .15s;
  margin-top: 4px;
  width: 100%;
  justify-content: center;
}

.aeof-card__pdf:hover { background: var(--ae-red-dk); color: #fff; }

.aeof-card__pdf--contact {
  background: var(--ae-light);
  color: var(--ae-mid);
  border: 1.5px solid var(--ae-border);
}

.aeof-card__pdf--contact:hover {
  background: var(--ae-border);
  color: var(--ae-dark);
}

.aeof-card__pdf svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
  flex-shrink: 0;
}

/* ── CTA Banner ─────────────────────────────────────────────── */
.aeof-cta {
  background: linear-gradient(135deg, var(--ae-red) 0%, var(--ae-red-dk) 100%);
  border-radius: var(--ae-radius);
  margin-top: 48px;
  overflow: hidden;
}

.aeof-cta__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 32px 40px;
}

.aeof-cta__title {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  margin: 0 0 6px;
}

.aeof-cta__desc {
  font-size: 14px;
  color: rgba(255,255,255,.82);
  margin: 0;
  line-height: 1.6;
  max-width: 500px;
}

.aeof-cta__desc strong { color: #fff; }

.aeof-cta__btn {
  display: inline-flex;
  align-items: center;
  padding: 12px 24px;
  background: #fff;
  color: var(--ae-red);
  font-size: 13px;
  font-weight: 700;
  border-radius: 6px;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .15s, transform .1s;
}

.aeof-cta__btn:hover {
  background: rgba(255,255,255,.9);
  transform: scale(1.02);
  color: var(--ae-red-dk);
}

/* ── Hidden state ───────────────────────────────────────────── */
.aeof-card--hidden { display: none !important; }
.aeof-section--hidden { display: none !important; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .aeof-banner__inner { flex-direction: column; padding: 28px 24px; gap: 20px; }
  .aeof-banner__title { font-size: 20px; }
  .aeof-banner__stats { gap: 24px; }
  .aeof-banner__num   { font-size: 26px; }
  .aeof-cta__inner    { flex-direction: column; padding: 24px; text-align: center; }
  .aeof-cta__btn      { width: 100%; justify-content: center; }
  .aeof-grid          { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .aeof-tabs { gap: 4px; }
  .aeof-tab  { padding: 6px 12px; font-size: 12px; }
}
