/* --- CSS RESET & NORMALIZE --- */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
  margin: 0;
  padding: 0;
  border: 0;
  vertical-align: baseline;
  box-sizing: border-box;
}
article, aside, details, figcaption, figure, 
footer, header, hgroup, menu, nav, section {
  display: block;
}
body {
  line-height: 1.5;
}
input, button, textarea, select {
  font: inherit;
  color: inherit;
}
u, ins, mark {
  color: inherit;
}
a {
  background: transparent;
  color: inherit;
  text-decoration: none;
}
ul, ol {
  list-style: none;
}
img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* --- ROOT VARIABLES & BRAND COLORS --- */
:root {
  --ep-primary: #27325C;
  --ep-secondary: #F5F7FA;
  --ep-accent: #D9AF43;
  --ep-black: #191A1E;
  --ep-offwhite: #F9FAFC;
  --ep-footer-bg: #232845;
  --ep-grey: #9EA4B0;
  --ep-radius-large: 18px;
  --ep-radius-small: 8px;
  --ep-shadow: 0 4px 32px rgba(39, 50, 92, 0.08);
  --ep-shadow-card: 0 2px 12px rgba(39, 50, 92, 0.10);
  --ep-btn-gradient: linear-gradient(90deg, #D9AF43 0%, #CF9222 100%);
}

/* --- FONTS --- */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@600;700&family=Open+Sans:wght@400;600&display=swap');
html, body {
  font-family: 'Open Sans', Arial, sans-serif;
  background: var(--ep-secondary);
  color: var(--ep-primary);
  font-size: 16px;
  min-height: 100%;
  letter-spacing: 0.01em;
  scroll-behavior: smooth;
}

h1, h2, h3, h4, h5 {
  font-family: 'Montserrat', Arial, sans-serif;
  color: var(--ep-primary);
  font-weight: 700;
  line-height: 1.15;
}
h1 {
  font-size: 2.5rem;
  margin-bottom: 20px;
}
h2 {
  font-size: 2rem;
  margin-bottom: 18px;
}
h3 {
  font-size: 1.3rem;
  margin-bottom: 12px;
  font-weight: 600;
}
h4, h5, h6 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
}
p, li, strong, span {
  font-family: 'Open Sans', Arial, sans-serif;
  font-size: 1rem;
  color: var(--ep-primary);
  font-weight: 400;
}
strong {
  font-weight: 700;
}
a {
  color: var(--ep-primary);
  font-weight: 600;
  transition: color 0.2s;
}
a:hover,
a:focus {
  color: var(--ep-accent);
  text-decoration: underline;
}

/* --- PAGE CONTAINER & SPACING --- */
.container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}
.content-wrapper {
  width: 100%;
  max-width: 900px;
  margin: 0 auto 0 auto;
}

.section {
  margin-bottom: 60px;
  padding: 40px 20px;
  background: var(--ep-offwhite);
  border-radius: var(--ep-radius-large);
  box-shadow: var(--ep-shadow);
}

/* === FLEXBOX PATTERNS === */
.card-container {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}
.card {
  margin-bottom: 20px;
  position: relative;
  background: #fff;
  border-radius: var(--ep-radius-large);
  box-shadow: var(--ep-shadow-card);
  padding: 28px 24px;
  transition: transform 0.22s cubic-bezier(.33,1,.68,1),box-shadow 0.15s;
  display: flex;
  flex-direction: column;
  min-width: 270px;
}
.card:hover,
.card:focus {
  transform: translateY(-4px) scale(1.015);
  box-shadow: 0 6px 28px rgba(39,50,92,0.14);
}

.content-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: space-between;
}
.text-image-section {
  display: flex;
  align-items: center;
  gap: 30px;
  flex-wrap: wrap;
}
.testimonial-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  padding: 24px;
  background: #fff;
  border-radius: var(--ep-radius-large);
  box-shadow: var(--ep-shadow-card);
  margin-bottom: 20px;
  border-left: 6px solid var(--ep-accent);
  transition: box-shadow 0.16s;
  min-width: 270px;
  color: var(--ep-primary);
}
.testimonial-card p {
  font-size: 1.1rem;
  color: var(--ep-black);
  margin-bottom: 14px;
}
.testimonial-card strong {
  color: var(--ep-primary);
  font-weight: 700;
  font-size: 1rem;
}
.star-rating {
  color: var(--ep-accent);
  font-size: 1.1rem;
  letter-spacing: 1px;
}
.feature-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 15px;
  padding: 18px 0;
}

/* MEMOIZED: Testimonial Carousel/Grids - Flexbox-Only */
.testimonial-carousel, .testimonial-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: flex-start;
}

/* --- HEADER --- */
header {
  background: #fff;
  border-bottom: 1px solid var(--ep-offwhite);
  box-shadow: 0 1px 16px rgba(39,50,92,0.07);
  position: relative;
  width: 100%;
  z-index: 99;
}
header .container {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  gap: 32px;
}
header img[alt="Enigmática Presencia"] {
  width: 140px;
}
nav {
  display: flex;
  gap: 24px;
  align-items: center;
}
nav a {
  padding: 6px 0 6px 0;
  font-family: 'Montserrat', 'Open Sans', Arial, sans-serif;
  font-size: 1rem;
  color: var(--ep-primary);
  opacity: 0.92;
  position: relative;
  transition: color 0.2s;
}
nav a.cta {
  background: var(--ep-btn-gradient);
  color: #fff;
  border-radius: var(--ep-radius-small);
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 9px 26px;
  margin-left: 18px;
  box-shadow: 0 2px 6px rgba(217,175,67,0.05);
  border: none;
  outline: none;
  transition: background 0.19s, transform 0.14s;
}
nav a.cta:hover,
nav a.cta:focus {
  background: linear-gradient(87deg, #CF9222 0%, #D9AF43 100%);
  color: #fff;
  transform: translateY(-2px) scale(1.045);
  box-shadow: 0 4px 14px rgba(217,175,67,0.22);
}
nav a:hover,
nav a:focus {
  color: var(--ep-accent);
  outline: none;
}

/* --- MOBILE BURGER NAV --- */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 2.1rem;
  color: var(--ep-primary);
  cursor: pointer;
  line-height: 1;
  padding: 8px 10px;
  margin-left: 18px;
  z-index: 1102;
  border-radius: 8px;
  transition: background 0.17s;
}
.mobile-menu-toggle:focus {
  background: var(--ep-offwhite);
  outline: 2px solid var(--ep-accent);
}
@media (max-width: 980px) {
  nav {
    display: none;
  }
  .mobile-menu-toggle {
    display: block;
  }
}
.mobile-menu {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(39,50,92,0.94);
  box-shadow: 0 2px 32px rgba(39,50,92,0.25);
  z-index: 1100;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  transform: translateX(-100vw);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.29s cubic-bezier(.9,.13,.24,1), opacity 0.22s;
}
.mobile-menu.open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}
.mobile-menu-close {
  background: none;
  border: none;
  font-size: 2rem;
  color: #fff;
  cursor: pointer;
  position: absolute;
  top: 18px;
  right: 24px;
  z-index: 1110;
  border-radius: 50%;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.mobile-menu-close:focus,
.mobile-menu-close:hover {
  background: rgba(217,175,67,0.18);
}

.mobile-nav {
  margin-top: 72px;
  padding: 0 34px;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.mobile-nav a {
  color: #fff;
  font-family: 'Montserrat', 'Open Sans', Arial, sans-serif;
  font-size: 1.3rem;
  font-weight: 600;
  padding: 12px 4px;
  border-radius: 8px;
  background: none;
  transition: background 0.16s, color 0.15s;
}
.mobile-nav a:active,
.mobile-nav a:focus,
.mobile-nav a:hover {
  background: rgba(217,175,67,0.18);
  color: var(--ep-accent);
}

/* Fade scroll for mobile menu */
.mobile-menu.open {
  animation: slideInMenu 0.34s cubic-bezier(.65,.05,.36,1);
}
@keyframes slideInMenu {
  0% { transform: translateX(-100vw); }
  100% { transform: translateX(0); }
}

/* --- SECTIONS & LAYOUTS --- */
/* Applied via .section, .feature-grid, .testimonial-carousel, card-container, etc. */
main {
  flex: 1 1 0%;
  display: flex;
  flex-direction: column;
}
.section:first-of-type {
  margin-top: 28px;
}

.feature-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: 24px;
}
.feature-grid > div {
  background: #fff;
  border-radius: var(--ep-radius-large);
  box-shadow: var(--ep-shadow-card);
  padding: 26px 18px 24px 18px;
  flex: 1 1 220px;
  min-width: 220px;
  max-width: 350px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  transition: box-shadow 0.14s, transform 0.19s;
  border-left: 5px solid var(--ep-accent);
}
.feature-grid > div img {
  width: 42px;
  height: 42px;
  margin-bottom: 10px;
}
.feature-grid > div:hover,
.feature-grid > div:focus {
  box-shadow: 0 8px 26px rgba(39,50,92,0.12);
  transform: translateY(-2px) scale(1.015);
}

.course-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin: 28px 0 24px 0;
}
.course-cards > div {
  background: #fff;
  border-radius: var(--ep-radius-large);
  box-shadow: var(--ep-shadow-card);
  padding: 22px 20px;
  flex: 1 1 270px;
  min-width: 240px;
  max-width: 350px;
  transition: box-shadow 0.14s, transform 0.19s;
  border-left: 5px solid var(--ep-accent);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.course-cards > div:hover,
.course-cards > div:focus {
  box-shadow: 0 8px 26px rgba(39,50,92,0.12);
  transform: translateY(-2px) scale(1.015);
}

/* --- TABLES (Course comparativa) --- */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  margin-top: 18px;
  border-radius: var(--ep-radius-large);
  overflow: hidden;
  box-shadow: var(--ep-shadow-card);
  font-size: 1rem;
}
thead {
  background: var(--ep-primary);
  color: #fff;
}
thead th {
  font-family: 'Montserrat', Arial, sans-serif;
  font-weight: 700;
  padding: 14px 10px;
}
tbody td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--ep-secondary);
  color: var(--ep-primary);
}
tbody tr:last-child td {
  border-bottom: none;
}

/* --- BLOG LIST --- */
.categories-filter {
  margin: 16px 0 20px 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 1rem;
  color: var(--ep-grey);
}
.categories-filter a {
  color: var(--ep-primary);
  font-family: 'Open Sans', Arial, sans-serif;
  font-weight: 600;
  padding: 2px 4px;
  border-radius: 5px;
  transition: background 0.13s, color 0.13s;
}
.categories-filter a:hover {
  background: var(--ep-accent);
  color: #fff;
}
.blog-list {
  margin: 26px 0 0 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.blog-list li {
  background: #fff;
  border-radius: var(--ep-radius-small);
  box-shadow: var(--ep-shadow-card);
  padding: 18px 16px 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.blog-list li a strong {
  color: var(--ep-primary);
  font-size: 1.06rem;
  font-weight: 700;
}

/* --- BUTTONS --- */
.cta, .btn, button, input[type=submit] {
  font-family: 'Montserrat', 'Open Sans', Arial, sans-serif;
  background: var(--ep-btn-gradient);
  color: #fff;
  border: none;
  outline: none;
  border-radius: var(--ep-radius-small);
  padding: 11px 32px;
  font-size: 1.1rem;
  font-weight: 700;
  transition: background 0.19s, color 0.17s, transform 0.18s, box-shadow 0.15s;
  cursor: pointer;
  margin-top: 16px;
  box-shadow: 0 2px 12px rgba(217,175,67,0.08);
}
.cta:hover,
.cta:focus, .btn:hover,
.btn:focus, button:hover,
button:focus, input[type=submit]:hover {
  background: linear-gradient(87deg, #CF9222 0%, #D9AF43 100%);
  color: #fff;
  transform: translateY(-2px) scale(1.045);
  box-shadow: 0 4px 22px rgba(217,175,67,0.18);
}

/* --- FORMS & INPUTS --- */
input, textarea, select {
  border: 1.5px solid var(--ep-primary);
  border-radius: var(--ep-radius-small);
  padding: 9px 14px;
  font-size: 1rem;
  transition: border-color 0.18s, box-shadow 0.12s;
  background: #fff;
  color: var(--ep-primary);
}
input:focus, textarea:focus, select:focus {
  border-color: var(--ep-accent);
  outline: none;
  box-shadow: 0 1px 6px rgba(217,175,67,0.08);
}

/* --- FOOTER --- */
footer {
  background: var(--ep-footer-bg);
  color: #fff;
  padding: 48px 0 38px 0;
  width: 100%;
  margin-top: 80px;
}
footer p {
  color: white;
}
footer .container {
  flex-wrap: wrap;
  flex-direction: row;
  gap: 52px;
  align-items: flex-start;
  justify-content: space-between;
}
.footer-logo img {
  width: 130px;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 46px;
  flex: 1 1 200px;
}
.footer-links nav {
  display: flex;
  flex-direction: column;
  gap: 13px;
}
.footer-links, .footer-links nav a {
  color: #fff;
  opacity: 0.96;
  font-weight: 600;
  transition: color 0.15s;
  font-family: 'Montserrat', Arial, sans-serif;
}
.footer-links nav a:hover {
  color: var(--ep-accent);
}
.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.98rem;
  color: #fff;
  opacity: 0.88;
}
.footer-contact img {
  width: 18px;
  margin-right: 7px;
  vertical-align: middle;
  display: inline-block;
  filter: brightness(90%) sepia(16%) hue-rotate(12deg) saturate(1.2);
}

/* --- UTILITIES & MICRO-INTERACTIONS --- */
::-webkit-scrollbar-thumb {
  background: var(--ep-accent);
  border-radius: 16px;
}
::-webkit-scrollbar {
  width: 9px;
  background: var(--ep-secondary);
}

img, svg {
  max-width: 100%;
  height: auto;
}
strong {
  color: var(--ep-primary);
  font-weight: 700;
}
ul, ol {
  margin: 18px 0 18px 20px;
  color: var(--ep-primary);
  font-size: 1rem;
}
ul li, ol li {
  margin-bottom: 6px;
  padding-left: 4px;
}
ul li::marker {
  color: var(--ep-accent);
  font-size: 1rem;
  font-weight: 700;
}

/* --- RESPONSIVE QUERIES --- */
@media (max-width: 1024px) {
  .container {
    max-width: 98vw;
  }
  header .container {
    gap: 12px;
  }
  .footer-links {
    gap: 26px;
  }
  footer .container {
    gap: 28px;
  }
}
@media (max-width: 768px) {
  /* Card, section, grid responsive stacking */
  .container, .content-wrapper,
  .section { padding: 18px 9px; }
  .section { margin-bottom: 38px; }
  .feature-grid, .course-cards, .testimonial-carousel, .testimonial-grid, .card-container, .content-grid {
    flex-direction: column;
    gap: 18px;
  }
  .feature-grid > div, .course-cards > div, .testimonial-card, .card {
    min-width: unset;
    max-width: unset;
    width: 100%;
  }
  .testimonials, .resources, .blog-list, .content-grid {
    gap: 16px;
  }
  .footer-links {
    flex-direction: column;
    gap: 12px;
  }
  footer .container {
    flex-direction: column;
    gap: 18px;
    align-items: flex-start;
  }
  .content-wrapper {
    max-width: 98vw;
    padding: 0 2vw;
  }
  .text-image-section {
    flex-direction: column;
    gap: 18px;
  }
}
@media (max-width: 500px) {
  h1 { font-size: 1.73rem; }
  h2 { font-size: 1.23rem; }
  h3 { font-size: 1rem; }
  .cta, .btn {
    font-size: 1rem;
    padding: 10px 12px;
  }
}

/* --- COOKIE CONSENT BANNER --- */
.cookie-consent-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  width: 100vw;
  background: #fffbe6;
  color: #191A1E;
  box-shadow: 0 -2px 22px rgba(39,50,92,0.07);
  border-top: 2.5px solid var(--ep-accent);
  z-index: 3000;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 22px 20px 22px;
  animation: bannerIn 0.37s cubic-bezier(.7,0,.14,1);
}
@keyframes bannerIn {
  from { transform: translateY(96px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.cookie-consent-banner p {
  font-size: 1rem;
  color: #191A1E;
  flex: 1 1 300px;
  margin-right: 16px;
}
.cookie-consent-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
}
.cookie-btn {
  font-family: 'Montserrat', Arial, sans-serif;
  border: none;
  outline: none;
  border-radius: var(--ep-radius-small);
  padding: 9px 22px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.14s, color 0.14s;
  margin-left: 5px;
}
.cookie-btn.accept {
  background: var(--ep-btn-gradient);
  color: #fff;
}
.cookie-btn.accept:hover,
.cookie-btn.accept:focus {
  background: linear-gradient(87deg, #CF9222 0%, #D9AF43 100%);
  color: #fff;
}
.cookie-btn.reject {
  background: #fff;
  color: var(--ep-primary);
  border: 1.5px solid var(--ep-accent);
}
.cookie-btn.reject:hover,
.cookie-btn.reject:focus {
  background: #fff7db;
}
.cookie-btn.settings {
  background: #f7f7fc;
  color: var(--ep-primary);
  border: 1.5px solid var(--ep-grey);
}
.cookie-btn.settings:hover,
.cookie-btn.settings:focus {
  background: #e9e1cf;
  color: var(--ep-primary);
}
@media (max-width: 700px) {
  .cookie-consent-banner {
    flex-direction: column;
    gap: 18px;
    padding: 19px 8px 19px 11px;
  }
  .cookie-consent-actions {
    gap: 7px;
  }
}

/* --- COOKIE CONSENT MODAL --- */
.cookie-modal-overlay {
  position: fixed;
  z-index: 3050;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(29, 29, 36, 0.54);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s;
}
.cookie-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.cookie-modal {
  background: #fff;
  border-radius: var(--ep-radius-large);
  box-shadow: var(--ep-shadow);
  min-width: 340px;
  max-width: 96vw;
  padding: 38px 32px 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: cookieModalFadeIn 0.35s cubic-bezier(.44,.11,.52,.92);
}
@keyframes cookieModalFadeIn {
  from { transform: scale(0.93); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.cookie-modal h3 {
  color: var(--ep-primary);
  font-size: 1.23rem;
  font-weight: 700;
  margin-bottom: 5px;
}
.cookie-category {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 9px;
}
.cookie-category input[type=checkbox] {
  width: 22px;
  height: 22px;
  accent-color: var(--ep-accent);
  margin-right: 6px;
}
.cookie-category label {
  font-size: 1rem;
  color: var(--ep-primary);
}
.cookie-category.essential label {
  font-weight: bold;
  color: var(--ep-primary);
}
.cookie-modal-actions {
  display: flex;
  gap: 14px;
  margin-top: 12px;
}
.cookie-modal .cookie-btn.settings {
  margin-left: 0;
}
@media (max-width: 425px) {
  .cookie-modal {
    padding: 24px 8px 18px 8px;
    min-width: unset;
  }
}

/* --- MAP IMAGE (Contact) --- */
.map img {
  width: 100%;
  max-width: 330px;
  border-radius: var(--ep-radius-large);
  border: 1.5px solid var(--ep-accent);
  box-shadow: 0 2px 14px rgba(39,50,92,0.09);
  margin: 16px 0 20px 0;
}

/* --- MISC & EFFECTS --- */
.fade-in {
  animation: fadeIn 0.5s;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* --- Z-INDEX LAYERING --- */
header { z-index: 99; }
.mobile-menu { z-index: 1100; }
.mobile-menu-toggle { z-index: 1102; }
.cookie-consent-banner { z-index: 3000; }
.cookie-modal-overlay { z-index: 3050; }

/* Ensure no element overlaps - spacing enforced */
.section, .card, .testimonial-card, .feature-grid > div, .course-cards > div, .card-container > .card {
  margin-bottom: 20px;
}

/* --- END OF CSS --- */
