/* 
 * Premium Theme Transformation for Osclass Modern Theme
 * Brand Colors: #FF5A5F (Red), #00A699 (Teal), #484848 (Dark Gray)
 * Typography: Inter (Google Fonts)
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #FF385C;
    --secondary-color: #00A699;
    --text-color: #484848;
    --light-gray: #717171;
    --border-color: #DDDDDD;
    --white: #FFFFFF;
    --shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif !important;
    color: var(--text-color) !important;
    background-color: #f4f7f8 !important;
    margin: 0;
    padding: 0;
    line-height: 1.43 !important;
}

/* Header & Navigation */
/* Neutralize Uniform.js for modern components */
.button:has(button),
div.selector,
div.checker,
div.uploader,
#search-pill-form .button,
#search-pill-form span {
    display: contents !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
}

/* Nuclear Width Reset for Legacy Modern Theme */
#header,
.container,
.content,
.forcemessages-inline,
div.breadcrumb,
.form_publish .search,
.user_account,
.add_item,
.wrapper,
#main,
#sidebar,
#footer {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    float: none !important;
    box-sizing: border-box !important;
}

/* Breadcrumb Styling */
.breadcrumb-container {
    padding: 12px 0;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.breadcrumb-container i {
    font-size: 10px;
    margin: 0 8px;
    color: #b0b0b0;
}

.breadcrumb-container a {
    color: #717171;
    text-decoration: none !important;
    transition: color 0.2s;
}

.breadcrumb-container a:hover {
    color: #222;
    text-decoration: underline !important;
}

/* Desktop: keep images square (1:1) — size increase comes from 2-column grid */
@media (min-width: 768px) {
    .listing-card .relative.aspect-square,
    .listing-card [class*="aspect-square"] {
        aspect-ratio: 1 / 1 !important;
    }
}

/* Mosaic Grid Layout (Ensuring 2nd column in mobile) */
@media (max-width: 640px) {

    .home-grid,
    #results-grid,
    .listing-items>div,
    .ad_list .listing-items {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 12px !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
        width: 100% !important;
    }

    .listing-card .relative {
        border-radius: 12px !important;
    }

    .listing-card h3 {
        font-size: 13px !important;
    }

    .listing-card p {
        font-size: 12px !important;
    }
}

#header,
#footer,
.content,
#content,
#main,
.wrapper,
.container,
.breadcrumb,
.form_publish .search,
.home #main,
.home #sidebar,
.item #main,
.item #sidebar,
.list #main,
.list #sidebar {
    /* max-width: 100vw !important; */
    /* width: 100% !important; */
    /* min-width: 0 !important; */
    box-sizing: border-box !important;
    float: none !important;
    /* Disable legacy floats */
}

/* Ensure images don't overflow */
img {
    max-width: 100%;
    height: auto;
}

#header .container {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}

html,
body {
    width: 100%;
}

#header h1 a {
    color: var(--primary-color) !important;
    font-weight: 800 !important;
    font-size: 24px !important;
    text-decoration: none !important;
    letter-spacing: -1px !important;
}

/* Search Bar (Centered Pill) */
.theme-search-form {
    display: flex;
    justify-content: center;
    width: 100%;
}

.search-pill {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #dddddd;
    border-radius: 40px;
    padding: 8px 8px 8px 24px;
    box-shadow: 0 3px 12px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.2s ease;
    max-width: 850px;
    width: 100%;
    cursor: default;
}

.search-pill:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.search-section {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 0 8px;
}

.search-section label {
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 2px;
    color: #222222;
}

.search-section input {
    border: none !important;
    padding: 0 !important;
    font-size: 14px !important;
    color: #717171 !important;
    background: transparent !important;
    width: 100% !important;
    outline: none !important;
}

.search-pill .divider {
    height: 32px;
    width: 1px;
    background: #dddddd;
    margin: 0 16px;
}

.search-button {
    background: #FF385C !important;
    border: none !important;
    border-radius: 50% !important;
    width: 48px !important;
    height: 48px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: white !important;
    cursor: pointer !important;
    transition: transform 0.1s ease !important;
}

.search-button:active,
#main-search-btn:active,
#user-menu-button:active,
#show-map-btn:active,
.theme-pagination a:active {
    transform: scale(0.95);
}

/* User Menu */
#user_menu {
    display: flex !important;
    align-items: center !important;
}

#user_menu ul {
    display: flex !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

#user_menu li {
    margin-left: 8px !important;
}

#user_menu li a {
    color: var(--text-color) !important;
    padding: 12px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    text-decoration: none !important;
    border-radius: 24px !important;
    transition: background 0.2s ease !important;
}

#user_menu li a:hover {
    background: #F7F7F7 !important;
}

.publish_button {
    display: none !important;
}

.form_publish {
    display: block !important;
}

#login_open,
#login {
    display: none !important;
}

/* Hero Section / Main Search */
.hero-container {
    padding: 40px 80px;
    background: #000;
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
    height: 500px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.hero-container h2 {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 24px;
}

/* Mosaic Grid Layout */
.listing-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 32px;
    /* Increased gap for better visual separation */
}

@media (min-width: 1024px) {
    .listing-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 40px;
        /* 2-column layout — larger images on desktop */
    }
}

.listing-card {
    cursor: pointer;
    transition: transform 0.2s ease;
    touch-action: manipulation; /* Eliminates 300ms tap delay on iOS */
    -webkit-tap-highlight-color: transparent; /* Remove grey tap flash on iOS */
}

/* Global: remove 300ms tap delay on all links and buttons */
a, button {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.listing-card:hover {
    transform: none;
    /* Theme cards don't usually lift on home page, they just show navigation */
}

/* Swiper removed from homepage, keeping classes for potential reuse in other pages if needed, but styling specifically for cards below */
.listing-card-img-container {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    aspect-ratio: 1 / 1;
    margin-bottom: 12px;
}

.listing-card-info {
    padding-top: 4px;
}

.listing-card-title {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.listing-card-location {
    color: var(--light-gray);
    font-size: 15px;
    margin-bottom: 4px;
}

.listing-card-price {
    font-weight: 700;
    font-size: 15px;
}

.listing-card-price span {
    font-weight: 400;
}

/* Footer */
#footer {
    border-top: 1px solid var(--border-color);
    padding: 12px 0 !important; /* Extremely compact */
    background: #F7F7F7;
}

/* Loading Overlay */
#theme-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out;
}

.theme-spinner-logo {
    width: 240px;
    height: 160px;
    background: url('images/Logo-curvas.svg') no-repeat center;
    background-size: contain;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.9);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.1);
        opacity: 1;
    }

    100% {
        transform: scale(0.9);
        opacity: 0.5;
    }
}

/* Interactive Map & Hover Modals */
.map-container {
    width: 100%;
    height: 500px;
    background: #F0F0F0;
    margin: 40px 0;
    border-radius: 24px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

#theme-map {
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Custom Leaflet Marker */
.theme-marker {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 28px;
    padding: 4px 12px 4px 4px;
    font-weight: 700;
    font-size: 14px;
    color: var(--text-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.18);
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
    display: flex;
    align-items: center;
    gap: 8px;
}

.marker-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.theme-marker:hover,
.theme-marker.active {
    background: var(--text-color);
    color: var(--white);
    transform: scale(1.05);
    z-index: 1000 !important;
}

/* Hover Modal Styling */
.map-hover-modal {
    position: absolute;
    width: 280px;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.2, 0, 0, 1);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.map-hover-modal.active {
    opacity: 1;
    pointer-events: auto;
}

/* Modal Carousel Styles */
.map-hover-modal .modalSwiper {
    width: 100%;
    height: 200px;
}

.map-hover-modal .modal-carousel-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.map-hover-modal .swiper-pagination {
    bottom: 8px !important;
}

.map-hover-modal .swiper-button-next,
.map-hover-modal .swiper-button-prev {
    width: 28px !important;
    height: 28px !important;
    background: rgba(255, 255, 255, 0.9) !important;
    border-radius: 50% !important;
    opacity: 0;
    transition: opacity 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.map-hover-modal .swiper-button-next::after,
.map-hover-modal .swiper-button-prev::after {
    font-size: 12px !important;
    color: #222 !important;
    font-weight: bold;
}

.map-hover-modal:hover .swiper-button-next,
.map-hover-modal:hover .swiper-button-prev {
    opacity: 1;
}

.modal-thumb {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid var(--border-color);
}

.modal-content {
    padding: 20px;
}

.modal-title {
    font-weight: 700;
    font-size: 17px;
    margin-bottom: 6px;
    color: var(--text-color);
}

.modal-price {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-color);
    margin-bottom: 15px;
}

.modal-price span {
    font-weight: 400;
}

.modal-contact {
    display: block;
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: white;
    text-align: center;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: filter 0.2s ease;
}

.modal-contact:hover {
    filter: brightness(0.9);
}
/* Smooth Map Marker Transitions */
path.leaflet-interactive {
    transition: stroke-width 0.2s ease-out, stroke 0.2s ease-out, fill 0.2s ease-out, d 0.2s ease-out;
}

/* Hide Leaflet default elements */
.leaflet-control-attribution {
    display: none !important;
}

.leaflet-bar {
    border: none !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

.leaflet-bar a {
    border-radius: 8px !important;
}

/* Search Split-View Utilities */
.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #e2e2e2;
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #d0d0d0;
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Map Pins & Badges */
.price-marker {
    transition: transform 0.2s cubic-bezier(0, 0, 0.2, 1);
}

.price-marker:hover {
    transform: scale(1.1);
    z-index: 1000 !important;
}

.price-marker div {
    white-space: nowrap;
}

/* Map Hover Modal Styling */
.map-hover-modal {
    position: absolute;
    width: 280px;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    pointer-events: auto;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease;
    transform: translateY(10px);
}

.map-hover-modal.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.modal-carousel-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.modal-content {
    padding: 16px;
}

.modal-title {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modal-price {
    font-weight: 800;
    font-size: 16px;
    margin-bottom: 8px;
}

.modal-price span {
    font-weight: 400;
    font-size: 13px;
    color: #717171;
}

.modal-contact {
    display: block;
    width: 100%;
    background: #222222;
    color: white;
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    margin-top: 12px;
}

/* Sticky Map Fix (Left Side Mirror) */
#map-sidebar {
    height: calc(100vh - 80px) !important;
    position: sticky !important;
    top: 80px !important;
    left: 0;
    z-index: 40;
}

/* Skeleton Loading Effect */
.skeleton {
    background: #f0f0f0;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Modal Animations */
#filter-modal:not(.hidden) {
    animation: fadeIn 0.2s ease-out;
}

#filter-modal:not(.hidden)>div {
    animation: slideUp 0.3s cubic-bezier(0, 0, 0.2, 1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

/* Radio Button Styling (Visual fallback if peer-checked fails) */
input[type="radio"].hidden+span {
    user-select: none;
    cursor: pointer;
}

/* Pagination Styling */
.theme-pagination ul {
    display: flex;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
    justify-content: center;
}

.theme-pagination li {
    display: inline-block;
}

.theme-pagination a, .theme-pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.searchPaginationSelected {
    background: #222222;
    color: #ffffff !important;
}

.searchPaginationNonSelected, .searchPaginationNext, .searchPaginationPrev {
    background: #ffffff;
    color: #222222;
    border: 1px solid #e5e7eb;
}

.searchPaginationNonSelected:hover, .searchPaginationNext:hover, .searchPaginationPrev:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    transform: scale(1.05);
}