/* DigiSoko Kenya - Mobile Layout Fixes */

/* Prevent horizontal scrolling of the whole page */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

/* Top bar - make it cleaner on mobile */
@media (max-width: 640px) {
  .top-bar .max-w-7xl {
    flex-wrap: wrap;
    gap: 0.35rem !important;
    padding-top: 0.4rem !important;
    padding-bottom: 0.4rem !important;
  }
  .top-bar a {
    font-size: 0.7rem !important;
  }
}

/* Category navigation - force horizontal scroll instead of wrapping */
@media (max-width: 1023px) {
  nav .overflow-x-auto {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    gap: 1rem !important;
    padding-bottom: 0.5rem;
  }
  nav .overflow-x-auto a {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
  }
}

/* Flash news / deals ticker - stop text cut-off */
@media (max-width: 768px) {
  .flash-news,
  .km-flash,
  [class*="flash"] {
    font-size: 0.75rem !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* Hero section buttons - better spacing on mobile */
@media (max-width: 640px) {
  .hero-actions,
  .hero-btns {
    flex-direction: column !important;
    gap: 0.75rem !important;
  }
  .hero-actions a,
  .hero-btns a {
    width: 100% !important;
    text-align: center;
  }
}

/* General text overflow protection */
@media (max-width: 640px) {
  h1, h2, h3 {
    word-break: break-word;
    line-height: 1.25 !important;
  }
  .truncate {
    max-width: 100%;
  }
}