/* ===========================
   GLOBAL CSS - BIJOUX LÉGERS
   Styles globaux et base
   Version 2026
   =========================== */

/* Reset et base anti-overflow */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: #2d3748;
    background-color: #fff;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img,
video,
iframe,
embed,
object {
    max-width: 100%;
    height: auto;
    display: block;
}

table {
    max-width: 100%;
}

/* Anti-overflow responsive */
.table-responsive,
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Variables CSS niche bijoux */
:root {
    --color-primary: #00838f;
    --color-primary-dark: #006f7a;
    --color-primary-light: #e0f4f5;
    --color-accent: #c5cae9;
    --color-accent-warm: #fff9c4;
    --color-dark: #1a2535;
    --color-text: #2d3748;
    --color-text-muted: #6b7a8d;
    --color-border: #e8ecf0;
    --color-bg: #fff;
    --color-bg-soft: #f7f9fc;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-md: 0 8px 32px rgba(0,0,0,0.1);
    --font-system: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Typographie */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-system);
    line-height: 1.25;
    margin-top: 0;
    color: var(--color-dark);
    overflow-wrap: break-word;
    word-wrap: break-word;
}

p {
    margin-top: 0;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

a {
    color: var(--color-primary);
}

a:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 3px;
    border-radius: 3px;
}

/* Utilitaires */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Tableaux responsive globaux */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    margin-bottom: 24px;
}

.table-wrapper table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

/* Textes longs et URLs */
* {
    overflow-wrap: break-word;
    word-wrap: break-word;
}

pre,
code {
    overflow-x: auto;
    max-width: 100%;
    font-size: 14px;
}

/* Formulaires */
input,
textarea,
select,
button {
    font-family: var(--font-system);
    font-size: 16px;
}

input,
textarea,
select {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

/* Images */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Focus skip */
.skip-to-content {
    position: absolute;
    top: -100px;
    left: 16px;
    background-color: var(--color-primary);
    color: #fff;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    z-index: 9999;
}

.skip-to-content:focus {
    top: 8px;
}

/* Sélection texte */
::selection {
    background-color: var(--color-primary-light);
    color: var(--color-primary-dark);
}

/* Scrollbar custom (optionnel) */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg-soft);
}

::-webkit-scrollbar-thumb {
    background-color: var(--color-accent);
    border-radius: 4px;
}

/* ===========================
   RESPONSIVE GLOBAL
   =========================== */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }

    .container {
        padding: 0 16px;
    }

    /* Grilles génériques mobiles */
    .grid,
    [class*='grid-'] {
        grid-template-columns: 1fr !important;
    }

    /* Tableaux */
    table {
        font-size: 13px;
    }

    th, td {
        padding: 10px 12px !important;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 15px;
    }

    h1 {
        font-size: 24px;
    }

    h2 {
        font-size: 20px;
    }

    h3 {
        font-size: 17px;
    }

    .container {
        padding: 0 14px;
    }
}