/* ============================================================
   TRANSFORMLULU.COM — MOBILE RESPONSIVE OVERRIDES
   ============================================================
   All rules live inside @media queries so the desktop experience
   stays completely untouched. Uses !important to override the
   inline styles used throughout the site.
   ============================================================ */

/* ---- Hide hamburger on desktop ---- */
.mobile-menu-btn {
  display: none;
}

/* ==========================================================
   TABLET — 769px – 1024px
   ========================================================== */
@media (max-width: 1024px) {

  /* Nav items tighter */
  .top-nav .nav-items {
    gap: 2px !important;
  }
  .top-nav .nav-item {
    padding: 8px 8px !important;
    font-size: 11px !important;
  }

  /* 4-col grids → 2 cols */
  [data-mobile-grid-4] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* ==========================================================
   MOBILE — 768px and below
   ========================================================== */
@media (max-width: 768px) {

  /* ---- HAMBURGER NAV ---- */
  .mobile-menu-btn {
    display: flex !important;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    margin-left: auto;
    z-index: 60;
  }
  .mobile-menu-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: #1A1A1A;
    border-radius: 1px;
    transition: transform 0.3s, opacity 0.3s;
  }
  .mobile-menu-btn.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
  }
  .mobile-menu-btn.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .top-nav .nav-items {
    display: none !important;
  }
  .top-nav .nav-items.mobile-open {
    display: flex !important;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: #fff;
    padding: 16px 24px;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    gap: 4px;
    z-index: 100;
  }
  .top-nav .nav-items.mobile-open .nav-item {
    padding: 12px 8px !important;
    font-size: 14px !important;
    white-space: normal !important;
    border-bottom: 1px solid #f0f0f0;
  }
  .top-nav .nav-items.mobile-open .nav-item:last-child {
    border-bottom: none;
  }

  /* ---- NAV DOTS — hide on mobile ---- */
  .nav-dots {
    display: none !important;
  }

  /* ---- SCROLL DOTS (insights page) ---- */
  .scroll-dots {
    display: none !important;
  }

  /* ---- FOOTER ---- */
  .site-footer {
    flex-direction: column !important;
    gap: 12px !important;
    text-align: center !important;
    padding: 20px 16px !important;
  }
  .site-footer .footer-links {
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 12px !important;
  }

  /* ---- LANDING HERO SECTIONS (split layout) ---- */
  /* These are section[display:flex] with a text panel (35-38%) + image */
  [data-mobile-landing] {
    flex-direction: column !important;
    min-height: auto !important;
  }
  [data-mobile-landing] > [data-mobile-text] {
    width: 100% !important;
    padding: 40px 24px 32px !important;
    flex-shrink: initial !important;
    min-height: auto !important;
  }
  [data-mobile-landing] > [data-mobile-strip] {
    width: 100% !important;
    height: 4px !important;
  }
  [data-mobile-landing] > [data-mobile-image] {
    width: 100% !important;
    height: 35vh !important;
    min-height: 220px !important;
    position: relative !important;
  }

  /* ---- SECTION PADDING ---- */
  /* Override heavy padding (96px) on content sections */
  [data-mobile-section] {
    padding: 48px 20px !important;
  }

  /* Challenge / Tombstone section (full-screen overlay) */
  #challenge,
  #tombstone {
    min-height: 60vh !important;
    padding: 48px 20px !important;
  }

  /* ---- SECTION NAV (approach page sticky sub-nav) ---- */
  .section-nav {
    height: auto !important;
    padding: 0 12px !important;
    gap: 0 !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    justify-content: flex-start !important;
  }
  .section-nav a {
    padding: 10px 14px !important;
    font-size: 11px !important;
    flex-shrink: 0 !important;
  }

  /* ---- INDEX LANDING (new clean layout, no hero image) ---- */
  #landing {
    padding: 40px 20px 32px !important;
  }
  #landing h1 {
    font-size: clamp(32px, 10vw, 48px) !important;
  }

  /* ---- MULTI-COLUMN GRIDS → SINGLE COLUMN ---- */
  [data-mobile-grid],
  [data-mobile-grid-4] {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  /* ---- TWO-COLUMN FLEX → STACK ---- */
  [data-mobile-stack] {
    flex-direction: column !important;
    gap: 20px !important;
  }
  [data-mobile-stack] > * {
    width: 100% !important;
  }

  /* ---- HORIZONTAL SCROLL WRAPPERS ---- */
  [data-mobile-scroll] {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* Revenue timeline brand pills — scrollable */
  [data-mobile-scroll-inner] {
    min-width: 600px !important;
  }

  /* ---- FLIP CARDS ---- */
  .context-flip .flip-inner {
    height: 140px !important;
  }
  .context-flip .flip-front,
  .context-flip .flip-back {
    padding: 16px !important;
  }
  .context-flip .flip-front p,
  .context-flip .flip-back li {
    font-size: 13px !important;
  }

  .strategy-flip .flip-inner {
    height: 80px !important;
  }
  .strategy-flip .flip-front p {
    font-size: 15px !important;
  }

  /* ---- APPROACH PAGE: Category cards ---- */
  .cat-card {
    margin-bottom: 8px;
  }

  /* ---- APPROACH PAGE: Horizon rows ---- */
  .horizon-row {
    flex-direction: column !important;
  }

  /* ---- APPROACH PAGE: Philosophy cards ---- */
  .philosophy-card {
    flex-direction: column !important;
    gap: 12px !important;
    padding: 20px 16px !important;
  }
  /* Number column — shrink & inline */
  .philosophy-card > div:first-child {
    width: auto !important;
    flex-shrink: 0 !important;
  }
  .philosophy-card > div:first-child span {
    font-size: 32px !important;
  }
  /* Text column — full width */
  .philosophy-card > div:nth-child(2) {
    width: 100% !important;
  }
  /* Button column — full width, centered */
  .philosophy-card > div:nth-child(3) {
    width: 100% !important;
    justify-content: center !important;
    padding-top: 4px !important;
  }
  /* Center the inspiration-btn wrapper */
  .inspiration-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  /* Inspiration popup — fixed overlay on mobile instead of absolute hover */
  .inspiration-popup {
    position: fixed !important;
    top: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    margin-top: 0 !important;
    border-radius: 16px 16px 0 0 !important;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.2) !important;
    padding: 24px 20px 32px !important;
    z-index: 200 !important;
    max-height: 60vh !important;
    overflow-y: auto !important;
  }
  /* Disable hover-triggered popup on mobile */
  .inspiration-btn:hover .inspiration-popup {
    display: none !important;
  }
  /* Show popup only when toggled via JS class */
  .inspiration-btn .inspiration-popup.mobile-popup-open {
    display: block !important;
  }
  /* Backdrop overlay for popup */
  .mobile-popup-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 199;
  }
  /* Close button for inspiration popup */
  .mobile-popup-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #f0f0f0;
    color: #333;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
  }

  /* Philosophy section padding override */
  #philosophy {
    padding: 48px 20px !important;
  }

  /* ---- GOVERNANCE PAGE: Timeline ---- */
  /* Timeline already has min-width:900px and the section has overflow-x:auto */
  /* Just reduce section padding and ensure smooth scroll */
  #timeline {
    padding: 48px 20px !important;
  }

  /* Team cards */
  .team-card {
    min-width: 100% !important;
    height: auto !important;
    min-height: 180px;
  }

  /* Team/Experts row with 180px label */
  [data-mobile-label-row] {
    flex-direction: column !important;
  }
  [data-mobile-label-row] > *:first-child {
    width: 100% !important;
    border-right: none !important;
    border-bottom: 1px solid #E0E0E0;
    padding: 12px 0 !important;
  }
  [data-mobile-label-row] > *:last-child {
    grid-template-columns: 1fr !important;
  }

  /* Phase blocks — make full width and stack */
  .phase-block {
    margin-left: 0 !important;
    width: 100% !important;
  }

  /* ---- CHANGE MANAGEMENT PAGE ---- */
  /* Thesis callout */
  [data-mobile-section] > div > [style*="border-left:4px"] {
    padding: 16px 20px !important;
  }

  /* ---- INSIGHTS PAGE ---- */
  /* Sidebar layout → vertical stack */
  .insights-layout {
    flex-direction: column !important;
  }
  .insights-nav {
    width: 100% !important;
    min-width: 100% !important;
    flex-direction: row !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    max-height: none !important;
    -webkit-overflow-scrolling: touch;
  }
  .insights-nav__title {
    display: none !important;
  }
  .insights-nav__item {
    flex-shrink: 0 !important;
    padding: 10px 14px !important;
    border-left: none !important;
    border-bottom: 3px solid transparent !important;
    white-space: nowrap !important;
    flex-direction: row !important;
    gap: 6px !important;
    align-items: center !important;
  }
  .insights-nav__item--active {
    border-bottom-color: var(--color-primary, #D31334) !important;
    border-left-color: transparent !important;
  }
  .insights-nav__label {
    display: none !important;
  }
  .insights-panel {
    width: 100% !important;
  }

  /* Prep hero stat row */
  .prep-stats-row {
    gap: 24px !important;
  }
  .prep-stat__value {
    font-size: 1.8rem !important;
  }

  /* Insight content charts — ensure they don't overflow */
  .insight-content__chart {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .chart-canvas-wrap {
    min-height: 200px !important;
  }

  /* Insight content titles & body */
  .insight-content__title {
    font-size: 1.3rem !important;
  }

  /* Store visit cards */
  .store-visit-card {
    flex-direction: column !important;
  }

  /* ---- DATA PAGE ---- */
  /* grid--2, grid--3, grid--4 from styles.css */
  .grid--2,
  .grid--3,
  .grid--4 {
    grid-template-columns: 1fr !important;
  }

  /* ---- SECTION GENERAL ---- */
  .section {
    padding: 3rem 0 !important;
  }

  .container {
    padding: 0 1rem !important;
  }

  .page-header {
    padding-top: calc(64px + 2rem) !important;
    padding-bottom: 2rem !important;
  }

  /* ---- ASSORTMENT & SURVEY: Iframe pages ---- */
  .dashboard-frame iframe,
  .survey-frame iframe {
    min-height: 500px !important;
    height: calc(100vh - 180px) !important;
  }

  /* ---- ASSORTMENT & SURVEY DASHBOARDS ---- */
  /* Sidebars already hidden at 768px in their own CSS */
  /* Chart grids should be 1 col */
  .chart-grid {
    grid-template-columns: 1fr !important;
  }
  .chart-grid-2col {
    grid-template-columns: 1fr !important;
  }
  /* Heatmap tables — horizontal scroll */
  .hm-table {
    display: block !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  /* NPS grid — 1 col on small phones */
  .nps-grid {
    grid-template-columns: 1fr !important;
  }
  /* Quote grid */
  .quote-grid {
    grid-template-columns: 1fr !important;
  }
  /* Venn controls */
  .venn-ctrl-group {
    min-width: 100% !important;
  }
  /* KPI row */
  .kpi-row {
    grid-template-columns: 1fr !important;
  }
  /* Global filter rows */
  .gf-row {
    flex-wrap: wrap !important;
  }

  /* ---- STORE MAP ---- */
  .map-inner {
    padding: 1rem 0.5rem !important;
  }
  .map-tabs {
    gap: 4px !important;
  }
  .map-tabs button {
    padding: 5px 10px !important;
    font-size: 11px !important;
  }

  /* ---- GATE PAGE ---- */
  .gate .card h1 {
    font-size: 1.4rem !important;
  }

  /* ---- CHART PAIR (from styles.css) ---- */
  .chart-pair {
    grid-template-columns: 1fr !important;
  }

  /* ---- GENERAL TYPOGRAPHY ADJUSTMENTS ---- */
  h1 {
    font-size: clamp(1.8rem, 8vw, 3rem) !important;
  }

  /* ---- BUTTONS — ensure tap targets ---- */
  .btn {
    padding: 0.75rem 1.5rem !important;
    min-height: 44px;
  }

  /* ---- IMAGES — prevent overflow ---- */
  img {
    max-width: 100% !important;
    height: auto;
  }
}

/* ==========================================================
   SMALL PHONE — 480px and below
   ========================================================== */
@media (max-width: 480px) {

  [data-mobile-section] {
    padding: 32px 16px !important;
  }

  [data-mobile-landing] > [data-mobile-text] {
    padding: 32px 16px 24px !important;
  }

  .context-flip .flip-inner {
    height: 160px !important;
  }

  .prep-stats-row {
    flex-direction: column !important;
    gap: 16px !important;
  }

  .insights-nav__item {
    padding: 8px 10px !important;
  }
  .insights-nav__num {
    font-size: 0.65rem !important;
  }

  /* Even smaller chart containers */
  .chart-canvas-wrap {
    min-height: 180px !important;
  }

  /* Team cards smaller */
  .team-card {
    min-height: 140px;
  }
}

/* ==========================================================
   MOBILE-ONLY COMPONENTS
   (Generated by mobile.js — these only appear on ≤768px)
   ========================================================== */

/* ---- Hide elements replaced on mobile ---- */
@media (max-width: 768px) {
  [data-mobile-hide] {
    display: none !important;
  }
}

/* ---- VERTICAL REVENUE TIMELINE ---- */
@media (max-width: 768px) {
  .mobile-rev-chart-wrap {
    margin-top: 16px;
  }
  .mobile-rev-vertical {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .mobile-rev-vertical__label {
    font-weight: 700;
    font-size: 14px;
    color: hsl(var(--foreground, 0 0% 0%));
    margin-bottom: 12px;
  }
  .mobile-rev-vertical__track {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 0 0;
    /* Vertical line behind everything */
    background: linear-gradient(hsl(var(--foreground, 0 0% 0%)), hsl(var(--foreground, 0 0% 0%))) center/3px 100% no-repeat;
  }
  .mobile-rev-vertical__pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    padding: 12px 8px;
    position: relative;
    z-index: 1;
  }
  .mobile-rev-vertical__pill {
    font-weight: 700;
    font-size: 11px;
    padding: 3px 12px;
    border-radius: 9999px;
    white-space: nowrap;
    background: #fff;
    border: 1px solid hsl(var(--border, 0 0% 87.8%));
    color: hsl(var(--foreground, 0 0% 0%));
  }
  .mobile-rev-vertical__pill--lulu {
    background: hsl(357 100% 44%);
    color: #fff;
    border-color: hsl(357 100% 44%);
  }
  .mobile-rev-vertical__marker {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    position: relative;
    z-index: 1;
    padding: 4px 0;
  }
  .mobile-rev-vertical__marker-line {
    flex: 1;
    height: 3px;
    background: hsl(357 100% 44%);
  }
  .mobile-rev-vertical__marker-label {
    font-weight: 700;
    font-size: 18px;
    color: hsl(357 100% 44%);
    flex-shrink: 0;
  }
  .mobile-rev-vertical__arrow {
    font-size: 16px;
    color: hsl(var(--foreground, 0 0% 0%));
    margin-top: 4px;
    position: relative;
    z-index: 1;
  }
}
@media (min-width: 769px) {
  .mobile-rev-chart-wrap {
    display: none !important;
  }
}

/* ---- HORIZON CHART — MOBILE FIXES ---- */
@media (max-width: 768px) {
  /* Horizon rows: stack label above arrows */
  .horizon-row {
    flex-direction: column !important;
  }
  .horizon-row > div:first-child {
    width: 100% !important;
    padding-right: 0 !important;
    margin-bottom: 8px;
  }
  .horizon-row > div:last-child {
    margin-right: 0 !important;
  }
  /* Impact text: remove left margins on mobile */
  .horizon-detail p {
    margin-left: 0 !important;
  }
  /* Plan/impact arrows: full width on mobile */
  .horizon-detail > div[style*="margin-left"] {
    margin-left: 0 !important;
    width: 100% !important;
  }
  .horizon-row > div:last-child > div:first-child {
    width: 100% !important;
    margin-left: 0 !important;
  }
}

/* ---- SIMPLIFIED MOBILE TIMELINE ---- */
@media (max-width: 768px) {
  .mobile-timeline {
    margin-top: 24px;
  }
  .mobile-timeline__phase {
    position: relative;
    padding-left: 24px;
    border-left: 3px solid hsl(357 100% 44%);
    margin-bottom: 0;
    padding-bottom: 24px;
  }
  .mobile-timeline__phase:last-of-type {
    border-left-color: transparent;
  }
  .mobile-timeline__header {
    margin-bottom: 12px;
  }
  .mobile-timeline__weeks {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: hsl(357 100% 44%);
    margin-bottom: 4px;
  }
  .mobile-timeline__name {
    font-size: 18px;
    font-weight: 700;
    color: #000;
  }
  .mobile-timeline__items {
    list-style: none;
    padding: 0;
    margin: 0;
  }
  .mobile-timeline__items li {
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    padding: 4px 0;
    padding-left: 16px;
    position: relative;
  }
  .mobile-timeline__items li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: hsl(357 100% 44%);
    font-weight: 700;
  }
  .mobile-timeline__connector {
    display: none;
  }
  .mobile-timeline__steercos {
    margin-top: 24px;
    padding: 16px;
    background: #f8f8f8;
    border-radius: 8px;
  }
}
@media (min-width: 769px) {
  .mobile-timeline,
  .mobile-timeline__steercos {
    display: none !important;
  }
}

/* ---- BIO MODAL — MOBILE FIXES ---- */
@media (max-width: 768px) {
  #bio-overlay {
    align-items: flex-end !important;
    padding: 0 !important;
  }
  #bio-card {
    flex-direction: column !important;
    max-height: 85vh !important;
    min-height: auto !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    border-radius: 16px 16px 0 0 !important;
    margin: 0 !important;
    width: 100% !important;
    position: relative;
  }
  #bio-photo {
    width: 100% !important;
    height: 250px !important;
    flex-shrink: 0 !important;
  }
  #bio-photo img {
    height: 100% !important;
    object-fit: cover !important;
  }
  #bio-card > div:nth-child(2) {
    width: 100% !important;
    padding: 24px 20px 32px !important;
  }
  #bio-name {
    font-size: 24px !important;
  }
  #bio-text {
    font-size: 14px !important;
    line-height: 1.7 !important;
  }

  /* X close button */
  .mobile-bio-close {
    position: absolute !important;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.5);
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    z-index: 110;
    line-height: 1;
    padding: 0;
  }
  .mobile-bio-close:active {
    background: rgba(0,0,0,0.7);
  }
}

/* Hide X button on desktop */
@media (min-width: 769px) {
  .mobile-bio-close {
    display: none !important;
  }
}
