/**
 * Areti Portal — Mobile Overrides
 *
 * @package AretiPortal
 */

/* ─── 1024px and below — Tablet ────────────────────────── */

@media (max-width: 1024px) {
    .artip-listings-content {
        flex-direction: column;
    }

    .artip-map-column {
        position: relative;
        top: 0;
        height: 350px;
        max-height: none;
        flex: none;
        order: -1;
    }

    .artip-listings-content.artip-with-map .artip-cards-column {
        flex: none;
        width: 100%;
    }

    .artip-cards-grid {
        --artip-cols: 2;
    }

    .artip-destinations-grid {
        --artip-dest-cols: 2 !important;
    }

    .artip-mobile-toggles {
        display: flex;
        gap: 8px;
    }
}

/* ─── 768px and below — Small Tablet ───────────────────── */

@media (max-width: 768px) {
    .artip-filters-row {
        flex-direction: column;
        align-items: stretch;
    }

    .artip-filter-group {
        width: 100%;
    }

    .artip-filter-input,
    .artip-filter-select {
        width: 100%;
    }

    .artip-filter-price {
        flex-direction: row;
    }

    .artip-filter-small {
        width: 100%;
        flex: 1;
    }

    .artip-cards-grid {
        --artip-cols: 2;
        gap: 12px;
    }

    /* Hide desktop map on mobile — replaced by overlay */
    .artip-map-column {
        display: none;
    }

    .artip-featured-carousel .artip-card {
        flex: 0 0 260px;
    }
}

/* ─── 480px and below — Phone ──────────────────────────── */

@media (max-width: 480px) {
    .artip-cards-grid {
        --artip-cols: 1;
    }

    .artip-destinations-grid {
        --artip-dest-cols: 1 !important;
    }

    .artip-card__footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .artip-card__actions {
        width: 100%;
    }

    .artip-card__actions .artip-btn {
        flex: 1;
        justify-content: center;
    }

    .artip-featured-carousel .artip-card {
        flex: 0 0 85vw;
    }
}

/* ─── Mobile Map Overlay ───────────────────────────────── */

.artip-mobile-map-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: var(--artip-white);
    display: flex;
    flex-direction: column;
    animation: artip-slide-up 0.3s ease;
}

@keyframes artip-slide-up {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.artip-mobile-map-overlay__header {
    display: flex;
    justify-content: flex-end;
    padding: 12px 16px;
    background: var(--artip-white);
    border-bottom: 1px solid var(--artip-border);
    z-index: 2;
}

.artip-mobile-map-overlay__close {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--artip-white);
    border: 1px solid var(--artip-border);
    border-radius: var(--artip-radius-sm);
    font-family: var(--artip-font);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    color: var(--artip-text);
}

.artip-mobile-map-overlay__map {
    flex: 1;
    position: relative;
}

/* Bottom card on marker tap */
.artip-mobile-map-overlay__card {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 3;
    background: var(--artip-white);
    border-radius: var(--artip-radius) var(--artip-radius) 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    padding: 16px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.artip-mobile-map-overlay__card--visible {
    transform: translateY(0);
}

.artip-mobile-card {
    display: flex;
    gap: 12px;
    align-items: center;
}

.artip-mobile-card__image {
    width: 80px;
    height: 60px;
    border-radius: var(--artip-radius-sm);
    object-fit: cover;
    flex-shrink: 0;
}

.artip-mobile-card__info {
    flex: 1;
    min-width: 0;
}

.artip-mobile-card__name {
    font-size: 15px;
    font-weight: 600;
    color: var(--artip-text);
    margin: 0 0 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.artip-mobile-card__city {
    font-size: 13px;
    color: var(--artip-text-light);
}

.artip-mobile-card__price {
    font-size: 16px;
    font-weight: 700;
    color: var(--artip-text);
    flex-shrink: 0;
}

/* ─── Mobile Filter Drawer ─────────────────────────────── */

.artip-filter-drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99998;
    background: var(--artip-white);
    border-radius: var(--artip-radius) var(--artip-radius) 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    padding: 20px 16px;
    max-height: 80vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.artip-filter-drawer--open {
    transform: translateY(0);
}

.artip-filter-drawer__overlay {
    position: fixed;
    inset: 0;
    z-index: 99997;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.artip-filter-drawer__overlay--visible {
    opacity: 1;
    pointer-events: auto;
}

.artip-filter-drawer__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--artip-border);
}

.artip-filter-drawer__title {
    font-size: 16px;
    font-weight: 700;
    color: var(--artip-text);
    margin: 0;
}

.artip-filter-drawer__close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--artip-text);
    padding: 4px;
}

.artip-filter-drawer__actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--artip-border);
}

.artip-filter-drawer__actions .artip-btn {
    flex: 1;
    justify-content: center;
}

/* ─── Touch Swipe Support ──────────────────────────────── */

.artip-card__gallery {
    touch-action: pan-y;
}

/* ═══════════════════════════════════════════════════════════
   PHASE 3 — Mobile overrides
   ═══════════════════════════════════════════════════════════ */

/* ─── Search Bar ───────────────────────────────────────── */

@media (max-width: 768px) {
    .artip-search__form {
        flex-direction: column;
        border-radius: var(--artip-radius);
        padding: 16px;
        gap: 0;
    }

    .artip-search__field--date,
    .artip-search__field--guests {
        border-left: none;
        border-top: 1px solid var(--artip-border);
        padding-left: 0;
        padding-top: 12px;
        margin-top: 12px;
    }

    .artip-search__field--submit {
        margin-top: 12px;
    }

    .artip-search__submit {
        width: 100%;
        justify-content: center;
    }

    .artip-search__hero-bg {
        padding: 48px 20px 80px;
        border-radius: 0;
    }

    .artip-search__title {
        font-size: 24px;
    }

    .artip-search__subtitle {
        font-size: 14px;
    }

    /* Datepicker single month on small screens */
    .artip-dp__months {
        flex-direction: column;
    }

    .artip-dp__month {
        min-width: 200px;
    }
}

/* ─── Single Property Page ─────────────────────────────── */

@media (max-width: 1024px) {
    .artip-single__content {
        grid-template-columns: 1fr;
    }

    .artip-single__sidebar {
        position: relative;
        top: 0;
    }
}

@media (max-width: 768px) {
    .artip-single__gallery-grid {
        grid-template-columns: 1fr;
        max-height: 300px;
    }

    .artip-single__gallery-thumbs {
        display: none;
    }

    .artip-single__name {
        font-size: 22px;
    }

    .artip-single__amenities-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .artip-single__rooms {
        grid-template-columns: 1fr;
    }

    /* Sticky booking bar on mobile */
    .artip-booking-widget {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 9999;
        border-radius: var(--artip-radius) var(--artip-radius) 0 0;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
        max-height: 60vh;
        overflow-y: auto;
    }

    .artip-booking-widget__dates {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .artip-search__popular-list {
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
    }
}
