/* ========================================
   RENTAL SEARCH BAR
   ======================================== */
.wh-rental-search {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 0;
    align-items: center;
    max-width: 900px;
    margin: 0 auto 15px;
    padding: 0;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .12);
    border-radius: 9999px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .06);
    overflow: visible;
    position: relative;
}

.wh-rental-search select,
.wh-rental-search input[type=text] {
    width: 100%;
    height: 100%;
    border: 0;
    background: transparent;
    padding: 20px 16px;
    outline: none;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wh-rental-search .button {
    width: 100%;
    height: 100%;
    border: 0;
    background: var(--tbim-medium-blue);
    color: #fff;
    padding: 20px 20px;
    border-radius: 9999px;
    margin: 0;
    outline: none;
}

.wh-rental-search select {
    border-right: 1px solid rgba(0, 0, 0, .08);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
    padding-right: 40px;
}

.wh-rental-search select:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.wh-rental-search select:focus {
    background-color: rgba(0, 0, 0, 0.04);
    background-color: #fff !important;
}

.wh-rental-search input[type=text]:first-of-type {
    border-right: 1px solid rgba(0, 0, 0, .08);
}

.wh-rental-search input[type=text]:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.wh-rental-search input[type=text]:focus {
    background-color: rgba(0, 0, 0, 0.04);
}

.wh-rental-search input[type=text]::placeholder {
    color: #999;
    font-weight: 400;
}

/* Style dropdown options to match calendar appearance */
.wh-rental-search select option {
    padding: 12px 16px !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    color: #333 !important;
    background: #fff !important;
    border: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
}

.wh-rental-search select option:checked {
    background-color: var(--tbim-medium-blue) !important;
    color: #fff !important;
}

.wh-rental-search select option:hover {
    background-color: rgba(0, 0, 0, 0.08) !important;
    color: #333 !important;
}

.wh-rental-search select::-webkit-list-button {
    display: none !important;
}

/* ========================================
   CUSTOM DROPDOWN
   ======================================== */
.wh-custom-dropdown {
    position: relative;
    width: 100%;
    height: 100%;
    border-right: 1px solid rgba(0, 0, 0, .08);
}

.wh-custom-dropdown-trigger {
    width: 100%;
    height: 100%;
    border: 0;
    background: transparent;
    padding: 20px 16px;
    padding-right: 40px;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: none;
    border-top-left-radius: 9999px;
    border-bottom-left-radius: 9999px;
}

.wh-custom-dropdown-trigger:hover,
.wh-custom-dropdown-trigger:focus,
.wh-custom-dropdown-trigger:active {
    background-color: rgba(0, 0, 0, 0.02);
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
    border-top-left-radius: 9999px;
    border-bottom-left-radius: 9999px;
}

.wh-custom-dropdown-trigger:focus {
    background-color: rgba(0, 0, 0, 0.04);
}

.wh-custom-dropdown-trigger .wh-custom-dropdown-text {
    color: #333 !important;
}

.wh-custom-dropdown-arrow {
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 16px;
    transition: transform 0.2s ease;
}

.wh-custom-dropdown.open .wh-custom-dropdown-arrow {
    transform: rotate(180deg);
}

.wh-custom-dropdown-options {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .12);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .15);
    z-index: 10000;
    max-height: 200px;
    overflow-y: auto;
    margin-top: 4px;
    min-height: 50px;
    width: 100%;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.wh-custom-dropdown.open .wh-custom-dropdown-options {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.wh-custom-dropdown-option {
    padding: 12px 16px;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid rgba(0, 0, 0, .06);
}

.wh-custom-dropdown-option:last-child {
    border-bottom: none;
}

.wh-custom-dropdown-option:hover {
    background-color: rgba(0, 0, 0, 0.08);
}

.wh-custom-dropdown-option.selected {
    background-color: var(--tbim-medium-blue);
    color: #fff;
}

.wh-custom-dropdown-option.selected:hover {
    background-color: var(--tbim-medium-blue);
    color: #fff;
}

/* ========================================
   STATIC LOCATION (single location case)
   ======================================== */
.wh-rental-search .wh-location-static {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 20px 16px; /* add left/right padding to match inputs */
    border-right: 1px solid rgba(0, 0, 0, .08);
    border-top-left-radius: 9999px;
    border-bottom-left-radius: 9999px;
    box-sizing: border-box;
}

.wh-rental-search .wh-location-static .wh-location-label {
    color: #666;
    font-weight: 500;
}

.wh-rental-search .wh-location-static .wh-location-name {
    color: #333;
    font-weight: 500;
}

/* ========================================
   LITEPICKER CALENDAR
   ======================================== */
.wh-rental-search .litepicker {
    display: block;
    position: absolute;
    top: calc(100% + 8px) !important;
    left: 50% !important;
    transform: translateX(-50%);
    width: 100% !important;
    min-width: 640px;
    max-width: 100% !important;
    margin-top: 0;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .15);
    border: 1px solid rgba(0, 0, 0, .08);
    overflow: hidden;
    z-index: 99999;
    --litepicker-month-width: calc((100% - 48px) / 2);
    --litepicker-day-width: 50px !important;
}

.wh-rental-search .litepicker .container__months {
    width: 100% !important;
    display: flex;
    flex-wrap: nowrap !important;
    gap: 24px !important;
    box-shadow: none !important;
}

.wh-rental-search .litepicker .container__main {
    width: 100% !important;
    padding: 20px;
}

.litepicker .month-item {
    box-sizing: border-box;
    padding: 5px 12px !important;
    width: var(--litepicker-month-width) !important;
    flex: 0 0 var(--litepicker-month-width);
    max-width: none;
    margin: 0 !important;
}

.litepicker .month-item-header {
    border: none;
    align-items: center;
}

.litepicker .month-item-header select {
    font-size: 18px;
    font-weight: 600;
}

.litepicker .month-item-name,
.litepicker .month-item-year {
    font-size: 16px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    pointer-events: none;
    background: transparent;
    border: 0;
    padding: 0;
}

.litepicker .month-item-header select.month-item-name option,
.litepicker .month-item-header select.month-item-year option { 
    display: none; 
}

.litepicker .month-item-weekdays-row {
    display: grid !important;
    grid-template-columns: repeat(7, 1fr) !important;
    margin: 0 auto 8px auto;
    width: 100% !important;
    justify-items: center;
}

.litepicker .month-item-weekdays-row div {
    font-size: 14px !important;
    font-weight: 500;
    color: #666;
    height: 30px;
    line-height: 30px;
    text-align: center;
}

.litepicker .container__days {
    display: grid !important;
    grid-template-columns: repeat(7, 1fr) !important;
    margin: 0 auto 8px auto;
    width: 100% !important;
}

.litepicker .container__days div {
    height: var(--litepicker-day-width);
    width: 100% !important;
    font-size: 16px !important;
}

.litepicker .day-item {
    box-sizing: border-box;
    border-radius: 9999px;
    width: 100%;
    height: var(--litepicker-day-width);
    line-height: var(--litepicker-day-width);
    font-size: 16px;
    text-align: center;
    margin: 0;
}

.litepicker .is-start-date .day-item {
    background: #000;
    color: #fff;
    border-radius: 9999px 0 0 9999px;
}

.litepicker .is-end-date .day-item {
    background: #000;
    color: #fff;
    border-radius: 0 9999px 9999px 0;
}

.litepicker .is-in-range .day-item {
    background: rgba(0, 0, 0, .08);
    border-radius: 0 !important;
}

.litepicker .button-apply {
    display: none;
}

.litepicker .button-previous-month,
.litepicker .button-next-month {
    width: 36px;
    height: 36px;
}

/* ========================================
   RENTAL CARDS
   ======================================== */
#rental-unit-list {
    width: 100%;
}

#rental-unit-list .trailer-container {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    width: 100%;
}

#rental-unit-list .trailer-container .t-feed {
    width: auto !important;
    transform: none !important;
}

#rental-unit-list .rental-card {
    padding: 0 !important;
    margin: 10px 0 !important;
    overflow: hidden !important;
    box-sizing: border-box;
    word-break: normal !important;
    overflow-wrap: normal !important;
    hyphens: none !important;
}

#rental-unit-list .rental-card[style*="display: none"] {
    display: none !important;
}

#rental-unit-list .rental-card .t-feed-head {
    padding: 0 !important;
    display: flex;
    flex-direction: column;
}

#rental-unit-list .rental-card .t-feed-head h3 {
    font-size: 18px !important;
    margin: 8px 0 0 !important;
    padding: 0 0 4px !important;
    text-align: center;
}

#rental-unit-list .rental-card .t-details {
    padding: 8px 16px 12px !important;
}

#rental-unit-list .rental-card .t-financial {
    padding: 0 !important;
    text-align: center;
}

#rental-unit-list .rental-card .t-img {
    aspect-ratio: 4/3;
    width: 100%;
    margin: 0;
}

#rental-unit-list .rental-card .rental-rates {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 12px;
    margin: 6px 0 10px;
}

#rental-unit-list .rental-card .rental-rates .rate {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
}

#rental-unit-list .rental-card .rental-rates .rate span {
    white-space: nowrap;
}

#rental-unit-list .rental-card .rental-rates .rate strong {
    padding: 0;
}

#rental-unit-list .rental-card .buttons-block p {
    margin: 0;
    clear: both;
    overflow: auto;
}

#rental-unit-list .rental-card .wh-reserve-rental {
    width: 100%;
}

#rental-unit-list .rental-card .t-btn {
    border-radius: 6px;
}

.rental-card .t-title {
    font-size: 20px !important;
    line-height: 1.25;
    margin-bottom: 8px;
}

.rental-card .t-meta,
.rental-card .t-pricing {
    font-size: 18px !important;
}

/* ========================================
   LOADING & ERROR STATES
   ======================================== */
.loading-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    min-height: 200px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    position: relative;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--tbim-medium-blue, #007cba);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

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

.loading-text {
    font-size: 16px;
    color: #666;
    font-weight: 500;
}

.error-message {
    text-align: center;
    padding: 40px 20px;
    font-size: 16px;
    color: #d32f2f;
    background: #ffebee;
    border-radius: 8px;
    margin: 20px 0;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.filter-message {
    text-align: center;
    padding: 12px 20px;
    font-size: 14px;
    color: #666;
    background: #f5f5f5;
    border-radius: 6px;
    margin-bottom: 16px;
    font-weight: 500;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 720px) {
    .wh-rental-search {
        grid-template-columns: 1fr 1fr;
        border-radius: 12px;
    }

    .wh-rental-search .button {
        grid-column: 1 / -1;
        margin: 0;
    }
}

@media (max-width: 1200px) {
    #rental-unit-list .trailer-container {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    #rental-unit-list .trailer-container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    #rental-unit-list .trailer-container {
        grid-template-columns: 1fr;
    }
}