﻿.av-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    display: none;
    z-index: 2000;
}

    .av-overlay.show {
        display: block;
    }

@media (max-width: 800px) {
    .av-datepop {
        top: 20px !important;
    }
}

/*
  Date picker overlay
  Mobile fix: keep the calendar fully visible by constraining height and allowing internal scroll.
*/
.av-datepop {
    position: fixed;
    left: 50%;
    top: 96px;
    transform: translateX(-50%);
    width: min(980px, calc(100vw - 24px));
    max-height: calc(100vh - 24px);
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 20px 60px rgba(0,0,0,.18);
    overflow: hidden;
    font-family: inherit;
    display: flex;
    flex-direction: column;
}

.av-datepop-header {
    padding: 18px 22px 12px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.av-tabs {
    background: #f2f2f2;
    border-radius: 999px;
    padding: 4px;
    display: inline-flex;
    gap: 4px;
}

.av-tab {
    border: 0;
    background: transparent;
    padding: 8px 16px;
    border-radius: 999px;
    font-weight: 600;
}

    .av-tab.active {
        background: #fff;
        box-shadow: 0 2px 10px rgba(0,0,0,.08);
    }

.av-close {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,.12);
    background: #fff;
    font-size: 22px;
    line-height: 1;
}

.av-datepop-body {
    padding: 6px 22px 18px;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.av-calwrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}

@media (max-width: 860px) {
    .av-calwrap {
        grid-template-columns: 1fr;
        gap: 14px; /* tighter spacing on mobile */
    }

    .av-cal {
        padding: 4px 6px 8px; /* reduce inner padding */
    }

    .av-day {
        height: 40px; /* slightly smaller tap targets but still comfy */
        border-radius: 12px;
    }

    .av-quick {
        gap: 8px;
    }

    .av-chip {
        padding: 8px 12px;
        font-size: 14px;
    }
}

.av-cal {
    border-radius: 16px;
    padding: 6px 10px 10px;
}

.av-cal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 4px 10px;
}

.av-navbtn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,.12);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.av-monthtitle {
    font-weight: 700;
}

.av-dow {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    padding: 0 4px 6px;
    color: #6c757d;
    font-size: 12px;
    font-weight: 600;
}

.av-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    padding: 0 4px 8px;
}

.av-day {
    height: 42px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 600;
    user-select: none;
}

    .av-day:hover {
        border-color: rgba(220,53,69,.35);
        background: rgba(220,53,69,.06);
    }

    .av-day.is-muted {
        opacity: .35;
        cursor: default;
    }

        .av-day.is-muted:hover {
            border-color: transparent;
            background: #fff;
        }

    .av-day.is-start, .av-day.is-end {
        background: #dc3545;
        color: #fff;
    }

    .av-day.is-inrange {
        background: rgba(220,53,69,.12);
        border-color: rgba(220,53,69,.08);
    }

.av-quick {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding: 10px 4px 0;
}

.av-chip {
    border: 1px solid rgba(0,0,0,.12);
    border-radius: 999px;
    padding: 8px 14px;
    background: #fff;
    font-weight: 600;
    cursor: pointer;
}

    .av-chip.active {
        border-color: #dc3545;
        box-shadow: 0 6px 16px rgba(220,53,69,.15);
    }

.av-months {
    display: none;
    padding: 6px 4px 4px;
}

    .av-months.show {
        display: block;
    }

.av-months-card {
    border: 1px solid rgba(0,0,0,.10);
    border-radius: 18px;
    padding: 18px;
    background: #fff;
}

.av-row {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    align-items: center;
}

    .av-row label {
        font-weight: 700;
    }

.av-range {
    width: min(420px, 100%);
}

.av-footer {
    padding: 14px 22px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-top: 1px solid rgba(0,0,0,.06);
    background: #fff;
}

@media (max-width: 800px) {
    .av-datepop {
        top: 12px;
        width: calc(100vw - 16px);
        max-height: calc(100vh - 16px);
        border-radius: 18px;
    }
    .av-datepop-header {
        padding: 14px 14px 10px;
    }
    .av-datepop-body {
        padding: 6px 14px 14px;
    }
    .av-footer {
        padding: 12px 14px 14px;
        position: sticky;
        bottom: 0;
    }
}

/* Home listing grids (Index mobile): use CSS grid so cards fill space nicely */
.grid-section .grid-wrapper{
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
    justify-content: initial;
}
.grid-section .grid-card{ width: auto; }
@media (max-width: 575px){
    .grid-section .grid-wrapper{ grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
    .grid-section .grid-content h4{ font-size: 15px; }
    .grid-section .grid-meta{ font-size: 12px; }
}

.av-summary {
    font-weight: 700;
}

.av-actions {
    display: flex;
    gap: 10px;
}

.av-btn {
    border-radius: 12px;
    padding: 10px 16px;
    border: 1px solid rgba(0,0,0,.12);
    background: #fff;
    font-weight: 700;
}

    .av-btn.primary {
        background: #dc3545;
        border-color: #dc3545;
        color: #fff;
    }
