/*
 * ══════════════════════════════════════════════════════════════════
 *  APDG Store — Base styles
 *  Reset minimal + typographie + utilitaires layout
 * ══════════════════════════════════════════════════════════════════
 */

/* ── Reset ───────────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 100%;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: var(--lh-base);
    font-weight: var(--fw-regular);
    color: var(--color-surface-950);
    background-color: var(--color-surface-50);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

input, button, textarea, select {
    font: inherit;
}

p, h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
}

a {
    color: inherit;
    text-decoration: none;
}

ul, ol {
    list-style: none;
}

button {
    cursor: pointer;
    border: none;
    background: none;
}

/* ── Typographie ─────────────────────────────────────────────────── */

/*
 * Les h1/h2 utilisent Bitter (--font-headline / --font-title).
 * Les textes courants utilisent Poppins (--font-body).
 */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-title);
    font-weight: var(--fw-semibold);
    line-height: 1.2;
    color: var(--color-surface-950);
}

h1 {
    font-family: var(--font-headline);
    font-size: var(--text-headline);
    line-height: var(--lh-headline);
}

h2 {
    font-size: var(--text-title);
    line-height: var(--lh-title);
}

h3 {
    font-size: var(--text-base);
    line-height: var(--lh-base);
}

p {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: var(--lh-base);
}

/* ── Conteneur principal ─────────────────────────────────────────── */
.apdg-container {
    width: 100%;
    max-width: var(--max-width);
    margin-inline: auto;
    padding-inline: var(--container-px);
}

/* Section avec padding vertical standard */
.apdg-section {
    padding-block: var(--container-py);
}

/* ── Utilitaires texte ───────────────────────────────────────────── */
.text-sm       { font-size: var(--text-sm); line-height: var(--lh-sm); }
.text-base     { font-size: var(--text-base); line-height: var(--lh-base); }
.text-title    { font-size: var(--text-title); line-height: var(--lh-title); font-family: var(--font-title); }
.text-headline { font-size: var(--text-headline); line-height: var(--lh-headline); font-family: var(--font-headline); }

.fw-regular  { font-weight: var(--fw-regular); }
.fw-medium   { font-weight: var(--fw-medium); }
.fw-semibold { font-weight: var(--fw-semibold); }
.fw-bold     { font-weight: var(--fw-bold); }

/* ── Boutons ─────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: var(--fw-medium);
    line-height: var(--lh-base);
    border-radius: var(--radius-full);
    border: none;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.2s ease, transform 0.15s ease;
    box-shadow: var(--shadow-sm);
    text-decoration: none;
}

.btn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

/* Bouton primaire — fond blanc (sur sections colorées) */
.btn--white {
    background-color: var(--color-surface-50);
    color: var(--color-surface-950);
}

/* Bouton secondaire — fond primary */
.btn--primary {
    background-color: var(--color-primary-500);
    color: var(--color-surface-50);
}

/* Bouton dark */
.btn--dark {
    background-color: var(--color-surface-800);
    color: var(--color-surface-50);
}

/* Bouton icône seul (panier, navigation) */
.btn--icon {
    padding: 12px;
    border-radius: var(--radius-full);
}

/* ── Tags / Badges produit ───────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 8px;
    border-radius: var(--radius-full);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: var(--fw-medium);
    line-height: var(--lh-sm);
    white-space: nowrap;
}

.badge--dark {
    background-color: var(--color-surface-800);
    color: var(--color-surface-50);
}

.badge--primary {
    background-color: var(--color-primary-500);
    color: var(--color-surface-50);
}

/* ── Grille produits ─────────────────────────────────────────────── */
.apdg-products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--gap-lg);
}

@media (max-width: 1024px) {
    .apdg-products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .apdg-products-grid {
        grid-template-columns: 1fr;
    }
}

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

/* Focus visible pour accessibilité clavier */
:focus-visible {
    outline: 2px solid var(--color-primary-500);
    outline-offset: 2px;
}

/* ── Scrollbar ───────────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--color-surface-100);
}
::-webkit-scrollbar-thumb {
    background: var(--color-surface-300);
    border-radius: 3px;
}

@media (max-width: 768px) {
    body { overflow-x: hidden; }
}
