
.ermafi-res {
    --ermafi-accent: #9b252c;
    max-width: 780px;
    margin: 35px auto;
    background: #fff;
    border: 1px solid #ece7e4;
    border-radius: 22px;
    box-shadow: 0 18px 55px rgba(25, 20, 20, .09);
    overflow: hidden;
    color: #242424;
    font-family: inherit;
}

.ermafi-res * {
    box-sizing: border-box;
}

.ermafi-res-header {
    padding: 42px 45px;
    background: linear-gradient(135deg, #211c1d, #4b292b);
    color: #fff;
}

.ermafi-res-eyebrow {
    display: block;
    margin-bottom: 12px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 2.5px;
    color: #f0c5aa;
}

.ermafi-res-header h2 {
    margin: 0 0 12px;
    font-size: clamp(28px, 5vw, 39px);
    line-height: 1.2;
    color: #fff;
}

.ermafi-res-header p {
    margin: 0;
    color: #f0e6e6;
    font-size: 15px;
    line-height: 1.7;
}

.ermafi-res-body {
    padding: 38px 45px 42px;
}

.ermafi-res-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
    font-size: 19px;
    font-weight: 750;
}

.ermafi-res-section-title span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #f8e9e9;
    color: #92232b;
    font-size: 13px;
    font-weight: 800;
}

.ermafi-res-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 21px;
}

.ermafi-res-field {
    display: flex;
    flex-direction: column;
    gap: 9px;
    min-width: 0;
}

.ermafi-res-field label {
    font-size: 13px;
    font-weight: 700;
    color: #333;
}

.ermafi-res-field label small {
    font-weight: 400;
    color: #777;
}

.ermafi-res-field input,
.ermafi-res-field select,
.ermafi-res-field textarea {
    width: 100%;
    min-height: 48px;
    margin: 0;
    padding: 11px 14px;
    border: 1px solid #dcdcdc;
    border-radius: 10px;
    background: #fff;
    color: #252525;
    font: inherit;
    font-size: 15px;
    box-shadow: none;
}

.ermafi-res-field textarea {
    min-height: 100px;
    resize: vertical;
}

.ermafi-res-field input:focus,
.ermafi-res-field select:focus,
.ermafi-res-field textarea:focus {
    border-color: var(--ermafi-accent);
    outline: 2px solid rgba(155, 37, 44, .15);
    outline-offset: 1px;
}

.ermafi-res-wide {
    grid-column: 1 / -1;
}

.ermafi-res-divider {
    height: 1px;
    background: #eee9e7;
    margin: 35px 0;
}

.ermafi-res-footer {
    margin-top: 32px;
}

.ermafi-res-footer button {
    width: 100%;
    min-height: 54px;
    border: 0;
    border-radius: 11px;
    background: var(--ermafi-accent);
    color: #fff;
    font-size: 16px;
    font-weight: 750;
    opacity: 1;
    cursor: pointer;
    transition: background-color .2s ease, opacity .2s ease;
}

.ermafi-res-footer p {
    text-align: center;
    font-size: 12px;
    color: #777;
    margin: 13px 0 0;
}

@media (max-width: 640px) {
    .ermafi-res {
        margin: 15px auto;
        border-radius: 15px;
    }

    .ermafi-res-header {
        padding: 30px 24px;
    }

    .ermafi-res-body {
        padding: 28px 22px 32px;
    }

    .ermafi-res-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .ermafi-res-wide {
        grid-column: auto;
    }
}


/* ErMaFi Reservations – freie Personenzahl */
.ermafi-res-custom-guests {
    margin-top: 10px;
}

.ermafi-res-custom-guests[hidden] {
    display: none !important;
}

.ermafi-res-custom-guests label {
    display: block;
    margin-bottom: 9px;
    font-size: 13px;
    font-weight: 700;
}

.ermafi-res-custom-guests input {
    width: 100%;
}


/* ErMaFi – Reservationsseiten-Layout v1 */

/* WooFood: rechte Sidebar nur auf Reservationsseiten ausblenden */
body.ermafi-reservations-page #main .container > .col-md-4 {
    display: none !important;
}

/* WooFood: Hauptinhalt auf volle Breite setzen */
body.ermafi-reservations-page #main .container > .col-md-8 {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    flex: 0 0 100% !important;
}

/* Reservationsformular mittig */
body.ermafi-reservations-page .ermafi-res {
    width: 100%;
    max-width: 850px;
    margin: 35px auto;
}

/* Mobile Ansicht */
@media (max-width: 640px) {
    body.ermafi-reservations-page .ermafi-res {
        margin: 15px auto;
    }
}


/* ErMaFi – Reservationsseiten-Layout v2 */

/* WooFood: Sidebar ausblenden */
body.ermafi-reservations-page #main .main-inner > .container > .col-md-4 {
    display: none !important;
}

/* WooFood: Inhaltsbereich auf volle Breite */
body.ermafi-reservations-page #main .main-inner > .container > .col-md-8 {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
    float: none !important;
}

/* Formular mittig ausrichten */
body.ermafi-reservations-page .ermafi-res {
    width: 100%;
    max-width: 850px;
    margin: 35px auto !important;
}


/* ErMaFi – Transparenter Reservationsseiten-Hintergrund v1 */

/* Nur den äusseren Seitenkasten transparent machen */
body.ermafi-reservations-page #main .entry-content,
body.ermafi-reservations-page #main .entry-content > .wp-block-group,
body.ermafi-reservations-page #main article {
    background: transparent !important;
    box-shadow: none !important;
}

/* Premium-Reservationsformular bleibt unverändert */
body.ermafi-reservations-page .ermafi-res {
    background: #fff;
}


/* ErMaFi – Transparenter Artikelkasten v2 */

/* Äusseren WordPress-Seitenkasten entfernen */
body.ermafi-reservations-page article:has(.ermafi-res) {
    background: transparent !important;
    box-shadow: none !important;
    border: 0 !important;
}

/* Doppelte WordPress-Seitenüberschrift ausblenden */
body.ermafi-reservations-page article:has(.ermafi-res) > .entry-header {
    display: none !important;
}

/* Inhalt ohne weissen Hintergrund */
body.ermafi-reservations-page article:has(.ermafi-res) .entry-content {
    background: transparent !important;
    box-shadow: none !important;
}

/* Premium-Formular bleibt schön mittig */
body.ermafi-reservations-page .ermafi-res {
    max-width: 850px;
    margin: 35px auto !important;
    background: #fff !important;
}

/* ErMaFi – Aktiver Reservationsbutton */
.ermafi-res-footer button:not(:disabled):hover {
    background: #75191f;
}

.ermafi-res-footer button:disabled {
    opacity: .55;
    cursor: not-allowed;
}


/* ErMaFi – Sichtbare Reservationsbestätigung V1 */
.ermafi-res .ermafi-res-success {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-top: 25px;
    padding: 20px;
    border: 2px solid #66bd83;
    border-radius: 13px;
    background: #e9f9ed;
    color: #145c2b;
    box-shadow: 0 5px 20px rgba(0, 0, 0, .12);
}

.ermafi-res .ermafi-res-success[hidden] {
    display: none !important;
}

.ermafi-res .ermafi-res-success-icon {
    flex: 0 0 37px;
    width: 37px;
    height: 37px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #16803c;
    color: white;
    font-size: 25px;
    font-weight: bold;
}

.ermafi-res .ermafi-res-success strong {
    display: block;
    margin-bottom: 7px;
    color: #145c2b;
    font-size: 18px;
    line-height: 1.4;
}

.ermafi-res .ermafi-res-success span:not(.ermafi-res-success-icon) {
    display: block;
    color: #245b35;
    font-size: 14px;
    line-height: 1.6;
}

@media (max-width: 600px) {
    .ermafi-res .ermafi-res-success {
        padding: 15px;
        gap: 10px;
    }
    .ermafi-res .ermafi-res-success strong {
        font-size: 16px;
    }
}


/* ErMaFi – iPhone Safari Formular-Fix V1 */
@supports (-webkit-touch-callout: none) {
    @media (max-width: 767px) {

        .ermafi-res .ermafi-res-field select {
            box-sizing: border-box !important;
            height: 50px !important;
            min-height: 50px !important;
            padding: 0 38px 0 14px !important;
            line-height: normal !important;
            font-size: 16px !important;
            -webkit-appearance: menulist !important;
            appearance: auto !important;
            background-color: #fff !important;
            color: #252525 !important;
        }

    }
}

/* ErMaFi – Mobile Breite und Kalender V1 */

/* Eigenes Kalender-Symbol */
.ermafi-res .ermafi-res-date-wrap {
    position: relative;
    width: 100%;
    min-width: 0;
}

.ermafi-res .ermafi-res-date-wrap input[type="date"] {
    width: 100%;
    padding-right: 45px !important;
}

.ermafi-res .ermafi-res-calendar-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    pointer-events: none;
}

/* Nur iPhone und andere schmale Mobilgeräte */
@media (max-width: 640px) {

    body.ermafi-reservations-page #main .container,
    body.ermafi-reservations-page #main .main-inner > .container {
        width: 100% !important;
        max-width: 100% !important;
    }

    body.ermafi-reservations-page #main .container > .col-md-8,
    body.ermafi-reservations-page #main .main-inner > .container > .col-md-8 {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    body.ermafi-reservations-page .ermafi-res {
        width: 100% !important;
        max-width: 100% !important;
        margin: 15px auto !important;
    }

    body.ermafi-reservations-page .ermafi-res-header {
        padding: 30px 22px !important;
    }

    body.ermafi-reservations-page .ermafi-res-body {
        padding: 28px 22px 32px !important;
    }
}




/* ErMaFi – Einheitliches mobiles Datumsfeld V3 */
@media (max-width: 640px) {

    .ermafi-res .ermafi-res-grid,
    .ermafi-res .ermafi-res-field,
    .ermafi-res .ermafi-res-date-wrap {
        min-width: 0 !important;
        max-width: 100% !important;
    }

    .ermafi-res .ermafi-res-date-wrap {
        position: relative;
        width: 100% !important;
        overflow: visible !important;
    }

    .ermafi-res .ermafi-res-date-wrap input[type="date"] {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        height: 50px !important;
        min-height: 50px !important;
        box-sizing: border-box !important;
        margin: 0 !important;
        padding: 0 45px 0 14px !important;
        border: 1px solid #dcdcdc !important;
        border-radius: 10px !important;
        background: #fff !important;
        color: #252525 !important;
        font-size: 16px !important;
        line-height: normal !important;
        text-align: left !important;
        -webkit-appearance: none !important;
        appearance: none !important;
    }

    .ermafi-res .ermafi-res-date-wrap
    input[type="date"]::-webkit-date-and-time-value {
        min-height: 0;
        height: 48px;
        line-height: 48px;
        text-align: left;
    }

    .ermafi-res .ermafi-res-date-wrap
    input[type="date"]::-webkit-calendar-picker-indicator {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        margin: 0;
        opacity: 0;
        cursor: pointer;
    }

    .ermafi-res .ermafi-res-calendar-icon {
        right: 14px !important;
        z-index: 1;
        pointer-events: none;
    }
}


/* ErMaFi – iPhone Datum vertikal zentrieren V4 */
@supports (-webkit-touch-callout: none) {
    @media (max-width: 640px) {
        .ermafi-res .ermafi-res-date-wrap
        input[type="date"]::-webkit-datetime-edit {
            display: inline-flex;
            align-items: center;
            height: 48px;
            line-height: normal;
            padding: 0;
        }
    }
}
