/* ==========================================================================
   patch-mobile-client.css — Fix-uri UI/UX mobil · Zona Client · MyClubCar
   Adăugat: 2026-03 · Nu modifică componente existente, doar extinde
   ========================================================================== */


/* ── B3: Topbar overflow pe mobil ≤480px ─────────────────────────────────── */
/*
   Problema: .tb-right = btn-notif + btn-new + tb-user (avatar+nume+caret)
   Suma depășește lățimea ecranului. Soluție: ascunde numele și caretul
   din user-menu, păstrează doar avatarul. btn-new-label deja ascuns în
   responsive.css dar btn-new rămâne lat. Reducem padding-ul și gap-ul.
*/
@media (max-width: 480px) {
  .tb-right {
    gap: 6px;
  }

  /* Ascunde numele utilizatorului din topbar — rămâne doar avatarul */
  .tb-user-n,
  .tb-user-caret {
    display: none;
  }

  /* Reduce padding avatar pentru a câștiga spațiu */
  .tb-user {
    padding: 4px;
    gap: 0;
  }

  /* btn-new: ascunde și iconița SVG pe lângă label, rămâne doar "+" */
  .btn-new {
    padding: 8px 12px;
    min-width: 0;
  }

  /* btn-notif: ușor mai compact */
  .btn-notif {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
  }
}

/* La 360px și sub, ascunde complet btn-new din topbar —
   clientul poate folosi butonul din card-head (există în dashboard) */
@media (max-width: 380px) {
  .topbar .btn-new {
    display: none;
  }
}


/* ── B4: Stats 3 elemente asimetric pe mobil ─────────────────────────────── */
/*
   Problema: 3 stats cu grid repeat(2,1fr) → 2+1 (ultimul jumătate lățime)
   Soluție: auto-fit cu minim rezonabil → se aranjează fluid.
   Pe ≤360px: o singură coloană pentru lizibilitate.
*/
@media (max-width: 600px) {
  .stats {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  }
}

@media (max-width: 360px) {
  .stats {
    grid-template-columns: 1fr;
  }
}


/* ── B5: Tabel Oferte & Comenzi — overflow orizontal pe mobil ────────────── */
/*
   Problema: coloanele ID, Configurație, Dată, Preț, Status, PDF
   nu încap pe ecran de 390px. Soluție: pe mobil ascundem coloana
   Configurație (întotdeauna „Ofertă") și comprimăm Preț (no-wrap).
   Wrapper overflow-x:auto există deja — fix doar coloane și font.
*/
@media (max-width: 600px) {
  /* Ascunde coloana Configurație din tabel oferte client */
  .qt th:nth-child(2),
  .qt td:nth-child(2) {
    display: none;
  }

  /* Prețul: nu rupe pe linie nouă */
  .qt td:nth-child(4) {
    white-space: nowrap;
    font-size: .75rem;
  }

  /* ID Ofertă mai compact */
  .qt td:nth-child(1),
  .qt th:nth-child(1) {
    font-size: .75rem;
    padding-left: 12px;
  }

  /* Buton PDF mai mic */
  .qt td:last-child a,
  .qt td:last-child .btn {
    font-size: .65rem;
    padding: 3px 7px;
  }
}

@media (max-width: 420px) {
  /* La ecrane foarte mici: ascunde și data */
  .qt th:nth-child(3),
  .qt td:nth-child(3) {
    display: none;
  }
}


/* ── B6: Catalog public — overflow orizontal la scroll ──────────────────── */
/*
   Problema: .pub-main sau containerul interior debordează pe orizontală
   la scroll, heading-ul și textul ies din viewport.
   Soluție: overflow-x:hidden pe body + containere publice.
*/
body {
  overflow-x: hidden;
}

.pub-main {
  overflow-x: hidden;
}

/* Titlul catalog public să nu depășească viewport */
@media (max-width: 600px) {
  .cat-hero-title,
  .pub-hero h1 {
    font-size: clamp(1.6rem, 7vw, 2.4rem);
    word-break: break-word;
  }

  .pub-main .container,
  .pub-main > * {
    max-width: 100%;
    overflow-x: hidden;
  }
}


/* ── acc-grid: tab-nav lateral → top pe mobil ────────────────────────────── */
/*
   Problema: .acc-grid = 220px sidebar + 1fr content. Pe mobil,
   sidebar-ul ocupă toată lățimea și impinge conținutul jos,
   dar rămâne sticky și blochează scroll-ul.
   Soluție: stivuire verticală sub 768px, sticky dezactivat.
*/
@media (max-width: 768px) {
  .acc-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .tab-nav {
    position: static; /* dezactivare sticky pe mobil */
  }

  /* Tab-nav orizontal scroll pe mobil */
  .tab-nav {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    border-radius: var(--r2);
  }

  /* Ascunde heading-ul tab-nav pe mobil (spațiu prețios) */
  .tab-nav-head {
    display: none;
  }

  /* Tab-uri orizontale */
  .tab-a {
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    border-left: none;
    border-bottom: 2.5px solid transparent;
    flex-shrink: 0;
    font-size: .72rem;
    text-align: center;
    border-right: 1px solid var(--border);
  }

  .tab-a:last-child {
    border-right: none;
    border-bottom: 2.5px solid transparent;
  }

  .tab-a.on {
    border-left-color: transparent;
    border-bottom-color: var(--brand);
    background: var(--brand-light);
  }

  /* Ascunde subtitlul EN în tab pe mobil */
  .tab-a-en {
    display: none;
  }

  .tab-a-ico {
    width: 28px;
    height: 28px;
  }
}


/* ── form-row cols-2 / cols-3: o coloană pe mobil ───────────────────────── */
/*
   Deja există în responsive.css pentru .form-grid-2 etc.
   Adăugăm și pentru .form-row.cols-2 / .cols-3 folosite în account.view.php
*/
@media (max-width: 600px) {
  .form-row.cols-2,
  .form-row.cols-3 {
    grid-template-columns: 1fr;
  }
}


/* ── cfg-row: layout card configurație pe mobil ─────────────────────────── */
/*
   Problema (SS1, SS11): .cfg-row = thumb + info + butoane (Editează + Ofertă)
   Pe mobil mic butoanele ies din rând sau se suprapun.
*/
@media (max-width: 520px) {
  .cfg-acts {
    flex-direction: column;
    gap: 5px;
    align-items: flex-end;
  }

  .cfg-acts .btn {
    font-size: .7rem !important;
    padding: 5px 10px !important;
    width: 100%;
    text-align: center;
    justify-content: center;
  }
}


/* ── side-item cu butoane: wrap pe mobil ─────────────────────────────────── */
/*
   SS 12 (Date facturare): .side-item cu Editează + Șterge → overflow pe mobil
*/
@media (max-width: 520px) {
  /* side-item în taburi billing/addresses */
  .card .side-item {
    flex-wrap: wrap;
    gap: 8px;
  }

  .card .side-item > div:last-child {
    width: 100%;
    justify-content: flex-end;
  }
}
