/* ============================================================
   svt_boutique.css  –  Boutique eSVT
   Police : Fraunces (titres) + DM Sans (corps)
   Thème  : vert nature (#1a7a4a) + écru (#faf8f3)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,wght@0,400;0,700;0,900;1,400&family=DM+Sans:wght@400;500;600&display=swap');

/* ── Variables ───────────────────────────────────────────── */
:root {
    --vert-pri    : #1a7a4a;
    --vert-hover  : #145f39;
    --vert-light  : #e8f5ee;
    --ecru        : #faf8f3;
    --ecru-bord   : #ede9e0;
    --texte       : #1c1c1c;
    --texte-doux  : #5a5a5a;
    --blanc       : #ffffff;
    --rouge       : #d9534f;
    --or          : #c8952a;
    --bleu        : #2563eb;
    --radius      : 14px;
    --shadow-card : 0 4px 18px rgba(0,0,0,.09);
    --shadow-hover: 0 10px 32px rgba(26,122,74,.18);
    --transition  : .22s ease;
}

/* ── Reset minimal ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
/* Scopé à #boutique-page (pas body) : le header/sidebar partagés
   (header.php) vivent aussi dans <body>, et font-family/color sont
   hérités par défaut — les cibler sur body aurait pu déteindre sur le
   texte du header si celui-ci ne fixe pas explicitement les siens.
   Voir échanges du 05/09/2026. */
#boutique-page {
    font-family: 'DM Sans', sans-serif;
    background: var(--ecru);
    color: var(--texte);
}

/* ── Sous-titre boutique (sous le header eSVT) ─────────── */
#boutique-subhero {
    background: var(--vert-pri);
    background-image: radial-gradient(ellipse 80% 60% at 70% 50%, rgba(255,255,255,.06) 0%, transparent 70%);
    color: #fff;
    padding: 22px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
#boutique-subhero p {
    font-family: 'Fraunces', serif;
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    opacity: .95;
}
#boutique-subhero .hero-liens {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
#boutique-subhero .hero-liens a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 50px;
    font-size: .85rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform var(--transition), box-shadow var(--transition);
}
#boutique-subhero .hero-liens a:hover { transform: translateY(-2px); }

/* ── Barre filtres/* ── Barre filtres + recherche ───────────────────────────── */
#boutique-toolbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--blanc);
    border-bottom: 1px solid var(--ecru-bord);
    box-shadow: 0 2px 8px rgba(0,0,0,.05);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.filtre-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 50px;
    border: 1.5px solid var(--ecru-bord);
    background: var(--blanc);
    font-family: 'DM Sans', sans-serif;
    font-size: .85rem;
    font-weight: 500;
    cursor: pointer;
    color: var(--texte-doux);
    transition: all var(--transition);
}
.filtre-btn:hover { border-color: var(--vert-pri); color: var(--vert-pri); }
.filtre-btn.actif {
    background: var(--vert-pri);
    border-color: var(--vert-pri);
    color: #fff;
}
.filtre-btn .nb {
    background: rgba(0,0,0,.12);
    border-radius: 50px;
    padding: 1px 7px;
    font-size: .78rem;
}
.filtre-btn.actif .nb { background: rgba(255,255,255,.25); }

#boutique-search {
    margin-left: auto;
    position: relative;
}
#boutique-search input {
    padding: 8px 16px 8px 36px;
    border: 1.5px solid var(--ecru-bord);
    border-radius: 50px;
    font-family: 'DM Sans', sans-serif;
    font-size: .88rem;
    background: var(--ecru);
    outline: none;
    width: 220px;
    transition: border-color var(--transition), width var(--transition);
}
#boutique-search input:focus {
    border-color: var(--vert-pri);
    width: 280px;
    background: #fff;
}
#boutique-search .icon-search {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--texte-doux);
    font-size: .9rem;
    pointer-events: none;
}

/* ── Grille produits ─────────────────────────────────────── */
#boutique-grid-wrap {
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 24px 60px;
}
#boutique-vide {
    display: none;
    text-align: center;
    padding: 60px 20px;
    color: var(--texte-doux);
    font-size: 1rem;
}
#boutique-vide span { font-size: 2.5rem; display: block; margin-bottom: 10px; }

#boutique-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 28px;
}

/* ── Carte produit ───────────────────────────────────────── */
.carte-produit {
    background: var(--blanc);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
    position: relative;
}
.carte-produit:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}
.carte-produit[data-actif="0"] { opacity: .55; }

/* Bandeau badge */
.badge-produit {
    position: absolute;
    top: 14px;
    left: 14px;
    background: var(--or);
    color: #fff;
    font-size: .73rem;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 50px;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.badge-produit.badge-nouveau   { background: var(--vert-pri); }
.badge-produit.badge-bientot   { background: #7c3aed; }
.badge-produit.badge-bestseller{ background: var(--or); }
.badge-produit.badge-inactif   { background: #94a3b8; left: auto; right: 14px; }

/* Miniature */
.carte-img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    display: block;
    background: var(--ecru);
}
.carte-img-placeholder {
    width: 100%;
    aspect-ratio: 4/3;
    background: var(--ecru);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
}

/* Corps carte */
.carte-body {
    padding: 18px 20px 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.carte-type-tag {
    display: inline-block;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .5px;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 50px;
    margin-bottom: 10px;
    width: fit-content;
}
.tag-livre    { background: #fff3cd; color: #92681a; }
.tag-pdf      { background: #dbeafe; color: #1d4ed8; }
.tag-objet    { background: #fce7f3; color: #9d174d; }
.tag-ressource{ background: var(--vert-light); color: var(--vert-hover); }
.tag-lemon    { background: #ede9fe; color: #6d28d9; }

.carte-titre {
    font-family: 'Fraunces', serif;
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 8px;
    line-height: 1.3;
    color: var(--texte);
}
.carte-desc {
    font-size: .86rem;
    color: var(--texte-doux);
    margin: 0;
    line-height: 1.55;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Liste des ressources incluses dans un bundle Lemon Squeezy */
.carte-ls-inclus {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    font-size: .8rem;
}
.carte-ls-inclus li { margin-bottom: 3px; }
.carte-ls-inclus a {
    color: var(--vert-pri);
    text-decoration: none;
}
.carte-ls-inclus a:hover { text-decoration: underline; }

/* Pied carte */
.carte-footer {
    padding: 14px 20px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-top: 1px solid var(--ecru-bord);
}
.carte-prix {
    font-family: 'Fraunces', serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--vert-pri);
}
.carte-prix.gratuit { color: var(--texte-doux); font-size: 1rem; font-weight: 500; }

.btn-achat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 50px;
    font-family: 'DM Sans', sans-serif;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none !important;
    border: none;
    transition: all var(--transition);
    background: var(--vert-pri);
    color: #fff;
    box-shadow: 0 3px 10px rgba(26,122,74,.25);
}
.btn-achat:hover {
    background: var(--vert-hover);
    transform: scale(1.04);
    box-shadow: 0 5px 16px rgba(26,122,74,.35);
    text-decoration: none !important;
}
.btn-achat.bientot {
    background: #e2e8f0;
    color: var(--texte-doux);
    box-shadow: none;
    cursor: default;
}
.btn-apercu {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .82rem;
    color: var(--vert-pri);
    text-decoration: none !important;
    font-weight: 500;
    margin-top: 6px;
    transition: gap var(--transition);
}
.btn-apercu:hover { gap: 8px; text-decoration: none !important; }

/* ── Admin toggle ────────────────────────────────────────── */
#admin-panel-wrap {
    max-width: 1280px;
    margin: 0 auto 0;
    padding: 0 24px;
}
#btn-toggle-admin {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 50px;
    border: 1.5px solid var(--ecru-bord);
    background: var(--blanc);
    font-family: 'DM Sans', sans-serif;
    font-size: .84rem;
    font-weight: 600;
    color: var(--texte-doux);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}
#btn-toggle-admin:hover { border-color: var(--vert-pri); color: var(--vert-pri); }

/* ── Panel admin ─────────────────────────────────────────── */
#admin-panel {
    display: none;
    background: var(--blanc);
    border: 1.5px solid var(--ecru-bord);
    border-radius: var(--radius);
    padding: 28px;
    margin: 16px 0 32px;
    box-shadow: var(--shadow-card);
}
#admin-panel h2 {
    font-family: 'Fraunces', serif;
    font-size: 1.25rem;
    margin: 0 0 20px;
    color: var(--texte);
}
#admin-panel h2 span { color: var(--vert-pri); }

/* Formulaire */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.form-grid .full { grid-column: 1 / -1; }
.form-row { display: flex; flex-direction: column; gap: 5px; }
.form-row label {
    font-size: .8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--texte-doux);
}
.form-row input,
.form-row select,
.form-row textarea {
    padding: 9px 13px;
    border: 1.5px solid var(--ecru-bord);
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: .9rem;
    background: var(--ecru);
    color: var(--texte);
    outline: none;
    transition: border-color var(--transition);
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
    border-color: var(--vert-pri);
    background: #fff;
}
.form-row textarea { min-height: 90px; resize: vertical; }
.form-row-centre {
    justify-content: center;
    padding-top: 20px;
}
.label-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    text-transform: none;
    font-size: .9rem;
}
.chk-actif {
    width: 16px;
    height: 16px;
}
.form-actions {
    margin-top: 18px;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.btn-sauv {
    padding: 10px 24px;
    border-radius: 8px;
    border: none;
    background: var(--vert-pri);
    color: #fff;
    font-family: 'DM Sans', sans-serif;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition);
}
.btn-sauv:hover { background: var(--vert-hover); }
.btn-annuler {
    padding: 10px 20px;
    border-radius: 8px;
    border: 1.5px solid var(--ecru-bord);
    background: transparent;
    font-family: 'DM Sans', sans-serif;
    font-size: .9rem;
    cursor: pointer;
    color: var(--texte-doux);
    transition: all var(--transition);
}
.btn-annuler:hover { border-color: var(--rouge); color: var(--rouge); }
#msg-admin {
    font-size: .88rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 6px;
    display: none;
}
#msg-admin.ok  { background: var(--vert-light); color: var(--vert-hover); display: block; }
#msg-admin.err { background: #fee2e2; color: #991b1b; display: block; }

/* Tableau admin */
#admin-liste { margin-top: 28px; }
#admin-liste h3 {
    font-family: 'Fraunces', serif;
    font-size: 1rem;
    margin: 0 0 12px;
}
.tbl-admin {
    width: 100%;
    border-collapse: collapse;
    font-size: .85rem;
}
.tbl-admin th {
    background: var(--ecru);
    padding: 9px 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--ecru-bord);
    white-space: nowrap;
}
.tbl-admin td {
    padding: 9px 12px;
    border-bottom: 1px solid var(--ecru-bord);
    vertical-align: middle;
}
.tbl-admin tr:hover td { background: #f9f9f6; }
.tbl-admin .badge-type {
    padding: 3px 9px;
    border-radius: 50px;
    font-size: .75rem;
    font-weight: 600;
}
.td-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.btn-edit, .btn-del, .btn-toggle-actif {
    padding: 4px 10px;
    border-radius: 6px;
    border: none;
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity var(--transition);
}
.btn-edit        { background: #dbeafe; color: #1d4ed8; }
.btn-del         { background: #fee2e2; color: #991b1b; }
.btn-toggle-actif{ background: #f0fdf4; color: var(--vert-pri); }
.btn-edit:hover, .btn-del:hover, .btn-toggle-actif:hover { opacity: .8; }

/* ── Toast ───────────────────────────────────────────────── */
#boutique-toast {
    position: fixed;
    bottom: 28px;
    right: 28px;
    background: var(--texte);
    color: #fff;
    padding: 12px 22px;
    border-radius: 10px;
    font-size: .9rem;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0,0,0,.25);
    z-index: 9999;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .3s, transform .3s;
    pointer-events: none;
}
#boutique-toast.visible { opacity: 1; transform: translateY(0); }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 680px) {
    #boutique-subhero { padding: 14px 16px; flex-direction: column; align-items: flex-start; }
    #boutique-toolbar{ padding: 10px 16px; }
    #boutique-search { margin-left: 0; width: 100%; }
    #boutique-search input { width: 100%; }
    #boutique-grid-wrap { padding: 20px 16px 40px; }
    #boutique-grid  { grid-template-columns: 1fr; }
    .form-grid       { grid-template-columns: 1fr; }
    #admin-panel     { padding: 20px 16px; }
}
