/* Förfrågningsformuläret (forfragan.php / forfragan.js): restaurangsidan och Snabbtitt */

.jbg-ff {
    --jbg-ff-rod: #ee0f16;
    --jbg-ff-mork: #c60001;
    --jbg-ff-guld: #f9c22b;
    --jbg-ff-guld-ljus: #fdf4d8;
    --jbg-ff-kant: #c9c9c9;
    --jbg-ff-gra: #595959;
    color: #222;
}

.jbg-ff__rubrik {
    margin: 0 0 16px;
}

.jbg-ff__form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px 20px;
}

.jbg-ff__form > .jbg-ff__rubrik,
.jbg-ff__form > .jbg-ff__forifyllt,
.jbg-ff__falt--hel,
.jbg-ff__skicka {
    grid-column: 1 / -1;
}

@media (min-width: 640px) {
    .jbg-ff__form {
        grid-template-columns: 1fr 1fr;
    }
}

.jbg-ff__hp {
    position: absolute !important;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.jbg-ff__falt {
    position: relative;
    min-width: 0;
}

.jbg-ff__etikett {
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
    font-size: 15px;
    line-height: 1.3;
}

.jbg-ff__valfritt {
    font-weight: 400;
    color: var(--jbg-ff-gra);
}

.jbg-ff .uk-input,
.jbg-ff .uk-textarea {
    width: 100%;
    height: 46px;
    padding: 0 12px;
    border: 1px solid var(--jbg-ff-kant);
    border-radius: 4px;
    background: #fff;
    font-size: 16px; /* under 16px zoomar iOS in vid fokus */
    color: #222;
}

.jbg-ff .uk-textarea {
    height: auto;
    min-height: 92px;
    padding: 10px 12px;
    line-height: 1.45;
    resize: vertical;
}

.jbg-ff .uk-input:focus,
.jbg-ff .uk-textarea:focus {
    border-color: #555;
    outline: 2px solid var(--jbg-ff-guld);
    outline-offset: 0;
}

.jbg-ff [aria-invalid="true"],
.jbg-ff [aria-invalid="true"]:focus {
    border-color: var(--jbg-ff-mork) !important;
    box-shadow: inset 0 0 0 1px var(--jbg-ff-mork);
}

.jbg-ff__fel {
    margin: 6px 0 0;
    color: var(--jbg-ff-mork);
    font-size: 14px;
    line-height: 1.35;
}

.jbg-ff__fel::before {
    content: "! ";
    font-weight: 700;
}

.jbg-ff__tips,
.jbg-ff__hjalp {
    margin: 6px 0 0;
    font-size: 14px;
    line-height: 1.35;
    color: var(--jbg-ff-gra);
}

.jbg-ff__lank {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    color: var(--jbg-ff-mork);
    text-decoration: underline;
    cursor: pointer;
}

.jbg-ff__forifyllt {
    margin: 0;
    padding: 10px 12px;
    background: var(--jbg-ff-guld-ljus);
    border-radius: 4px;
    font-size: 14px;
}

.jbg-ff__forifyllt[hidden],
.jbg-ff [hidden] {
    display: none !important;
}

/* ---------- Datumfältet ---------- */

.jbg-ff__datum {
    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-height: 46px;
    padding: 2px 4px;
    border: 1px solid var(--jbg-ff-kant);
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
}

.jbg-ff__datum:focus-within {
    border-color: #555;
    outline: 2px solid var(--jbg-ff-guld);
}

.jbg-ff__chips {
    display: contents;
    margin: 0;
    padding: 0;
    list-style: none;
}

.jbg-ff__chip {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin: 0;
    padding: 0 0 0 10px;
    border: 1px solid var(--jbg-ff-guld);
    border-radius: 999px;
    background: var(--jbg-ff-guld-ljus);
    font-size: 15px;
    line-height: 32px;
    white-space: nowrap;
}

.jbg-ff__chipbort {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    font-size: 20px;
    line-height: 1;
    color: #333;
    cursor: pointer;
}

.jbg-ff__chipbort:hover,
.jbg-ff__chipbort:focus-visible {
    background: rgba(0, 0, 0, .08);
}

.jbg-ff__datumknapp {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex: 1 0 auto;
    min-height: 40px;
    padding: 0 6px;
    border: 0;
    background: none;
    font: inherit;
    font-size: 16px;
    color: #757575;
    text-align: left;
    cursor: pointer;
}

.jbg-ff__datum--valda .jbg-ff__datumknapp {
    color: var(--jbg-ff-mork);
    font-size: 15px;
}

.jbg-ff__datumknapp::after {
    content: "";
    flex: none;
    width: 18px;
    height: 18px;
    background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23666' stroke-width='1.4'%3E%3Crect x='2.5' y='4' width='15' height='13.5' rx='1.5'/%3E%3Cpath d='M2.5 8h15M6.5 2v4M13.5 2v4'/%3E%3C/svg%3E");
}

.jbg-ff__datumknapp:focus {
    outline: none;
}

/* ---------- Kryssrutan ---------- */

.jbg-ff__kryss {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 15px;
    line-height: 1.45;
}

.jbg-ff__kryss .uk-checkbox {
    flex: none;
    width: 22px;
    height: 22px;
    margin: 0;
    border: 1px solid #8a8a8a;
    border-radius: 3px;
    background-color: #fff;
    cursor: pointer;
}

.jbg-ff__kryss .uk-checkbox:checked {
    background-color: var(--jbg-ff-mork);
    border-color: var(--jbg-ff-mork);
}

.jbg-ff__kryss .uk-checkbox:focus-visible {
    outline: 2px solid var(--jbg-ff-guld);
    outline-offset: 2px;
}

/* ---------- Skicka ---------- */

.jbg-ff__info,
.jbg-ff__gratis {
    margin: 0 0 12px;
    font-size: 14px;
    line-height: 1.45;
    color: var(--jbg-ff-gra);
}

.jbg-ff__info a {
    text-decoration: underline;
}

.jbg-ff__gratis {
    margin: 10px 0 0;
    text-align: center;
}

.jbg-ff__sammanfattning {
    margin: 0 0 12px;
    color: var(--jbg-ff-mork);
    font-weight: 700;
    font-size: 15px;
}

.jbg-ff__serverfel {
    margin: 0 0 14px;
    padding: 12px 14px;
    border-left: 4px solid var(--jbg-ff-mork);
    background: #fdeeee;
    font-size: 15px;
    line-height: 1.45;
}

.jbg-ff__serverfel p {
    margin: 0;
}

.jbg-ff__serverfel p + p {
    margin-top: 6px;
}

.jbg-ff__knapp {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 52px;
    text-transform: none;
    font-size: 18px;
    letter-spacing: 0;
}

.jbg-ff__knapp[disabled] {
    opacity: .85;
    cursor: progress;
}

.jbg-ff__spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: jbg-ff-snurr .8s linear infinite;
}

.jbg-ff__knapp[aria-busy="true"] .jbg-ff__spinner {
    display: inline-block;
}

@keyframes jbg-ff-snurr {
    to { transform: rotate(360deg); }
}

/* ---------- Tack ---------- */

.jbg-ff__tack {
    padding: 20px;
    border-top: 4px solid #1f6b35;
    background: #eef7ef;
    font-size: 16px;
    line-height: 1.5;
}

.jbg-ff__tackrubrik {
    margin: 0 0 8px;
    color: #1f6b35;
}

.jbg-ff__tackrubrik:focus {
    outline: none;
}

.jbg-ff__tack p {
    margin: 0 0 10px;
}

.jbg-ff__tackingress {
    font-weight: 700;
}

.jbg-ff__tacksammanfattning {
    color: #333;
}

.jbg-ff__tackepost strong {
    overflow-wrap: anywhere;
}

.jbg-ff__tackknappar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.jbg-ff__tackknappar .uk-button {
    text-transform: none;
    letter-spacing: 0;
}

@media (max-width: 639px) {
    .jbg-ff__tackknappar .uk-button {
        width: 100%;
    }
}

/* ---------- Hitta formuläret ---------- */

.jbg-ff-faktaknapp {
    display: none;
    width: 100%;
    margin-top: 20px;
    text-transform: none;
    letter-spacing: 0;
    font-size: 17px;
}

@media (min-width: 960px) {
    .jbg-ff-faktaknapp {
        display: block;
    }
}

.jbg-ff-hopp {
    display: inline-block;
    margin: 6px 0 16px;
    text-transform: none;
    letter-spacing: 0;
    font-size: 15px;
}

.jbg-ff-sticky {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 970;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: #fff;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, .15);
}

.jbg-ff-sticky .uk-button {
    width: 100%;
    min-height: 48px;
    text-transform: none;
    letter-spacing: 0;
    font-size: 17px;
}

.jbg-ff-sticky[hidden] {
    display: none;
}

html.jbg-ff-sticky-pa body {
    padding-bottom: 72px;
}

/* ---------- Datumväljaren ---------- */

.jbg-dv {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1050;
    width: 328px;
    max-width: calc(100vw - 32px);
    margin-top: 4px;
    padding: 12px;
    border-top: 3px solid var(--jbg-ff-rod, #ee0f16);
    border-radius: 0 0 6px 6px;
    background: #fff;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .22);
    color: #222;
    font-size: 15px;
}

.jbg-dv__huvud {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.jbg-dv__manad {
    margin: 0;
    font-weight: 700;
    font-size: 17px;
}

.jbg-dv__pil {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: none;
    font-size: 26px;
    line-height: 1;
    color: #222;
    cursor: pointer;
}

.jbg-dv__pil:hover:not([disabled]) {
    background: #f2f2f2;
}

.jbg-dv__pil[disabled] {
    color: #ccc;
    cursor: default;
}

.jbg-dv__tabell {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.jbg-dv__tabell th {
    padding: 4px 0;
    font-size: 12px;
    font-weight: 400;
    text-transform: lowercase;
    text-align: center;
    color: #666;
}

.jbg-dv__tabell td {
    padding: 2px;
    text-align: center;
}

.jbg-dv__dag {
    position: relative;
    width: 100%;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    font: inherit;
    font-size: 15px;
    color: #222;
    cursor: pointer;
}

.jbg-dv__dag--helg {
    color: #9b1c1c;
    background: #fbf6ea;
}

.jbg-dv__dag:hover:not([disabled]) {
    background: #f1e6c8;
}

.jbg-dv__dag--idag::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 5px;
    width: 16px;
    height: 3px;
    margin-left: -8px;
    border-radius: 2px;
    background: var(--jbg-ff-guld, #f9c22b);
}

.jbg-dv__dag[disabled] {
    background: none;
    color: #c4c4c4;
    cursor: default;
}

.jbg-dv__dag--vald,
.jbg-dv__dag--vald:hover:not([disabled]) {
    background: var(--jbg-ff-rod, #ee0f16);
    color: #fff;
    font-weight: 700;
}

.jbg-dv__dag:focus-visible,
.jbg-dv__pil:focus-visible {
    outline: 2px solid #222;
    outline-offset: 1px;
}

.jbg-dv__status {
    min-height: 20px;
    margin: 8px 2px 0;
    font-size: 14px;
    color: #555;
}

.jbg-dv__fot {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.jbg-dv__fot .uk-button {
    flex: 1;
    min-height: 44px;
    padding: 0 12px;
    text-transform: none;
    letter-spacing: 0;
    font-size: 16px;
}

/* Mobil: ark nerifrån (läggs i body, se forfragan.js) */
.jbg-dv-bakgrund {
    position: fixed;
    inset: 0;
    z-index: 10050;
    background: rgba(0, 0, 0, 0);
    transition: background .25s;
}

.jbg-dv-bakgrund--in {
    background: rgba(0, 0, 0, .45);
}

.jbg-dv--ark {
    position: absolute;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    max-width: none;
    margin: 0;
    padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
    border-top: 0;
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
    transition: transform .25s ease-out;
}

.jbg-dv--ark::before {
    content: "";
    display: block;
    width: 40px;
    height: 4px;
    margin: -4px auto 10px;
    border-radius: 2px;
    background: var(--jbg-ff-guld, #f9c22b);
}

.jbg-dv-bakgrund--in .jbg-dv--ark {
    transform: none;
}

.jbg-dv--ark .jbg-dv__dag {
    height: 44px;
    font-size: 17px;
}

.jbg-dv--ark .jbg-dv__pil {
    width: 44px;
    height: 44px;
}

.jbg-dv--ark .jbg-dv__fot .uk-button {
    min-height: 48px;
}

html.jbg-dv-last,
html.jbg-dv-last body {
    overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
    .jbg-dv--ark,
    .jbg-dv-bakgrund {
        transition: none;
    }
}
