/* ============================================================
   Dreams 3D — thème "modern geek" dérivé du logo pixel-art :
   rose fuchsia + bleu électrique + arc-en-ciel, fond nuit étoilée.
   ============================================================ */

/* Polices auto-hébergées (RGPD : aucun appel à Google Fonts). */
@import url('fonts/fonts.css');

:root {
    --bg:        #0d0818;
    --surface:   #171029;
    --surface-2: #201640;
    --border:    #34255c;
    --pink:      #ff3ec8;
    --pink-soft: #ff8ade;
    --blue:      #45c4ff;
    --gold:      #ffb347;
    --text:      #f2ecff;
    --muted:     #a396c9;
}

html { background: var(--bg); }

body {
    font-family: 'Rubik', sans-serif;
    background: var(--bg);
    color: var(--text);
}

/* Ciel nocturne : deux halos (rose / bleu) + poussière d'étoiles */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(ellipse 60% 40% at 15% -5%, rgba(255, 62, 200, .14), transparent),
        radial-gradient(ellipse 50% 35% at 90% 10%, rgba(69, 196, 255, .12), transparent),
        radial-gradient(1.5px 1.5px at 20% 30%, rgba(255,255,255,.45), transparent),
        radial-gradient(1px 1px at 55% 15%, rgba(255,255,255,.3), transparent),
        radial-gradient(1.5px 1.5px at 80% 45%, rgba(255,138,222,.4), transparent),
        radial-gradient(1px 1px at 35% 70%, rgba(255,255,255,.25), transparent),
        radial-gradient(1.5px 1.5px at 70% 85%, rgba(69,196,255,.35), transparent),
        radial-gradient(1px 1px at 10% 90%, rgba(255,255,255,.3), transparent);
}

/* ---- Typo pixel (titres, logo) ---- */
.pixel {
    font-family: 'Press Start 2P', monospace;
    line-height: 1.6;
    letter-spacing: .02em;
}

.pixel-title {
    font-family: 'Press Start 2P', monospace;
    color: var(--pink);
    text-shadow:
        0 0 14px rgba(255, 62, 200, .55),
        3px 3px 0 rgba(69, 196, 255, .35);
    line-height: 1.6;
}

/* ---- Barre arc-en-ciel (clin d'œil au logo) ---- */
.rainbow {
    height: 4px;
    background: linear-gradient(90deg, var(--pink), var(--gold), #ffe95c, var(--blue), #8a5cff);
    image-rendering: pixelated;
}

/* ---- Boutons ---- */
.btn {
    display: inline-block;
    font-family: 'Press Start 2P', monospace;
    font-size: .65rem;
    padding: .8rem 1.1rem;
    color: #16041f;
    background: linear-gradient(180deg, var(--pink-soft), var(--pink));
    border: 2px solid #16041f;
    box-shadow: 4px 4px 0 var(--blue);
    cursor: pointer;
    transition: transform .1s, box-shadow .1s;
    text-align: center;
}
.btn:hover:not(:disabled) {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 var(--blue), 0 0 18px rgba(255, 62, 200, .45);
}
.btn:active:not(:disabled) {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 var(--blue);
}
.btn:disabled { opacity: .35; cursor: not-allowed; }

.btn-ghost {
    display: inline-block;
    font-family: 'Press Start 2P', monospace;
    font-size: .6rem;
    padding: .7rem 1rem;
    color: var(--blue);
    background: transparent;
    border: 2px solid var(--blue);
    box-shadow: 3px 3px 0 rgba(69, 196, 255, .35);
    cursor: pointer;
    transition: transform .1s, box-shadow .1s, color .15s;
}
.btn-ghost:hover { transform: translate(-1px, -1px); color: var(--pink-soft); border-color: var(--pink); box-shadow: 4px 4px 0 rgba(255, 62, 200, .4); }

.btn-danger {
    font-family: 'Press Start 2P', monospace;
    font-size: .55rem;
    padding: .55rem .8rem;
    color: #ff6b81;
    background: transparent;
    border: 2px solid #ff4560;
    cursor: pointer;
}
.btn-danger:hover { background: rgba(255, 69, 96, .12); }

/* ---- Cartes ---- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 5px 5px 0 rgba(0, 0, 0, .45);
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.card:hover {
    border-color: var(--pink);
    box-shadow: 5px 5px 0 rgba(255, 62, 200, .25), 0 0 22px rgba(255, 62, 200, .18);
    transform: translateY(-2px);
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 5px 5px 0 rgba(0, 0, 0, .45);
}

/* ---- Champs ---- */
.input {
    background: var(--surface-2);
    border: 2px solid var(--border);
    color: var(--text);
    padding: .6rem .9rem;
    font-family: 'Rubik', sans-serif;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--muted); }
.input:focus { border-color: var(--pink); box-shadow: 0 0 12px rgba(255, 62, 200, .35); }

/* ---- Nav ---- */
.nav-link {
    font-family: 'Press Start 2P', monospace;
    font-size: .6rem;
    color: var(--muted);
    transition: color .15s, text-shadow .15s;
}
.nav-link:hover { color: var(--pink-soft); text-shadow: 0 0 10px rgba(255, 62, 200, .6); }

/* ---- Catégories du header : liens + sous-menu au survol ---- */
.nav-cat { position: relative; }

.nav-cat > a { display: inline-block; padding: .5rem 0; }

.sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    min-width: 11rem;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 5px 5px 0 rgba(0, 0, 0, .55);
    z-index: 50;
    padding: .3rem 0;
}
.nav-cat:hover .sub-menu,
.nav-cat:focus-within .sub-menu { display: block; }

.sub-menu a {
    display: block;
    padding: .55rem 1rem;
    font-size: .85rem;
    color: var(--text);
    white-space: nowrap;
    transition: color .15s, background .15s;
}
.sub-menu a:hover { color: var(--pink-soft); background: var(--surface-2); }

/* ---- Recherche dépliante (clic sur la loupe) ---- */
.search-form { display: flex; align-items: center; gap: .4rem; }

.search-input {
    width: 0;
    opacity: 0;
    padding: .45rem 0;
    border-width: 0 !important;
    transition: width .25s ease, opacity .2s ease, padding .25s ease;
}
.search-form.open .search-input {
    width: min(14rem, 55vw);
    opacity: 1;
    padding: .45rem .8rem;
    border-width: 2px !important;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.3rem;
    height: 1.3rem;
    padding: 0 .3rem;
    font-family: 'Rubik', sans-serif;
    font-size: .7rem;
    font-weight: 700;
    color: #16041f;
    background: var(--pink);
    box-shadow: 0 0 10px rgba(255, 62, 200, .7);
}

/* ---- Tableaux (admin, compte) ---- */
.tbl { width: 100%; border-collapse: collapse; font-size: .85rem; }
.tbl th {
    font-family: 'Press Start 2P', monospace;
    font-size: .55rem;
    color: var(--blue);
    text-align: left;
    padding: .6rem .5rem;
    border-bottom: 2px solid var(--border);
}
.tbl td { padding: .55rem .5rem; border-bottom: 1px solid var(--surface-2); }
.tbl tr:hover td { background: rgba(255, 62, 200, .04); }

/* ---- Visuel d'attente (produit sans photo) ----
   Emplacement assumé, aux couleurs de la boutique : le client comprend qu'une
   photo arrive, et rien ne prétend représenter le produit. Le champ image du
   produit reste vide, donc le flux Merchant et le sitemap l'excluent toujours. */
.no-photo {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .5rem;
    text-align: center;
    background:
        repeating-linear-gradient(45deg, rgba(255, 62, 200, .06) 0 8px, transparent 8px 16px),
        var(--surface-2);
    border: 2px dashed var(--border);
    color: var(--muted);
    font-family: 'Press Start 2P', monospace;
    font-size: .45rem;
    line-height: 1.9;
}

/* Logo de la boutique en filigrane (chemin relatif à cette feuille : valable
   quel que soit le préfixe d'URL du site). */
.no-photo::before {
    content: "";
    width: 45%;
    max-width: 5rem;
    aspect-ratio: 591 / 422;
    background: url("logo.png") center / contain no-repeat;
    image-rendering: pixelated;
    opacity: .3;
}

/* Miniatures (panier, listes admin) : filigrane seul, sans texte. */
.no-photo--sm { border-width: 1px; gap: 0; }
.no-photo--sm .no-photo__label { display: none; }
.no-photo--sm::before { width: 72%; max-width: none; }

/* ---- Divers ---- */
.pixelated { image-rendering: pixelated; }

/* Texte pour lecteurs d'écran uniquement */
.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;
}

.text-muted { color: var(--muted); }
.text-pink  { color: var(--pink-soft); }
.text-blue  { color: var(--blue); }
.text-gold  { color: var(--gold); }

.glow-box {
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: 0 0 30px rgba(255, 62, 200, .12), 5px 5px 0 rgba(0, 0, 0, .45);
}

a { color: inherit; }

/* ============================================================
   Responsive / tactile
   ============================================================ */

/* Sous-menu ouvert au tap (mobile/tablette : pas de :hover fiable) */
.nav-cat.open .sub-menu { display: block; }

/* Les tableaux larges défilent horizontalement au lieu de s'écraser */
.overflow-x-auto .tbl { min-width: 640px; }

/* Cibles tactiles confortables (≥ 44 px) sur écrans tactiles */
@media (pointer: coarse) {
    .btn, .btn-ghost, .btn-danger { min-height: 2.75rem; }
    .nav-link { padding: .5rem .15rem; }
    .sub-menu a { padding: .8rem 1rem; }
    .input { min-height: 2.6rem; }
}

/* Petits écrans : titres pixel et boutons moins encombrants */
@media (max-width: 640px) {
    .pixel-title { font-size: .8rem; }
    .btn { font-size: .6rem; padding: .7rem .9rem; }
    .search-form.open .search-input { width: min(11rem, 45vw); }
}

/* Menu mobile (burger) */
#mobile-menu a {
    display: block;
    padding: .7rem .5rem;
    transition: color .15s;
}
#mobile-menu a:hover { color: var(--pink-soft); }
