.search-page *,
.search-page *::before,
.search-page *::after,
.search-loading *,
.search-loading *::before,
.search-loading *::after {
    box-sizing: border-box;
}

.search-page {
    padding-top: 72px;
    background: #fbfaf7;
}

.search-loading {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(255, 252, 246, 0.68);
    backdrop-filter: blur(8px);
}

.search-loading.is-visible {
    display: flex;
}

.search-loading-box {
    width: min(360px, 100%);
    background: white;
    border: 1px solid rgba(221, 194, 150, 0.75);
    border-radius: 8px;
    padding: 28px 26px;
    text-align: center;
    box-shadow: 0 24px 70px rgba(7, 61, 52, 0.18);
}

.search-loading-box strong {
    display: block;
    color: var(--green);
    font-size: 22px;
    margin-top: 18px;
}

.search-loading-box p {
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.5;
    margin: 8px 0 0;
}

.loading-line {
    position: relative;
    height: 5px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(221, 194, 150, 0.34);
}

.loading-line span {
    position: absolute;
    inset: 0 auto 0 0;
    width: 42%;
    border-radius: inherit;
    background: var(--green);
    animation: loadingSlide 1.05s ease-in-out infinite;
}

.search-hero {
    min-height: 360px;
    display: flex;
    align-items: flex-end;
    background:
        linear-gradient(180deg, rgba(7, 61, 52, 0.28), rgba(7, 61, 52, 0.58)),
        url("https://images.unsplash.com/photo-1600607687920-4e2a09cf159d?auto=format&fit=crop&w=1800&q=80") center/cover;
}

.search-hero-inner {
    position: relative;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 66px 0 28px;
}

.search-heading {
    color: white;
    max-width: 620px;
    margin-bottom: 18px;
}

.search-heading span {
    display: block;
    text-transform: uppercase;
    letter-spacing: 2.4px;
    font-size: 11px;
    font-weight: 800;
    color: var(--gold);
    margin-bottom: 12px;
}

.search-heading h1 {
    margin: 0;
    font-size: clamp(28px, 3.8vw, 48px);
    line-height: 1.08;
    letter-spacing: 0;
}

.search-panel {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    width: min(760px, 100%);
    background: rgba(255, 252, 246, 0.96);
    border: 1px solid rgba(221, 194, 150, 0.55);
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.search-field {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 58px;
    border: 1px solid rgba(176, 176, 176, 0.8);
    border-radius: 8px;
    padding: 0 44px 0 16px;
    background: white;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
    text-align: left;
    cursor: pointer;
}

.search-field span {
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-size: 9px;
    font-weight: 800;
    color: var(--green);
    margin-bottom: 3px;
}

.search-field strong {
    width: 100%;
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
}

.search-field i {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border: 2px solid var(--green);
    border-radius: 4px;
    opacity: 0.9;
}

.search-field i::before,
.search-field i::after {
    content: "";
    position: absolute;
    background: var(--green);
}

.search-field i::before {
    left: 3px;
    right: 3px;
    top: 4px;
    height: 2px;
}

.search-field i::after {
    left: 4px;
    top: -4px;
    width: 2px;
    height: 5px;
    box-shadow: 8px 0 0 var(--green);
}

.search-field:focus-within {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(221, 194, 150, 0.24);
}

.search-submit {
    min-height: 58px;
    border: 0;
    border-radius: 8px;
    background: var(--green);
    color: white;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

.search-datepicker {
    position: absolute;
    z-index: 40;
    display: none;
    width: 292px;
    background: white;
    border: 1px solid rgba(221, 194, 150, 0.75);
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 20px 50px rgba(7, 61, 52, 0.18);
}

.search-datepicker.is-open {
    display: block;
    animation: datepickerIn 0.18s ease-out both;
}

.dp-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.dp-head strong {
    color: var(--green);
    font-size: 15px;
    text-transform: capitalize;
}

.dp-head button {
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: white;
    color: var(--green);
    cursor: pointer;
    font-size: 17px;
}

.dp-week,
.dp-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.dp-week {
    color: var(--gold);
    font-size: 11px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 8px;
}

.dp-grid {
    gap: 4px;
}

.dp-grid span {
    aspect-ratio: 1;
}

.dp-grid button {
    aspect-ratio: 1;
    border: 0;
    border-radius: 50%;
    background: white;
    color: var(--text);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.15s, color 0.15s;
}

.dp-grid button:hover {
    background: rgba(221, 194, 150, 0.28);
}

.dp-grid button.selected {
    background: var(--green);
    color: white;
}

.dp-grid button.in-range {
    background: rgba(221, 194, 150, 0.28);
    border-radius: 4px;
}

.dp-grid button:disabled {
    color: #c7c7c7;
    text-decoration: line-through;
    cursor: not-allowed;
    background: white;
}

.search-submit:hover {
    background: #073d34;
    transform: translateY(-1px);
}

.search-panel.is-loading .search-submit {
    opacity: 0.82;
}

.results-section {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 42px 0 70px;
}

.results-ready {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.5s, transform 0.5s;
}

.results-ready.is-visible,
.results-section:not(.is-searching) .results-ready {
    opacity: 1;
    transform: none;
}

.results-title {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: end;
    margin-bottom: 24px;
}

.results-title span {
    color: var(--green);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: 12px;
}

.results-title h2 {
    margin: 6px 0 0;
    font-size: 30px;
}

.villa-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}

.villa-card {
    background: white;
    border: 1px solid rgba(10, 81, 65, 0.11);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 16px 40px rgba(10, 81, 65, 0.08);
    animation: cardIn 0.45s both;
}

.villa-card:nth-child(2) { animation-delay: 0.08s; }
.villa-card:nth-child(3) { animation-delay: 0.16s; }
.villa-card:nth-child(4) { animation-delay: 0.24s; }
.villa-card:nth-child(5) { animation-delay: 0.32s; }
.villa-card:nth-child(6) { animation-delay: 0.40s; }

.villa-photo {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #eee;
}

.villa-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s;
}

.villa-card:hover .villa-photo img {
    transform: scale(1.04);
}

.villa-info {
    padding: 18px;
}

.villa-location {
    display: block;
    color: var(--text-light);
    font-size: 13px;
    margin-bottom: 6px;
}

.villa-info h3 {
    margin: 0;
    color: var(--green);
    font-size: 22px;
}

.villa-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0;
}

.villa-meta span {
    border: 1px solid rgba(221, 194, 150, 0.8);
    background: #fffaf1;
    color: #5f574a;
    border-radius: 999px;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 700;
}

.villa-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-top: 1px solid #f0ece5;
    padding-top: 16px;
}

.villa-price strong {
    color: var(--green);
    font-size: 24px;
}

.villa-price span {
    color: var(--text-light);
    font-size: 13px;
}

.villa-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 18px;
    border-radius: 999px;
    background: var(--green);
    color: white;
    text-decoration: none;
    font-weight: 800;
    font-size: 13px;
    white-space: nowrap;
}

.search-message {
    background: white;
    border: 1px solid rgba(221, 194, 150, 0.75);
    border-radius: 8px;
    padding: 24px;
    color: var(--text);
    box-shadow: 0 14px 34px rgba(10, 81, 65, 0.06);
}

.search-message.error {
    border-color: #efc2b8;
    background: #fff8f6;
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes loadingSlide {
    0% {
        transform: translateX(-110%);
    }
    50% {
        transform: translateX(65%);
    }
    100% {
        transform: translateX(250%);
    }
}

@keyframes datepickerIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@media (min-width: 760px) {
    .search-page {
        padding-top: 86px;
    }

    .search-panel {
        grid-template-columns: minmax(0, 1fr) 190px;
        padding: 10px;
    }

    .villa-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1080px) {
    .villa-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .search-page {
        overflow-x: hidden;
    }

    body,
    html {
        overflow-x: hidden;
    }

    header {
        padding-left: 12px;
        padding-right: 12px;
    }

    .header-nav {
        gap: 10px;
    }

    .nav-phone {
        padding-left: 10px;
        padding-right: 10px;
    }

    .search-hero {
        min-height: 410px;
    }

    .search-hero-inner {
        width: calc(100% - 44px);
        padding: 58px 0 24px;
    }

    .search-heading h1 {
        font-size: 27px;
    }

    .search-panel {
        width: 100%;
        padding: 8px;
        gap: 8px;
        border-radius: 10px;
    }

    .search-field,
    .search-submit {
        min-height: 56px;
    }

    .search-field {
        padding-left: 14px;
        padding-right: 52px;
        overflow: hidden;
    }

    .search-field strong {
        font-size: 14px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .search-field i {
        right: 16px;
    }

    .results-title {
        display: block;
    }

    .results-section {
        width: calc(100% - 44px);
        padding-top: 34px;
    }

    .results-title h2 {
        font-size: 30px;
        line-height: 1.15;
    }

    .villa-grid,
    .villa-card {
        width: 100%;
        min-width: 0;
    }

    .villa-bottom {
        align-items: stretch;
        flex-direction: column;
    }

    .villa-cta {
        width: 100%;
    }

    .search-datepicker {
        left: 0 !important;
        right: 0;
        width: 100%;
        max-width: 100%;
        padding: 12px;
    }
}
