/* ==========================================================
   VARIABLES
   ========================================================== */

:root {
    --afk-orange:         #F47216;
    --afk-orange-light:   #FF8A2B;
    --afk-orange-bg:      #FFF4EB;
    --afk-orange-bg-deep: #FFE9D7;
    --afk-dark:           #0B0E13;
    --afk-dark-hover:     #1a1f29;
    --afk-border:         #E2E5EA;
    --afk-border-card:    #ECEEF1;
    --afk-text-muted:     #48505e;
    --afk-text-gray:      #3A4150;
    --afk-text-light:     #9aa1ac;
    --afk-bg-neutral:     #EEF0F3;
    --afk-green:          #16A34A;
    --afk-green-dark:     #0f7a37;
    --afk-red:            #b91c1c;
    --afk-wa-green:       #25D366;
    --afk-wa-dark:        #06321c;
    --afk-radius-sm:      8px;
    --afk-radius:         11px;
    --afk-radius-md:      12px;
    --afk-radius-lg:      16px;
    --afk-font-main:      Inter, sans-serif;
    --afk-font-title:     Archivo, sans-serif;
}


/* ==========================================================
   CONTAINER — [afk_reservation_form]
   ========================================================== */

.afk-fc {
    padding: 20px 18px 22px;
    border-radius: var(--afk-radius-lg);
    background: #fff;
    color: var(--afk-dark);
    font-family: var(--afk-font-main);
    box-shadow: 0 20px 50px -18px rgba(0, 0, 0, .55);
}

.afk-fc h2 {
    margin: 0 0 4px;
    font-family: var(--afk-font-title);
    font-size: 23px;
    font-weight: 800;
    font-style: italic;
    line-height: 1.02;
    text-transform: uppercase;
    color: var(--afk-dark);
}

.afk-note {
    margin-bottom: 14px;
    color: var(--afk-text-gray);
    font-size: 13px;
}


/* ==========================================================
   BADGE
   ========================================================== */

.afk-ok {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 8px;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(22, 163, 74, .12);
    color: var(--afk-green);
    font-size: 11.5px;
    font-weight: 700;
}

.afk-ok-dot {
    display: block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--afk-green);
}


/* ==========================================================
   FORMULAIRE — CHAMPS
   ========================================================== */

.afk-f {
    margin-bottom: 11px;
}

.afk-f label {
    display: block;
    margin-bottom: 5px;
    color: var(--afk-text-muted);
    font-size: 12.5px;
    font-weight: 600;
}

.afk-req {
    color: var(--afk-orange);
}

/* !important requis pour contrecarrer les styles de thème */
.afk-f input,
.afk-f select {
    visibility: visible;
    opacity: 1;
    width: 100%;
    padding: 13px;
    border: 1.5px solid var(--afk-border);
    border-radius: var(--afk-radius);
    background: #fff;
    box-sizing: border-box;
    color: var(--afk-dark);
    font-family: var(--afk-font-main);
    font-size: 15.5px;
    -webkit-appearance: none;
    appearance: none;
}

.afk-f input:focus,
.afk-f select:focus {
    outline: none;
    border-color: var(--afk-orange);
    box-shadow: 0 0 0 4px rgba(244, 114, 22, .14);
}

/* Overrides thème & macOS pour les selects natifs */
.afk-f select:not(.afk-veh-hidden) {
    padding: 11px 36px 11px 13px !important;
    border: 1.5px solid var(--afk-border) !important;
    background: #fff !important;
    background-color: #fff !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%239aa1ac'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 13px center !important;
    box-shadow: none !important;
    color: var(--afk-dark) !important;
    font-weight: 600 !important;
}

.afk-f select:not(.afk-veh-hidden):focus {
    border-color: var(--afk-orange) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23F47216'/%3E%3C/svg%3E") !important;
    box-shadow: 0 0 0 4px rgba(244, 114, 22, .14) !important;
}

/* Grille deux colonnes (dates) */
.afk-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* Select véhicule caché (remplacé par le dropdown custom) */
.afk-veh-hidden {
    display: none !important;
}


/* ==========================================================
   DROPDOWN VÉHICULE PERSONNALISÉ
   ========================================================== */

.afk-select {
    position: relative;
    visibility: visible;
    opacity: 1;
}

/* !important requis : les thèmes appliquent souvent leurs propres styles aux <button> */
.afk-fc .afk-select-trigger {
    visibility: visible;
    opacity: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 11px 13px;
    border: 1.5px solid var(--afk-border);
    border-radius: var(--afk-radius);
    background: #fff !important;
    background-color: #fff !important;
    background-image: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
    box-sizing: border-box;
    cursor: pointer;
    color: var(--afk-dark) !important;
    font-family: var(--afk-font-main);
    font-size: 15.5px;
    font-weight: 600;
    letter-spacing: normal;
    text-align: left;
    text-transform: none;
}

.afk-fc .afk-select-trigger:hover,
.afk-fc .afk-select-trigger:focus {
    background: #fff !important;
    background-color: #fff !important;
    box-shadow: none !important;
    color: var(--afk-dark) !important;
}

.afk-fc .afk-select-trigger::after {
    content: "";
    flex-shrink: 0;
    margin-top: 5px;
    margin-left: auto;
    border: 5px solid transparent;
    border-top-color: var(--afk-text-light);
}

.afk-fc .afk-select.open .afk-select-trigger {
    border-color: var(--afk-orange);
    box-shadow: 0 0 0 4px rgba(244, 114, 22, .14) !important;
}

.afk-fc .afk-select.open .afk-select-trigger::after {
    transform: rotate(180deg);
    margin-top: -5px;
    border-top-color: var(--afk-orange);
}

.afk-select-label {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 9px;
    overflow: hidden;
}

.afk-select-label span {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.afk-sel-thumb {
    flex-shrink: 0;
    width: 36px;
    height: 25px;
    border-radius: 5px;
    object-fit: cover;
}

.afk-select-list {
    visibility: visible;
    opacity: 1;
    display: none;
    position: absolute;
    z-index: 60;
    left: 0;
    right: 0;
    max-height: 330px;
    margin: 6px 0 0;
    padding: 6px;
    border: 1px solid var(--afk-border);
    border-radius: var(--afk-radius-md);
    background: #fff;
    overflow: auto;
    box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .45);
    list-style: none;
}

.afk-select-list.open {
    display: block;
}

.afk-select-opt {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 9px;
    cursor: pointer;
}

.afk-select-opt:hover {
    background: var(--afk-orange-bg);
}

.afk-select-opt.sel {
    background: var(--afk-orange-bg-deep);
}

.afk-opt-thumb {
    display: block;
    flex-shrink: 0;
    width: 48px;
    height: 33px;
    border-radius: 6px;
    background: var(--afk-bg-neutral);
    object-fit: cover;
}

.afk-opt-noimg {
    display: inline-block;
}

.afk-opt-name {
    flex: 1;
    color: var(--afk-dark);
    font-size: 14.5px;
    font-weight: 600;
}

.afk-opt-price {
    color: var(--afk-orange);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}


/* ==========================================================
   DISPONIBILITÉ & TOTAL
   ========================================================== */

.afk-avail {
    display: none;
    margin: 0 0 12px;
    padding: 11px 14px;
    border-radius: var(--afk-radius);
    font-size: 13px;
    font-weight: 600;
}

.afk-avail.checking {
    display: block;
    background: #F3F4F6;
    color: #6b7280;
}

/* Groupés : mêmes couleurs pour disponibilité et messages */
.afk-avail.ok,
.afk-msg.ok {
    display: block;
    background: rgba(22, 163, 74, .12);
    border: 1px solid rgba(22, 163, 74, .3);
    color: var(--afk-green-dark);
}

.afk-avail.no,
.afk-msg.err {
    display: block;
    background: rgba(220, 38, 38, .1);
    border: 1px solid rgba(220, 38, 38, .3);
    color: var(--afk-red);
}

.afk-total {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 10px;
    margin: 4px 0 12px;
    padding: 13px 15px;
    border: 1px solid rgba(244, 114, 22, .3);
    border-radius: var(--afk-radius-md);
    background: linear-gradient(180deg, var(--afk-orange-bg), var(--afk-orange-bg-deep));
}

.afk-total-lbl {
    color: var(--afk-text-muted);
    font-size: 13px;
    font-weight: 600;
}

.afk-total-val {
    margin-left: auto;
    color: var(--afk-orange);
    font-family: var(--afk-font-title);
    font-size: 20px;
    font-weight: 800;
}

.afk-total-detail {
    width: 100%;
    color: #8a6c52;
    font-size: 11.5px;
}


/* ==========================================================
   MESSAGES
   ========================================================== */

.afk-msg {
    display: none;
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: var(--afk-radius);
    font-size: 13.5px;
}

/* .afk-msg.ok et .afk-msg.err sont définis avec .afk-avail ci-dessus */


/* ==========================================================
   BOUTONS
   ========================================================== */

.afk-sbtn {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 15px 20px;
    border: none;
    border-radius: var(--afk-radius-md);
    background: linear-gradient(180deg, var(--afk-orange-light), var(--afk-orange));
    box-shadow: 0 12px 26px -10px rgba(244, 114, 22, .7);
    cursor: pointer;
    color: #fff;
    font-family: var(--afk-font-main);
    font-size: 15.5px;
    font-weight: 700;
    text-align: center;
}

.afk-sbtn:disabled {
    opacity: .55;
    cursor: not-allowed;
    box-shadow: none;
}

.afk-alt {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 14px 0 6px;
    color: var(--afk-text-light);
    font-size: 12px;
}

.afk-alt::before,
.afk-alt::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #E6E8EC;
}

.afk-wa-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    padding: 15px 20px;
    border: none;
    border-radius: var(--afk-radius-md);
    background: var(--afk-wa-green);
    cursor: pointer;
    color: var(--afk-wa-dark);
    font-family: var(--afk-font-main);
    font-size: 15.5px;
    font-weight: 700;
    text-decoration: none;
}

.afk-trust-line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 13px;
    color: var(--afk-text-gray);
    font-size: 12px;
}


/* ==========================================================
   GRILLE FLOTTE — [afk_fleet]
   ========================================================== */

.afk-fleet {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}

.afk-fleet * {
    box-sizing: border-box;
}

.afk-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--afk-border-card);
    border-radius: var(--afk-radius-lg);
    background: #fff;
    box-shadow: 0 10px 30px -22px rgba(0, 0, 0, .35);
}

.afk-card-img {
    position: relative;
    aspect-ratio: 798 / 467;
    background: var(--afk-bg-neutral);
}

.afk-card-img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.afk-card-badge {
    position: absolute;
    bottom: 12px;
    left: 0;
    padding: 7px 13px 7px 12px;
    border-radius: 0 10px 10px 0;
    background: var(--afk-orange);
    box-shadow: 0 6px 14px -6px rgba(244, 114, 22, .7);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}

.afk-card-badge b {
    font-family: var(--afk-font-title);
    font-size: 18px;
    font-weight: 800;
}

.afk-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 11px;
    padding: 15px 15px 16px;
}

.afk-card-body h3 {
    margin: 0;
    font-family: var(--afk-font-title);
    font-size: 20px;
    font-weight: 800;
    font-style: italic;
    text-transform: uppercase;
    color: var(--afk-dark);
}

.afk-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.afk-card-tags span {
    padding: 5px 9px;
    border-radius: var(--afk-radius-sm);
    background: #F2F3F5;
    color: #5a626e;
    font-size: 12px;
    font-weight: 500;
}

.afk-card-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: auto;
    padding: 15px 20px;
    border-radius: var(--afk-radius-md);
    background: var(--afk-dark);
    color: #fff;
    font-family: var(--afk-font-main);
    font-size: 15.5px;
    font-weight: 700;
    text-decoration: none;
}

.afk-card-btn:hover {
    background: var(--afk-dark-hover);
    color: #fff;
}


/* ==========================================================
   INDICATIF TÉLÉPHONIQUE
   ========================================================== */

/* !important requis pour contrecarrer width:100% du thème / Select2 */
.afk-phone-row {
    display: flex !important;
    gap: 8px !important;
    align-items: stretch !important;
}

.afk-f .afk-phone-code {
    flex: 0 0 30% !important;
    width: 30% !important;
    max-width: 30% !important;
    min-width: 80px;
    padding: 11px 28px 11px 10px !important;
    font-size: 14px !important;
}

.afk-f .afk-phone-row input {
    flex: 1 1 0% !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
}

/* Fallback si Select2 persiste sur le sélecteur d'indicatif */
.afk-phone-row .select2.select2-container {
    flex: 0 0 30% !important;
    width: 30% !important;
    max-width: 30% !important;
    min-width: 80px !important;
}


/* ==========================================================
   RESPONSIVE
   ========================================================== */

@media (max-width: 360px) {

    .afk-phone-row {
        flex-direction: column !important;
    }

    .afk-f .afk-phone-code,
    .afk-phone-row .select2.select2-container {
        flex: 1 1 100% !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0;
    }

    .afk-f .afk-phone-row input {
        flex: none !important;
        width: 100% !important;
    }

}
