/* === RESET & BASE === */
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;500;600;700;800&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #2c3e50;
  line-height: 1.5;
  overflow-x: hidden;
  background: #fff;
  width: 100%;
}

a {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

ul, ol {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
}

/* === COUNTRY BAR (top thin bar) === */
.country-bar {
  background: #fff;
  border-bottom: 1px solid #eaeaea;
  padding: 0 4%;
  height: 32px;
  display: flex;
  align-items: center;
  width: 100%;
}

.country-bar .flag-selector {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #4a5568;
  cursor: pointer;
}

.country-bar .flag-selector img {
  width: 22px;
  height: auto;
}

/* === TOP UTILITY BAR === */
.top-bar {
  background: #f2f7fc;
  padding: 0 4%;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  border-bottom: 1px solid #e1ebf5;
  width: 100%;
  position: relative;
}

.top-bar-left {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 100%;
}

.top-bar-left a {
  color: #004c97;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s;
  padding: 10px 18px 8px;
  display: flex;
  align-items: center;
}

.top-bar-left a.active-tab {
  background: #fff;
  color: #004c97;
  font-weight: 700;
  border-top: 3px solid #004c97;
  border-left: 1px solid #e1ebf5;
  border-right: 1px solid #e1ebf5;
  border-bottom: 1px solid #fff;
  margin-bottom: -1px;
  border-radius: 4px 4px 0 0;
}

.top-bar-left a:not(.active-tab):hover {
  color: #0355c2;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 22px;
  height: 100%;
}

.top-bar-right > a {
  color: #004c97;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: color 0.2s;
}

.top-bar-right > a:hover {
  color: #0355c2;
}

.top-bar-right .top-icon {
  color: #004c97;
  font-size: 14px;
}

/* === LOGIN DROPDOWN (DARK BLUE matching Screenshot 2) === */
.login-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 100%;
}

.banca-online-btn {
  background: #004c97;
  color: #fff !important;
  padding: 0 20px;
  height: 42px;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s;
  cursor: pointer;
  border: none;
  font-family: inherit;
  border-radius: 4px 4px 0 0;
}

.banca-online-btn:hover {
  background: #003a73;
}

.login-panel {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  background: #004c97;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  padding: 22px 20px 24px;
  width: 350px;
  z-index: 1100;
}

.login-dropdown:hover .login-panel,
.login-panel.show {
  display: block;
}

.login-panel .login-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.login-panel .login-input-row .lock-icon {
  color: #fff;
  font-size: 22px;
  flex-shrink: 0;
}

.login-panel .login-input-row input {
  flex: 1;
  padding: 9px 14px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  background: #fff;
  color: #333;
}

.login-panel .login-input-row .btn-ingresar {
  background: #ff7900;
  color: #fff;
  padding: 9px 18px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 14px;
  transition: background 0.2s;
  white-space: nowrap;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.login-panel .login-input-row .btn-ingresar:hover {
  background: #e06a00;
}

.login-panel .login-links {
  padding-top: 4px;
}

.login-panel .login-links li {
  padding: 5px 0;
  display: flex;
  align-items: center;
}

.login-panel .login-links li::before {
  content: '■';
  color: #ff7900;
  margin-right: 10px;
  font-size: 8px;
}

.login-panel .login-links a {
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.login-panel .login-links a:hover {
  text-decoration: underline;
}

.desktop-only { display: block; }
.mobile-only { display: none !important; }
.mobile-logo { display: none; }
.desktop-logo { display: block; }

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: #004c97;
  font-size: 24px;
  cursor: pointer;
  padding: 10px;
}

/* === MAIN NAV === */
.main-nav {
  background: #fff;
  padding: 0 4%;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  border-bottom: 3px solid #004c97;
  position: sticky;
  top: 0;
  z-index: 999;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  width: 100%;
}

.main-nav .logo {
  margin-right: 48px;
  flex-shrink: 0;
}

.main-nav .logo img {
  height: 44px;
  width: auto;
}

.main-nav .nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 100%;
}

.main-nav .nav-links a {
  color: #004c97;
  font-size: 15px;
  font-weight: 700;
  padding: 0 18px;
  height: 70px;
  display: flex;
  align-items: center;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}

.main-nav .nav-links a:hover {
  background: #f2f7fc;
  color: #0355c2;
}

.main-nav .nav-links .font-arrow {
  font-size: 11px;
  margin-left: 6px;
  color: #004c97;
}

/* === HERO BANNER === */
.hero-banner {
  width: 100%;
  overflow: hidden;
}

.hero-banner img {
  width: 100%;
  height: auto;
  display: block;
}

.hero-banner img.mobile-banner {
  display: none;
}

/* === HELP SECTION (Te podemos ayudar) === */
.help-section {
  background: #edf3fa;
  padding: 40px 4%;
  display: flex;
  align-items: center;
  gap: 36px;
  width: 100%;
}

.help-left {
  width: 250px;
  flex-shrink: 0;
}

.help-left h2 {
  font-size: 28px;
  font-weight: 700;
  color: #004c97;
  margin-bottom: 6px;
  line-height: 1.2;
}

.help-left p {
  font-size: 14px;
  color: #4a5568;
  margin-bottom: 18px;
}

.help-left .search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 24px;
  padding: 10px 24px;
  font-size: 14px;
  color: #94a3b8;
  cursor: pointer;
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-weight: 500;
}

.help-left .search-btn:hover {
  border-color: #004c97;
  box-shadow: 0 0 0 1px #004c97;
}

.help-right {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.help-right .promo-card {
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: block;
}

.help-right .promo-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.12);
}

.help-right .promo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* === CALCULATORS SECTION (1 SINGLE ROW OF CIRCLES) === */
.calculators-section {
  background: #f0f7ff;
  padding: 50px 4% 60px;
  text-align: center;
  width: 100%;
}

.calculators-section h2 {
  font-size: 32px;
  font-weight: 700;
  color: #004c97;
  margin-bottom: 8px;
}

.calculators-section .subtitle {
  font-size: 15px;
  color: #4a5568;
  margin-bottom: 40px;
}

.calc-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  flex-wrap: nowrap;
}

.calc-circle {
  width: 140px;
  height: 140px;
  background: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,76,151,0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  flex-shrink: 0;
  padding: 12px;
  overflow: hidden;
}

.calc-circle:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 28px rgba(0,76,151,0.16);
}

.calc-circle img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* === NEWS SECTION === */
.news-section {
  padding: 60px 4%;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
}

.news-section > h2 {
  text-align: center;
  font-size: 32px;
  font-weight: 700;
  color: #004c97;
  margin-bottom: 40px;
}

.news-container {
  display: flex;
  gap: 40px;
}

.news-left {
  flex: 3;
}

.news-right {
  flex: 1.1;
  min-width: 300px;
}

.news-left .novedades-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.news-left .novedades-header h3 {
  font-size: 22px;
  font-weight: 700;
  color: #1e293b;
}

.news-left .novedades-header a {
  color: #004c97;
  font-size: 14px;
  font-weight: 600;
}

.news-left .novedades-header a:hover {
  text-decoration: underline;
}

/* Featured main news card */
.featured-news {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 24px;
  height: 420px;
  background: #002e5b;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.featured-news .featured-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.featured-news .featured-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(180deg, rgba(0, 46, 91, 0) 0%, rgba(0, 40, 85, 0.95) 75%);
  padding: 40px 32px 28px;
  color: #fff;
}

.featured-news .featured-overlay h4 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.3;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

.featured-news .featured-overlay p {
  font-size: 14px;
  line-height: 1.6;
  opacity: 0.92;
  margin-bottom: 12px;
}

.featured-news .featured-overlay .date {
  font-size: 13px;
  opacity: 0.8;
  font-weight: 500;
}

/* 2x2 news grid subcards */
.news-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.news-card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  height: 250px;
  cursor: pointer;
  background: #002e5b;
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
  display: block;
}

.news-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.news-card .news-card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(180deg, rgba(0, 46, 91, 0) 0%, rgba(0, 40, 85, 0.95) 75%);
  padding: 24px 20px 16px;
  color: #fff;
}

.news-card .news-card-overlay h5 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1.35;
  color: #fff;
}

.news-card .news-card-overlay .date {
  font-size: 12px;
  opacity: 0.8;
  font-weight: 500;
}

/* Comunicados especiales */
.news-right h3 {
  font-size: 22px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 24px;
}

.comunicado-item {
  border-bottom: 1px solid #e2e8f0;
  padding: 16px 0;
}

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

.comunicado-item h5 {
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
  cursor: pointer;
  line-height: 1.45;
  margin-bottom: 6px;
}

.comunicado-item h5 a {
  color: #004c97;
}

.comunicado-item h5 a:hover {
  text-decoration: underline;
}

.comunicado-item .tag {
  display: inline-block;
  background: #004c97;
  color: #fff;
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 4px;
  margin-bottom: 6px;
  font-weight: 600;
}

.comunicado-item .date {
  font-size: 13px;
  color: #004c97;
  font-weight: 600;
}

/* === FOOTER === */
.main-footer {
  background: #f4f8fb;
  border-top: 3px solid #004c97;
  padding: 50px 4% 30px;
  width: 100%;
}

.footer-container {
  display: flex;
  gap: 60px;
  max-width: 1600px;
  margin: 0 auto 40px;
}

.footer-brand {
  min-width: 180px;
  flex-shrink: 0;
}

.footer-brand .footer-logo {
  width: 170px;
}

.footer-columns {
  display: flex;
  flex: 1;
  gap: 50px;
}

.footer-col {
  flex: 1;
}

.footer-col h4 {
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 14px;
}

.footer-col h4.mt {
  margin-top: 26px;
}

.footer-col a {
  display: block;
  font-size: 14px;
  color: #004c97;
  padding: 4px 0;
  font-weight: 500;
  transition: color 0.2s;
}

.footer-col a:hover {
  text-decoration: underline;
  color: #0355c2;
}

.footer-apps {
  margin-bottom: 20px;
}

.footer-apps h4 {
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 12px;
}

.footer-apps .app-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.footer-apps .app-badges img {
  height: 38px;
  width: auto;
}

.footer-social h4 {
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 12px;
}

.footer-social .social-icons {
  display: flex;
  gap: 16px;
}

.footer-social .social-icons a {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #004c97;
  font-size: 20px;
  transition: opacity 0.2s;
}

.footer-social .social-icons a:hover {
  opacity: 0.75;
}

.footer-bottom {
  text-align: center;
  padding-top: 24px;
  border-top: 1px solid #cbd5e1;
  max-width: 1600px;
  margin: 0 auto;
}

.footer-bottom p {
  font-size: 12px;
  color: #64748b;
  line-height: 1.6;
}

.footer-sbp {
  text-align: center;
  padding-top: 24px;
}

.footer-sbp img {
  width: 170px;
  margin: 0 auto;
}

/* === MODAL "TE AYUDAMOS" OVERLAY === */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.55);
  z-index: 2000;
  justify-content: center;
  align-items: center;
}

.modal-overlay.active {
  display: flex;
}

.modal-teayudamos {
  background: #fff;
  border-radius: 20px;
  width: 540px;
  max-width: 92vw;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
  position: relative;
  padding: 36px 40px;
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-teayudamos .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}

.modal-teayudamos .modal-header h3 {
  font-size: 24px;
  font-weight: 700;
  color: #004c97;
}

.modal-teayudamos .modal-close {
  background: none;
  border: none;
  font-size: 26px;
  color: #64748b;
  cursor: pointer;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.modal-teayudamos .modal-close:hover {
  background: #f1f5f9;
  color: #1e293b;
}

.modal-teayudamos .modal-search {
  position: relative;
  margin-bottom: 26px;
}

.modal-teayudamos .modal-search input {
  width: 100%;
  padding: 14px 44px 14px 18px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
}

.modal-teayudamos .modal-search input:focus {
  border-color: #004c97;
}

.modal-teayudamos .modal-search .search-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 18px;
}

.modal-teayudamos .temas-populares h4 {
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 12px;
}

.modal-teayudamos .temas-populares a {
  display: block;
  color: #004c97;
  font-size: 14px;
  padding: 6px 0;
  font-weight: 600;
}

.modal-teayudamos .temas-populares a:hover {
  text-decoration: underline;
}

.modal-teayudamos .contact-actions {
  display: flex;
  gap: 16px;
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid #e2e8f0;
}

.modal-teayudamos .contact-card {
  flex: 1;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  padding: 20px 14px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s;
}

.modal-teayudamos .contact-card:hover {
  border-color: #004c97;
}

.modal-teayudamos .contact-card .contact-icon {
  font-size: 34px;
  color: #004c97;
  margin-bottom: 10px;
}

.modal-teayudamos .contact-card h5 {
  font-size: 15px;
  font-weight: 700;
  color: #004c97;
  margin-bottom: 4px;
}

.modal-teayudamos .contact-card p {
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
  .calc-row {
    flex-wrap: wrap;
    gap: 16px;
  }
  .calc-circle {
    width: 120px;
    height: 120px;
  }
  .help-right {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .desktop-only { display: none !important; }
  .mobile-only { display: block !important; }
  .desktop-logo { display: none; }
  .mobile-logo { display: block; height: 32px !important; }
  .mobile-menu-btn { display: block; }
  
  .country-bar {
    display: none;
  }
  
  .main-nav {
    height: 64px;
    padding: 0 0 0 16px;
    justify-content: space-between;
    border-bottom: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  }
  
  .main-nav .logo {
    margin-right: 0;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }
  
  .main-nav .nav-links {
    display: none;
  }
  
  /* Mobile Login Dropdown */
  .main-nav .login-dropdown {
    height: 100%;
    display: flex;
    align-items: center;
  }
  
  .main-nav .banca-online-btn {
    height: 100%;
    padding: 0 16px;
    border-radius: 0;
    text-align: center;
    line-height: 1.1;
    font-size: 11px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
  }
  
  .main-nav .banca-online-btn i {
    font-size: 16px;
  }
  
  .main-nav .login-panel {
    top: 64px;
    right: 0;
    width: 100vw;
    border-radius: 0;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    padding: 24px;
  }
  
  /* The rest of mobile layout */
  .hero-banner img.desktop-banner {
    display: none;
  }
  .hero-banner img.mobile-banner {
    display: block;
  }
  .help-section {
    flex-direction: column;
    padding: 30px 4%;
  }
  .help-left {
    width: 100%;
  }
  .help-right {
    grid-template-columns: 1fr 1fr;
  }
  .news-container {
    flex-direction: column;
  }
  .news-grid {
    grid-template-columns: 1fr;
  }
  .footer-container {
    flex-direction: column;
    gap: 32px;
  }
  .footer-columns {
    flex-direction: column;
    gap: 28px;
  }
}
