/*
 * Galeries clients (/galeries-clients) : barre de la galerie, albums, grille avec boutons sous les photos,
 * fenêtre de commande de tirage, panier. S'appuie sur espace-prive.css (formulaires, boutons, cartes) et galerie.css.
 */

/* Éléments masqués par le script (les boutons ont leur propre display) */
.gc-dialogue [hidden],
.gc-commande [hidden] {
    display: none !important;
}

.gc-apercu {
    margin: 0;
    padding: 10px 16px;
    background: #f5b84b;
    color: #222;
    font-size: 14px;
    text-align: center;
}

/* ---------- Barre de la galerie ---------- */

.gc-barre-titre {
    color: var(--ep-titre) !important;
    font-family: "Roboto Slab", serif;
    font-size: 17px;
    text-decoration: none !important;
}

.gc-barre-lien {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.gc-barre svg,
.gc-action svg,
.gc-entete-photos svg {
    flex: none;
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.gc-pastille {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: var(--ep-accent);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
}

.gc-pastille--vide {
    background: rgba(255, 255, 255, .14);
}

/* ---------- Accueil de la galerie ---------- */

.gc-album img {
    filter: none;
}

/* ---------- Albums et en-tête des photos ---------- */

.gc-albums {
    padding-top: 28px;
}

.gc-albums .gg-filtres {
    margin-bottom: 0;
}

.gc-entete-photos {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px 24px;
    max-width: 1600px;
    margin: 0 auto;
    padding: 34px 16px 0;
}

.gc-entete-photos .ep-titre {
    margin-bottom: 4px;
}

.gc-entete-photos .ep-chiffres {
    margin-bottom: 0;
}

.gc-attente {
    opacity: .7;
    pointer-events: none;
}

/* ---------- Grille avec boutons sous chaque photo ---------- */

.gc-galerie {
    padding-top: 22px;
}

.gc-grille {
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 22px 14px;
}

.gc-photo a:first-child {
    aspect-ratio: 1 / 1;
}

.gc-photo img {
    object-position: 50% 40%;
}

.gc-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
}

.gc-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 10px;
    border: 0;
    border-radius: 2px;
    background: transparent;
    color: #cfcfcf !important;
    font-family: "Poppins", sans-serif;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .5px;
    text-decoration: none !important;
    cursor: pointer;
    transition: background-color .2s, color .2s;
}

.gc-action:hover,
.gc-action:focus-visible {
    background: rgba(255, 255, 255, .08);
    color: #fff !important;
}

.gc-action:focus-visible {
    outline: 2px solid var(--ep-accent, #d447a4);
    outline-offset: 1px;
}

.gc-favori {
    width: 40px;
    padding: 0;
}

.gc-favori svg {
    width: 20px;
    height: 20px;
}

.gc-favori[aria-pressed="true"] {
    color: var(--ep-accent, #d447a4) !important;
}

.gc-favori[aria-pressed="true"] svg {
    fill: currentColor;
}

/* Le premier bouton texte pousse les suivants à droite */
.gc-actions .gc-favori + .gc-action {
    margin-left: auto;
}

/* Dans la visionneuse */
.gg-lb-actions .gc-actions {
    gap: 8px;
    margin: 0;
    padding: 4px;
    border-radius: 3px;
    background: rgba(255, 255, 255, .06);
}

.gg-lb-actions .gc-action {
    min-height: 44px;
}

.gg-lb-actions .gc-favori + .gc-action {
    margin-left: 0;
}

@media (max-width: 767px) {
    .gc-grille {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px 6px;
        padding: 0 6px;
    }

    .gc-actions {
        gap: 0;
        margin-top: 2px;
    }

    /* Téléphone : icônes seules sous les vignettes */
    .gc-grille .gc-action span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
    }

    .gc-grille .gc-action {
        width: 44px;
        min-height: 44px;
        padding: 0;
    }

    .gc-entete-photos {
        padding-top: 24px;
    }

    .gc-entete-photos .ep-bouton {
        width: 100%;
    }
}

/* ---------- Mode d'emploi ---------- */

.gc-aide {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px 32px;
    margin-top: 48px;
    padding-top: 28px;
    border-top: 1px solid var(--ep-trait);
    font-size: 14px;
}

.gc-aide h3 {
    margin: 0 0 6px;
    font-family: "Poppins", sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.gc-aide p {
    margin: 0;
}

.ep-section .gc-aide:first-child {
    margin-top: 0;
}

/* ---------- Code d'accès ---------- */

.ep-champ input.gc-code {
    font-family: "Poppins", sans-serif;
    font-size: 18px;
    letter-spacing: 2px;
    text-align: center;
    text-transform: uppercase;
}

.ep-champ input.gc-code::placeholder {
    color: #5c5c5c;
    font-size: 14px;
}

/* ---------- Fenêtre « Commander un tirage » ---------- */

.gc-dialogue {
    /* Hors du bloc .ep : mêmes couleurs que l'espace privé */
    --ep-accent: #d447a4;
    --ep-accent-fonce: #b8378c;
    --ep-trait: rgba(255, 255, 255, .1);
    width: min(640px, calc(100vw - 24px));
    max-height: calc(100vh - 24px);
    overflow-x: hidden;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 6px;
    background: #222;
    color: #c4c4c4;
    font-size: 15px;
    line-height: 1.6;
}

.gc-dialogue::backdrop {
    background: rgba(0, 0, 0, .75);
}

.gc-dialogue-corps {
    position: relative;
    margin: 0;
    padding: 28px 26px 24px;
}

.gc-dialogue h2 {
    margin: 0 36px 20px 0;
    color: #f2f2f2;
    font-family: "Roboto Slab", serif;
    font-size: 22px;
    font-weight: 300;
}

.gc-dialogue-fermer {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .06);
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.gc-dialogue-fermer:hover {
    background: rgba(255, 255, 255, .14);
}

.gc-tirage {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 24px;
    align-items: start;
}

.gc-tirage-apercu {
    width: 100%;
    border-radius: 3px;
    background: #111;
}

.gc-select,
.gc-panier input[type="number"],
.gc-commande textarea {
    display: block;
    width: 100%;
    height: 48px;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 4px;
    background: #171717;
    color: #fff;
    font-size: 16px;
}

.gc-commande textarea {
    height: auto;
    min-height: 90px;
    resize: vertical;
}

.gc-select:focus,
.gc-panier input:focus,
.gc-commande textarea:focus,
.gc-quantite input:focus {
    border-color: var(--ep-accent);
    outline: none;
    box-shadow: 0 0 0 3px rgba(212, 71, 164, .25);
}

.gc-finitions {
    margin: 0 0 18px;
    padding: 0;
    border: 0;
}

.gc-finitions legend {
    margin-bottom: 6px;
    padding: 0;
    border: 0;
    color: #ddd;
    font-size: 14px;
    font-weight: 500;
}

.ep-champ .gc-puce {
    position: relative;
    display: inline-block;
    margin: 0 6px 6px 0;
    cursor: pointer;
}

.gc-puce input {
    position: absolute;
    left: 0;
    top: 0;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0;
}

.gc-puce span {
    display: inline-block;
    padding: 8px 14px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 2px;
    color: #ddd;
    font-size: 14px;
    transition: background-color .2s, border-color .2s;
}

.gc-puce input:checked + span {
    border-color: var(--ep-accent);
    background: var(--ep-accent);
    color: #fff;
}

.gc-puce input:focus-visible + span {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.gc-quantite {
    display: inline-flex;
    align-items: stretch;
    height: 48px;
}

.gc-quantite button {
    width: 46px;
    border: 1px solid rgba(255, 255, 255, .18);
    background: #2c2c2c;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
}

.gc-quantite button:first-child { border-radius: 4px 0 0 4px; }
.gc-quantite button:last-child  { border-radius: 0 4px 4px 0; }

.gc-quantite input {
    width: 64px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-width: 1px 0;
    background: #171717;
    color: #fff;
    font-size: 16px;
    text-align: center;
    -moz-appearance: textfield;
}

.gc-quantite input::-webkit-outer-spin-button,
.gc-quantite input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.gc-tirage-total {
    margin: 4px 0 0;
    font-size: 16px;
}

.gc-tirage-total strong {
    color: #fff;
    font-size: 20px;
}

.gc-ajoute {
    margin: 18px 0 0;
}

.gc-dialogue .ep-message--erreur {
    margin: 18px 0 0;
}

.gc-dialogue-actions {
    margin-top: 22px;
}

@media (max-width: 560px) {
    .gc-dialogue-corps {
        padding: 22px 16px 18px;
    }

    .gc-tirage {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .gc-tirage-apercu {
        max-height: 160px;
        width: auto;
        max-width: 100%;
    }

    .gc-dialogue-actions .ep-bouton {
        width: 100%;
    }
}

/* ---------- Panier ---------- */

.gc-lignes {
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--ep-trait);
}

.gc-ligne {
    display: grid;
    grid-template-columns: 76px 1fr 84px 90px 40px;
    gap: 16px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--ep-trait);
}

.gc-ligne img {
    width: 76px;
    height: 76px;
    object-fit: cover;
    border-radius: 3px;
    background: #111;
}

.gc-ligne-texte strong {
    display: block;
    color: #eee;
    font-weight: 500;
}

.gc-ligne-texte span {
    font-size: 13px;
}

.gc-panier .gc-ligne-quantite input {
    height: 42px;
    text-align: center;
}

.gc-ligne-prix {
    color: #eee;
    text-align: right;
}

.gc-ligne-retirer {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .06);
    color: #ddd;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.gc-ligne-retirer:hover {
    background: rgba(255, 107, 129, .25);
    color: #fff;
}

.gc-panier-pied {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 14px 0 26px;
}

.gc-sans-js {
    display: none;
}

.gc-sous-total {
    margin: 0 0 0 auto;
}

.gc-sous-total strong {
    color: #fff;
    font-size: 18px;
}

.gc-commande {
    max-width: 680px;
    margin-top: 30px;
}

.gc-sous-titre {
    margin: 0 0 14px;
    font-family: "Poppins", sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.gc-sous-titre:not(:first-child) {
    margin-top: 28px;
}

.gc-livraison small {
    color: #8c8c8c;
}

.gc-deux {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px;
}

.gc-totaux {
    margin-bottom: 18px;
}

.gc-total dt,
.gc-total dd {
    color: #fff !important;
    font-size: 18px;
}

@media (max-width: 767px) {
    .gc-ligne {
        grid-template-columns: 64px 1fr 70px 36px;
        grid-template-areas:
            "photo texte texte retirer"
            "photo quantite prix prix";
        gap: 6px 12px;
    }

    .gc-ligne img          { grid-area: photo; width: 64px; height: 64px; }
    .gc-ligne-texte        { grid-area: texte; }
    .gc-ligne-quantite     { grid-area: quantite; max-width: 80px; }
    .gc-ligne-prix         { grid-area: prix; }
    .gc-ligne-retirer      { grid-area: retirer; justify-self: end; }

    .gc-deux {
        grid-template-columns: 1fr;
    }
}

/* Texte lu par les lecteurs d'écran seulement */
.gc-cache {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ---------- QR code de téléchargement ---------- */

.gc-qr {
    width: 40px;
    padding: 0;
}

.gc-dialogue--qr {
    width: min(560px, calc(100vw - 24px));
}

.gc-qr-contenu {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 24px;
    align-items: start;
}

.gc-qr-code svg {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 4px;
}

.gc-qr-vignette {
    width: 96px;
    height: 96px;
    margin-bottom: 12px;
    object-fit: cover;
    border-radius: 3px;
    background: #111;
}

@media (max-width: 560px) {
    .gc-qr-contenu {
        grid-template-columns: 1fr;
    }

    .gc-qr-code {
        max-width: 240px;
        margin: 0 auto;
    }

    .gc-qr-vignette {
        display: none;
    }
}

/* Page ouverte sur le téléphone après le scan */
.gc-qr-page {
    text-align: center;
}

.gc-qr-photo {
    display: block;
    max-width: 100%;
    max-height: 70vh;
    margin: 0 auto;
    border-radius: 3px;
}

.gc-qr-page .ep-actions {
    margin-top: 20px;
}

.gc-icone {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
