/* Crispy Crust Enterprise Marketing Mobile Adapter */
/* Viewport <= 768px Strict Zero-Horizontal-Overflow standard (scrollWidth <= 390px) */

@media (max-width: 768px) {
  :root {
    --header-height: 50px;
  }

  body {
    width: 100vw;
    max-width: 100vw;
    overflow-x: hidden !important;
  }

  .mkt-navbar {
    padding: 0 10px;
    height: var(--header-height);
  }

  .brand-logo {
    height: 28px;
  }

  .facility-badge-locked span {
    display: none;
  }

  .facility-badge-locked {
    padding: 4px;
    border-radius: 50%;
  }

  /* Hide Desktop Horizontal Navigation */
  .desktop-nav-tabs {
    display: none !important;
  }

  /* Show Mobile Screen Switcher */
  .mobile-screens-dropdown-wrap {
    display: inline-flex !important;
    position: relative;
  }

  .mobile-screens-trigger {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 32px;
    padding: 0 10px;
    background: rgba(13, 148, 136, 0.15);
    border: 1px solid rgba(13, 148, 136, 0.4);
    border-radius: 6px;
    color: #2dd4bf;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
  }

  .mobile-screens-popover {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: 165px;
    background: #0f172a;
    border: 1px solid rgba(51, 65, 85, 0.95);
    border-radius: 10px;
    padding: 6px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.8);
    z-index: 99999;
    display: none;
    flex-direction: column;
    gap: 2px;
  }

  .mobile-screens-popover.show {
    display: flex;
  }

  .mobile-screen-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: #cbd5e1;
    font-size: 12px;
    font-weight: 700;
    text-align: right;
    width: 100%;
    cursor: pointer;
    font-family: inherit;
  }

  .mobile-screen-item.active {
    background: rgba(13, 148, 136, 0.2);
    color: #2dd4bf;
  }

  /* Compact Header Status Panel */
  .header-status-panel {
    gap: 6px;
  }

  .status-capsule {
    display: none;
  }

  .user-profile-btn {
    width: 30px;
    height: 30px;
  }

  /* Main Container on Mobile */
  .main-view-container {
    padding: 10px 8px;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  /* Mobile KPI Grid: 2 columns */
  .kpi-metrics-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    margin-bottom: 12px !important;
  }

  .kpi-card {
    padding: 8px 10px !important;
  }

  .kpi-label {
    font-size: 10px;
  }

  .kpi-value {
    font-size: 15px;
  }

  .kpi-subtext {
    font-size: 9px;
  }

  .kpi-icon-box {
    width: 28px;
    height: 28px;
  }

  .kpi-icon-box svg {
    width: 14px;
    height: 14px;
  }

  /* Workflow & Card Grids */
  .workflow-builder-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .social-stream-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .app-card {
    padding: 12px 10px !important;
    border-radius: 8px !important;
  }

  .card-header-bar {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 8px !important;
  }

  .odoo-stepper {
    width: 100%;
    justify-content: space-between;
  }

  .stepper-step {
    padding: 4px 6px;
    font-size: 9.5px;
    flex: 1;
    justify-content: center;
  }

  /* Form and Button Layouts */
  .form-row-2col,
  .form-row-3col {
    display: flex;
    flex-direction: column !important;
    gap: 8px !important;
  }

  .btn {
    width: 100%;
    justify-content: center;
    box-sizing: border-box;
  }

  .btn-group-mobile-stack {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
  }

  .btn-group-mobile-stack .btn {
    width: 100%;
  }

  /* Data Table Mobile Wrapper */
  .data-table-wrap {
    max-width: calc(100vw - 16px);
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .data-table th,
  .data-table td {
    padding: 6px 8px !important;
    font-size: 11px !important;
  }

  /* SMS Phone Mockup */
  .sms-preview-phone {
    width: 100% !important;
    max-width: 280px !important;
    box-sizing: border-box;
  }

  /* Email Preview Container */
  .email-preview-container {
    width: 100% !important;
    padding: 10px !important;
    box-sizing: border-box;
  }

  /* Modal responsive */
  .modal-card {
    width: 95% !important;
    max-width: 95% !important;
    margin: 10px auto;
  }
}

