/* =============================================================================
   Responsive — Tablet & Mobile Layout
   Mobile-first enhancements layered on top of the base CSS.

   Strategy (Facebook / YouTube mobile pattern):
   ─ ≤ 768px  (mobile): sidebar hidden, bottom nav bar, full-width content,
                         hamburger opens a full overlay drawer
   ─ 769–1024px (tablet): sidebar stays as 64px icon rail,
                           content takes remaining width
   ─ ≥ 1025px (desktop): unchanged from base CSS
   ============================================================================= */

/* ===========================================================================
   SECTION 1 — Mobile (≤ 768px)
   =========================================================================== */
@media (max-width: 768px) {

  /* ── 1.1  DESKTOP SIDEBAR — completely hidden on mobile ─────────────────── */
  /* The sidebar is a desktop-only element. On mobile the mob-nav-overlay     */
  /* handles navigation. We hide the sidebar with zero size and no visibility. */
  .sidebar {
    display: none !important;
  }

  /* ── 1.2  CONTENT — full width, no left margin ──────────────────────────── */
  .page-content-wrap,
  .page-body.sidebar-open .page-content-wrap {
    margin-left: 0 !important;
    max-width: 100vw !important;
    padding-bottom: 64px; /* clear the bottom nav bar */
  }

  html, body { overflow-x: hidden; }

  /* ── 1.3  MOBILE NAV OVERLAY ────────────────────────────────────────────── */
  /* Full-screen overlay — hidden by default, toggled by hamburger            */
  .mob-nav-overlay {
    position: fixed;
    inset: 0;
    z-index: 700;
    background: #1a1a2e;         /* dark brand colour */
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    /* Shown/hidden via [hidden] attribute + opacity animation */
    opacity: 0;
    transition: opacity .2s ease;
    pointer-events: none;
  }
  .mob-nav-overlay:not([hidden]) {
    opacity: 1;
    pointer-events: all;
  }

  /* Header row */
  .mob-nav-overlay__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,.1);
    flex-shrink: 0;
  }
  .mob-nav-overlay__title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -.01em;
  }
  .mob-nav-overlay__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,.1);
    border: none;
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .15s;
  }
  .mob-nav-overlay__close:hover { background: rgba(255,255,255,.2); }

  /* 2-column grid of nav tiles */
  .mob-nav-overlay__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;   /* exactly 2 columns */
    gap: 1px;
    background: rgba(255,255,255,.07); /* gap colour */
    flex: 1;
    align-content: start;
  }

  .mob-nav-overlay__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    background: #1a1a2e;
    color: rgba(255,255,255,.75);
    text-decoration: none;
    font-size: .9375rem;
    font-weight: 600;
    transition: background .15s, color .15s;
    min-height: 60px;
  }
  .mob-nav-overlay__item i {
    font-size: 1.15rem;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
    color: rgba(255,255,255,.5);
    transition: color .15s;
  }
  .mob-nav-overlay__item:hover {
    background: rgba(255,255,255,.08);
    color: #fff;
  }
  .mob-nav-overlay__item:hover i { color: #e94560; }
  .mob-nav-overlay__item.is-active {
    background: rgba(233,69,96,.15);
    color: #e94560;
  }
  .mob-nav-overlay__item.is-active i { color: #e94560; }

  /* Auth footer */
  .mob-nav-overlay__auth {
    display: flex;
    flex-direction: column;
    border-top: 1px solid rgba(255,255,255,.1);
    flex-shrink: 0;
  }
  .mob-nav-overlay__auth-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    color: rgba(255,255,255,.7);
    text-decoration: none;
    font-size: .9375rem;
    font-weight: 600;
    transition: background .15s, color .15s;
    border-bottom: 1px solid rgba(255,255,255,.06);
  }
  .mob-nav-overlay__auth-link i { font-size: 1rem; width: 22px; text-align: center; }
  .mob-nav-overlay__auth-link:hover { background: rgba(255,255,255,.07); color: #fff; }
  .mob-nav-overlay__auth-link--signin { color: #e94560; }
  .mob-nav-overlay__auth-link--signin i { color: #e94560; }
  .mob-nav-overlay__auth-link--logout  { color: rgba(233,100,100,.8); }
  .mob-nav-overlay__auth-link--logout i { color: rgba(233,100,100,.8); }

  /* ── 1.4  HERO ──────────────────────────────────────────────────────────── */
  .hero {
    width: 100vw !important;
    margin-left: 0 !important;
  }
  .hero__content,
  .page-body.sidebar-open .hero__content {
    left: var(--space-5) !important;
    right: var(--space-5) !important;
    max-width: 100% !important;
    bottom: var(--space-10) !important;
  }
  .hero__arrow--prev,
  .page-body.sidebar-open .hero__arrow--prev {
    left: var(--space-3) !important;
  }

  /* ── 1.5  HEADER ─────────────────────────────────────────────────────────  */
  .header__inner { padding-inline: var(--space-3); gap: var(--space-2); }
  .header__currency-btn span { display: none; }
  .header__merch-pill { padding: 0 var(--space-3); margin-right: var(--space-3); }
  .header__merch-pill::after { display: none; }

  /* ── 1.6  BOTTOM NAV BAR ─────────────────────────────────────────────────  */
  .bottom-nav {
    display: flex !important;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 56px;
    background: #fff;
    border-top: 1px solid #e5e5e5;
    z-index: 400;
    align-items: stretch;
    box-shadow: 0 -2px 12px rgba(0,0,0,.07);
  }
  .bottom-nav__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: #666;
    text-decoration: none;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: .03em;
    padding: 6px 0 4px;
    transition: color .15s;
    position: relative;
    min-height: unset;  /* override the 44px touch target rule for this specific nav */
  }
  .bottom-nav__item i { font-size: 1.15rem; line-height: 1; }
  .bottom-nav__item.active,
  .bottom-nav__item:hover { color: var(--color-highlight, #e94560); }
  .bottom-nav__item.active::before {
    content: '';
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 28px; height: 3px;
    background: var(--color-highlight, #e94560);
    border-radius: 0 0 3px 3px;
  }
  .bottom-nav__badge {
    position: absolute;
    top: 4px; right: calc(50% - 18px);
    min-width: 16px; height: 16px;
    padding: 0 3px;
    background: var(--color-highlight, #e94560);
    color: #fff; font-size: 9px; font-weight: 700;
    border-radius: 99px;
    display: flex; align-items: center; justify-content: center;
    line-height: 1; min-height: unset;
  }

  /* ── 1.7  SECTION LAYOUT ─────────────────────────────────────────────────  */
  .section    { padding-block: var(--space-10); }
  .section-sm { padding-block: var(--space-8); }
  .container  { padding-inline: var(--space-4); }

  /* ── 1.8  GRIDS ──────────────────────────────────────────────────────────  */
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }

  /* ── 1.9  FEATURED SECTION ───────────────────────────────────────────────  */
  .featured-section { grid-template-columns: 1fr; }
  .featured-section__right { min-height: 56vw; background-attachment: scroll; }
  .featured-section__left  { padding: var(--space-10) var(--space-5); }
  .featured-section__video-card { right: var(--space-3); bottom: var(--space-3); max-width: 200px; }

  /* ── 1.10  ARTIST PROFILE ────────────────────────────────────────────────  */
  .artist-hero__inner { flex-direction: column; text-align: center; gap: var(--space-5); }
  .artist-hero__photo, .artist-hero__photo-placeholder { width: 160px; height: 160px; }
  .artist-hero__social, .artist-hero__tags, .artist-hero__follow-row { justify-content: center; }

  /* ── 1.11  EVENTS ────────────────────────────────────────────────────────  */
  .event-row {
    grid-template-columns: 72px 1fr;
    grid-template-rows: auto auto;
    gap: var(--space-4) var(--space-3);
    padding: var(--space-4);
  }
  .event-row__actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
  .event-row__date-day { font-size: var(--font-size-2xl); }

  /* ── 1.12  MERCH ─────────────────────────────────────────────────────────  */
  .merch-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-3); }

  /* ── 1.13  SHOP PRODUCT ──────────────────────────────────────────────────  */
  .shop-product__grid { grid-template-columns: 1fr; gap: var(--space-8); }
  .shop-product__trust { flex-direction: column; gap: var(--space-3); }

  /* ── 1.14  CART ──────────────────────────────────────────────────────────  */
  .shop-cart__layout { grid-template-columns: 1fr; gap: var(--space-5); }
  .shop-cart__summary { position: static; }
  .shop-cart-table th:nth-child(3), .shop-cart-table td:nth-child(3) { display: none; }

  /* ── 1.15  CHECKOUT ──────────────────────────────────────────────────────  */
  .checkout-layout { grid-template-columns: 1fr; gap: var(--space-5); }
  .checkout-summary { position: static; }
  .checkout-row, .checkout-row--3 { grid-template-columns: 1fr; }
  .checkout-step span { width: 24px; height: 24px; font-size: .7rem; }
  .checkout-section { padding: var(--space-5) var(--space-4); }

  /* ── 1.16  BOOKING ───────────────────────────────────────────────────────  */
  .booking-section { grid-template-columns: 1fr; gap: var(--space-6); }

  /* ── 1.17  SOCIAL FEED ───────────────────────────────────────────────────  */
  .social-layout { grid-template-columns: 1fr; padding: calc(var(--header-height) + 12px) 12px 80px; gap: 12px; }
  .social-sidebar--left { position: static; }
  .social-sidebar--right { display: none; }
  .social-sidebar--left .social-sidebar__card:first-child { display: none; }
  .social-profile-header { flex-direction: column; gap: var(--space-4); }

  /* ── 1.18  FOOTER ────────────────────────────────────────────────────────  */
  .footer__grid { grid-template-columns: 1fr; gap: var(--space-8); }
  .footer__bottom { flex-direction: column; text-align: center; gap: var(--space-3); }
  .newsletter-widget__form { flex-direction: column; }

  /* ── 1.19  NEWS & EVENTS STRIP ───────────────────────────────────────────  */
  .nec-card { flex: 0 0 200px; height: 140px; }
  .news-events-section__title { font-size: var(--font-size-2xl); }

  /* ── 1.20  MISC GRIDS ────────────────────────────────────────────────────  */
  .news-layout, .news-grid,
  .services-grid,
  .ir-grid, .investor-grid,
  .video-grid     { grid-template-columns: 1fr !important; }
  .streaming-grid,
  .stats-grid,
  .home-merch-grid { grid-template-columns: repeat(2, 1fr) !important; }

  /* ── 1.21  SEARCH ────────────────────────────────────────────────────────  */
  #search-input, #search-input::placeholder { font-size: var(--font-size-xs); }

  /* ── 1.22  MODAL ─────────────────────────────────────────────────────────  */
  .modal-overlay { padding: var(--space-4); align-items: flex-end; }
  .modal { border-radius: var(--radius-lg) var(--radius-lg) 0 0; max-height: 85vh; }

  /* ── 1.23  DROPDOWNS — full width ────────────────────────────────────────  */
  .header__notif-dropdown, .header__profile-dropdown {
    position: fixed;
    top: var(--header-height); left: 0; right: 0;
    max-width: 100%; min-width: unset;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    max-height: 70vh; overflow-y: auto;
  }

  /* ── 1.24  TYPOGRAPHY ────────────────────────────────────────────────────  */
  h1 { font-size: var(--font-size-2xl); }
  h2 { font-size: var(--font-size-xl); }
  .section-title { font-size: var(--font-size-2xl); }

  /* ── 1.25  TOUCH TARGETS ─────────────────────────────────────────────────  */
  button, .btn { min-height: 44px; }
  .form-control { padding: var(--space-4); font-size: var(--font-size-base); }
}

/* Extra-small phones */
@media (max-width: 400px) {
  .merch-grid { grid-template-columns: 1fr; }
  .stats-grid, .streaming-grid, .home-merch-grid { grid-template-columns: 1fr !important; }
  .header__merch-pill { display: none; }
}


/* ===========================================================================
   SECTION 2 — Tablet only (769px – 1024px)
   =========================================================================== */
@media (min-width: 769px) and (max-width: 1024px) {

  /* ── 2.1  SIDEBAR — stays as 64px icon rail ─────────────────────────────── */
  /* No changes needed — base CSS handles this correctly */

  /* ── 2.2  GRIDS — 2 columns where base has 4 ───────────────────────────── */
  .grid-4 { grid-template-columns: repeat(2, 1fr); }

  /* Merch stays 2 cols on tablet */
  .merch-grid { grid-template-columns: repeat(2, 1fr); }

  /* ── 2.3  FEATURED ──────────────────────────────────────────────────────── */
  .featured-section__right { background-attachment: scroll; }
  .featured-section__left { padding: var(--space-12) var(--space-8); }

  /* ── 2.4  SHOP ──────────────────────────────────────────────────────────── */
  .shop-product__grid { gap: var(--space-8); }
  .checkout-row--3 { grid-template-columns: 1fr 1fr; }

  /* ── 2.5  SOCIAL ─────────────────────────────────────────────────────────── */
  .social-layout { grid-template-columns: 200px 1fr; }
  .social-sidebar--right { display: none; }

  /* ── 2.6  BOOKING ───────────────────────────────────────────────────────── */
  .booking-section { grid-template-columns: 1fr 340px; }

  /* ── 2.7  HERO ──────────────────────────────────────────────────────────── */
  .hero__content {
    left: calc(var(--sidebar-width-collapsed, 64px) + var(--space-6));
    max-width: 72%;
  }
}


/* ===========================================================================
   SECTION 3 — Bottom Nav Bar (hidden by default, shown on mobile)
   =========================================================================== */

/* Hidden on desktop/tablet — JS or the media query above enables it */
.bottom-nav {
  display: none;
}


/* ===========================================================================
   SECTION 4 — Sidebar overlay backdrop
   =========================================================================== */

/* The backdrop sits behind the open drawer on mobile */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 590;
}


/* ===========================================================================
   SECTION 5 — Small utility tweaks that apply across breakpoints
   =========================================================================== */

/* Prevent content overflow on all screens */
img, video, iframe, table {
  max-width: 100%;
}

/* Tables — horizontal scroll wrapper */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Make all admin tables scrollable on tablet/mobile */
@media (max-width: 1024px) {
  .sa-table,
  .shop-cart-table,
  .admin-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }
}

/* Touch target minimum size */
@media (max-width: 768px) {
  a, button {
    min-height: 44px;
    min-width: 44px;
  }
  /* But don't enlarge inline text links */
  p a, li a, .footer__links a, .sidebar__nav a {
    min-height: unset;
    min-width: unset;
  }
  /* Bigger form inputs on mobile for fat fingers */
  .form-control {
    padding: var(--space-4);
    font-size: var(--font-size-base);
  }
}
