/* ============================================================
   MK BikeDesk Location — Styles
   ============================================================ */

#mk-bikedesk-wrap {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    max-width: 900px;
    margin: 0 auto;
    color: #111;
}

/* ── Étapes ───────────────────────────────────────────────── */
.mkbd-steps {
    display: flex;
    border-bottom: 2px solid #111;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0;
}
.mkbd-step {
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    color: #ccc;
    cursor: default;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    user-select: none;
    white-space: nowrap;
}
.mkbd-step.done   { color: #111; cursor: pointer; }
.mkbd-step.done:hover { color: #555; }
.mkbd-step.active { color: #111; border-bottom-color: #111; }

/* ── Panneaux ─────────────────────────────────────────────── */
.mkbd-panel         { display: none; }
.mkbd-panel.active  { display: block; }

/* ── Messages ─────────────────────────────────────────────── */
.mkbd-msg {
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 1rem;
    border-left: 4px solid;
    border-radius: 3px;
}
.mkbd-msg-err { background: #fff0f0; border-color: #c00; color: #c00; }
.mkbd-msg-ok  { background: #f0fff0; border-color: #2a7a2a; color: #2a7a2a; }

/* ── Boutons ──────────────────────────────────────────────── */
.mkbd-btn {
    display: inline-block;
    padding: 10px 20px;
    border: 1px solid #111;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: .1s;
    background: #fff;
    color: #111;
    border-radius: 3px;
    font-family: inherit;
}
.mkbd-btn:hover       { background: #f5f5f5; color: #111; text-decoration: none; }
.mkbd-btn-primary     { background: #111; color: #fff !important; border-color: #111; }
.mkbd-btn-primary:hover { background: #333; color: #fff !important; }
.mkbd-btn-ghost       { background: transparent; border-color: #ccc; color: #777; }
.mkbd-btn-ghost:hover { background: #f5f5f5; color: #111; }
.mkbd-btn-full        { display: block; width: 100%; box-sizing: border-box; }
.mkbd-btn-sm          { padding: 6px 14px; font-size: 12px; }
.mkbd-btn-cart        { font-size: 15px; padding: 14px 20px; }
.mkbd-btn:disabled    { opacity: .5; cursor: not-allowed; }

/* ── Loading ──────────────────────────────────────────────── */
.mkbd-loading {
    padding: 1.5rem;
    text-align: center;
    color: #888;
    font-size: 13px;
}
.mkbd-empty {
    font-size: 13px;
    color: #888;
    padding: 1rem 0;
}

/* ── Barre période ────────────────────────────────────────── */
.mkbd-period-bar {
    font-size: 13px;
    color: #555;
    background: #f8f8f8;
    padding: 8px 12px;
    border-left: 3px solid #111;
    margin-bottom: 1.25rem;
}

/* ── Panier bar ───────────────────────────────────────────── */
.mkbd-panier-bar {
    background: #111;
    color: #fff;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    font-size: 13px;
}

/* ── Calendrier ───────────────────────────────────────────── */
.mkbd-hint {
    font-size: 14px;
    padding: 10px 14px;
    background: #f8f8f8;
    border-left: 4px solid #111;
    margin-bottom: 1.25rem;
}
.mkbd-cal-nav {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.mkbd-cal-nav button {
    padding: 6px 14px;
    border: 1px solid #ccc;
    background: #fff;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    border-radius: 3px;
}
.mkbd-cal-nav button:hover:not(:disabled) { background: #f5f5f5; }
.mkbd-cal-nav button:disabled { opacity: .3; cursor: default; }

.mkbd-cal-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}
@media (max-width: 640px) {
    .mkbd-cal-grid { grid-template-columns: 1fr; }
}
.mkbd-cal-month-name {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    text-align: center;
    margin-bottom: 8px;
}
.mkbd-cal-dow {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}
.mkbd-cal-dow span {
    font-size: 9px;
    color: #aaa;
    text-align: center;
    padding: 2px 0;
}
.mkbd-cal-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
}
.mkbd-day {
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    border-radius: 3px;
    user-select: none;
    transition: .1s;
}
.mkbd-day:hover:not(.past):not(.empty):not(.too-far) { background: #f0f0f0; }
.mkbd-day.empty, .mkbd-day.past, .mkbd-day.too-far { color: #ccc; cursor: default; }
.mkbd-day.start, .mkbd-day.end  { background: #111; color: #fff; }
.mkbd-day.start    { border-radius: 3px 0 0 3px; }
.mkbd-day.end      { border-radius: 0 3px 3px 0; }
.mkbd-day.start.end { border-radius: 3px; }
.mkbd-day.in-range { background: #e8e8e8; border-radius: 0; }

/* ── Filtres ──────────────────────────────────────────────── */
.mkbd-filtres {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: .75rem;
}
.mkbd-filtre-btn {
    padding: 5px 14px;
    border: 1px solid #ccc;
    background: #fff;
    font-size: 12px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    border-radius: 3px;
    transition: .1s;
}
.mkbd-filtre-btn:hover   { border-color: #111; }
.mkbd-filtre-btn.active  { background: #111; color: #fff; border-color: #111; }

/* ── Grille vélos ─────────────────────────────────────────── */
.mkbd-velo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 1rem;
}
.mkbd-vcard {
    border: 1px solid #ddd;
    cursor: pointer;
    transition: .15s;
    position: relative;
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
}
.mkbd-vcard:hover      { border-color: #999; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.mkbd-vcard.selected   { border: 2px solid #111; }

.mkbd-vcard-img {
    height: 130px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}
.mkbd-vcard-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.mkbd-no-img { font-size: 36px; opacity: .2; }

.mkbd-cat-badge {
    position: absolute;
    top: 7px;
    left: 7px;
    background: rgba(255,255,255,.92);
    font-size: 10px;
    padding: 2px 7px;
    font-weight: 600;
    border-radius: 2px;
}
.mkbd-vcheck {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 22px;
    height: 22px;
    border: 2px solid #ccc;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    border-radius: 3px;
}
.mkbd-vcard.selected .mkbd-vcheck {
    background: #111;
    border-color: #111;
    color: #fff;
}
.mkbd-vcard-body  { padding: 10px; }
.mkbd-vcard-brand { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: #aaa; margin-bottom: 2px; }
.mkbd-vcard-name  { font-size: 13px; font-weight: 700; margin-bottom: 3px; }
.mkbd-vcard-meta  { font-size: 11px; color: #aaa; margin-bottom: 6px; }
.mkbd-vcard-price { font-size: 1.15rem; font-weight: 700; }
.mkbd-vcard-price small { font-size: .6rem; color: #aaa; font-weight: 400; }

/* ── Accessoires ──────────────────────────────────────────── */
.mkbd-opts-block {
    border: 1px solid #e0e0e0;
    margin-bottom: 1rem;
    border-radius: 4px;
    overflow: hidden;
}
.mkbd-opts-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: #f8f8f8;
    border-bottom: 1px solid #e0e0e0;
}
.mkbd-opts-header-img {
    width: 52px;
    height: 40px;
    background: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    border-radius: 3px;
}
.mkbd-opts-header-img img { width: 100%; height: 100%; object-fit: cover; }
.mkbd-opts-header-title { font-size: 13px; font-weight: 700; }
.mkbd-opts-header-sub   { font-size: 12px; color: #888; }
.mkbd-opts-body         { padding: 12px 14px; }
.mkbd-opts-loading      { font-size: 13px; color: #aaa; padding: 8px 0; }

.mkbd-opt-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border: 1px solid #e8e8e8;
    margin-bottom: 6px;
    cursor: pointer;
    border-radius: 3px;
    transition: .1s;
}
.mkbd-opt-row:last-child { margin-bottom: 0; }
.mkbd-opt-row:hover      { border-color: #999; }
.mkbd-opt-row.selected   { border-color: #111; background: #fafafa; }
.mkbd-opt-row input[type=checkbox] {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    accent-color: #111;
    cursor: pointer;
}
.mkbd-opt-desc { flex: 1; font-size: 13px; font-weight: 600; }
.mkbd-opt-tag  { font-size: 11px; padding: 2px 8px; background: #f0f0f0; color: #555; font-weight: 600; border-radius: 2px; }
.mkbd-opt-tag.paid { background: #111; color: #fff; }

/* ── Récap ────────────────────────────────────────────────── */
.mkbd-recap-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-bottom: 1rem;
}
.mkbd-recap-table th {
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #888;
    padding: 6px 8px;
    border-bottom: 2px solid #111;
}
.mkbd-recap-table td  { padding: 8px; border-bottom: 1px solid #eee; }
.mkbd-tr-velo td      { font-weight: 700; background: #f8f8f8; }
.mkbd-tr-total td     { font-weight: 700; font-size: 15px; border-top: 2px solid #111; border-bottom: none; padding-top: 10px; }

.mkbd-total-bar {
    background: #111;
    color: #fff;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 1.25rem;
    border-radius: 3px;
}

/* ── CGV ──────────────────────────────────────────────────── */
.mkbd-cgv-box {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    margin-bottom: 1rem;
    border-radius: 3px;
}
.mkbd-cgv-box input[type=checkbox] {
    width: 16px;
    height: 16px;
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: #111;
    cursor: pointer;
}
.mkbd-cgv-box label {
    font-size: 13px;
    color: #333;
    cursor: pointer;
    line-height: 1.5;
}
.mkbd-cgv-box a { color: #111; font-weight: 600; }

/* ── Note login ───────────────────────────────────────────── */
.mkbd-login-note {
    font-size: 12px;
    color: #888;
    text-align: center;
    margin-top: 8px;
}
.mkbd-login-note a { color: #111; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 600px) {
    .mkbd-steps { overflow-x: auto; }
    .mkbd-step  { padding: 8px 12px; font-size: 12px; }
    .mkbd-velo-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

/* ── Lien changer les dates ──────────────────────────────── */
.mkbd-period-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.mkbd-change-date {
    font-size: 12px;
    color: #555;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    padding: 2px 8px;
    border: 1px solid #ccc;
    border-radius: 3px;
    transition: .1s;
}
.mkbd-change-date:hover {
    background: #fff;
    border-color: #111;
    color: #111;
    text-decoration: none;
}

/* ── Étape combinée Dates + Vélos ───────────────────────────── */

.mkbd-dates-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    background: #f0f7f0;
    border: 1px solid #cde3cd;
    border-radius: 8px;
    padding: .75rem 1rem;
    margin-bottom: 1.25rem;
    font-weight: 600;
}
.mkbd-dates-summary .mkbd-change-date { white-space: nowrap; }

.mkbd-velos-info {
    margin: 1.25rem 0 .75rem;
    color: #555;
    font-size: .95rem;
}
.mkbd-velos-info:empty { display: none; }

/* Cartes en mode catalogue (dates pas encore choisies) */
.mkbd-vcard.catalog { cursor: pointer; opacity: .92; }
.mkbd-vcard.catalog .mkbd-vcheck { display: none; }
.mkbd-vcard.catalog:hover { opacity: 1; }

/* Flash du hint quand on clique un vélo sans avoir choisi les dates */
.mkbd-hint-flash {
    animation: mkbdFlash 1.6s ease;
}
@keyframes mkbdFlash {
    0%, 100% { background: transparent; }
    20%, 60% { background: #fff3cd; box-shadow: 0 0 0 3px #ffe08a; border-radius: 6px; }
}

/* Bouton "Effacer les dates" dans la nav du calendrier */
.mkbd-cal-nav .mkbd-btn-ghost { border-color: #ccc; color: #777; background: #fff; }
.mkbd-cal-nav .mkbd-btn-ghost:hover { background: #f5f5f5; color: #111; }

.mkbd-dates-summary-actions { display: flex; gap: 1rem; white-space: nowrap; }


/* ============================================================
   CALENDRIER EN POPUP — desktop ET mobile
   Champ unique « Période de location » qui ouvre le calendrier
   dans une fenêtre (popup centrée en desktop, feuille glissante
   en mobile). Le bloc calendrier interne reste piloté par mkBD.
   ============================================================ */

/* Champ « Période de location » */
#mkbd-date-fields {
    display: flex;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 1.25rem;
    max-width: 420px;
}

.mkbd-date-field {
    flex: 1 1 auto;
    min-width: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    min-height: 56px;
    padding: 9px 40px 9px 14px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: .1s;
    -webkit-tap-highlight-color: transparent;
}

.mkbd-date-field:hover  { border-color: #111; }
.mkbd-date-field:active { background: #f5f5f5; }

.mkbd-date-field-label {
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: #aaa;
}

.mkbd-date-field-value {
    font-size: 15px;
    line-height: 1.2;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

#mkbd-date-fields.is-filled .mkbd-date-field-value {
    color: #111;
    font-weight: 700;
}

.mkbd-date-field-caret {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #888;
}

/* Bouton effacer : visible seulement quand des dates sont posées */
.mkbd-date-field-reset {
    display: none;
    flex: 0 0 auto;
    width: 50px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 15px;
    line-height: 1;
    color: #888;
    cursor: pointer;
    font-family: inherit;
    transition: .1s;
}
.mkbd-date-field-reset:hover { border-color: #111; color: #111; }

#mkbd-date-fields.is-filled .mkbd-date-field-reset { display: block; }

/* Le résumé vert fait doublon avec le champ */
#mkbd-dates-summary { display: none !important; }

/* ── Enveloppe popup / feuille ─────────────────────────────── */
.mkbd-cal-sheet {
    position: fixed;
    inset: 0;
    z-index: 99990;
    visibility: hidden;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.mkbd-cal-sheet.is-open {
    visibility: visible;
    pointer-events: auto;
}

.mkbd-cal-sheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    opacity: 0;
    transition: opacity .2s ease;
}
.mkbd-cal-sheet.is-open .mkbd-cal-sheet-backdrop { opacity: 1; }

/* Popup centrée (desktop) */
.mkbd-cal-sheet-inner {
    position: relative;
    width: 100%;
    max-width: 860px;
    max-height: 90vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 6px;
    padding: 0 24px 24px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, .25);
    transform: translateY(12px) scale(.98);
    opacity: 0;
    transition: transform .2s ease, opacity .2s ease;
}
.mkbd-cal-sheet.is-open .mkbd-cal-sheet-inner {
    transform: none;
    opacity: 1;
}

.mkbd-cal-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 2;
    background: #fff;
    padding: 20px 0 12px;
    margin-bottom: 16px;
    border-bottom: 2px solid #111;
    font-size: 14px;
}

.mkbd-cal-sheet-close {
    background: none;
    border: 0;
    padding: 4px 8px;
    font-size: 18px;
    line-height: 1;
    color: #888;
    cursor: pointer;
    font-family: inherit;
    transition: .1s;
}
.mkbd-cal-sheet-close:hover { color: #111; }

.mkbd-cal-sheet-foot {
    position: sticky;
    bottom: 0;
    background: #fff;
    padding: 16px 0 4px;
    margin-top: 16px;
    box-shadow: 0 -8px 12px -8px rgba(0, 0, 0, .12);
}

body.mkbd-noscroll { overflow: hidden; }

/* Accès rapide aux locations existantes pour les clients connectés */
.mkbd-manage-rentals {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 20px;
    padding: 14px 16px;
    background: #fff9d7;
    border-left: 4px solid #f4da49;
    font-size: 14px;
}
.mkbd-manage-rentals .mkbd-btn { white-space: nowrap; }

.mkbd-terms-access {
    display: flex;
    justify-content: flex-end;
    margin: 0 0 10px;
}
.mkbd-terms-access .mkbd-btn { white-space: nowrap; }
.mkbd-terms-panel {
    margin: 0 0 16px;
    padding: 20px;
    background: #fff;
    border: 1px solid #dedede;
    max-height: 520px;
    overflow: auto;
}
.mkbd-terms-panel h1 { font-size: 26px; }
.mkbd-terms-panel h2 { font-size: 22px; }

/* ── Adaptation MOBILE : feuille glissante par le bas ──────── */
@media (max-width: 768px) {
    .mkbd-manage-rentals { align-items: flex-start; flex-direction: column; }
    .mkbd-terms-access { justify-content: flex-start; }
    #mkbd-date-fields { max-width: none; }

    .mkbd-cal-sheet {
        align-items: flex-end;
        justify-content: stretch;
        padding: 0;
    }

    .mkbd-cal-sheet-inner {
        max-width: none;
        max-height: 90vh;
        border-radius: 12px 12px 0 0;
        padding: 0 16px calc(16px + env(safe-area-inset-bottom, 0px));
        transform: translateY(100%);
        opacity: 1;
        transition: transform .28s ease;
    }
    .mkbd-cal-sheet.is-open .mkbd-cal-sheet-inner { transform: none; }

    /* Poignée décorative */
    .mkbd-cal-sheet-head { padding-top: 22px; }
    .mkbd-cal-sheet-head::before {
        content: "";
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 36px;
        height: 4px;
        border-radius: 2px;
        background: #e0e0e0;
    }

    /* Un seul mois visible à la fois */
    .mkbd-cal-sheet .mkbd-cal-grid { grid-template-columns: 1fr; }
    .mkbd-cal-sheet .mkbd-cal-month:not(:first-child) { display: none; }

    /* Confort tactile */
    .mkbd-cal-sheet .mkbd-cal-nav button { padding: 10px 14px; min-height: 42px; }
    .mkbd-cal-sheet .mkbd-day            { height: 42px; font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
    .mkbd-cal-sheet-inner,
    .mkbd-cal-sheet-backdrop { transition: none; }
}
/* Options de location : prix à droite, texte sous l’option */
.mkbd-opt-row {
    display: grid;
    grid-template-columns: 15px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
}

.mkbd-opt-row input[type="checkbox"] {
    grid-column: 1;
}

.mkbd-opt-desc {
    grid-column: 2;
    min-width: 0;
}

.mkbd-opt-tag {
    grid-column: 3;
    justify-self: end;
    white-space: nowrap;
}

.mkbd-cancellation-info {
    grid-column: 2 / -1;
    margin: 0;
    width: auto;
    flex: none;
}
/* ── Heures de retrait et de retour ───────────────────────── */
.mkbd-times {
    margin: 0 0 1.25rem;
    padding: 12px 14px;
    border: 1px solid #e2e2e2;
    background: #fafafa;
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    align-items: flex-end;
}
.mkbd-time-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.mkbd-time-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #666;
}
.mkbd-time-select {
    padding: 7px 10px;
    border: 1px solid #ccc;
    background: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    border-radius: 3px;
    min-width: 110px;
}
.mkbd-time-select:focus { border-color: #111; outline: none; }
.mkbd-time-note {
    flex: 1 1 100%;
    margin: 0;
    font-size: 13px;
    color: #555;
}
