
/* =========================================================================
   RESPONSIVE LAYER
   Loaded AFTER the page's main stylesheet. Phones first: most visitors use
   them. Sections: 1 global safety, 2 forms + taps, 3 tables become cards,
   4 shared helpers (chart box, pagination).
   ========================================================================= */

/* ---- 1. Global safety: nothing may push the page wider than the screen ---- */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { overflow-x: hidden; overflow-x: clip; }
img, video, canvas, iframe, svg { max-width: 100%; }
.chart-box { position: relative; width: 100%; height: 320px; }
.chart-box canvas { display: block; }

/* ---- 2. Forms and tap targets ---- */
@media (max-width: 900px) {
  /* 16px stops iPhones zooming the page when a field is focused */
  input, select, textarea { font-size: 16px !important; }
  .btn { min-height: 44px; }
  .btn.btn-sm, .btn-sm { min-height: 40px; }
}
@media (max-width: 700px) {
  .field-row, .form-row, .two-col { grid-template-columns: 1fr !important; }
  .btn-block { width: 100%; }
  .tbl-toolbar input, .tbl-search { width: 100%; }
  .tbl-pager { justify-content: center; text-align: center; }
  .tbl-pages { justify-content: center; }
}

/* ---- 3. Tables: on phones every row becomes a card (labels are added by responsive.js) ---- */
@media (max-width: 700px) {
  .table-scroll { overflow: visible; }
  .table-scroll .table { min-width: 0; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table thead { display: none; }
  .table tr {
    background: var(--white, #fff); border: 1px solid var(--line, #E3E9F2); border-radius: 14px;
    padding: 4px 14px; margin-bottom: 12px; box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  }
  .table tr:last-child td { border-bottom: 1px dashed var(--line, #E3E9F2); }
  .table td {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    padding: 10px 0; border: 0; border-bottom: 1px dashed var(--line, #E3E9F2);
    text-align: right; overflow-wrap: anywhere;
  }
  .table td:last-child, .table tr:last-child td:last-child { border-bottom: 0; }
  .table td[data-label]::before {
    content: attr(data-label); flex: none; max-width: 42%; text-align: left;
    font-size: .76rem; font-weight: 700; letter-spacing: .02em; color: var(--muted, #5C6E85);
  }
  /* rows with no label (loading / empty messages) read as plain text */
  .table td:not([data-label]) { display: block; text-align: left; }
  .table tr:has(td:not([data-label])) { border-style: dashed; box-shadow: none; }
}

/* =========================================================================
   STORE SITES (store.css): grids and the customer dashboard
   ========================================================================= */
@media (max-width: 860px) {
  .feature-grid, .service-grid, .steps { grid-template-columns: 1fr; gap: 22px; }
  .site-footer-big .footer-grid { grid-template-columns: 1fr 1fr; gap: 26px; }
  .grid-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}
@media (max-width: 560px) {
  .site-footer-big .footer-grid { grid-template-columns: 1fr; }
  .stat-cards { grid-template-columns: 1fr 1fr; }
  .stat-card { padding: 14px; }
  .summary-row { flex-wrap: wrap; gap: 4px 12px; }
}
@media (max-width: 360px) {
  .stat-cards, .grid-tiles { grid-template-columns: 1fr; }
}

/* =========================================================================
   PHONE TWEAKS for the store pages
   ========================================================================= */
@media (max-width: 700px) {
  .section { padding: 56px 0; }
  .hero { padding: 56px 0 56px; }
  .auth-card, .auth-box { padding: 26px 20px; }
}
@media (max-width: 560px) {
  .hero h1 { font-size: clamp(1.9rem, 8.4vw, 2.4rem); max-width: none; }
  .hero-float-card { left: 8px; bottom: -14px; max-width: 200px; padding: 10px 14px; }
  .hero-badge-top { right: 8px; }
  .hero-ctas .btn { flex: 1 1 100%; justify-content: center; }
  .trust-row { gap: 14px 22px; margin-top: 30px; padding-top: 22px; }
}
