/* Mobile Fixes CSS for ScrapMetalBuyers.com — July 2026 v4 */
/* Complete mobile overhaul: clean, modern, fast UX */

/* ===== CRITICAL FIX: Override inline style that hides nav on mobile ===== */
@media (max-width: 768px) {
  nav#smb-nav, nav {
    display: flex !important;
  }
}

@media (max-width: 900px) {
  /* === HAMBURGER BUTTON === */
  #smb-hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    background: transparent;
    border: 2px solid #00ff41;
    border-radius: 8px;
    cursor: pointer;
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10001;
    padding: 0;
  }
  #smb-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: #00ff41;
    border-radius: 2px;
    transition: all 0.3s ease;
  }
  #smb-hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
  #smb-hamburger.open span:nth-child(2) { opacity: 0; }
  #smb-hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

  /* === HIDE DESKTOP NAV LINKS === */
  .smb-nav-links { display: none !important; }

  /* === NAV BAR === */
  #smb-nav {
    position: relative;
    display: flex !important;
    height: 56px !important;
    padding: 0 16px !important;
  }

  /* === MOBILE MENU OVERLAY === */
  #smb-mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #0a0a0a;
    z-index: 99999;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0;
  }
  #smb-mobile-menu.active {
    display: block;
  }

  /* Menu Header */
  .smb-mm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #222;
    position: sticky;
    top: 0;
    background: #0a0a0a;
    z-index: 1;
  }
  .smb-mm-title {
    color: #00ff41;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 1px;
  }
  #smb-mm-close {
    background: none;
    border: 2px solid #333;
    color: #fff;
    font-size: 28px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
  }

  /* CTA buttons at top of menu */
  .smb-mm-cta {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .smb-mm-phone {
    display: block;
    background: #ffd700;
    color: #000;
    text-align: center;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
  }
  .smb-mm-ai {
    display: block;
    background: #00ff41;
    color: #000;
    text-align: center;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
  }

  /* Sections */
  .smb-mm-section {
    padding: 16px 20px;
    border-top: 1px solid #1a1a1a;
  }
  .smb-mm-label {
    color: #888;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 12px;
    font-weight: 600;
  }

  /* Category Grid */
  .smb-mm-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .smb-mm-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #111;
    border: 1px solid #222;
    border-radius: 10px;
    padding: 14px 12px;
    text-decoration: none;
    transition: border-color 0.2s;
  }
  .smb-mm-item:active {
    border-color: #00ff41;
    background: #0a1a0a;
  }
  .smb-mm-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
  }
  .smb-mm-name {
    color: #fff;
    font-size: 0.82rem;
    font-weight: 500;
    line-height: 1.2;
  }

  /* Resource links */
  .smb-mm-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .smb-mm-links a {
    display: block;
    color: #ccc;
    text-decoration: none;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: background 0.2s;
  }
  .smb-mm-links a:active {
    background: #111;
    color: #00ff41;
  }

  /* === HERO SECTION === */
  .hero {
    padding: 24px 16px 20px !important;
    text-align: center;
  }
  .hero h1 {
    font-size: 1.35rem !important;
    line-height: 1.3 !important;
    margin-bottom: 10px !important;
  }
  .hero p {
    font-size: 0.85rem !important;
    margin-bottom: 16px !important;
    line-height: 1.5 !important;
  }
  .hero .cta-btn,
  .hero a.cta-btn {
    display: block !important;
    width: 100% !important;
    margin: 6px 0 !important;
    text-align: center !important;
    padding: 13px 16px !important;
    font-size: 0.92rem !important;
    box-sizing: border-box !important;
  }

  /* === BIG AI BUTTON: Clean on mobile === */
  .hero div[style*="margin-top:28px"] {
    margin-top: 14px !important;
  }
  button[style*="padding:20px 44px"],
  button[style*="padding:16px 36px"] {
    padding: 13px 16px !important;
    font-size: 0.88rem !important;
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 8px !important;
  }

  /* Hide duplicate AI CTA button */
  div[style*="text-align:center"][style*="padding:18px 16px 8px"] {
    display: none !important;
  }

  /* === TRUST BAR === */
  .trust-bar {
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 4px 10px !important;
    padding: 10px 16px !important;
    font-size: 0.75rem !important;
  }

  /* === SECTIONS === */
  .section {
    padding: 22px 16px !important;
  }
  .section h2 {
    font-size: 1.15rem !important;
    padding-left: 10px !important;
    border-left-width: 3px !important;
    margin-bottom: 12px !important;
  }

  /* === CARD GRID === */
  .card-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  .card {
    padding: 14px !important;
  }
  .card h4 {
    font-size: 0.95rem !important;
  }
  .card p {
    font-size: 0.82rem !important;
  }

  /* === STAT BAR === */
  .stat-bar {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    flex-direction: unset !important;
    gap: 0 !important;
  }
  .stat-bar .stat {
    text-align: center !important;
    padding: 10px 6px !important;
    border-bottom: 1px solid #1a2a1a;
    border-right: 1px solid #1a2a1a;
  }
  .stat-bar .stat .num {
    font-size: 1rem !important;
  }
  .stat-bar .stat .label {
    font-size: 0.65rem !important;
  }

  /* === CALCULATOR === */
  #calc-widget {
    padding: 20px 16px !important;
  }
  .calc-grid,
  div[style*="grid-template-columns:1fr 1fr"][style*="gap:20px"] {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  /* === FORM SECTION === */
  .form-wrap {
    padding: 18px 16px !important;
    margin: 14px 0 !important;
    border-radius: 10px !important;
  }
  .form-wrap h3 {
    font-size: 1.05rem !important;
    margin-bottom: 14px !important;
  }
  .form-row {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  .form-wrap input,
  .form-wrap select,
  .form-wrap textarea {
    font-size: 16px !important; /* Prevents iOS zoom on focus */
    padding: 12px !important;
    border-radius: 6px !important;
  }
  .submit-btn {
    width: 100% !important;
    padding: 14px !important;
    font-size: 1rem !important;
    border-radius: 6px !important;
  }

  /* === CTA BOX === */
  .cta-box {
    padding: 22px 16px !important;
    margin: 20px 12px !important;
    border-radius: 10px !important;
  }
  .cta-box h2 {
    font-size: 1.1rem !important;
  }
  .cta-box .cta-btn {
    display: block !important;
    margin: 6px auto !important;
    width: 100% !important;
    max-width: 300px !important;
  }

  /* === FOOTER === */
  footer {
    padding: 18px 16px !important;
    text-align: center;
  }

  /* === HIDE NEHEMIAH BLOCKS ON MOBILE (clutter) === */
  footer > div[style*="background:#0d1a0d"],
  footer div[style*="background:#0d1a0d"] {
    display: none !important;
  }

  /* === IMAGES === */
  .section img, .product-image img, img[loading="lazy"] {
    max-height: 180px !important;
    width: auto !important;
    max-width: 100% !important;
    object-fit: contain !important;
  }

  /* === TABLES === */
  table, .data-table {
    display: block !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    font-size: 0.8rem !important;
  }

  /* === FAQ === */
  .faq-item {
    margin-bottom: 6px !important;
  }
  .faq-q {
    padding: 12px 14px !important;
    font-size: 0.88rem !important;
  }
  .faq-a {
    padding: 10px 14px !important;
    font-size: 0.82rem !important;
  }

  /* === PRICE GRID === */
  div[style*="grid-template-columns:1fr 1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  /* === CITY LINKS === */
  .city-links {
    gap: 5px !important;
  }
  .city-links a {
    font-size: 0.72rem !important;
    padding: 3px 7px !important;
  }

  /* === HIDE CHAT BUBBLE TEXT === */
  #uai-bubble span {
    display: none !important;
  }

  /* === STICKY BOTTOM CTA BAR === */
  #smb-mobile-cta-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #0a0a0a;
    border-top: 2px solid #00ff41;
    display: flex;
    z-index: 9998;
    padding: 8px 10px;
    gap: 8px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.8);
  }
  #smb-mobile-cta-bar a {
    flex: 1;
    text-align: center;
    padding: 12px 6px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.8rem;
    text-decoration: none;
    white-space: nowrap;
  }
  #smb-mobile-cta-bar .smb-cta-call {
    background: #00ff41;
    color: #000;
  }
  #smb-mobile-cta-bar .smb-cta-quote {
    background: #ffd700;
    color: #000;
  }

  /* Add bottom padding to body so content isn't hidden behind sticky bar */
  body {
    padding-bottom: 68px !important;
  }
}

/* Desktop: hide hamburger, mobile menu, and mobile CTA bar */
@media (min-width: 901px) {
  #smb-hamburger { display: none !important; }
  #smb-mobile-menu { display: none !important; }
  #smb-mobile-cta-bar { display: none !important; }
}
