/* =============================================================
   SALOTT-IT — Mobile / Tablet polish (LOT 8.2)
   Loaded after style.css — defensive overrides only.
   ============================================================= */

/* Skip-link (a11y WCAG 2.4.1) — invisible jusqu'au focus clavier */
.skip-link {
  position: absolute;
  top: -40px;
  left: 8px;
  background: var(--primary, #0b2559);
  color: #fff;
  padding: 8px 16px;
  border-radius: 0 0 8px 8px;
  text-decoration: none;
  font-weight: 600;
  z-index: 10000;
  transition: top 0.2s;
}
.skip-link:focus { top: 0; outline: 2px solid var(--accent, #FF6B35); }

/* Global overflow guard (prevents 1px-element horizontal scroll bugs) */
html, body { overflow-x: hidden; }
img, video, iframe, embed, object {
  max-width: 100%;
  height: auto;
}

/* Smooth tap on iOS, no double-tap zoom delay */
html { -webkit-text-size-adjust: 100%; }
body { touch-action: manipulation; }

/* Safe-area for iOS notch (iPhone X+) */
.topbar, .navbar, .footer-bottom {
  padding-left: max(env(safe-area-inset-left, 0px), 0.75rem);
  padding-right: max(env(safe-area-inset-right, 0px), 0.75rem);
}

/* Visible keyboard focus (a11y) — does not affect mouse :focus */
:focus-visible {
  outline: 2px solid var(--accent, #FF6B35);
  outline-offset: 2px;
  border-radius: 4px;
}
button:focus:not(:focus-visible),
a:focus:not(:focus-visible),
input:focus:not(:focus-visible) { outline: none; }

/* ---------- TABLET & MOBILE (≤ 992px) ---------- */
@media (max-width: 992px) {

  /* Inputs: 16px minimum prevents iOS Safari zoom-on-focus */
  input[type="text"], input[type="email"], input[type="password"],
  input[type="tel"], input[type="number"], input[type="search"],
  input[type="url"], input[type="date"], textarea, select,
  .form-control {
    font-size: 16px !important;
    min-height: 44px;
  }
  textarea.form-control { min-height: 88px; }

  /* Tap targets ≥ 44×44px (WCAG 2.5.5 / Apple HIG) */
  .btn, button, .nav-link, .dropdown-item,
  .topbar a, .footer a, .pagination a, .pagination .page-item,
  .btn-cart, .btn-account, .hamburger {
    min-height: 44px;
    min-width: 44px;
  }
  .btn, button {
    padding-left: max(0.75rem, 14px);
    padding-right: max(0.75rem, 14px);
  }

  /* Topbar: avoid cramped 12px text */
  .topbar { font-size: 0.82rem; }
  .topbar-inner { gap: 0.5rem; flex-wrap: wrap; }

  /* Tables that overflow → horizontal scroll wrapper hint */
  .table-responsive,
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ---------- NAVBAR ACTIONS: garantit que le hamburger reste visible ---------- */
@media (max-width: 992px) {
  .navbar-inner { gap: 8px; }
  .navbar-actions { gap: 4px; flex-shrink: 0; }
  .navbar-actions .btn-cart,
  .navbar-actions .btn-account,
  .navbar-actions .hamburger { padding: 8px; }
  .hamburger { display: flex !important; }
}
@media (max-width: 480px) {
  .btn-account span { display: none !important; }
  .btn-account { padding: 8px !important; }
  .navbar-brand .logo-svg { height: 32px; }
  .user-dropdown .dd-arrow { display: none; }
}

/* ---------- MOBILE PORTRAIT (≤ 600px) ---------- */
@media (max-width: 600px) {
  .topbar-left span:first-child { /* hide email, keep phone */
    display: none;
  }
  .topbar-right a span,
  .topbar-right a:not(:last-child):not([data-tour-launch]) {
    /* keep icons + tour link, hide redundant labels */
  }

  /* Footer: collapse very dense columns */
  .footer-grid { gap: 1.5rem !important; }
  .footer-grid h4 { margin-bottom: 0.5rem; }

  /* Hero / sections: tighter side padding */
  .container, .navbar-inner, .topbar-inner { padding-left: 12px; padding-right: 12px; }

  /* Modals: full-width minus 12px on small screens */
  .modal-dialog, .modal-content { max-width: calc(100vw - 24px); }

  /* Ensure CTAs are thumb-reachable */
  .btn-lg { min-height: 48px; padding-top: 12px; padding-bottom: 12px; }
}

/* ---------- LANDSCAPE PHONE (short height) ---------- */
@media (max-height: 480px) and (orientation: landscape) {
  .hero { min-height: auto; padding: 1.5rem 0; }
  .topbar { display: none; } /* gain vertical space */
}

/* ---------- DARK MODE PREP (system preference, no toggle yet) ---------- */
@media (prefers-color-scheme: dark) {
  /* Placeholder — explicit opt-in via .dark class only, no auto-switch */
}

/* ---------- PWA install banner ---------- */
.pwa-install-banner {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%) translateY(120%);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(11, 37, 89, 0.18);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(420px, calc(100vw - 24px));
  z-index: 1040;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  font-family: var(--font, system-ui, sans-serif);
}
.pwa-install-banner.is-visible { transform: translateX(-50%) translateY(0); }
.pwa-install-banner__icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary, #0b2559), var(--accent, #FF6B35));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
}
.pwa-install-banner__text { flex: 1; min-width: 0; line-height: 1.3; }
.pwa-install-banner__text strong { display: block; font-size: 0.9rem; color: var(--dark, #1a1a2e); }
.pwa-install-banner__text span { display: block; font-size: 0.78rem; color: var(--gray, #6c757d); }
.pwa-install-banner__actions { display: flex; gap: 6px; flex-shrink: 0; }
.pwa-install-banner button {
  border: 0; cursor: pointer; padding: 8px 12px; border-radius: 8px;
  font-size: 0.82rem; font-weight: 600; font-family: inherit;
}
.pwa-install-banner__skip { background: transparent; color: var(--gray, #6c757d); }
.pwa-install-banner__cta { background: var(--accent, #FF6B35); color: #fff; }
.pwa-install-banner__cta:hover { background: var(--accent-dark, #e55a2b); }

/* ---------- PRINT polish ---------- */
@media print {
  .topbar, .navbar, .hamburger, .mobile-menu,
  .tour-overlay, .tour-spotlight, .tour-popover, .tour-relaunch,
  .footer, [data-tour-launch] { display: none !important; }
  body { background: #fff; color: #000; }
}
