/* ==========================================================================
   GoTo Venue Search - Responsive Styles (v4 — compact UI, stepper, checkboxes)
   ========================================================================== */

/* Desktop XL (>1400px) */
@media (min-width: 1401px) {
    .gvs-results-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }

    .gvs-search-wrapper {
        padding: 0 40px;
    }

    .gvs-searchbar {
        max-width: 960px;
    }
}

/* Desktop (1024-1400px) */
@media (max-width: 1400px) {
    .gvs-results-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 15px;
    }

    .gvs-searchbar {
        max-width: 860px;
    }

    .gvs-segment--search .gvs-search-input {
        font-size: 15px !important;
    }

    .gvs-segment__btn {
        padding: 8px 14px;
    }

    .gvs-segment__label {
        font-size: 11px;
    }

    .gvs-segment__value {
        font-size: 14px;
    }

    .gvs-filter-btn {
        width: 40px;
        height: 40px;
    }

    .gvs-searchbar__btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* Tablet (768-1023px) */
@media (max-width: 1023px) {
    .gvs-results-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }

    /* Search bar wraps into 2 rows */
    .gvs-searchbar {
        flex-wrap: wrap;
        border-radius: 20px;
        max-width: 600px;
        padding: 6px;
    }

    /* Text search takes full width on first row */
    .gvs-segment--search {
        flex: 1 1 100%;
        border-bottom: 1px solid var(--gvs-border);
        padding-bottom: 6px;
        margin-bottom: 4px;
    }

    .gvs-segment--search .gvs-search-input {
        font-size: 16px !important;
    }

    /* Other segments share second row */
    .gvs-segment:not(.gvs-segment--search) {
        flex: 1 1 auto;
        min-width: 0;
    }

    /* Hide dividers, use spacing instead */
    .gvs-segment__divider {
        display: none;
    }

    .gvs-segment__btn {
        padding: 8px 14px;
        min-height: 56px;
        border-radius: 10px;
    }

    .gvs-segment__label {
        font-size: 11px;
    }

    .gvs-segment__value {
        font-size: 14px;
    }

    /* Filtre knap */
    .gvs-filter-btn {
        width: 38px;
        height: 38px;
    }

    /* Søg knap */
    .gvs-searchbar__btn {
        padding: 10px 18px;
        font-size: 14px;
    }

    .gvs-searchbar__btn svg {
        width: 16px;
        height: 16px;
    }

    .gvs-searchbar__btn span {
        display: none;
    }

    /* Panels position: full width under searchbar */
    .gvs-panel {
        left: 0;
        right: 0;
        transform: translateY(-4px);
        min-width: auto;
        width: 100%;
    }

    .gvs-panel.gvs-panel--visible {
        transform: translateY(0);
    }

    .gvs-panel--filters {
        right: 0;
        left: auto;
        min-width: auto;
        width: 100%;
    }

    /* Autocomplete full width */
    .gvs-autocomplete {
        left: 0;
        right: 0;
        min-width: auto;
    }

    /* Stepper: slightly smaller on tablet */
    .gvs-stepper__btn {
        width: 32px;
        height: 32px;
    }

    .gvs-stepper__input {
        width: 50px;
        font-size: 13px !important;
    }

    /* Cards */
    .gvs-card-title {
        font-size: 18px !important;
    }

    .gvs-card-detail {
        font-size: 11px;
    }

    .gvs-card-content {
        padding: 8px 12px 10px;
    }

    .gvs-card-image {
        height: 220px;
    }

    /* Inspiration tags */
    .gvs-inspiration {
        padding: 8px 0 12px;
    }

    .gvs-inspiration__tag {
        font-size: 11px;
        padding: 4px 10px;
    }
}

/* Mobile (<=767px) */
@media (max-width: 767px) {
    .gvs-results-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .gvs-search-wrapper {
        padding: 0 16px;
    }

    /* ======================================================================
       Mobile Trigger + Overlay Pattern
       ====================================================================== */

    /* Show mobile trigger, hide desktop searchbar */
    .gvs-mobile-trigger {
        display: block;
    }

    .gvs-searchbar-wrapper {
        display: none;
    }

    /* When overlay is active: show searchbar as fullscreen overlay */
    .gvs-searchbar-wrapper.gvs-overlay-active {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 2000;
        background: var(--gvs-bg-white);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0;
    }

    /* Overlay header */
    .gvs-overlay-active .gvs-mobile-overlay-header {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 16px;
        border-bottom: 1px solid var(--gvs-border);
        position: sticky;
        top: 0;
        background: var(--gvs-bg-white);
        z-index: 10;
    }

    /* Searchbar in overlay mode: vertical, no shadow, no radius */
    .gvs-overlay-active .gvs-searchbar {
        flex-direction: column;
        border-radius: 0;
        box-shadow: none;
        max-width: none;
        width: 100%;
        padding: 0 16px;
        gap: 0;
        align-items: stretch;
    }

    /* All segments become full-width sections */
    .gvs-overlay-active .gvs-segment {
        width: 100%;
        flex: none;
    }

    .gvs-overlay-active .gvs-segment__divider {
        display: none;
    }

    /* Search input in overlay */
    .gvs-overlay-active .gvs-segment--search {
        border-bottom: 1px solid var(--gvs-border);
        padding: 8px 0;
    }

    .gvs-overlay-active .gvs-search-input-wrapper {
        min-height: 48px;
        padding: 0 4px;
    }

    .gvs-overlay-active .gvs-search-input {
        font-size: 16px !important;
    }

    /* Autocomplete in overlay: inline, not fixed */
    .gvs-overlay-active .gvs-autocomplete {
        position: relative;
        top: auto;
        bottom: auto;
        left: auto;
        right: auto;
        border-radius: 0;
        max-height: 200px;
        box-shadow: none;
        border-bottom: 1px solid var(--gvs-border);
    }

    /* Segment buttons in overlay: simplified labels */
    .gvs-overlay-active .gvs-segment__btn {
        min-height: auto;
        padding: 14px 0;
        border-radius: 0;
        border-bottom: 1px solid var(--gvs-border);
        background: transparent;
    }

    .gvs-overlay-active .gvs-segment--active .gvs-segment__btn {
        background: transparent;
    }

    .gvs-overlay-active .gvs-segment__icon {
        display: flex;
    }

    .gvs-overlay-active .gvs-segment__label {
        font-size: 12px;
        margin-bottom: 0;
    }

    .gvs-overlay-active .gvs-segment__value {
        font-size: 15px;
    }

    /* Panels in overlay: inline (always visible, not dropdown) */
    .gvs-overlay-active .gvs-panel {
        position: static !important;
        top: auto !important;
        bottom: auto !important;
        left: auto !important;
        right: auto !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        max-height: none !important;
        overflow: visible !important;
        z-index: auto !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        transform: none !important;
        background: var(--gvs-bg-white);
        border-bottom: 1px solid var(--gvs-border);
    }

    .gvs-overlay-active .gvs-panel__inner {
        padding: 12px 0;
    }

    .gvs-overlay-active .gvs-panel__heading {
        font-size: 10px;
    }

    /* Filters segment in overlay: show inline */
    .gvs-overlay-active .gvs-filter-btn {
        display: none;
    }

    .gvs-overlay-active .gvs-segment--filters .gvs-panel {
        border-bottom: none;
    }

    /* Hide clear buttons in overlay (less clutter) */
    .gvs-overlay-active .gvs-segment__clear--inline {
        display: none;
    }

    /* Stepper in overlay */
    .gvs-overlay-active .gvs-stepper__btn {
        width: 36px;
        height: 36px;
    }

    .gvs-overlay-active .gvs-stepper__input {
        width: 56px;
        font-size: 14px !important;
    }

    /* Quickpicks in overlay */
    .gvs-overlay-active .gvs-quickpick {
        font-size: 12px;
        padding: 5px 10px;
    }

    .gvs-overlay-active .gvs-quickpicks {
        justify-content: flex-start;
    }

    /* Tiles in overlay */
    .gvs-overlay-active .gvs-landsdel-tiles {
        grid-template-columns: repeat(2, 1fr);
    }

    .gvs-overlay-active .gvs-event-tiles {
        grid-template-columns: repeat(2, 1fr);
    }

    .gvs-overlay-active .gvs-event-tile,
    .gvs-overlay-active .gvs-landsdel-tile {
        font-size: 12px;
        padding: 8px 10px;
    }

    /* Checkbox group in overlay */
    .gvs-overlay-active .gvs-checkbox-group {
        gap: 10px;
    }

    .gvs-overlay-active .gvs-checkbox__label {
        font-size: 13px;
    }

    .gvs-overlay-active .gvs-checkbox__box {
        width: 18px;
        height: 18px;
    }

    /* Search CTA button in overlay: sticky at bottom */
    .gvs-overlay-active .gvs-searchbar__btn {
        position: sticky;
        bottom: 0;
        width: 100%;
        margin: 16px 0 0;
        padding: 16px;
        font-size: 16px;
        border-radius: 12px;
        display: flex;
        justify-content: center;
    }

    .gvs-overlay-active .gvs-searchbar__btn span {
        display: inline;
    }

    /* ======================================================================
       Regular Mobile Styles (non-overlay: cards, results, etc.)
       ====================================================================== */

    /* Inspiration tags */
    .gvs-inspiration {
        padding: 8px 0 12px;
    }

    .gvs-inspiration__tag {
        font-size: 11px;
        padding: 4px 10px;
    }

    /* Cards */
    .gvs-card-title {
        font-size: 16px !important;
    }

    .gvs-card-detail {
        font-size: 11px;
    }

    .gvs-card-detail__icon {
        width: 12px;
        height: 12px;
    }

    .gvs-card-content {
        padding: 8px 12px 10px;
    }

    .gvs-card-image {
        height: 200px;
    }

    .gvs-card-meta {
        gap: 6px;
    }

    /* Results meta */
    .gvs-results-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    /* No results */
    .gvs-no-results {
        padding: 40px 16px;
    }
}

/* Mobile Small (<480px) */
@media (max-width: 479px) {
    .gvs-results-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    /* Stack segments fully on small screens */
    .gvs-searchbar {
        border-radius: 14px;
        padding: 4px;
    }

    .gvs-segment--search .gvs-search-input-wrapper {
        padding: 6px 10px;
    }

    .gvs-segment__btn {
        padding: 8px 12px;
    }

    /* Cards: full width, slightly larger image */
    .gvs-card-title {
        font-size: 18px !important;
    }

    .gvs-card-detail {
        font-size: 12px;
    }

    .gvs-card-detail__icon {
        width: 13px;
        height: 13px;
    }

    .gvs-card-content {
        padding: 10px 14px 12px;
    }

    .gvs-card-image {
        height: 220px;
    }

    .gvs-card-meta {
        gap: 8px;
    }

    /* Active filter tags */
    .gvs-active-filters {
        gap: 6px;
    }

    .gvs-filter-tag {
        font-size: 11px;
        padding: 4px 8px;
    }

    /* Event tiles: single column */
    .gvs-event-tiles {
        grid-template-columns: 1fr;
    }

    /* Landsdel tiles: single column */
    .gvs-landsdel-tiles {
        grid-template-columns: 1fr;
    }

    /* Stepper: full width friendly */
    .gvs-stepper {
        justify-content: center;
    }

    .gvs-stepper__btn {
        width: 36px;
        height: 36px;
    }

    .gvs-stepper__input {
        width: 56px;
    }

    /* Checkbox group: stack if needed */
    .gvs-checkbox-group {
        gap: 6px;
    }
}

/* Touch device optimizations */
@media (hover: none) {
    .gvs-venue-card:hover {
        transform: none;
        box-shadow: none;
    }

    .gvs-venue-card:hover .gvs-card-image img {
        transform: none;
    }

    /* Active states for touch */
    .gvs-venue-card:active {
        transform: scale(0.98);
    }

    .gvs-segment__btn:active {
        background: var(--gvs-bg-light);
    }

    .gvs-event-tile:hover {
        transform: none;
    }

    .gvs-landsdel-tile:hover {
        transform: none;
    }

    .gvs-stepper__btn:active {
        background: var(--gvs-bg-light);
    }

    .gvs-filter-btn:active {
        background: var(--gvs-bg-light);
    }

    .gvs-quickpick:active {
        background: var(--gvs-bg-light);
    }
}

/* Map responsive */
@media (max-width: 767px) {
    .gvs-map {
        height: 350px;
    }

    .gvs-map-card {
        left: 12px;
        right: 12px;
        bottom: 12px;
        width: auto;
    }

    .gvs-map-card__image {
        height: 130px;
    }
}

@media (max-width: 479px) {
    .gvs-map {
        height: 280px;
    }

    .gvs-map-card__image {
        height: 110px;
    }
}
