/* =========================================================
   MOBILE.CSS — CLEAN, STABLE, CANONICAL
   Desktop CSS remains COMPLETELY untouched
   ========================================================= */


/* =========================================================
   HARD DESKTOP KILL SWITCH
   ========================================================= */
@media (min-width: 769px) {
  .mobile-drawer,
  .mobile-drawer *,
  .mobile-overlay,
  .mobile-header-controls,
  .mobile-menu-left,
  .mobile-menu-right {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
}


/* =========================================================
   MOBILE ONLY
   ========================================================= */
@media (max-width: 768px) {

  body {
    overflow-x: hidden;
  }

  /* =====================================================
     HEADER — MOBILE STRUCTURE
     ===================================================== */

  /* Hide desktop-only elements */
  body.is-homepage header.top-header > .top-bar {
    display: none !important;
  }

  header.top-header nav.main-nav {
    display: none !important;
  }

  /* Header container */
  body.is-homepage header.top-header .main-header {
    position: relative;
    display: block !important;
    padding: 10px 48px;
    min-height: 96px;
  }

  /* Mobile control wrapper (layout-neutral) */
  body.is-homepage header.top-header .mobile-header-controls {
    position: absolute;
    inset: 0;
    pointer-events: none;
  }

  /* Left hamburger */
  body.is-homepage header.top-header .mobile-menu-left {
    position: absolute;
    left: 6px;
    top: 10px;
    font-size: 30px;
    cursor: pointer;
    z-index: 10001;
    pointer-events: auto;
  }

  /* Right hamburger */
  body.is-homepage header.top-header .mobile-menu-right {
    position: absolute;
    right: 6px;
    top: 10px;
    font-size: 30px;
    cursor: pointer;
    z-index: 10001;
    pointer-events: auto;
  }

  /* Logo */
  body.is-homepage header.top-header .header-left {
    position: absolute;
    left: 50%;
    top: 12px;
    transform: translateX(-50%);
    z-index: 10000;
    text-align: center;
  }

  /* Hide catalog image */
  body.is-homepage header.top-header .header-right {
    display: none !important;
  }

  body.is-homepage header.top-header .header-search input {
    width: 100%;
    box-sizing: border-box;
  }

body.is-homepage header.top-header .header-search {
  margin-top: 56px;

  /* 🔥 critical fix */
  margin-left: -28px;
  margin-right: -48px;

  display: flex;
  justify-content: center;
}


body.is-homepage header.top-header .header-search form {
  width: 100%;
  max-width: 210px; /* adjust if you want wider/narrower */
}

 body.is-homepage header.top-header {
    padding-bottom: 16px;
  }
  
  /* =====================================================
     OVERLAY (shared)
     ===================================================== */

  .mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 99998;
    display: none;
    pointer-events: none;
  }

  body.mobile-menu-open .mobile-overlay,
  body.mobile-options-open .mobile-overlay {
    display: block;
    pointer-events: auto;
  }


  /* =====================================================
     LEFT DRAWER — MAIN MENU
     ===================================================== */

  .mobile-drawer-left {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;

    width: 80%;
    max-width: 320px;

    background: #000;
    color: #fff;

    z-index: 100000;

    transform: translateX(-100%);
    transition: transform 0.25s ease;
    overflow-y: auto;
  }

  body.mobile-menu-open .mobile-drawer-left {
    transform: translateX(0);
  }

  .mobile-drawer-content {
    padding: 16px;
  }

  /* Top-level items */
  .mobile-main-nav .menu-item > a {
    display: block;
    padding: 12px 0;
    color: #fff;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.04em;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    text-decoration: none;
  }

  /* Submenus */
  .mobile-main-nav .submenu {
    display: none;
    margin: 6px 0 10px;
    padding-left: 14px;
  }

  .mobile-main-nav .menu-item.open > .submenu {
    display: block;
  }

  .mobile-main-nav .submenu a {
    display: block;
    padding: 8px 0;
    color: #ddd;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    text-align: left;
    text-decoration: none;
  }


  /* =====================================================
     RIGHT DRAWER — OPTIONS (CATALOG / LANGUAGE)
     ===================================================== */

  .mobile-drawer-right {
    position: fixed;
    top: 0;
    bottom: 0;
    right: 0;

    width: 80%;
    max-width: 320px;

    background: #000;
    color: #fff;

    z-index: 100000;

    transform: translateX(100%);
    transition: transform 0.25s ease;
    overflow-y: auto;

    pointer-events: none;
  }

  body.mobile-options-open .mobile-drawer-right {
    transform: translateX(0);
    pointer-events: auto;
  }

  .mobile-options-nav a {
    display: block;
    padding: 14px 0;
    color: #fff;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.04em;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    text-decoration: none;
  }

  /* Language submenu */
  .mobile-options-nav .submenu {
    display: none;
    padding-left: 14px;
  }

  .mobile-options-nav .menu-item.open > .submenu {
    display: block;
  }

/* =====================================================
   MOBILE SUBMENU — HARD RESET (LEFT + RIGHT)
   ===================================================== */

/* Force mobile submenus to behave like stacked blocks */
.mobile-main-nav .submenu,
.mobile-options-nav .submenu {
  position: static !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  transform: none !important;

  display: none;
  margin: 6px 0 10px;
  padding-left: 14px;

  background: transparent;
  box-shadow: none;
}

/* Open state (shared) */
.mobile-main-nav .menu-item.open > .submenu,
.mobile-options-nav .menu-item.open > .submenu {
  display: block;
}

/* Align language submenu items to the left */
.mobile-options-nav .submenu a {
  text-align: left;
}

  /* =====================================================
     CONTENT + FOOTER (unchanged behavior)
     ===================================================== */

  .is-homepage .homepage {
    display: block;
    padding: 0 12px;
  }

  .is-homepage .catalog-sidebar,
  .is-homepage .homepage-right {
    display: none !important;
  }

  .is-homepage .homepage-breadcrumbs {
    margin: 10px 0;
	padding-bottom: 1px;
  }

  .is-homepage .random-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .is-homepage .random-item img {
    width: 100%;
    height: auto;
  }

  .is-homepage .random-item .item-name {
    font-size: 13px;
    line-height: 1.3;
  }
  
  /* =====================================================
   HOMEPAGE — RANDOM PICKS (MOBILE REDUCTION)
   Show only 1 item per category on mobile
   ===================================================== */

  .homepage-random-picks .random-row .random-item {
    display: none;
  }

  .homepage-random-picks .random-row .random-item:first-child {
    display: block;
  }

/* =====================================================
   HOMEPAGE — RANDOM PICKS SPACING (MOBILE)
   ===================================================== */

/* Title closer to first item */
.is-homepage .homepage-title {
  margin-bottom: 2px; /* was larger */
}

/* Reduce gap between rows */
.is-homepage .homepage-random-picks .random-row {
  margin-bottom: 2px;
}

/* Reduce space around each item */
.is-homepage .random-item {
  margin-bottom: 2px;
}

/* Tighten image → text spacing */
.is-homepage .random-item-image {
  margin-bottom: 2px;
}

/* Center single random item on mobile */
.homepage-random-picks .random-row {
  justify-items: center;
}

.homepage-random-picks .random-row .random-item {
  width: 100%;
  max-width: 240px; /* adjust if needed */
}

/* When only one random item is shown, span full grid width */
.homepage-random-picks .random-row .random-item:first-child {
  grid-column: 1 / -1;
  justify-self: center;
}

/* Tighten text blocks */
.is-homepage .random-item-info .issuer,
.is-homepage .random-item-info .item-name,
.is-homepage .random-item-info .year,
.is-homepage .random-item-info .reference {
  margin-bottom: 2px;
}

.site-footer .footer-separator-bottom {
  margin-bottom: 0px;
}



}



  .is-homepage .footer-columns {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .is-homepage .newsletter-row {
    flex-wrap: wrap;
  }

  .is-homepage .newsletter-row input,
  .is-homepage .newsletter-row button {
    width: 100%;
  }

  .is-homepage .footer-bottom-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
  }

  .is-homepage .footer-cloudflare {
    margin-top: 6px;
  }
}


/* =========================================================
   SMALL PHONES
   ========================================================= */
@media (max-width: 480px) {
  .is-homepage .random-row {
    grid-template-columns: 1fr;
  }
}
