/* Greecevest responsive polish: shared by public, auth and dashboard surfaces. */
html, body { max-width: 100%; overflow-x: clip; }
img, video, iframe, svg { max-width: 100%; }
main, section, .container, .container-fluid, .row, [class*="col-"] { min-width: 0; }
.table-responsive { -webkit-overflow-scrolling: touch; }

@media (max-width: 991.98px) {
    h1 { font-size: clamp(1.9rem, 7vw, 2.75rem); line-height: 1.08; }
    h2 { font-size: clamp(1.55rem, 5.8vw, 2.2rem); line-height: 1.15; }
    .gv-nav-mobile-panel,
    .navbar-collapse.show { max-height: calc(100dvh - 72px); overflow-y: auto; overscroll-behavior: contain; }
    .dropdown-menu { max-width: calc(100vw - 1.5rem); }
    .modal-dialog { width: auto; max-width: calc(100vw - 1.5rem); margin: .75rem auto; }
    .modal-content { max-height: calc(100dvh - 1.5rem); overflow: hidden; }
    .modal-body { overflow-y: auto; overscroll-behavior: contain; }
    .pagination { flex-wrap: wrap; gap: .25rem; }
    .slick-prev, .slick-next { z-index: 2; }
}

@media (max-width: 767.98px) {
    input:not([type="checkbox"]):not([type="radio"]), select, textarea { font-size: 16px !important; }
    button, .btn, [role="button"] { min-height: 44px; }
    .container, .container-fluid { padding-left: 1rem; padding-right: 1rem; }
    section { scroll-margin-top: 72px; }
    .row { --bs-gutter-x: 1rem; }
    .card, .property-card, .professional-card { max-width: 100%; }
    .card-body { padding: 1rem; }
    .card-header { padding: .9rem 1rem; }
    .btn-group, .input-group { max-width: 100%; }
    .btn-group.flex-wrap, .d-flex.flex-wrap { row-gap: .5rem; }
    .form-control, .form-select, .select2-selection { min-height: 46px; }
    .select2-container { width: 100% !important; max-width: 100%; }
    .select2-dropdown { max-width: calc(100vw - 2rem); }
    .table-responsive { border-radius: 12px; }
    .table-responsive > table { min-width: 650px; }
    .dataTables_wrapper .row { gap: .75rem; }
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate { width: 100%; text-align: left !important; }
    .dataTables_wrapper .dataTables_filter input { width: 100%; margin: .4rem 0 0 !important; }
    .modal-footer { flex-direction: column-reverse; align-items: stretch; padding: .8rem; }
    .modal-footer > * { width: 100%; margin: .2rem 0 !important; }
    .offcanvas { max-width: min(90vw, 340px); }
    .alert { padding: .8rem .9rem; }
    .auth-split-page { min-height: 100dvh !important; padding: .75rem !important; align-items: flex-start !important; }
    .auth-split-card { border-radius: .9rem !important; box-shadow: 0 14px 36px rgba(8,43,73,.14) !important; }
    .auth-split-form { padding: 1.25rem !important; }
    .auth-split-logo { margin-bottom: 1.25rem !important; }
    .auth-split-logo img { height: 2.5rem !important; }
    .auth-split-fields { margin-top: 1.4rem !important; gap: 1rem !important; }
    .auth-foot { margin-top: 1.25rem !important; }
}

/* Dashboard responsive workspace */
@media (max-width: 991.98px) {
    .nav-container { width: 100%; }
    .sidebar { width: min(86vw, 300px) !important; max-width: 300px; flex-basis: auto !important; }
    .page-content { width: 100%; min-width: 0; }
    .page-content > .container,
    .page-content > .container-fluid,
    .page-content .dashboard-content { width: 100%; padding-left: 1rem; padding-right: 1rem; }
    .gv-dashboard :is(.gv-stats, .gv-tools-grid, .gv-dashboard-grid) { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    .page-content .d-flex.justify-content-between { flex-wrap: wrap; gap: .75rem; }
}

@media (max-width: 575.98px) {
    .gv-dashboard-header .topBar { min-height: 64px !important; padding: 8px 10px !important; }
    .gv-breadcrumb { max-width: 34vw; }
    .gv-breadcrumb span { font-size: .78rem; }
    .gv-header-actions { margin-left: auto; }
    .gv-icon-button, .gv-account-trigger { width: 42px !important; height: 42px; min-height: 42px !important; border-radius: 12px; }
    .page-content > .container,
    .page-content > .container-fluid,
    .page-content .dashboard-content { padding-left: .75rem; padding-right: .75rem; }
    .page-content :is(.card, .stats-card, .subscription-card) { border-radius: 14px !important; }
    .page-content .card-header { padding: .85rem .9rem; }
    .page-content .card-body { padding: .9rem; }
    .gv-dashboard :is(.gv-stats, .gv-tools-grid, .gv-dashboard-grid) { grid-template-columns: minmax(0, 1fr) !important; }
    .gv-dashboard .gv-welcome { padding: 1.25rem !important; }
    .gv-dashboard .gv-welcome h1 { font-size: 1.75rem !important; }
    .gv-dashboard .gv-stat-card, .gv-dashboard .gv-tool-card { min-width: 0; }
    .page-content .nav-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
    .page-content .nav-tabs::-webkit-scrollbar { display: none; }
    .page-content .nav-tabs .nav-link { white-space: nowrap; }
    .page-content .btn:not(.btn-sm), .page-content button:not(.btn-sm) { min-height: 44px; }
    .page-content .d-flex.justify-content-between > .btn,
    .page-content .d-flex.justify-content-between > a.btn { width: 100%; }
    .gv-system-notice { padding: .75rem !important; font-size: .82rem; }
}

/* Map and dense discovery views */
@media (max-width: 767.98px) {
    #map, .leaflet-container, .gv-market-map-frame { min-height: 56dvh; }
    .leaflet-popup-content-wrapper { max-width: calc(100vw - 40px); }
    .leaflet-popup-content { max-width: calc(100vw - 72px); }
    .gv-market-popup-card { min-width: 0 !important; }
    .filter-row, .results-toolbar, .property-toolbar { align-items: stretch !important; }
    .filter-row > *, .results-toolbar > *, .property-toolbar > * { width: 100%; }
}
