/* ═══ Bikeley Provider Mobile Optimization ═══ */
/* Include via bikeley-upgrade.css or base.php */

/* ── Global Provider Mobile ── */
@media (max-width: 768px) {
  .provider-content { margin-top: 8px; }
  .provider-content .card { border-radius: 12px; padding: 14px; }
  
  /* All page titles */
  .pe__title, .inb__title, .pma__title, .svc__title, .nws__title,
  .db__title, .page-header__title, h1 { font-size: 20px !important; }

  /* All page headers: stack vertically */
  .pe__head, .inb__head, .pma__header, .svc__head, .nws__head,
  .db__header { 
    flex-direction: column; 
    align-items: stretch !important; 
    gap: 10px !important; 
  }

  /* Full-width buttons on mobile */
  .pe__preview, .svc__add-btn, .nws__add-btn, .pma__header .btn-primary {
    text-align: center;
    display: block;
  }

  /* Tabs: scrollable, smaller */
  .pe__tabs, .inb__tabs, .svc__tabs, .nws__tabs {
    gap: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .pe__tabs::-webkit-scrollbar, .inb__tabs::-webkit-scrollbar,
  .svc__tabs::-webkit-scrollbar { display: none; }
  .pe__tab, .inb__tab, .svc__tab {
    padding: 10px 14px;
    font-size: 14px;
    flex-shrink: 0;
  }

  /* Grids: single column */
  .pe__grid, .nws__grid, .svc__form-grid {
    grid-template-columns: 1fr !important;
  }
  .pe__f--wide, .svc__f--wide, .nws__f--full, .svc__f--full {
    grid-column: 1 !important;
  }

  /* Form inputs: slightly bigger touch targets */
  .pe__f input, .pe__f textarea, .pe__f select,
  .svc__f input, .svc__f textarea, .svc__f select,
  .nws__f input, .nws__f textarea, .nws__f select {
    padding: 12px 14px;
    font-size: 16px; /* prevents iOS zoom */
  }
}

/* ── Anfragen Mobile ── */
@media (max-width: 640px) {
  .inb__tabs { margin-bottom: 10px; }
  .inb__tab { padding: 10px 12px; font-size: 13px; }
  .inb__filters { flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
  .inb__pill { padding: 6px 12px; font-size: 13px; }

  .inb__row {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 8px;
    padding: 14px;
  }
  .inb__dot { position: absolute; top: 16px; right: 14px; }
  .inb__row { position: relative; }
  .inb__right { 
    display: flex; 
    gap: 8px; 
    align-items: center;
    width: 100%;
  }
  .inb__date { font-size: 12px; }
  .inb__badge { font-size: 11px; }
  .inb__name { font-size: 15px; }
  .inb__msg { white-space: normal; -webkit-line-clamp: 2; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
  .inb__bike-tag { font-size: 12px; }
}

/* ── Marktplatz Mobile ── */
@media (max-width: 768px) {
  .pma__toolbar {
    flex-direction: column;
    gap: 8px;
  }
  .pma__search {
    max-width: none !important;
    width: 100%;
  }
  .pma__toolbar-filters {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
  }
  .pma__toolbar-filters::-webkit-scrollbar { display: none; }
  .pma__pill { flex-shrink: 0; }

  .pma__bulk {
    flex-wrap: wrap;
    gap: 6px;
    font-size: 13px;
  }

  /* Table → card layout on mobile */
  .pma__thead { display: none; }
  .pma__row {
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px;
    border-bottom: 1px solid rgba(0,0,0,.04);
  }
  .pma__row-bike {
    flex: 1 1 100% !important;
    order: 1;
  }
  .pma__row-check {
    order: 0;
    position: absolute;
    top: 14px;
    right: 14px;
  }
  .pma__row { position: relative; padding-right: 48px; }
  .pma__row-cell {
    flex: 0 0 auto !important;
  }
  .pma__row-cell:nth-child(3) { order: 2; } /* status */
  .pma__row-cell:nth-child(4) { order: 3; } /* price */
  .pma__row-cell:nth-child(5) { order: 4; } /* stock */
  .pma__row-actions {
    order: 5;
    width: 100%;
    justify-content: flex-start !important;
    padding-top: 8px;
    border-top: 1px solid rgba(0,0,0,.04);
    margin-top: 4px;
    flex: 1 1 100% !important;
  }
  .pma__status { font-size: 11px; }
  .pma__row-price { font-size: 15px; }
  .pma__row-title { font-size: 14px; }
  .pma__row-img { width: 48px; height: 36px; }
}

/* ── Editor Mobile ── */
@media (max-width: 640px) {
  .pe__chips { gap: 6px; }
  .pe__chip { padding: 8px 14px; font-size: 14px; }
  .pe__chip--sm { padding: 6px 12px; font-size: 12px; }

  .pe__hday {
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 12px;
  }
  .pe__hday-name { width: 100%; font-size: 14px; }
  .pe__hday-times { margin-left: 0; width: 100%; }
  .pe__hday-times input { flex: 1; min-width: 0; }

  .pe__img-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .pe__img-card { border-radius: 8px; }
  .pe__img-actions { opacity: 1; } /* always show on mobile - no hover */
  .pe__img-upload { padding: 14px; }

  .pe__save-btn { width: 100%; text-align: center; }
}

/* ── Services Mobile ── */
@media (max-width: 640px) {
  .svc__item-main {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .svc__item-meta {
    width: 100%;
  }
  .svc__item-actions {
    width: 100%;
    display: flex;
    gap: 6px;
  }
  .svc__item-title { font-size: 15px; }
  .svc__item-desc { white-space: normal; }
  .svc__add-more { font-size: 13px; padding: 10px; }
  .svc__create { padding: 14px; }
}

/* ── Updates/News Mobile ── */
@media (max-width: 640px) {
  .nws__item-main {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .nws__item-right {
    width: 100%;
    display: flex;
    gap: 6px;
  }
  .nws__item-actions {
    position: absolute;
    top: 14px;
    right: 14px;
  }
  .nws__item { position: relative; }
  .nws__item-title { font-size: 15px; padding-right: 40px; }
  .nws__item-body { white-space: normal; }
  .nws__form-wrap { padding: 14px; }
  .nws__save-btn { width: 100%; text-align: center; }
}

/* ── Dashboard Mobile ── */
@media (max-width: 640px) {
  .db__status-bar {
    flex-direction: column;
    gap: 4px;
  }
  .db__status-item {
    min-width: auto !important;
    width: 100%;
  }
  .db__quick-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px;
  }
  .db__manage-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px;
  }
  .db__quick-card, .db__manage-link {
    padding: 14px 12px !important;
    font-size: 13px !important;
  }
  .db__quick-card svg { width: 18px; height: 18px; }
}

/* ── Prevent iOS zoom on inputs ── */
@media (max-width: 768px) {
  input[type="text"], input[type="email"], input[type="tel"],
  input[type="url"], input[type="number"], input[type="search"],
  input[type="password"], textarea, select {
    font-size: 16px !important;
  }
}

/* ── Topbar mobile refinements ── */
@media (max-width: 768px) {
  .provider-topbar {
    padding: 10px 14px;
  }
  .provider-topbar__title {
    font-size: 16px;
    font-weight: 600;
  }
  .provider-topbar__actions .btn {
    padding: 6px 12px;
    font-size: 13px;
  }
}
