/* Marsk Camp Booking — Base Styles */
.mcb-module {
    position: relative;
    font-family: inherit;
    color: #333;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

.mcb-module * { box-sizing: border-box; }

/* Form layout */
.mcb-search-form,
.mcb-guest-form {
    margin-bottom: 30px;
}

.mcb-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
}

.mcb-field {
    flex: 1;
    min-width: 180px;
}

.mcb-field-small {
    flex: 0 0 100px;
    min-width: 80px;
}

.mcb-field-submit {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-end;
}

.mcb-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 14px;
    color: #555;
}

.mcb-field input,
.mcb-field select,
.mcb-field textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.mcb-field input:focus,
.mcb-field select:focus,
.mcb-field textarea:focus {
    border-color: #5a4a3a;
    outline: none;
    box-shadow: 0 0 0 3px rgba(90, 74, 58, 0.1);
}

/* Input group (with inline button) */
.mcb-input-group {
    display: flex;
    gap: 8px;
}

.mcb-input-group input {
    flex: 1;
}

/* Buttons */
.mcb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    text-decoration: none;
    line-height: 1.4;
    font-family: inherit;
}

.mcb-btn:active {
    transform: scale(0.98);
}

.mcb-btn-primary {
    background: #5a4a3a;
    color: #fff;
}

.mcb-btn-primary:hover {
    background: #4a3a2a;
}

.mcb-btn-secondary {
    background: #e8e0d8;
    color: #5a4a3a;
}

.mcb-btn-secondary:hover {
    background: #d8d0c8;
}

.mcb-btn-back {
    background: transparent;
    color: #5a4a3a;
    border: 1px solid #ccc;
}

.mcb-btn-back:hover {
    background: #f5f0eb;
}

.mcb-btn-time {
    background: #f5f0eb;
    color: #5a4a3a;
    padding: 8px 16px;
    font-size: 14px;
    border: 1px solid #d8d0c8;
}

.mcb-btn-time:hover {
    background: #5a4a3a;
    color: #fff;
}

/* Results grid */
.mcb-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin: 24px 0;
}

/* Room / item cards */
.mcb-room-card {
    background: #fff;
    border: 1px solid #e5e0db;
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.mcb-room-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.mcb-room-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.mcb-room-info {
    padding: 20px;
}

.mcb-room-info h4 {
    margin: 0 0 8px;
    font-size: 18px;
    color: #333;
}

.mcb-room-desc {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 16px;
}

.mcb-room-pricing {
    margin-bottom: 16px;
}

.mcb-price-total {
    font-size: 20px;
    font-weight: 700;
    color: #5a4a3a;
}

/* Time slots */
.mcb-time-slots {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

/* Order summary */
.mcb-order-summary {
    background: #f9f7f5;
    border: 1px solid #e5e0db;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.mcb-summary-total {
    font-size: 22px;
    font-weight: 700;
    color: #5a4a3a;
}

/* Form actions */
.mcb-form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    gap: 16px;
}

/* Checkbox */
.mcb-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

.mcb-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

/* Confirmation */
.mcb-confirmation-box {
    text-align: center;
    padding: 40px 20px;
    background: #f0f8e8;
    border-radius: 12px;
    border: 1px solid #c5e0a5;
}

.mcb-confirmation-box h3 {
    color: #2d7a0e;
    font-size: 24px;
    margin-bottom: 12px;
}

/* Loading */
.mcb-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    border-radius: 8px;
}

.mcb-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e0db;
    border-top-color: #5a4a3a;
    border-radius: 50%;
    animation: mcb-spin 0.8s linear infinite;
}

@keyframes mcb-spin {
    to { transform: rotate(360deg); }
}

/* Error & no results */
.mcb-error {
    color: #c0392b;
    padding: 12px;
    background: #fdf2f2;
    border-radius: 6px;
}

.mcb-no-results {
    color: #666;
    text-align: center;
    padding: 40px 20px;
    font-size: 16px;
}

/* Checkbox fields */
.mcb-field-checkbox {
    display: flex;
    align-items: flex-end;
    padding-bottom: 10px;
}

.mcb-checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

.mcb-checkbox-label input[type="checkbox"] {
    width: auto !important;
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .mcb-form-row {
        flex-direction: column;
    }

    .mcb-field,
    .mcb-field-small {
        min-width: 100%;
        flex: 1 1 100%;
    }

    .mcb-field-submit {
        flex: 1 1 100%;
    }

    .mcb-results-grid {
        grid-template-columns: 1fr;
    }

    .mcb-form-actions {
        flex-direction: column;
    }

    .mcb-btn {
        width: 100%;
    }
}

/* ============ PRICE CALENDAR ============ */
/* "From" prices shown on each day, color-coded cheap (green) → expensive (red). */
.mcb-price-calendar .flatpickr-day {
    height: 48px;
    max-width: none;
    line-height: 1.15;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.mcb-price-calendar .mcb-day-price {
    display: block;
    font-size: 9px;
    font-weight: 600;
    margin-top: 1px;
    letter-spacing: -0.2px;
}

.mcb-price-calendar .flatpickr-day.mcb-price-q1 { background: #e8f5e9; }
.mcb-price-calendar .flatpickr-day.mcb-price-q1 .mcb-day-price { color: #2e7d32; }

.mcb-price-calendar .flatpickr-day.mcb-price-q2 { background: #fffde7; }
.mcb-price-calendar .flatpickr-day.mcb-price-q2 .mcb-day-price { color: #f9a825; }

.mcb-price-calendar .flatpickr-day.mcb-price-q3 { background: #fff3e0; }
.mcb-price-calendar .flatpickr-day.mcb-price-q3 .mcb-day-price { color: #ef6c00; }

.mcb-price-calendar .flatpickr-day.mcb-price-q4 { background: #ffebee; }
.mcb-price-calendar .flatpickr-day.mcb-price-q4 .mcb-day-price { color: #c62828; }

/* Keep selection/hover visible on top of the price colors. */
.mcb-price-calendar .flatpickr-day.selected,
.mcb-price-calendar .flatpickr-day.selected:hover {
    background: #569ff7;
    border-color: #569ff7;
}
.mcb-price-calendar .flatpickr-day.selected .mcb-day-price { color: #fff; }
.mcb-price-calendar .flatpickr-day.mcb-day-priced:hover { filter: brightness(0.93); }

/* Room for the taller day cells. */
.mcb-price-calendar.flatpickr-calendar { width: auto; }
.mcb-price-calendar .dayContainer { min-height: 300px; }

/* Bigger, clearly tappable month navigation in the price calendar */
.mcb-price-calendar .flatpickr-months {
    margin-bottom: 8px;
    align-items: center;
}

.mcb-price-calendar .flatpickr-prev-month,
.mcb-price-calendar .flatpickr-next-month {
    width: 42px;
    height: 42px;
    background: #5a4a3a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    top: 0;
    margin: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.mcb-price-calendar .flatpickr-prev-month svg,
.mcb-price-calendar .flatpickr-next-month svg {
    width: 18px;
    height: 18px;
    fill: #fff;
}

.mcb-price-calendar .flatpickr-prev-month:hover svg,
.mcb-price-calendar .flatpickr-next-month:hover svg {
    fill: #fff;
}

/* "Færdig" button — hidden on desktop, shown in the mobile fullscreen calendar */
.mcb-cal-done {
    display: none;
}

/* Fullscreen calendar on mobile: swiping months feels natural when the
   calendar owns the whole screen instead of floating over the page. */
@media (max-width: 768px) {
    .mcb-price-calendar.flatpickr-calendar.open {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh;
        height: 100dvh;
        margin: 0;
        border-radius: 0;
        z-index: 1000010;
        overflow-y: auto;
        padding: 12px 8px 90px;
        box-shadow: none;
        display: flex;
        flex-direction: column;
    }

    .mcb-price-calendar.flatpickr-calendar.open::before,
    .mcb-price-calendar.flatpickr-calendar.open::after {
        display: none; /* no anchor arrow in fullscreen */
    }

    .mcb-price-calendar .flatpickr-months {
        flex-shrink: 0;
        padding-top: 4px;
    }

    .mcb-price-calendar .flatpickr-innerContainer,
    .mcb-price-calendar .flatpickr-rContainer,
    .mcb-price-calendar .flatpickr-days {
        width: 100% !important;
        max-width: 100% !important;
    }

    .mcb-price-calendar .dayContainer {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
    }

    .mcb-price-calendar .flatpickr-day {
        height: 54px;
        font-size: 15px;
    }

    .mcb-price-calendar .mcb-day-price {
        font-size: 10px;
    }

    .mcb-price-calendar .mcb-cal-done {
        display: block;
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: 12px;
        padding: 14px;
        background: #5a4a3a;
        color: #fff;
        border: none;
        border-radius: 8px;
        font-size: 17px;
        font-weight: 700;
        z-index: 1000011;
        box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    }
}
