/* Place du Rhin — Étape 9.9 Design / mobile / confort utilisateur */
/* Couche visuelle additionnelle, sans casser les fonctions existantes. */

:root {
  --pdr-radius-sm: 12px;
  --pdr-radius-md: 18px;
  --pdr-radius-lg: 26px;
  --pdr-shadow-soft: 0 12px 32px rgba(24, 47, 74, .08);
  --pdr-shadow-hover: 0 18px 44px rgba(24, 47, 74, .13);
  --pdr-border: rgba(14, 116, 144, .14);
  --pdr-border-strong: rgba(14, 116, 144, .24);
  --pdr-bg-soft: #f7fbfb;
  --pdr-text: #10142f;
  --pdr-text-soft: #60708a;
  --pdr-blue: #31557f;
  --pdr-green: #5aa05a;
}

html {
  scroll-behavior: smooth;
}

body {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img,
video,
canvas,
svg {
  max-width: 100%;
}

.container,
.header-inner {
  width: min(1180px, calc(100% - 32px));
}

.site-header {
  backdrop-filter: blur(16px);
  background: rgba(255,255,255,.86);
  border-bottom: 1px solid rgba(14,116,144,.10);
}

.header-inner {
  gap: 16px;
}

.logo {
  white-space: nowrap;
}

.nav {
  gap: 4px;
}

.nav a {
  border-radius: 999px;
  padding: 9px 12px;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}

.nav a:hover {
  background: #eefbfc;
  transform: translateY(-1px);
}

.header-actions {
  gap: 8px;
}

.btn,
button.btn,
a.btn {
  border-radius: 999px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  line-height: 1.1;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}

.btn:hover,
button.btn:hover,
a.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  box-shadow: 0 10px 24px rgba(49, 85, 127, .18);
}

.btn-primary:hover {
  box-shadow: 0 14px 32px rgba(49, 85, 127, .24);
}

.btn-outline {
  background: rgba(255,255,255,.76);
}

.field,
input,
select,
textarea {
  border-radius: 16px;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.field:focus,
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(49, 85, 127, .42);
  box-shadow: 0 0 0 4px rgba(49, 85, 127, .09);
  background: #fff;
}

.page-panel,
.card,
.auth-card,
.search-card,
.mod-card,
.trust-card,
.category-dynamic-card,
.home-listing-card,
.listing-card,
.seller-card,
.profile-card,
.admin-card {
  border-color: var(--pdr-border);
  box-shadow: var(--pdr-shadow-soft);
}

.page-panel,
.auth-card,
.search-card {
  border-radius: var(--pdr-radius-lg);
}

.card,
.mod-card,
.trust-card,
.category-dynamic-card,
.home-listing-card,
.listing-card,
.seller-card,
.profile-card,
.admin-card {
  border-radius: var(--pdr-radius-md);
}

.home-listing-card,
.listing-card,
.category-dynamic-card,
.mod-card,
.trust-card {
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.home-listing-card:hover,
.listing-card:hover,
.category-dynamic-card:hover,
.mod-card:hover,
.trust-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--pdr-shadow-hover);
  border-color: var(--pdr-border-strong);
}

.badge,
.mod-badge {
  border-radius: 999px;
  font-weight: 900;
  letter-spacing: -.01em;
}

.page-hero {
  overflow: hidden;
}

.page-hero h1,
.hero-dynamic h1,
.home-section-head h2 {
  text-wrap: balance;
}

.page-hero p,
.hero-dynamic p,
.home-section-head p {
  text-wrap: pretty;
}

.breadcrumb {
  overflow-wrap: anywhere;
}

.home-listing-thumb,
.listing-card img,
.listing-image,
.gallery-main img {
  background: linear-gradient(135deg, #edf7f7, #deefe7);
}

.home-listing-body h3,
.listing-card h3 {
  overflow-wrap: anywhere;
}

.home-listing-price,
.price,
.listing-price {
  font-variant-numeric: tabular-nums;
}

.auth-form,
.form-grid,
.form-grid-mod {
  gap: 12px;
}

.auth-form label {
  font-weight: 850;
}

.form-status,
.alert,
.notice {
  border-radius: 16px;
}

table {
  border-collapse: separate;
  border-spacing: 0;
}

table th,
table td {
  vertical-align: top;
}

.table-wrap,
.admin-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 18px;
}

.message-thread,
.messages-list,
.conversation-list {
  scrollbar-width: thin;
  scrollbar-color: rgba(49, 85, 127, .28) transparent;
}

.message-thread::-webkit-scrollbar,
.messages-list::-webkit-scrollbar,
.conversation-list::-webkit-scrollbar {
  width: 8px;
}

.message-thread::-webkit-scrollbar-thumb,
.messages-list::-webkit-scrollbar-thumb,
.conversation-list::-webkit-scrollbar-thumb {
  background: rgba(49, 85, 127, .24);
  border-radius: 999px;
}

.message-bubble {
  border-radius: 18px;
  line-height: 1.48;
}

.seller-profile-card,
.profile-card {
  overflow: hidden;
}

.avatar {
  flex-shrink: 0;
}

.lightbox,
.modal,
.dialog {
  backdrop-filter: blur(10px);
}

/* Petits écrans : le site devient confortable à utiliser au doigt. */
@media (max-width: 920px) {
  .site-header {
    position: sticky;
    top: 0;
    z-index: 50;
  }

  .header-inner {
    width: min(100% - 22px, 1180px);
    padding-block: 10px;
    flex-wrap: wrap;
  }

  .logo {
    font-size: .98rem;
  }

  .logo-mark {
    width: 34px;
    height: 34px;
  }

  .nav {
    order: 3;
    width: 100%;
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 6px 0 2px;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav a {
    flex: 0 0 auto;
    font-size: .9rem;
    padding: 9px 11px;
  }

  .header-actions {
    margin-left: auto;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .header-actions .btn,
  .header-actions a {
    min-height: 36px;
    padding: 8px 10px;
    font-size: .86rem;
  }

  .page-hero {
    padding-top: 34px;
    padding-bottom: 30px;
  }

  .page-hero h1 {
    font-size: clamp(2rem, 9vw, 3rem);
    line-height: 1;
  }

  .section {
    padding-block: 34px;
  }

  .page-panel,
  .auth-card,
  .search-card {
    padding: 18px;
  }

  .panel-header {
    gap: 10px;
    align-items: flex-start;
  }

  .panel-header .btn {
    width: auto;
  }

  .btn,
  button.btn,
  a.btn {
    min-height: 44px;
    padding-inline: 14px;
  }

  .field,
  input,
  select,
  textarea {
    min-height: 46px;
    font-size: 16px;
  }
}

@media (max-width: 720px) {
  .container,
  .header-inner {
    width: min(100% - 20px, 1180px);
  }

  .header-actions {
    width: 100%;
    justify-content: stretch;
  }

  .header-actions .btn,
  .header-actions a {
    flex: 1 1 auto;
  }

  .hero-dynamic {
    padding: 42px 0 34px !important;
    gap: 24px !important;
  }

  .hero-dynamic h1 {
    font-size: clamp(2.2rem, 12vw, 3.35rem) !important;
  }

  .hero-actions {
    display: grid !important;
    grid-template-columns: 1fr !important;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .hero-stats {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .hero-stat {
    padding: 14px !important;
  }

  .hero-stat strong {
    font-size: 1.35rem !important;
  }

  .home-section-head {
    flex-direction: column;
    align-items: stretch !important;
  }

  .home-section-head .btn {
    width: 100%;
  }

  .home-listings,
  .category-dynamic-grid,
  .trust-band,
  .admin-mod-layout,
  .form-grid,
  .form-grid-mod {
    grid-template-columns: 1fr !important;
  }

  .home-listing-thumb {
    height: 240px !important;
  }

  .home-listing-body {
    padding: 16px !important;
  }

  .home-listing-body h3 {
    font-size: 1.05rem !important;
  }

  .category-dynamic-card {
    display: grid;
    grid-template-columns: 58px 1fr;
    column-gap: 14px;
    align-items: center;
  }

  .category-icon {
    margin: 0 !important;
  }

  .category-dynamic-card span {
    grid-column: 2;
  }

  .mod-tabs {
    display: flex;
    overflow-x: auto;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .mod-tabs::-webkit-scrollbar {
    display: none;
  }

  .mod-tab {
    flex: 0 0 auto;
  }

  .mod-actions {
    display: grid !important;
    grid-template-columns: 1fr !important;
  }

  .mod-actions .btn,
  .mod-actions a {
    width: 100%;
  }

  .auth-form .btn,
  form .btn[type="submit"] {
    width: 100%;
  }

  .listing-grid,
  .cards-grid,
  .results-grid {
    grid-template-columns: 1fr !important;
  }

  .listing-card,
  .home-listing-card {
    max-width: 100%;
  }

  .message-layout,
  .messages-layout {
    grid-template-columns: 1fr !important;
  }

  .conversation-list {
    max-height: 320px;
  }

  .message-thread {
    max-height: 58vh;
  }

  table {
    min-width: 680px;
  }
}

@media (max-width: 430px) {
  .header-inner {
    width: min(100% - 16px, 1180px);
  }

  .logo {
    width: 100%;
    justify-content: center;
  }

  .header-actions {
    gap: 6px;
  }

  .nav a {
    font-size: .84rem;
  }

  .page-panel,
  .auth-card,
  .search-card,
  .mod-card,
  .trust-card,
  .category-dynamic-card,
  .home-listing-card {
    border-radius: 18px;
  }

  .page-hero h1 {
    font-size: 2.15rem;
  }

  .home-listing-thumb {
    height: 220px !important;
  }

  .hero-stat span {
    font-size: .78rem !important;
  }

  .btn,
  button.btn,
  a.btn {
    font-size: .92rem;
  }
}

/* Accessibilité : moins d’animations si l’utilisateur le demande. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
