/* ==== RESPONSIVE CONFIG ==== */

/* ----------------------------------------
   MOBILE — particle canvas opacity (hero empresas)
---------------------------------------- */
@media (max-width: 768px) {
  #particle-canvas {
    opacity: 0.35;
  }
}

/* ----------------------------------------
   TABLET  (≤ 1024px)
---------------------------------------- */
@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .doc-paper {
    padding: 40px;
  }

  /* Soluciones dropdown: narrower panel on tablet */
  .nav-dropdown-panel {
    width: 340px;
  }

  /* Infra cards: 2 columns on tablet */
  .infra-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  /* HUW bento: 2 cols on tablet */
  .huw-bento {
    grid-template-columns: 1fr 1fr;
  }

  /* API card: full-width on tablet */
  .huw-card--api {
    grid-column: span 2;
  }

  /* Tracción: horizontal dividers on tablet (2-col breaks the flow) */
  .traccion-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .traccion-stat {
    border-right: none;
    border-bottom: 1px solid rgba(102, 57, 252, 0.14);
  }

  .traccion-stat:last-child {
    border-bottom: none;
  }

  /* Sponsors layout: stack on tablet */
  .sponsors-layout {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  /* SaaS features: 2×2 on tablet */
  .saas-features-row {
    grid-template-columns: 1fr 1fr;
  }

  .saas-feature:nth-child(2) {
    border-right: none;
  }

  .saas-feature:nth-child(1),
  .saas-feature:nth-child(2) {
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
  }
}

/* ----------------------------------------
   MOBILE dropdown override (inside hamburger)
---------------------------------------- */
@media (max-width: 640px) {
  .nav-dropdown-wrapper {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
  }

  .nav-dropdown-trigger {
    width: 100%;
    justify-content: space-between;
    padding: 0.7rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    font-size: 0.95rem;
  }

  /* Override absolute positioning for mobile — panel is inline */
  .nav-dropdown-panel {
    position: static !important;
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto !important;
    width: 100% !important;
    background: rgba(0, 0, 0, 0.04);
    backdrop-filter: none;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.06);
    box-shadow: none;
    padding: 4px;
    margin-top: 4px;
    margin-bottom: 8px;
    display: none;            /* toggled by JS .open class */
  }

  .nav-dropdown-panel::before {
    display: none;            /* hide arrow tip on mobile */
  }

  .nav-dropdown-wrapper.open .nav-dropdown-panel {
    display: flex;
    flex-direction: column;
  }

  .nav-dropdown-item {
    padding: 10px 10px;
  }

  .ndi-title { font-size: 0.85rem; color: var(--color-neutral-900); }
  .ndi-desc  { color: var(--color-neutral-600); }
}

/* ----------------------------------------
   LARGE MOBILE / SMALL TABLET  (≤ 768px)
---------------------------------------- */
@media (max-width: 768px) {

  /* Hero slides: force single column */
  .hero-slide > .container > div {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }

  /* Hero image: smaller */
  .hero-image-wrapper {
    min-height: 220px !important;
  }

  .hero-image-wrapper img {
    max-height: 220px !important;
  }

  /* Glik-explainer: single column, no edge bleed */
  .glik-explainer {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
    padding: 2rem 1.25rem !important;
    border-radius: var(--radius-lg) !important;
    margin: 0 1rem !important;
  }

  /* Info badges in que-es-glik */
  .info-badge--top-right  { right: -8% !important; }
  .info-badge--mid-left   { left: -8%  !important; }
  .info-badge--bottom-right { right: -8% !important; }

  /* Herramientas bento */
  .herramientas-bento {
    grid-template-columns: 1fr !important;
  }

  .herr-card--tall { grid-row: span 1 !important; }

  /* Download banner */
  .download-banner {
    flex-direction: column !important;
    padding: 2.5rem 1.5rem 0 !important;
  }

  .download-banner-mockup {
    width: 100% !important;
    display: flex;
    justify-content: center;
  }

  /* SaaS mockup: full width on small screens */
  .saas-mockup-container {
    width: 100%;
    padding: 0 1.5rem;
  }
}

/* ----------------------------------------
   MOBILE  (≤ 640px)
---------------------------------------- */
@media (max-width: 640px) {
  :root {
    --space-section: 3.5rem;
  }

  /* Ensure no horizontal scroll on body */
  body {
    overflow-x: hidden;
  }

  /* Base hero: reduce height, add header clearance */
  .hero {
    min-height: 100svh;
    padding-top: 80px;
    align-items: flex-start;
  }

  /* Stronger, more vivid gradient background on mobile hero */
  #personas-hero {
    background:
      radial-gradient(ellipse at 15% 8%,  rgba(102, 57, 252, 0.28) 0%, transparent 52%),
      radial-gradient(ellipse at 85% 80%, rgba(219, 252, 117, 0.38) 0%, transparent 48%),
      radial-gradient(ellipse at 88% 12%, rgba(255, 113, 119, 0.18) 0%, transparent 40%),
      #F2F0FF !important;
  }

  /* ===== HEADER ===== */

  /* Hamburger button — visible on mobile */
  .hamburger {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 1100;
    flex-shrink: 0;
  }

  .hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--color-secondary-red);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
    transform-origin: center;
  }

  .hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .hamburger.open span:nth-child(2) { opacity: 0; }
  .hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* Nav links: hidden by default, dropdown on open */
  .nav-links {
    display: none;
    position: fixed;
    top: 72px;
    left: 0;
    width: 100%;
    background-color: #F4F2FF;
    flex-direction: column;
    padding: 1rem 1.5rem 1.5rem;
    box-shadow: var(--shadow-md);
    z-index: 999;
    gap: 0;
  }

  .nav-links.active {
    display: flex;
  }

  .nav-links {
    align-items: flex-start;
  }

  .nav-links .nav-link {
    padding: 0.7rem 0;
    border-bottom: none;
    font-size: 0.95rem;
    color: var(--color-secondary-blue) !important;
  }

  /* Toggle btn (Glik para Personas / Empresas) — always navy in mobile menu */
  .nav-links .toggle-btn,
  body[data-active-section="empresas"] .nav-links .toggle-btn {
    color: var(--color-secondary-blue) !important;
  }

  /* Header actions: hidden on mobile — CTAs live inside the hamburger menu */
  .header-actions {
    display: none !important;
  }

  /* Login shortcut visible in header on mobile, next to hamburger */
  .mobile-header-login {
    display: inline-flex;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-primary);
    text-decoration: none;
    padding: 6px 10px;
    border-radius: var(--radius-full);
    border: 1.5px solid rgba(102, 57, 252, 0.3);
    white-space: nowrap;
    transition: background-color var(--transition-base), border-color var(--transition-base);
  }

  .mobile-header-login:hover {
    background-color: rgba(102, 57, 252, 0.06);
    border-color: var(--color-primary);
  }

  /* Mobile-only CTAs inside nav menu */
  .nav-mobile-ctas {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding-top: 1.25rem;
    margin-top: 0.75rem;
    border-top: 1px solid rgba(0, 0, 0, 0.07);
    width: 100%;
  }

  .nav-mobile-login {
    display: block;
    text-align: center;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-primary);
    padding: 0.6rem 0;
    text-decoration: none;
  }

  .nav-mobile-register {
    text-align: center;
    width: 100%;
    padding: 0.75rem 1rem !important;
    font-size: 0.95rem !important;
    box-sizing: border-box;
  }

  /* ===== HERO SLIDES — mobile: text only, full width, centered ===== */

  /* Hero section: full viewport width, proper height */
  #personas-hero {
    width: 100%;
    min-height: 100svh;
    padding-bottom: 6rem; /* room for nav dots */
    box-sizing: border-box;
  }

  /* Slider wrapper: full width, no overflow clipping (parent already clips) */
  .personas-slider-wrapper {
    width: 100%;
    /* Do NOT add overflow:hidden here — it breaks translateX on nested flex */
  }

  /* Each slide: full width of slider, no clipping */
  .hero-slide {
    min-width: 100%;
    width: 100%;
    box-sizing: border-box;
    /* No overflow:hidden — let parent handle clipping */
    display: flex;
    align-items: flex-start;
    padding-top: 2rem;
  }

  /* Grid: single column */
  .hero-slide > .container > div {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
    width: 100%;
  }

  /* Show illustration below text on mobile — mask-faded at bottom (no color overlay) */
  .hero-image-wrapper {
    display: block !important;
    min-height: unset !important;
    height: 230px;
    overflow: hidden;
    position: relative;
    margin-top: 0.5rem;
    text-align: center;
    /* Fade the image itself to transparent — works on any background */
    -webkit-mask-image: linear-gradient(to bottom, black 45%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 45%, transparent 100%);
  }

  /* Scale down illustration to fit the clipped area */
  .hero-image-wrapper img {
    max-height: 290px !important;
    width: auto !important;
    display: inline-block;
    object-fit: contain;
    position: relative;
    z-index: 1;
  }

  /* Hide floating badges — they don't work in the stacked mobile layout */
  .hero-image-wrapper .floating-badge {
    display: none !important;
  }

  /* Hero slide pill label — center on mobile */
  .hero-slide-label {
    display: flex;
    justify-content: center;
    font-size: 0.65rem !important;
    letter-spacing: 0.06em;
  }

  /* Title */
  #personas-hero h1 {
    font-size: clamp(1.65rem, 7vw, 2rem) !important;
    line-height: 1.2;
    overflow-wrap: break-word;
    word-break: break-word;
    text-align: center;
    margin-bottom: 1rem;
  }

  /* Hero content: centered */
  .hero-content {
    text-align: center;
    max-width: 100%;
    padding: 0 1.25rem;
    width: 100%;
    box-sizing: border-box;
  }

  .hero-content .text-lead {
    font-size: 0.95rem;
    text-align: center;
    margin-bottom: 1.5rem;
  }

  /* CTA block: centered column */
  .hero-content > div {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    margin-top: 1.5rem !important;
  }

  /* Disclaimer */
  .hero-slide-disclaimer {
    text-align: center;
  }

  /* ===== QUÉ ES GLIK — info badges overlapping the mockup ===== */
  .glik-explainer {
    margin: 0 1rem !important;
    padding: 1.5rem 1rem !important;
  }

  /* Give the wrapper enough horizontal room so badges can overlap */
  .glik-explainer-visual {
    padding: 0 2.5rem;
  }

  .app-visual-wrapper {
    display: inline-block;
    position: relative;
  }

  .app-screenshot-img {
    width: 180px !important;
    display: block;
  }

  /* Compact badges — stay absolute, repositioned to overlap image edges */
  .info-badge {
    font-size: 0.7rem !important;
    padding: 6px 9px !important;
    gap: 7px !important;
    white-space: nowrap;
    animation: none !important;
  }

  .info-badge-icon {
    width: 22px !important;
    height: 22px !important;
  }

  /* Reposition to stay within viewport, overlapping image */
  .info-badge--top-right    { top: 8%  !important; right: -40px  !important; }
  .info-badge--mid-left     { top: 44% !important; left: -40px   !important; }
  .info-badge--bottom-right { bottom: 10% !important; right: -40px !important; }

  /* ===== OTHER SECTIONS ===== */

  .herramientas-bento {
    grid-template-columns: 1fr !important;
  }

  .download-badges {
    flex-direction: column !important;
  }

  /* Infra cards: single column on mobile */
  .infra-cards {
    grid-template-columns: 1fr;
  }

  /* SaaS browser URL: smaller */
  .browser-url {
    font-size: 0.65rem;
    max-width: 180px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .footer-bottom {
    flex-direction: column;
    gap: var(--space-md);
    text-align: center;
  }

  .footer-sic {
    flex-direction: column;
    gap: 0.75rem;
  }

  .doc-signatures {
    grid-template-columns: 1fr;
  }
}

/* ----------------------------------------
   WIDE DESKTOP  (≥ 1440px)
---------------------------------------- */
@media (min-width: 1440px) {
  .container {
    max-width: 1400px;
  }
}

/* ----------------------------------------
   MOBILE — new Empresas sections
---------------------------------------- */
@media (max-width: 640px) {
  .huw-bento {
    grid-template-columns: 1fr;
  }

  .huw-card--wide,
  .huw-card--api {
    grid-column: span 1;
  }

  .traccion-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .traccion-stat {
    border-right: none;
    border-bottom: 1px solid rgba(102, 57, 252, 0.14);
  }

  .traccion-stat:last-child {
    border-bottom: none;
  }

  .traccion-stat {
    padding: 2rem 1.5rem;
  }

  .traccion-stat {
    padding: 1.5rem 1rem;
  }

  .traccion-number {
    font-size: 2rem;
  }

  .sponsors-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .sponsors-benefits {
    grid-template-columns: 1fr;
  }

  .evento-wrapper {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .saas-badges-row {
    gap: 0.4rem;
  }

  /* Hide ALL badges on mobile — desktop only */
  .saas-fb--1,
  .saas-fb--2,
  .saas-fb--3,
  .saas-fb--4,
  .saas-fb--5 {
    display: none;
  }

  /* SaaS features: 2-col on mobile */
  .saas-features-row {
    grid-template-columns: 1fr 1fr;
  }

  .saas-feature:nth-child(2) {
    border-right: none;
  }

  .saas-feature:nth-child(3) {
    border-right: 1px solid rgba(0, 0, 0, 0.07);
  }

  .saas-feature:nth-child(1),
  .saas-feature:nth-child(2) {
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
  }
}
