/* ============================================================
   INDEX (index.html) — MOBILE REFACTOR
   Loaded last. Do not override slide theme colors globally.
   ============================================================ */

/* --- Burger: desktop hidden --- */
.mobile-burger {
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--kapital-black);
}

/* --- Mobile drawer --- */
.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 48;
  padding: calc(88px + env(safe-area-inset-top, 0px)) 20px 32px;
  background: rgba(236, 235, 234, 0.96);
  -webkit-backdrop-filter: blur(32px);
  backdrop-filter: blur(32px);
  overflow-y: auto;
}

.mobile-menu.is-open {
  display: block;
}

.mobile-menu-inner {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 360px;
}

.mobile-menu-link {
  display: block;
  padding: 14px 0;
  font-size: 18px;
  font-weight: 500;
  color: var(--kapital-black);
  text-decoration: none;
}

.mobile-menu-link-secondary {
  font-size: 15px;
  font-weight: 400;
  color: var(--gray-1);
}

.mobile-menu-divider {
  height: 1px;
  margin: 8px 0;
  background: rgba(184, 180, 175, 0.55);
}

body.mobile-nav-open {
  overflow: hidden;
}

/* ============================================================
   TABLET
   ============================================================ */
@media (max-width: 1024px) {
  .hero-content h2 {
    font-size: clamp(38px, 7vw, 52px);
    line-height: 1.05;
  }
}

/* ============================================================
   MOBILE
   ============================================================ */
@media (max-width: 767px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  /* ---- Announcement ---- */
  .announcement-bar {
    padding: 8px 0;
  }

  .announcement-bar-inner {
    justify-content: flex-start;
    gap: 8px;
    padding: 0 40px 0 16px;
    overflow: hidden;
    white-space: nowrap;
  }

  .announcement-bar p {
    flex: 1;
    min-width: 0;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .announcement-bar a {
    flex-shrink: 0;
    font-size: 12px;
  }

  /* ---- Header: logo | Abrir cuenta | burger ---- */
  .site-header-inner {
    max-width: none;
    width: 100%;
    padding: 10px 16px;
    gap: 8px;
  }

  .header-left {
    gap: 0;
    min-width: 0;
  }

  .header-nav,
  .entrar-container {
    display: none !important;
  }

  .header-right {
    gap: 8px;
    margin-left: auto;
    flex-shrink: 0;
  }

  .mobile-burger {
    display: inline-flex;
    color: #fff;
  }

  .logo-mark {
    width: 32px;
    height: 32px;
    color: #fff;
  }

  .btn-new-account {
    padding: 9px 14px;
    font-size: 12px;
    line-height: 1;
    background: rgba(213, 205, 195, 0.92);
    color: var(--kapital-black);
  }

  /* Contrast strip over hero (burger/logo always visible) */
  #rebrand-site-header:not([data-sticky="true"]):not([data-mobile-menu-open="true"]) .nav-background {
    background: linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.42) 0%,
      rgba(0, 0, 0, 0.12) 70%,
      rgba(0, 0, 0, 0) 100%
    );
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  #rebrand-site-header[data-sticky="true"] .nav-background,
  #rebrand-site-header[data-mobile-menu-open="true"] .nav-background {
    background: rgba(236, 235, 234, 0.92);
    -webkit-backdrop-filter: blur(32px);
    backdrop-filter: blur(32px);
  }

  #rebrand-site-header[data-sticky="true"] .logo-mark,
  #rebrand-site-header[data-sticky="true"] .mobile-burger,
  #rebrand-site-header[data-mobile-menu-open="true"] .logo-mark,
  #rebrand-site-header[data-mobile-menu-open="true"] .mobile-burger {
    color: var(--kapital-black);
  }

  #rebrand-site-header[data-sticky="true"] .btn-new-account,
  #rebrand-site-header[data-mobile-menu-open="true"] .btn-new-account {
    background: rgba(213, 205, 195, 0.95);
    color: var(--kapital-black);
  }

  /* ---- Hero full viewport ---- */
  .hero-section,
  .hero-home,
  .hero-home .swiper-wrapper,
  .hero-home .swiper-slide {
    width: 100%;
    max-width: 100%;
  }

  .hero-section {
    min-height: 100svh;
    height: 100svh;
  }

  .hero-home,
  .hero-home .swiper-wrapper,
  .hero-home .swiper-slide {
    min-height: 100%;
    height: 100%;
  }

  .home-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
  }

  .hero-container {
    max-width: none;
    width: 100%;
    padding: 92px 16px 72px;
    align-items: flex-end;
    gap: 20px;
  }

  .hero-content {
    gap: 18px;
    width: 100%;
  }

  /* Keep theme colors from hero.css (light = black, dark = white) */
  .hero-content h2 {
    font-size: clamp(34px, 10.5vw, 44px);
    line-height: 1;
    letter-spacing: -0.01em;
  }

  .hero-content .hero-subtitle {
    max-width: none;
    font-size: 15px;
    line-height: 1.45;
  }

  .hero-cta {
    padding: 14px 18px;
    font-size: 14px;
  }

  .hero-nav-bottom {
    left: 16px;
    right: 16px;
    width: auto;
    transform: none;
  }

  .hero-nav-controls {
    justify-content: space-between;
    gap: 16px;
  }

  /* ---- Sections below hero ---- */
  #kapital-home-sections .ecosystem-swiper .swiper-slide {
    width: 88vw;
    height: 380px;
    margin-right: 12px;
  }

  #kapital-home-sections .blog-swiper .swiper-slide {
    width: 88vw;
    margin-right: 12px;
  }

  /* ---- Modals ---- */
  #adminModal.modal-overlay.active {
    align-items: flex-end;
    padding: 12px;
  }

  #adminModal .modal-container {
    width: 100%;
    max-width: none;
    max-height: 92svh;
    overflow-y: auto;
    border-radius: 16px 16px 0 0;
  }
}

@media (max-width: 480px) {
  .btn-new-account {
    padding: 8px 12px;
    font-size: 11px;
  }

  .hero-content h2 {
    font-size: 34px;
  }

  .hero-content .hero-subtitle {
    font-size: 14px;
  }

  #kapital-home-sections .ecosystem-swiper .swiper-slide {
    width: 92vw;
    height: 340px;
  }
}
