/**
 * YM Booking Sidebar – CSS v5.5
 * Noch kompakter und harmonischer
 */

/* ── CRITICAL FIX: Theme überschreibt YM-Snippet Farben ──────────────────── */
section#ym,
section#ym * {
    color: #333 !important; /* Alle Texte dunkel */
}

section#ym h1,
section#ym h2,
section#ym h3 {
    color: #1a1a1a !important; /* Überschriften noch dunkler */
}

/* Detail-Seite spezifisch - Extra hohe Spezifität! */
section#ym h1.headline,
section#ym .headline,
section#ym div.sub-headline,
section#ym .sub-headline {
    color: #ffffff !important; /* WEISS auf dunklem Hintergrund! */
    text-shadow: 0 2px 4px rgba(0,0,0,0.5) !important; /* Schatten für Lesbarkeit */
}

/* CRITICAL: Überschreibe die wildcard .headline * Regel! */
section#ym.objectdetails .headline *,
section#ym.objectdetails .headline span,
section#ym.objectdetails .headline .model,
section#ym.objectdetails .headline .title,
section#ym.objectdetails .sub-headline *,
section#ym.objectdetails .sub-headline span,
section#ym .headline span.model,
section#ym .headline span.title {
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5) !important;
}

section#ym .model,
section#ym span.title,
section#ym .title {
    color: #333 !important;
}

section#ym {
    padding: 0 20px !important; /* Seitenabstand */
    max-width: 1200px !important;
    margin: 0 auto !important;
}

/* ── Haupt-Layout ────────────────────────────────────────────────────────── */
.ym-layout-outer {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 20px;
    width: 100%;
    box-sizing: border-box;
}

.ym-layout-main {
    flex: 0 0 66%;
    max-width: 66%;
    min-width: 0;
    box-sizing: border-box;
}

.ym-layout-sidebar {
    flex: 0 0 30%;
    max-width: 30%;
    min-width: 260px;
    max-width: 320px;
    position: sticky;
    top: 140px;
    align-self: flex-start;
    box-sizing: border-box;
    margin-right: 16px;
}

/* ── Sidebar Box ─────────────────────────────────────────────────────────── */
.ym-layout-sidebar .ym-sidebar-box {
    background: #fff;
    border: 1px solid #d5d5d5;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(0,0,0,0.07);
    font-size: 12px;
}

.ym-layout-sidebar .ym-booking-suggestions-title {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    background: #1bb2da;
    margin: 0;
    padding: 9px 11px;
    letter-spacing: 0.2px;
}

/* Booking-Container extrem kompakt */
.ym-layout-sidebar .booking-container {
    padding: 7px 9px !important;
    width: 100% !important;
    box-sizing: border-box;
}

/* Alle Inputs klein */
.ym-layout-sidebar .booking-container input,
.ym-layout-sidebar .booking-container select {
    font-size: 11px !important;
    padding: 4px 6px !important;
    margin-bottom: 3px !important;
    height: auto !important;
}

/* Labels klein */
.ym-layout-sidebar .booking-container label {
    font-size: 10px !important;
    margin-bottom: 1px !important;
    display: block;
}

/* Formgruppen kompakt */
.ym-layout-sidebar .booking-container > div,
.ym-layout-sidebar .booking-container .form-group {
    margin-bottom: 5px !important;
}

/* Kalender-Icon verstecken */
.ym-layout-sidebar .booking-container input[type="date"]::-webkit-calendar-picker-indicator,
.ym-layout-sidebar .booking-container input::-webkit-calendar-picker-indicator {
    display: none !important;
}

.ym-layout-sidebar .object-price-container,
.ym-layout-sidebar .user-data-container {
    width: 100% !important;
    box-sizing: border-box;
    font-size: 11px !important;
}

/* Original-Button verstecken */
.ym-layout-sidebar .booking-button-bar {
    display: none !important;
}

/* ── Shortcode Container Padding ─────────────────────────────────────────── */
section#ym.objectdetails {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

/* ── Hilfs-Buchungsbutton ────────────────────────────────────────────────── */
.ym-helper-btn {
    display: block;
    width: 100%;
    box-sizing: border-box;
    background: #1bb2da;
    color: #fff !important;
    text-align: center;
    padding: 9px 11px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none !important;
    border: none;
    border-top: 1px solid rgba(0,0,0,0.06);
    transition: background 0.15s;
    cursor: pointer;
}

.ym-helper-btn:hover {
    background: #16a0c5;
    color: #fff !important;
}

/* ── Nächste freie Termine ───────────────────────────────────────────────── */
.ym-next-offers {
    border-top: 1px solid #e8e8e8;
    padding: 7px 9px 4px;
}

.ym-next-offers-title {
    font-size: 11px;
    font-weight: 700;
    color: #2c5f7d;
    text-transform: none;
    letter-spacing: 0;
    margin: 0 0 8px 0;
}

.ym-offer-item {
    display: block;
    padding: 6px 7px;
    margin-bottom: 4px;
    background: #f7fbfd;
    border: 1px solid #d4ebf4;
    border-radius: 4px;
    font-size: 11px;
    text-decoration: none !important;
    color: #333 !important;
    line-height: 1.3;
}

/* Kurzzeit-Angebote mit besonderer Hervorhebung */
.ym-offer-kurzzeit {
    background: linear-gradient(135deg, #fff9e6 0%, #fff4d6 100%);
    border-color: #ffd966;
    border-left: 3px solid #ff9800;
}

.ym-offer-clickable {
    cursor: pointer;
    transition: all 0.12s;
}

.ym-offer-clickable:hover {
    background: #1bb2da;
    border-color: #1bb2da;
    color: #fff !important;
}

.ym-offer-clickable:hover .ym-offer-select-hint {
    color: rgba(255,255,255,0.9);
}

.ym-offer-select-hint {
    font-size: 10px;
    color: #1bb2da;
    white-space: nowrap;
    margin-left: 4px;
}

.ym-offer-loading,
.ym-offer-none {
    font-size: 10px;
    color: #999;
    font-style: italic;
    padding: 3px 0;
}

/* ── Optionaler Hinweis ──────────────────────────────────────────────────── */
.ym-date-optional-hint {
    font-size: 9px;
    color: #aaa;
    margin-top: 1px;
    font-style: italic;
}

/* Alle Datums-Felder gleich formatieren (Frühste + Späteste Anreise) */
.ym-layout-sidebar .booking-container input[type="date"],
.ym-layout-sidebar .booking-container input[type="text"][name*="date"],
.ym-layout-sidebar .booking-container input[name="bd[input-startdate]"],
.ym-layout-sidebar .booking-container input[name="bd[input-enddate]"],
.ym-layout-sidebar .booking-container input[id*="startdate"],
.ym-layout-sidebar .booking-container input[id*="enddate"] {
    font-size: 11px !important;
    padding: 4px 6px !important;
    border: 1px solid #d5d5d5 !important;
    border-radius: 3px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    height: 28px !important;
    line-height: 1.3 !important;
    /* Kalender-Icon komplett entfernen */
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

/* Kalender-Icon wirklich überall verstecken */
.ym-layout-sidebar .booking-container input::-webkit-calendar-picker-indicator {
    display: none !important;
    -webkit-appearance: none !important;
}

.ym-layout-sidebar .booking-container input::-webkit-datetime-edit {
    padding: 0 !important;
}

.ym-layout-sidebar .booking-container label[for*="startdate"],
.ym-layout-sidebar .booking-container label[for*="enddate"] {
    font-size: 10px !important;
    font-weight: 600 !important;
    color: #555 !important;
    margin-bottom: 2px !important;
    display: block !important;
}

/* ── Versions-Tag ────────────────────────────────────────────────────────── */
.ym-version-tag {
    text-align: center;
    font-size: 8px;
    color: #ccc;
    padding: 4px 6px 3px;
    font-family: monospace;
    line-height: 1.3;
}

/* ── Kurzzeit-Filter ─────────────────────────────────────────────────────── */
.ym-short-filter {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    cursor: pointer;
    margin: 7px 0;
    padding: 5px 9px;
    border: 1px solid #1bb2da;
    border-radius: 4px;
    color: #1bb2da;
    background: #fff;
    transition: background 0.2s, color 0.2s;
    user-select: none;
}

.ym-short-filter:hover,
.ym-short-filter.active {
    background: #1bb2da;
    color: #fff;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 960px) {
    .ym-layout-outer { flex-direction: column; }
    .ym-layout-main,
    .ym-layout-sidebar {
        flex: 1 1 100%;
        max-width: 100%;
        min-width: 0;
        position: static;
        margin-right: 0;
    }
    .ym-layout-sidebar { 
        order: -1;
        top: 0;
    }

    /* 20px Seitenabstand für /hausboote/ auf Mobile */
    .ym-layout-outer {
        padding-left: 20px;
        padding-right: 20px;
        box-sizing: border-box;
    }

    /* Kalender auf Mobile: volle Breite, kein Overflow */
    .ui-datepicker {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        left: 0 !important;
        right: 0 !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    /* Seitliche Scroll-Sperre wenn Kalender offen */
    .ym-layout-sidebar .booking-container {
        overflow: visible !important;
    }

    /* Kalender-Zellen gleichmäßig verteilen */
    .ui-datepicker table {
        width: 100% !important;
        table-layout: fixed !important;
    }

    .ui-datepicker td, 
    .ui-datepicker th {
        padding: 2px !important;
        font-size: 13px !important;
    }

    .ui-datepicker td a,
    .ui-datepicker td span {
        padding: 4px 2px !important;
        text-align: center !important;
    }
}

/* Spinner Animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ── Boot-Überschrift: weiß (innerhalb UND außerhalb section#ym) ────────── */
section#ym h1,
section#ym h2,
section#ym h3,
section#ym h1.headline,
section#ym .headline,
section#ym .headline .model,
section#ym .headline .title,
section#ym span.model,
section#ym span.title,
section#ym .object-title,
section#ym .objecttitle,
section#ym .object-name,
section#ym .objectname,
section#ym .title,
section#ym .name,
section#ym [class*="object-title"],
section#ym [class*="objectTitle"],
section#ym [class*="object-name"],
section#ym [class*="headline"],
section#ym .col-header,
section#ym .object-header,
section#ym header,
/* Außerhalb section#ym – direkt im Theme-Layout */
h1.headline,
h1.headline span,
h1.headline .model,
h1.headline .title,
.headline.objectdetails-headline,
.objectdetails h1,
.objectdetails h1 span {
    color: #ffffff !important;
}

/* ── SPAN.model + SPAN.title: maximale Spezifität gegen Theme-!important ─── */
body body section#ym span.model,
body body section#ym span.title,
body body section#ym h1 span,
body body section#ym h1.headline span,
body body section#ym .headline span,
body body section#ym .sub-headline span.model,
body body section#ym .sub-headline span.title,
body body section#ym div.sub-headline {
    color: #ffffff !important;
}

/* ── WordPress Post-Title (Boot-Name unter der Seiten-Überschrift) ───────── */
h1.wp-block-post-title,
.wp-block-post-title {
    color: #ffffff !important;
}

/* ── Kalender overflow fix: verhindert horizontales Scrollen auf Mobile ── */
@media (max-width: 960px) {
    body {
        overflow-x: hidden !important;
    }

    section#ym,
    .ym-layout-outer,
    .ym-layout-sidebar,
    .ym-sidebar-box,
    .booking-container {
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    /* jQuery UI Datepicker: innerhalb der Sidebar-Box bleiben */
    #ui-datepicker-div {
        width: calc(100vw - 40px) !important;
        max-width: calc(100vw - 40px) !important;
        left: 0px !important;
        box-sizing: border-box !important;
        font-size: 13px !important;
    }

    .ui-datepicker .ui-datepicker-header {
        padding: 6px 0 !important;
    }

    .ui-datepicker table {
        width: 100% !important;
        table-layout: fixed !important;
        border-collapse: collapse !important;
    }

    .ui-datepicker th,
    .ui-datepicker td {
        padding: 1px !important;
        font-size: 12px !important;
        text-align: center !important;
    }

    .ui-datepicker td a,
    .ui-datepicker td span {
        padding: 5px 1px !important;
        display: block !important;
    }
}


/* ── Mini-Kalender (optisch) ─────────────────────────────────────────────── */
#ym-mini-cal-loading{
    margin: 8px 0;
}
#ym-mini-cal-table{
    width:100%;
    border-collapse:collapse;
}
#ym-mini-cal-table th{
    font-size:12px;
    color:#666;
    padding:4px 0;
    text-align:center;
}
#ym-mini-cal-table td{
    padding:2px;
    text-align:center;
}
#ym-mini-cal-table .ym-day{
    display:block;
    border-radius:6px;
    padding:6px 0;
    font-size:13px;
    line-height:1;
    user-select:none;
}
#ym-mini-cal-table .ym-day-free-standard{
    background:#4caf50;
    color:#fff;
    cursor:pointer;
}
#ym-mini-cal-table .ym-day-free-kurzzeit{
    background:#ff9800;
    color:#fff;
    cursor:pointer;
}
#ym-mini-cal-table .ym-day-busy{
    background:#f8d7da;
    color:#7a2b2b;
}
#ym-mini-cal-table .ym-day-unknown{
    background:#eee;
    color:#777;
    cursor:default;
}
#ym-mini-cal-table .ym-day-past{
    opacity:.45;
}
#ym-mini-cal-table .ym-day-empty{
    background:transparent;
}


/* ═══════════════════════════════════════════════════════════════════════
   YM MOBILE LAYER  ·  nur für Mobilgeräte < 768px
   ═══════════════════════════════════════════════════════════════════════ */
@media (max-width: 767px) {

    /* ── Sticky Bottom Bar ─────────────────────────────────────────────── */
    #ym-mobile-sticky {
        display: flex;
        position: fixed;
        bottom: 0; left: 0; right: 0;
        background: #0a1e2e;
        border-top: 2px solid #1bb2da;
        padding: 10px 14px;
        z-index: 9999;
        align-items: center;
        justify-content: space-between;
        box-shadow: 0 -4px 16px rgba(0,0,0,0.4);
    }
    #ym-mobile-sticky .ym-sticky-price {
        display: flex;
        flex-direction: column;
        line-height: 1.2;
    }
    #ym-mobile-sticky .ym-sticky-label {
        font-size: 10px;
        color: #5a8099;
    }
    #ym-mobile-sticky .ym-sticky-amount {
        font-size: 18px;
        font-weight: 700;
        color: #1bb2da;
    }
    #ym-mobile-sticky .ym-sticky-btn {
        background: #e8a000;
        color: #fff;
        border: none;
        border-radius: 8px;
        padding: 10px 16px;
        font-weight: 700;
        font-size: 13px;
        cursor: pointer;
        white-space: nowrap;
    }
    #ym-mobile-sticky .ym-sticky-btn:active {
        background: #d49200;
    }
    /* Platz für Sticky Bar unten */
    section#ym {
        padding-bottom: 70px !important;
    }

    /* ── 360° Button Mobile ────────────────────────────────────────────── */
    #ym-mobile-360 {
        display: flex;
        align-items: center;
        gap: 10px;
        background: #0f2838;
        border: 1px solid #1bb2da;
        border-radius: 8px;
        padding: 10px 14px;
        margin: 10px 0;
        cursor: pointer;
        text-decoration: none;
        width: 100%;
        box-sizing: border-box;
    }
    #ym-mobile-360 .ym-360-icon {
        font-size: 26px;
        flex-shrink: 0;
    }
    #ym-mobile-360 .ym-360-text strong {
        display: block;
        color: #1bb2da;
        font-size: 13px;
        font-weight: 700;
    }
    #ym-mobile-360 .ym-360-text span {
        font-size: 11px;
        color: #5a8099;
    }

    /* ── Kurzzeit Banner Mobile ────────────────────────────────────────── */
    #ym-mobile-kurzzeit {
        background: #1a3a1a;
        border-left: 3px solid #ff6b00;
        border-radius: 6px;
        padding: 8px 12px;
        margin: 8px 0;
        font-size: 12px;
        color: #7dda7d;
        display: flex;
        align-items: center;
        gap: 8px;
    }
    #ym-mobile-kurzzeit .ym-kz-badge {
        background: #ff6b00;
        color: #fff;
        font-size: 10px;
        font-weight: 700;
        padding: 2px 6px;
        border-radius: 3px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* ── Mini-Kalender im Buchungs-Tab ─────────────────────────────────── */
    #ym-mobile-cal-wrap {
        background: #fff;
        border-radius: 8px;
        overflow: hidden;
        margin: 10px 0;
        box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    }
    #ym-mobile-cal-header {
        background: #1a3a4a;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 8px 12px;
    }
    #ym-mobile-cal-header span {
        font-size: 13px;
        font-weight: 700;
        color: #fff;
    }
    #ym-mobile-cal-header button {
        background: none;
        border: 1px solid #5a8099;
        color: #fff;
        border-radius: 4px;
        padding: 2px 10px;
        font-size: 16px;
        cursor: pointer;
    }
    #ym-mobile-cal-table {
        width: 100%;
        border-collapse: collapse;
        table-layout: fixed;
        padding: 6px;
        display: table;
    }
    #ym-mobile-cal-table th {
        font-size: 10px;
        color: #888;
        text-align: center;
        padding: 4px 0;
        font-weight: 600;
    }
    #ym-mobile-cal-table td {
        padding: 2px;
        text-align: center;
    }
    .ym-mcal-day {
        display: block;
        width: 100%;
        padding: 5px 0;
        border-radius: 4px;
        font-size: 12px;
        text-align: center;
        cursor: default;
    }
    .ym-mcal-free-std    { background: #4caf50; color: #fff; cursor: pointer; }
    .ym-mcal-free-kz     { background: #ff9800; color: #fff; cursor: pointer; }
    .ym-mcal-busy        { background: #e0e0e0; color: #aaa; }
    .ym-mcal-empty       { background: transparent; }
    .ym-mcal-free-std:active, .ym-mcal-free-kz:active { opacity: 0.8; }
    #ym-mobile-cal-legend {
        display: flex;
        gap: 10px;
        padding: 4px 8px 8px;
        flex-wrap: wrap;
    }
    #ym-mobile-cal-legend span {
        font-size: 10px;
        color: #888;
        display: flex;
        align-items: center;
        gap: 4px;
    }
    #ym-mobile-cal-legend i {
        display: inline-block;
        width: 10px; height: 10px;
        border-radius: 2px;
        flex-shrink: 0;
    }
    #ym-mobile-cal-loading {
        text-align: center;
        padding: 16px;
        font-size: 12px;
        color: #888;
    }

    /* Bestehende 360-Box auf Mobil verstecken (wir haben eigenen Button) */
    .ym-360-box {
        display: none !important;
    }
}

/* Desktop: alles mobile-spezifische verstecken */
@media (min-width: 768px) {
    #ym-mobile-sticky,
    #ym-mobile-360,
    #ym-mobile-kurzzeit,
    #ym-mobile-cal-wrap {
        display: none !important;
    }
}
