/*
Theme Name: NEONDISTRIKT
Theme URI: https://example.com/
Author: NEONDISTRIKT
Author URI: https://example.com/
Description: Cyberpunk affiliate shop theme.
Version: 1.2.2
Requires at least: 6.0
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: neondistrikt
*/

:root {
    --nd-black: #0E0E0E;
    --nd-white: #ffffff;
    --nd-blue: #2E92F8;
    --nd-cyan: #00a9ff;

    --nd-header-height: 200px;
    --nd-page-padding: 24px;
}

* {
    box-sizing: border-box;
}

/* Page fixe : header + footer restent en place, seul .site-main défile */

html {
    height: 100%;
    overflow: hidden;
    background: var(--nd-black);
}

body {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    margin: 0;
    overflow: hidden;
    background: var(--nd-black);
    color: var(--nd-white);
    font-family: "Courier New", Courier, monospace;
    font-size: 16px;
    line-height: 1.5;
}

/* Barre d'admin WordPress (visible seulement quand connecté) */
body.admin-bar {
    height: calc(100vh - 32px);
    height: calc(100dvh - 32px);
}

@media (max-width: 782px) {
    body.admin-bar {
        height: calc(100vh - 46px);
        height: calc(100dvh - 46px);
    }
}

button,
input,
select,
textarea {
    color: inherit;
    font-family: inherit;
}

a {
    color: var(--nd-white);
    text-decoration: none;
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--nd-cyan);
    outline-offset: 3px;
}

/* HEADER */

.site-header {
    position: relative;
    flex: none;
    min-height: var(--nd-header-height);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 22px 20px 24px;
    overflow: hidden;
    background-color: var(--nd-black);
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.55)),
        var(--nd-header-image, none);
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    text-align: center;
}

/* Vidéo de fond (optionnelle) */
.header-video {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.header-video video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.header-video::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.site-branding,
.main-navigation {
    position: relative;
    z-index: 1;
}

.site-title {
    margin: 0;
    color: var(--nd-blue);
    font-family: Arial, Helvetica, sans-serif;
    font-size: clamp(28px, 3.5vw, 40px);
    font-weight: 400;
    letter-spacing: 2px;
    line-height: 1.15;
}

.site-title a {
    color: inherit;
}

.site-description {
    margin: 8px 0 0;
    font-size: 16px;
    font-style: italic;
}

/* NAVIGATION */

.main-navigation {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.category-button {
    display: inline-flex;
    height: 44px;
    align-items: center;
    justify-content: center;
    padding: 0 24px;
    border: 1px solid var(--c);
    border-radius: 4px;
    background: var(--bg);
    color: var(--c);
    font-size: 15px;
    line-height: 1;
    white-space: nowrap;
    text-align: center;
    transition: background-color 160ms ease;
}

.category-button--light       { --c: #FEAB44; --bg: #150F08; }
.category-button--decorations { --c: #09FEA3; --bg: #01100A; }
.category-button--tech        { --c: #EB75FD; --bg: #120914; }
.category-button--all         { --c: #1362F2; --bg: #010912; }

/* Survol / actif : fond éclairci (~20%), texte et bordure inchangés */
.category-button:hover,
.category-button:focus-visible,
.category-button.is-active {
    background: color-mix(in srgb, var(--c) 20%, var(--bg));
    box-shadow: none;
    outline: none;
}

/* Ligne grise sous le header */

.header-divider {
    flex: none;
    width: 100%;
    height: 1px;
    margin: 0;
    border: 0;
    background: #333333;
}

/* CONTENU (seule zone qui défile) */

.site-main {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 18px var(--nd-page-padding) 28px;
    background: var(--nd-black);
}

.results-count {
    margin: 0 0 18px;
    font-style: italic;
}

.results-count strong {
    font-weight: 400;
}

/* GRILLE PRODUITS */

.product-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    width: 100%;
    align-items: stretch;
}

.product-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #444444;
    background: var(--nd-black);
}

.product-card-title {
    margin: 0;
    padding: 12px;
    font-size: 16px;
    font-style: italic;
    font-weight: 400;
    overflow-wrap: anywhere;
}

.product-card-title a:hover,
.product-card-title a:focus-visible {
    color: var(--nd-cyan);
}

/* Image cliquable */

.product-image-link {
    display: flex;
    width: 100%;
    aspect-ratio: 1 / 1;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 12px;
    background: var(--nd-black);
}

.product-image-link img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 220ms ease;
}

/* Zoom au survol : souris uniquement */
@media (hover: hover) and (pointer: fine) {
    .product-image-link:hover img {
        transform: scale(1.08);
    }
}

.product-image-placeholder {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    color: #777777;
    font-size: 13px;
    text-align: center;
}

/* Prix et bouton marchand : même format */

.product-card-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
    padding: 12px;
}

.product-price,
.shop-button {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border: 1px solid #777777;
    border-radius: 4px;
    background: #333333;
    font-size: 12px;
    line-height: 1.2;
    text-align: center;
}

.product-price:empty {
    display: none;
}

.shop-button {
    transition: background-color 160ms ease, border-color 160ms ease;
}

.shop-button:hover,
.shop-button:focus-visible {
    border-color: var(--nd-white);
    background: #161616;
}

/* Préfixe "> " : partout (PC + mobile) */

.results-count::before,
.product-card-title a::before {
    content: "> ";
    white-space: pre;
}

.no-products {
    padding: 20px 0;
}

/* PAGINATION */

.pagination {
    margin: 28px 0;
}

.pagination ul {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0;
    list-style: none;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 8px 12px;
    border: 1px solid #555555;
    border-radius: 4px;
}

.pagination .current,
.pagination a:hover {
    border-color: var(--nd-cyan);
    color: var(--nd-cyan);
}

/* MENTION AFFILIATION */

.affiliate-disclosure {
    margin: 28px 0 0;
    color: #999999;
    font-size: 12px;
    font-style: italic;
    text-align: center;
}

/* PAGES (About, Privacy Policy) */

.page-content {
    max-width: 800px;
    margin: 0 auto;
}

.page-title {
    margin: 0 0 24px;
    font-family: "Courier New", Courier, monospace;
    font-size: 30px;
    font-weight: 400;
}

.page-body {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 18px;
    line-height: 1.6;
}

.page-body h2,
.page-body h3,
.page-body h4 {
    margin: 32px 0 12px;
    font-family: "Courier New", Courier, monospace;
    font-size: 22px;
    font-weight: 400;
    line-height: 1.3;
}

.page-body p,
.page-body ul,
.page-body ol {
    margin: 0 0 16px;
}

.page-body a {
    text-decoration: underline;
}

/* FOOTER (fixe : ne défile pas) */

.site-footer {
    flex: none;
    display: flex;
    min-height: 58px;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 8px 16px;
    border-top: 1px solid #333333;
    background: #000000;
}

.footer-button {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border: 1px solid var(--nd-white);
    border-radius: 4px;
    background: var(--nd-black);
    font-size: 14px;
    line-height: 1.2;
    white-space: nowrap;
    transition: background-color 160ms ease, border-color 160ms ease;
}

.footer-button:hover,
.footer-button:focus-visible,
.footer-button.is-active {
    border-color: #777777;
    background: #333333;
}

/* PC uniquement : header compact + préfixe "> " */

@media (min-width: 1001px) {
    :root {
        --nd-header-height: 120px;
    }

    .site-header {
        gap: 4px;
        padding: 8px 20px;
    }

    .site-title {
        line-height: 1.1;
    }

    .site-description {
        margin-top: 2px;
        font-size: 14px;
        line-height: 1.3;
    }

    .category-button {
        height: 36px;
    }

    .page-content {
        max-width: none;
        padding-inline: 12%;
    }

    .category-button span::before,
    .footer-button--prompt::before,
    .page-title::before {
        content: "> ";
        white-space: pre;
    }
}

/* TABLETTE */

@media (max-width: 1000px) {
    :root {
        --nd-page-padding: 18px;
    }

    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* TELEPHONE : une carte par ligne, 4 boutons sur une ligne */

@media (max-width: 600px) {
    :root {
        --nd-page-padding: 16px;
    }

    .site-header {
        min-height: 0;
        gap: 12px;
        padding: 16px 16px 18px;
    }

    .site-description {
        margin-top: 4px;
        font-size: 12px;
    }

    .main-navigation {
        flex-wrap: nowrap;
        width: 100%;
        gap: 6px;
    }

    .category-button {
        flex: 1 1 auto;
        min-width: 0;
        height: 40px;
        padding: 0 6px;
        font-size: 12px;
    }

    .site-main {
        padding-top: 16px;
        padding-bottom: 24px;
    }

    .product-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }

    .product-card-title {
        font-size: 15px;
    }

    .site-footer {
        gap: 8px;
        padding: 8px 12px;
    }

    .footer-button {
        min-height: 36px;
        padding: 8px 10px;
        font-size: 11px;
    }
}

/* Réduction des animations */

@media (prefers-reduced-motion: reduce) {
    .category-button,
    .shop-button,
    .footer-button,
    .product-image-link img {
        transition: none;
    }
}