/* ══ Page d'accueil — design K3 (HomeView.php, classes hk-) ══════════════════════════════════════════════════════
   Fond blanc, orange de la marque, titres Manrope 800 aux lettres resserrées, grands arrondis. Valeurs de la charte. */

.hk {
    background: #fff;
}

.hk-container {
    width: min(var(--page-width), 100% - 2 * var(--page-gutter));
    margin: 0 auto;
}

.hk-container--narrow {
    width: min(var(--page-width-text), 100% - 2 * var(--page-gutter));
}

/* Ancres du pied de page : la section s'arrête sous la barre collée en haut */
.hk [id] {
    scroll-margin-top: 96px;
}

.hk-section {
    padding: 0 0 56px;
}

.hk-title {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    color: var(--c-text);
    font-size: var(--text-4xl);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.03em;
}

.hk-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--c-green);
    font-size: var(--text-lg);
    font-weight: 800;
    text-decoration: none;
}

.hk-link i {
    display: flex;
    transition: transform 0.2s;
}

.hk-link:hover {
    color: var(--c-green-dark);
}

.hk-link:hover i {
    transform: translateX(3px);
}

/* ── Grande photo et carte blanche ── */
.hk-hero {
    display: flex;
    align-items: center;
    min-height: 460px;
    padding: 40px 0 80px;
    box-sizing: border-box;
    background-color: var(--c-green-light);
    background-image: linear-gradient(135deg, var(--c-green-light) 0%, var(--c-gold-light) 100%);
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}

.hk-hero__card {
    max-width: 420px;
    padding: 32px;
    box-sizing: border-box;
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: var(--shadow-lg);
}

.hk-hero__title {
    margin: 0 0 12px;
    color: var(--c-text);
    font-size: var(--text-title);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.035em;
}

.hk-hero__text {
    margin: 0 0 20px;
    color: var(--c-muted);
    font-size: var(--text-lg);
    font-weight: 500;
    line-height: 1.5;
}

/* ── Barre de création : occasion · date · visibilité · bouton, à cheval sur la photo ── */
.hk-create-wrap {
    padding: 0 0 48px;
}

.hk-create {
    position: relative;
    z-index: 1;
    max-width: 960px;
    margin: -40px auto 0;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px;
    box-sizing: border-box;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-pill);
    background: #fff;
    box-shadow: var(--shadow-lg);
}

.hk-create__field {
    flex: 1 1 200px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 24px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: background 0.15s;
}

.hk-create__field:hover,
.hk-create__field:focus-within {
    background: var(--c-surface-alt);
}

.hk-create__label {
    color: var(--c-text);
    font-size: var(--text-xs);
    font-weight: 800;
}

/* Champs sans cadre : la pastille entière est le champ (les champs de global.css ont bordure et anneau) */
.hk-create__field select,
.hk-create__field input[type="date"] {
    width: 100%;
    min-height: 24px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: var(--c-muted);
    font-size: var(--text-md);
    font-weight: 500;
    line-height: 1.5;
    cursor: pointer;
}

.hk-create__field select {
    padding-right: 0;
    background-image: none;
    text-overflow: ellipsis;
}

.hk-create__field select:focus,
.hk-create__field input[type="date"]:focus {
    border-color: transparent;
    box-shadow: none;
    color: var(--c-text);
}

.hk-create__nodate {
    color: var(--c-subtle);
    font-size: var(--text-md);
    font-weight: 500;
    line-height: 1.5;
}

.hk-create__nodate[hidden],
.hk-create__field input[hidden] {
    display: none;
}

.hk-create__sep {
    flex: 0 0 1px;
    height: 32px;
    background: var(--c-border);
}

.hk-create__submit {
    flex-shrink: 0;
    gap: 10px;
    min-height: 56px;
    padding: 0 28px;
    font-size: var(--text-lg);
    font-weight: 800;
}

.hk-create__note {
    margin: 14px 0 0;
    text-align: center;
    color: var(--c-muted);
    font-size: var(--text-md);
    font-weight: 500;
}

.hk-create__note a {
    color: var(--c-green);
    font-weight: 800;
    text-decoration: none;
}

.hk-create__note a:hover {
    color: var(--c-green-dark);
}

/* ── Idées cadeaux ── */
.hk-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 20px;
}

.hk-chip {
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    background: var(--c-green-light);
    color: var(--c-green-dark);
    font-size: var(--text-sm);
    font-weight: 800;
    letter-spacing: 0;
    white-space: nowrap;
}

.hk-head__more {
    flex-shrink: 0;
    color: var(--c-green);
    font-size: var(--text-md);
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.hk-head__more:hover {
    color: var(--c-green-dark);
}

.hk-ideas__grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 20px;
}

.hk-idea {
    display: flex;
    flex-direction: column;
    min-width: 0;
    color: var(--c-text);
    text-decoration: none;
}

/* Photo du produit sur fond gris clair : multiply fond le blanc des photos de boutique dans ce fond */
.hk-idea__img {
    position: relative;
    display: block;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--c-surface-alt);
}

.hk-idea__img img {
    display: block;
    width: 100%;
    height: 100%;
    padding: 16px;
    box-sizing: border-box;
    object-fit: contain;
    mix-blend-mode: multiply;
    transition: transform 0.3s ease;
}

.hk-idea:hover .hk-idea__img img {
    transform: scale(1.04);
}

.hk-idea__add {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--c-green);
    color: #fff;
    font-size: var(--text-md);
    transition: transform 0.2s;
}

.hk-idea__add i {
    display: flex;
}

.hk-idea:hover .hk-idea__add {
    transform: scale(1.08);
}

.hk-idea__name {
    display: -webkit-box;
    margin-top: 10px;
    overflow: hidden;
    font-size: var(--text-md);
    font-weight: 600;
    line-height: 1.5;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.hk-idea__price {
    margin-top: 2px;
    font-size: var(--text-lg);
    font-weight: 800;
}

/* ── Comment ça marche ── */
.hk-steps {
    padding: 48px 0 64px;
    border-top: 1px solid var(--c-border);
}

.hk-steps .hk-title {
    margin-bottom: 28px;
}

.hk-steps__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.hk-step {
    padding: 28px;
    border-radius: var(--radius-lg);
    background: var(--c-surface-alt);
}

.hk-step__num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-bottom: 14px;
    border-radius: 50%;
    background: var(--c-green-light);
    color: var(--c-green-dark);
    font-size: var(--text-xl);
    font-weight: 800;
}

.hk-step__title {
    margin: 0 0 6px;
    font-size: var(--text-xl);
    font-weight: 800;
    line-height: 1.2;
}

.hk-step__text {
    margin: 0;
    color: var(--c-muted);
    font-size: var(--text-md);
    font-weight: 500;
    line-height: 1.5;
}

/* ── Démonstration du mode surprise (data-view="guest|owner", home.js) ── */
.hk-demo {
    padding: 64px 0;
    background: var(--c-green-light);
}

.hk-demo__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 40px 72px;
}

.hk-demo__text {
    flex: 1 1 380px;
    min-width: 0;
}

.hk-demo__title {
    margin: 0 0 12px;
    color: var(--c-text);
    font-size: var(--text-5xl);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.035em;
}

.hk-demo__text p {
    max-width: 440px;
    margin: 0;
    color: var(--c-text);
    font-size: var(--text-lg);
    font-weight: 500;
    line-height: 1.5;
}

.hk-demo__card {
    flex: 1 1 520px;
    min-width: 0;
    padding: 24px;
    box-sizing: border-box;
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: var(--shadow-md);
}

.hk-demo__tabs {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 16px;
    padding: 4px;
    border-radius: var(--radius-pill);
    background: var(--c-surface-alt);
}

.hk-demo__tab {
    min-height: 44px;
    padding: 10px 18px;
    border: 0;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--c-text);
    font-family: inherit;
    font-size: var(--text-md);
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.hk-demo__tab[aria-pressed="true"] {
    background: var(--c-text);
    color: #fff;
}

.hk-demo__tab:focus-visible {
    outline: 3px solid var(--c-green);
    outline-offset: 2px;
}

.hk-demo__list {
    margin: 0 0 12px;
    font-size: var(--text-xl);
    font-weight: 800;
}

.hk-demo__list span {
    color: var(--c-muted);
    font-size: var(--text-md);
    font-weight: 500;
}

.hk-demo__notice {
    display: none;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    background: var(--c-green-light);
    color: var(--c-green-dark);
    font-size: var(--text-md);
    font-weight: 800;
}

.hk-demo__notice i {
    display: flex;
}

[data-view="owner"] .hk-demo__notice {
    display: flex;
}

.hk-demo__items {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.hk-demo__item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hk-demo__thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 56px;
    height: 56px;
    border-radius: var(--radius-md);
    background: var(--c-surface-alt);
    font-size: var(--text-3xl);
}

.hk-demo__thumb--free  { background: var(--c-gold-light); }
.hk-demo__thumb--group { background: var(--c-green-light); }

.hk-demo__name {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    font-size: var(--text-md);
    font-weight: 600;
}

.hk-demo__name strong {
    font-weight: 800;
}

.hk-demo__tag {
    flex-shrink: 0;
    padding: 6px 12px;
    border: 1.5px solid transparent;
    border-radius: var(--radius-pill);
    font-size: var(--text-sm);
    font-weight: 700;
    white-space: nowrap;
}

.hk-demo__tag--free  { border-color: var(--c-border); color: var(--c-text); }
.hk-demo__tag--taken { background: var(--c-text); color: #fff; }
.hk-demo__tag--group { background: var(--c-green); color: #fff; }

/* Vous, en mode surprise : aucune réservation visible */
[data-view="owner"] .hk-demo__tag {
    display: none;
}

/* ── Questions fréquentes ── */
.hk-faq {
    padding-top: 56px;
}

.hk-faq .hk-title {
    margin-bottom: 24px;
}

.hk-faq__list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hk-faq__item {
    border-radius: var(--radius-lg);
    background: var(--c-surface-alt);
}

.hk-faq__item summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    color: var(--c-text);
    font-size: var(--text-lg);
    font-weight: 700;
    line-height: 1.5;
    list-style: none;
    cursor: pointer;
}

.hk-faq__item summary::-webkit-details-marker {
    display: none;
}

.hk-faq__item summary::after {
    content: '+';
    flex-shrink: 0;
    color: var(--c-green);
    font-size: var(--text-2xl);
    font-weight: 500;
    line-height: 1;
    transition: transform 0.2s;
}

.hk-faq__item[open] summary::after {
    transform: rotate(45deg);
}

.hk-faq__item summary:focus-visible {
    outline: 3px solid var(--c-green);
    outline-offset: 2px;
    border-radius: var(--radius-lg);
}

.hk-faq__item p {
    margin: 0;
    padding: 0 24px 20px;
    color: var(--c-muted);
    font-size: var(--text-md);
    line-height: 1.7;
}

/* ── Dernier appel ── */
.hk-final {
    padding-bottom: 72px;
}

.hk-final__box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 40px 48px;
    box-sizing: border-box;
    border-radius: var(--radius-lg);
    background: var(--c-green);
    color: #fff;
}

.hk-final__title {
    margin: 0 0 6px;
    font-size: var(--text-4xl);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.035em;
}

.hk-final__text {
    margin: 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: var(--text-md);
    font-weight: 500;
}

.hk-final__text a {
    color: #fff;
    font-weight: 700;
}

.hk-final__btn {
    font-weight: 800;
}

/* ── Bouton fixe sur téléphone (visiteurs, home.js) ── */
.hk-sticky {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 900;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow-up);
    transform: translateY(calc(100% + 80px)); /* masqué : sous l'écran, même posé au-dessus de la barre du bas */
    transition: transform 0.2s ease, bottom 0.3s ease;
}

.hk-sticky.is-visible {
    transform: translateY(0);
}

.hk-sticky .btn {
    max-width: 480px;            /* tablette : pas un bouton de toute la largeur */
    margin: 0 auto;
    font-weight: 800;
}

/* ── Tablette et petit ordinateur ── */
@media (max-width: 1024px) {
    .hk-ideas__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    /* Barre du bas affichée (header.js la masque au défilement) : le bouton fixe se pose au-dessus d'elle */
    .header__menu--mobile:not(.header__menu--hidden) ~ .hk .hk-sticky {
        bottom: calc(60px + env(safe-area-inset-bottom));
        padding-bottom: 12px;
    }

    /* Place pour le bouton fixe sous le dernier appel (visiteurs seulement) */
    .hk-final:has(~ .hk-sticky) {
        padding-bottom: 120px;
    }
}

@media (min-width: 1025px) {
    .hk-sticky {
        display: none;
    }
}

/* ── Barre de création en colonne ── */
@media (max-width: 768px) {
    .hk-hero {
        min-height: 0;
        padding: 32px 0 72px;
    }
    .hk-create {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        margin-top: -40px;
        border-radius: var(--radius-lg);
    }
    .hk-create__field {
        flex: none;
        padding: 12px 16px;
        border-radius: var(--radius-md);
    }
    .hk-create__sep {
        flex: none;
        height: 1px;
        margin: 0 16px;
    }
    .hk-create__submit {
        width: 100%;
        margin-top: 8px;
    }
    .hk-demo__title {
        font-size: var(--text-4xl);
    }
    .hk-final__box {
        padding: 32px 24px;
    }
    .hk-final__btn {
        width: 100%;
        box-sizing: border-box;
    }
}

/* ── Téléphone : idées en 2 colonnes, images carrées ── */
@media (max-width: 640px) {
    .hk-title,
    .hk-final__title {
        font-size: var(--text-3xl);
    }
    .hk-head {
        align-items: flex-start;
    }
    .hk-ideas__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }
    .hk-idea:nth-child(5) {
        display: none;               /* 4 idées : deux rangées pleines */
    }
    .hk-idea__img {
        aspect-ratio: 1 / 1;
    }
    .hk-hero__card {
        padding: 24px;
    }
    .hk-step {
        padding: 24px;
    }
    .hk-demo {
        padding: 48px 0;
    }
    .hk-demo__card {
        padding: 16px;
    }
    .hk-demo__tab {
        padding: 10px 14px;
    }
    .hk-faq__item summary {
        padding: 16px 20px;
        font-size: var(--text-md);
    }
    .hk-faq__item p {
        padding: 0 20px 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hk-idea__img img,
    .hk-idea__add,
    .hk-link i,
    .hk-sticky {
        transition: none;
    }
    .hk-idea:hover .hk-idea__img img,
    .hk-idea:hover .hk-idea__add {
        transform: none;
    }
}
