/* Listings specific styles */
.listings-section {
    padding: var(--space-12) 0 var(--space-20) 0;
    background-color: var(--color-black);
    width: 100vw;
    max-width: 100vw;
    margin: 0;
    overflow-x: hidden;
}

/* Enhanced custom cursor styles */
#cursor {
    position: fixed;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.5);
    mix-blend-mode: difference;
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 9999;
    transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1), 
                height 0.3s cubic-bezier(0.16, 1, 0.3, 1), 
                background-color 0.3s cubic-bezier(0.16, 1, 0.3, 1), 
                border 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0; /* Start invisible and fade in */
    will-change: transform, width, height;
}

#cursor::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.2s ease, height 0.2s ease, opacity 0.2s ease;
}

#cursor.cursor-hover {
    width: 50px;
    height: 50px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    mix-blend-mode: difference;
}

#cursor.cursor-hover::after {
    width: 8px;
    height: 8px;
    background-color: rgba(255, 255, 255, 1);
}

#cursor.cursor-image {
    width: 80px;
    height: 80px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    mix-blend-mode: difference;
}

#cursor.cursor-image::after {
    width: 6px;
    height: 6px;
    background-color: rgba(255, 255, 255, 0.9);
}

.cursor-trail {
    position: fixed;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    mix-blend-mode: difference;
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 9998;
    transition: width 0.2s ease, height 0.2s ease;
    will-change: transform, opacity;
}

body {
    cursor: none;
}

/* Ensure all interactive elements show the right cursor state */
a, button, .listing-banner, .listing-image, .popup-gallery-image, .popup-spec {
    cursor: none;
}

@media (max-width: 768px) {
    #cursor, .cursor-trail {
        display: none;
    }
    body, a, button, .listing-banner, .listing-image, * {
        cursor: auto !important;
    }
    
    /* Add padding-top to the listings section for mobile */
    .listings-section {
        padding-top: 100px !important;
    }
    
    /* Add margin-top to the section title for mobile */
    .section-title {
        margin-top: 30px !important;
    }
    
    /* Reorder elements in the listing info for mobile */
    .listing-info {
        display: flex;
        flex-direction: column;
    }
    
    .listing-title {
        order: 1;
        margin-bottom: 5px !important;
    }
    
    .listing-price {
        order: 2;
        margin-top: 0 !important;
        margin-bottom: 15px;
        font-size: var(--font-size-2xl) !important;
        font-weight: 700;
        color: inherit !important;
    }
    
    .listing-quick-specs {
        order: 3;
    }
    
    .listing-description {
        order: 4;
    }
    
    .banner-clone {
        width: 95%;
        max-height: 80vh;
        padding-bottom: 10px;
    }
    
    .popup-content {
        padding: 16px;
        gap: 16px;
    }
    
    /* Mobile carousel for popup gallery */
    .popup-gallery {
        display: flex;
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }
    
    /* Main image container */
    .popup-gallery-main {
        width: 100%;
        height: 220px;
        position: relative;
        overflow: hidden;
        border-radius: 8px;
        margin-bottom: 5px;
    }
    
    .popup-gallery-main img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
    }
    
    /* Thumbnails row */
    .popup-gallery-thumbs {
        display: flex;
        overflow-x: auto;
        gap: 5px;
        padding: 5px 0;
        scrollbar-width: thin;
        -webkit-overflow-scrolling: touch;
    }
    
    .popup-gallery-thumbs::-webkit-scrollbar {
        height: 4px;
    }
    
    .popup-gallery-thumbs::-webkit-scrollbar-track {
        background: transparent;
    }
    
    .popup-gallery-thumbs::-webkit-scrollbar-thumb {
        background-color: rgba(255, 255, 255, 0.3);
        border-radius: 2px;
    }
    
    /* Thumbnail styling */
    .popup-gallery-thumb {
        flex: 0 0 60px;
        height: 60px;
        border-radius: 4px;
        overflow: hidden;
        opacity: 0.7;
        transition: all 0.2s ease;
        border: 2px solid transparent;
    }
    
    .popup-gallery-thumb.active {
        opacity: 1;
        border-color: #ffffff;
    }
    
    .popup-gallery-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    /* Navigation arrows */
    .popup-gallery-nav {
        position: absolute;
        top: 50%;
        left: 0;
        right: 0;
        display: flex;
        justify-content: space-between;
        padding: 0 10px;
        transform: translateY(-50%);
        z-index: 5;
        pointer-events: none;
    }
    
    .popup-gallery-arrow {
        width: 36px;
        height: 36px;
        background-color: rgba(0, 0, 0, 0.6);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-size: 1.2rem;
        cursor: pointer;
        pointer-events: auto;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Hide individual gallery images */
    .popup-gallery-image {
        display: none;
    }
    
    .popup-gallery-image.active {
        display: block;
    }
    
    .popup-specs {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .popup-contact {
        padding: 16px;
        min-height: 150px;
    }
    
    .popup-contact-overlay h3 {
        font-size: 16px;
        margin-bottom: 6px;
    }
    
    .popup-contact-overlay p {
        font-size: 12px;
        margin-bottom: 8px;
    }
    
    .popup-btn {
        padding: 6px 12px;
        font-size: 12px;
        min-width: 80px;
    }
    
    /* Reduce font sizes */
    .popup-title {
        font-size: 20px;
    }
    
    .popup-price {
        font-size: 18px;
    }
    
    .popup-spec-label {
        font-size: 10px;
    }
    
    .popup-spec-value {
        font-size: 14px;
    }
    
    /* Adjust close button position for mobile */
    .popup-close {
        position: fixed;
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
        background-color: rgba(0, 0, 0, 0.85);
        border: 2px solid rgba(255, 255, 255, 0.5);
        border-radius: 50%;
        z-index: 1002; /* Higher than the popup */
        transform: none !important;
        opacity: 0; /* Start invisible */
        transition: all 0.3s ease;
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.6);
        display: flex;
        align-items: center;
        justify-content: center;
        -webkit-tap-highlight-color: transparent;
        animation: fadeInButton 0.5s forwards 0.3s; /* Animation with delay */
    }
    
    /* Add pulse animation after the button appears */
    .banner-clone.active ~ .popup-close {
        animation: pulseBorder 2s infinite 1s;
    }
    
    /* Subtle pulse animation for the border */
    @keyframes pulseBorder {
        0% {
            border-color: rgba(255, 255, 255, 0.5);
            box-shadow: 0 3px 10px rgba(0, 0, 0, 0.6);
        }
        50% {
            border-color: rgba(255, 255, 255, 0.9);
            box-shadow: 0 3px 15px rgba(255, 255, 255, 0.3);
        }
        100% {
            border-color: rgba(255, 255, 255, 0.5);
            box-shadow: 0 3px 10px rgba(0, 0, 0, 0.6);
        }
    }
    
    /* Style for the X using spans instead of pseudo-elements */
    .popup-close .close-line {
        position: absolute;
        width: 22px;
        height: 3px;
        background-color: #ffffff;
        border-radius: 1px;
    }
    
    .popup-close .close-line:first-child {
        transform: rotate(45deg);
    }
    
    .popup-close .close-line:last-child {
        transform: rotate(-45deg);
    }
    
    /* Hide the pseudo-element X since we're using spans */
    .popup-close::before,
    .popup-close::after {
        display: none;
    }
    
    .popup-close:hover,
    .popup-close:active {
        background-color: rgba(255, 255, 255, 0.25);
        transform: scale(1.1) !important;
    }
    
    .popup-close:hover .close-line,
    .popup-close:active .close-line {
        background-color: #fff;
    }
    
    /* Adjust header to not have the close button overlap */
    .popup-header {
        padding: 16px;
        justify-content: center;
        text-align: center;
    }
    
    .popup-title {
        font-size: 20px;
        width: 100%;
        text-align: center;
    }
    
    /* Animation for the close button */
    @keyframes fadeInButton {
        0% {
            opacity: 0;
            transform: scale(0.8) !important;
        }
        70% {
            opacity: 1;
            transform: scale(1.1) !important;
        }
        100% {
            opacity: 1;
            transform: scale(1) !important;
        }
    }
    
    /* Specific styles for the mobile close button */
    .mobile-close-btn {
        background-color: #000000 !important;
        border: 2px solid #ffffff !important;
        width: 44px !important;
        height: 44px !important;
        top: 10px !important;
        right: 10px !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7) !important;
    }
    
    .mobile-close-btn .close-line {
        width: 24px !important;
        height: 3px !important;
        background-color: #ffffff !important;
    }
    
    /* Override any animations to ensure visibility */
    .mobile-close-btn {
        opacity: 1 !important;
        transform: scale(1) !important;
        animation: none !important;
    }
    
    .banner-clone.active .popup-title {
        font-size: 16px !important;
        padding: 0 4px;
    }
    .banner-clone.active .popup-price {
        font-size: 15px !important;
        margin: 6px 0 8px 0 !important;
        padding: 0 4px;
    }
    .banner-clone.active .popup-specs {
        gap: 8px !important;
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
    }
    .banner-clone.active .popup-spec {
        padding: 8px 6px !important;
        font-size: 11px !important;
        gap: 2px !important;
    }
    .banner-clone.active .popup-spec-label {
        font-size: 9px !important;
    }
    .banner-clone.active .popup-spec-value {
        font-size: 12px !important;
    }
    .banner-clone.active .popup-description {
        font-size: 10px !important;
        line-height: 1.25 !important;
        padding: 0 2px;
    }
    .banner-clone.active .popup-description p,
    .banner-clone.active .popup-description ul {
        font-size: 10px !important;
        line-height: 1.25 !important;
    }
    .banner-clone.active .popup-contact {
        padding: 10px 6px !important;
        font-size: 12px !important;
        min-height: 100px !important;
    }
    .banner-clone.active .popup-contact-overlay h3 {
        font-size: 13px !important;
    }
    .banner-clone.active .popup-contact-overlay p {
        font-size: 11px !important;
    }
    .banner-clone.active .popup-btn {
        font-size: 11px !important;
        padding: 4px 10px !important;
        min-width: 60px !important;
    }
    .banner-clone.active .popup-gallery-main {
        height: 160px !important;
    }
    .banner-clone.active .popup-gallery-thumb {
        flex: 0 0 40px !important;
        height: 40px !important;
    }
    .banner-clone.active .popup-gallery-thumbs {
        gap: 3px !important;
        padding: 2px 0 !important;
    }
    .banner-clone.active .popup-content {
        gap: 10px !important;
        padding: 10px 0 10px 0 !important;
    }
}

.listings-container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0 var(--space-2);
}

.listings-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-10);
    margin-top: var(--space-12);
}

.listing-banner {
    background: rgba(25, 25, 25, 0.6);
    border-radius: 12px;
    overflow: visible;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    position: relative;
    padding: var(--space-4);
    height: 100%;
    width: 100%;
    margin: 0;
    box-sizing: border-box;
}

.listing-banner:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.listing-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

/* Enhanced image hover effects with blur */
.listing-images {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-3);
    margin-bottom: var(--space-4);
    width: 100%;
    align-items: center;
    position: relative;
}

.listing-image {
    height: 180px;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: zoom-in;
    filter: blur(0) brightness(1);
    z-index: 1;
}

.listing-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    vertical-align: middle;
}

/* Create the blur effect on siblings when one image is hovered */
.listing-images:hover .listing-image:not(:hover) {
    filter: blur(4px) brightness(0.7);
    transform: scale(0.95);
}

.listing-image:hover {
    z-index: 10;
    transform: scale(1.15);
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.7);
    filter: blur(0) brightness(1.1);
}

.listing-image:hover img {
    transform: scale(1.2);
}

.listing-info {
    padding: var(--space-4);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.listing-title {
    font-size: var(--font-size-2xl);
    margin-bottom: var(--space-4);
    font-weight: 700;
}

.listing-quick-specs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

.quick-spec {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.quick-spec-label {
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    opacity: 0.7;
}

.quick-spec-value {
    font-size: var(--font-size-md);
    font-weight: 500;
}

.listing-description {
    margin: var(--space-4) 0;
    font-size: var(--font-size-md);
    line-height: 1.5;
    opacity: 0.8;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.listing-price {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    margin-top: auto;
}

/* Modal styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 1900;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
    display: block;
    pointer-events: auto;
}

/* Dynamic overlay for popup */
.dynamic-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
}

.dynamic-overlay.active {
    opacity: 1;
    visibility: visible;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.banner-clone {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 90%;
    max-width: 1000px;
    max-height: 85vh;
    background: rgba(20, 20, 20, 0.95);
    border-radius: 20px;
    z-index: 1001;
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.banner-clone.active {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

/* Apple-style popup header */
.popup-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    background-color: rgba(25, 25, 25, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 5;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.popup-title {
    font-size: 28px;
    font-weight: 600;
    margin: 0;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: 0.1s;
}

.banner-clone.active .popup-title {
    opacity: 1;
    transform: translateY(0);
}

.popup-price {
    font-size: 26px;
    font-weight: 700;
    color: var(--color-accent);
    margin: 10px 0;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: 0.2s;
    text-align: center;
    padding: 0 10px;
    width: 100%;
    box-sizing: border-box;
}

.banner-clone.active .popup-price {
    opacity: 1;
    transform: translateY(0);
}

/* Apple-style popup content */
.popup-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    width: 100%;
    box-sizing: border-box;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Image gallery with Apple-style animations */
.popup-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: 0.3s;
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

.banner-clone.active .popup-gallery {
    opacity: 1;
    transform: translateY(0);
}

.popup-gallery-image {
    height: 180px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    filter: blur(0) brightness(1);
    z-index: 1;
    width: 100%;
}

/* Create the blur effect on siblings when one image is hovered */
.popup-gallery:hover .popup-gallery-image:not(:hover) {
    filter: blur(4px) brightness(0.7);
    transform: scale(0.95);
}

.popup-gallery-image:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
    z-index: 10;
    filter: blur(0) brightness(1.1);
}

.popup-gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.popup-gallery-image:hover img {
    transform: scale(1.05);
}

/* Specs section with Apple-style animations */
.popup-specs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: 0.4s;
}

.banner-clone.active .popup-specs {
    opacity: 1;
    transform: translateY(0);
}

.popup-spec {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.popup-spec:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-5px);
}

.popup-spec-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.6;
}

.popup-spec-value {
    font-size: 18px;
    font-weight: 500;
}

/* Description section with Apple-style animations */
.popup-description {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: 0.5s;
    line-height: 1.6;
}

.banner-clone.active .popup-description {
    opacity: 1;
    transform: translateY(0);
}

.popup-description p {
    margin-bottom: 16px;
    font-size: 16px;
    line-height: 1.6;
}

.popup-description ul {
    margin-left: 20px;
    margin-bottom: 16px;
}

.popup-description li {
    margin-bottom: 8px;
}

/* Contact section with Apple-style animations and blur effect */
.popup-contact {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 24px;
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: 0.6s;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
    width: 100%;
    box-sizing: border-box;
    min-height: 180px; /* Ensure minimum height */
}

.banner-clone.active .popup-contact {
    opacity: 1;
    transform: translateY(0);
}

.popup-contact-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    filter: blur(8px);
    opacity: 0.7;
    user-select: none;
    pointer-events: none;
    transition: all 0.3s ease;
}

.popup-contact-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.popup-contact-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.6;
}

.popup-contact-value {
    font-size: 14px;
    font-weight: 500;
}

.popup-contact-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 16px;
    text-align: center;
    border-radius: 16px;
    z-index: 10;
    box-sizing: border-box;
}

.popup-contact-overlay h3 {
    font-size: 18px;
    margin-bottom: 8px;
    font-weight: 600;
}

.popup-contact-overlay p {
    margin-bottom: 12px;
    opacity: 0.8;
    font-size: 14px;
    max-width: 90%;
    line-height: 1.4;
}

.popup-contact-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 5px;
}

.popup-btn {
    padding: 8px 16px;
    border-radius: 24px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    outline: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 90px;
    white-space: nowrap;
}

.popup-btn-primary {
    background: var(--color-accent);
    color: var(--color-black);
}

.popup-btn-primary:hover {
    background: var(--color-accent-hover);
    transform: translateY(-2px);
}

.popup-btn-outline {
    background: transparent;
    color: var(--color-white);
    border: 1px solid var(--color-white);
}

.popup-btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* Close button with Apple-style design */
.popup-close {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: 0.7s;
}

.banner-clone.active .popup-close {
    opacity: 1;
    transform: scale(1);
}

.popup-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.popup-close::before,
.popup-close::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 2px;
    background-color: var(--color-white);
    transition: all 0.3s ease;
}

.popup-close::before {
    transform: rotate(45deg);
}

.popup-close::after {
    transform: rotate(-45deg);
}

.popup-close:hover::before,
.popup-close:hover::after {
    background-color: var(--color-accent);
}

/* Make sure cursor is invisible on ALL elements */
body, 
a, 
button, 
.listing-banner, 
.listing-image, 
.popup-gallery-image, 
.popup-spec,
.popup-close,
.modal-close,
.popup-btn,
.btn,
.listing-modal-close,
.nav-link,
.footer-nav a,
.mobile-menu-link,
input,
textarea,
select,
.modal-overlay,
.dynamic-overlay,
.banner-clone,
.popup-contact-buttons a,
* {
    cursor: none !important;
}

@media (min-width: 768px) {
    .listing-content {
        flex-direction: row;
        width: 100%;
        align-items: center;
    }

    .listing-image {
        width: 280px;
        height: 160px;
        flex-shrink: 0;
        display: flex;
        align-items: center;
    }

    .listing-info {
        flex-grow: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding-left: var(--space-4);
        width: calc(100% - 280px);
    }

    .modal-specs {
        grid-template-columns: repeat(4, 1fr);
    }

    .modal-images {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .modal-images {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .listings-container {
        width: 100%;
        padding: 0 var(--space-2);
        max-width: 100%;
    }
}

/* Enhanced Modal Styling to match the images */
.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 90%;
    max-width: 450px;
    background-color: #121212;
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.modal-content {
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
    padding: 0;
    margin: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #ffffff;
}

.modal-body {
    padding: 24px;
}

/* Auth Form Styling */
.auth-form {
    margin-bottom: 20px;
}

.auth-form .form-group {
    margin-bottom: 24px;
    position: relative;
}

.auth-form .form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.auth-form .form-input {
    width: 100%;
    background-color: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    font-size: 16px;
    padding: 8px 0;
    transition: border-color 0.3s ease;
}

.auth-form .form-input:focus {
    outline: none;
    border-color: var(--color-accent);
}

.auth-form .form-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.password-input-wrapper {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-password:hover {
    color: #ffffff;
}

.remember-forgot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: -8px;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
}

.checkbox-wrapper input[type="checkbox"] {
    margin-right: 8px;
    accent-color: var(--color-accent);
}

.checkbox-wrapper label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.forgot-password {
    font-size: 14px;
    color: var(--color-accent);
    text-decoration: none;
}

.forgot-password:hover {
    text-decoration: underline;
}

.btn-primary {
    display: block;
    width: 100%;
    background-color: #ffffff;
    color: #000000;
    border: none;
    border-radius: 30px;
    padding: 14px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 24px;
}

.btn-primary:hover {
    background-color: var(--color-accent);
    transform: translateY(-2px);
}

.btn-secondary {
    display: block;
    width: 100%;
    background-color: transparent;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 30px;
    padding: 14px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.auth-separator {
    position: relative;
    text-align: center;
    margin: 24px 0;
}

.auth-separator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: rgba(255, 255, 255, 0.1);
}

.auth-separator span {
    position: relative;
    display: inline-block;
    padding: 0 16px;
    background-color: #121212;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
}

.social-auth {
    margin-bottom: 24px;
}

.social-auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background-color: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    padding: 12px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.social-auth-btn svg {
    margin-right: 12px;
    fill: #ffffff;
}

.social-auth-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.auth-switch {
    text-align: center;
    margin-top: 24px;
}

.auth-switch p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin: 0;
}

.auth-switch a {
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 500;
}

.auth-switch a:hover {
    text-decoration: underline;
}

.terms-checkbox {
    margin-top: 8px;
}

.terms-checkbox a {
    color: var(--color-accent);
    text-decoration: none;
}

.terms-checkbox a:hover {
    text-decoration: underline;
}

.success-message {
    text-align: center;
    color: var(--color-accent);
    font-size: 18px;
    font-weight: 500;
    padding: 40px 0;
}

/* Add no-scroll to body when modal is open */
body.no-scroll {
    overflow: hidden;
}

/* Style for textarea in seller form */
textarea.form-input {
    min-height: 100px;
    resize: vertical;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 12px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

/* Ensure authentication modals have higher z-index than listing modals */
#loginModal, #signupModal, #sellerModal {
    z-index: 1500;
}

.modal-overlay.active {
    z-index: 1400;
}

/* Listing modals */
[id^="modal-"] {
    z-index: 1200;
}

/* Custom scrollbar styling */
.banner-clone::-webkit-scrollbar {
    width: 6px;
    background-color: transparent;
}

.banner-clone::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    transition: background-color 0.3s ease;
}

.banner-clone::-webkit-scrollbar-thumb:hover {
    background-color: var(--color-accent);
}

.banner-clone::-webkit-scrollbar-track {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    margin: 10px 0;
}

.popup-content::-webkit-scrollbar {
    width: 4px;
    background-color: transparent;
}

.popup-content::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    transition: background-color 0.3s ease;
}

.popup-content::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.popup-content::-webkit-scrollbar-track {
    background-color: transparent;
    border-radius: 10px;
    margin: 5px 0;
}

/* Firefox scrollbar styling */
.banner-clone, .popup-content {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

/* Lightbox styles for enlarged image viewing */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    position: relative;
    width: 90%;
    height: 90%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.5s ease, transform 0.5s ease;
    touch-action: manipulation; /* Improve touch behavior */
}

.lightbox.active .lightbox-image {
    opacity: 1;
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2010;
    transition: all 0.3s ease;
}

.lightbox-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.lightbox-close::before,
.lightbox-close::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 2px;
    background-color: #ffffff;
    transition: background-color 0.3s ease;
}

.lightbox-close::before {
    transform: rotate(45deg);
}

.lightbox-close::after {
    transform: rotate(-45deg);
}

.lightbox-close:hover::before,
.lightbox-close:hover::after {
    background-color: var(--color-accent);
}

.lightbox-nav {
    position: absolute;
    top: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    box-sizing: border-box;
}

.lightbox-nav-button {
    width: 50px;
    height: 50px;
    background-color: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    z-index: 2010;
}

.lightbox-nav-button:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.lightbox-nav-button::before {
    content: '';
    display: block;
    width: 12px;
    height: 12px;
    border-top: 2px solid #ffffff;
    border-left: 2px solid #ffffff;
    transition: border-color 0.3s ease;
}

.lightbox-prev::before {
    transform: rotate(-45deg);
}

.lightbox-next::before {
    transform: rotate(135deg);
}

.lightbox-nav-button:hover::before {
    border-color: var(--color-accent);
}

.lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: #ffffff;
    font-size: 14px;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 5px 15px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

@media (max-width: 768px) {
    .lightbox-nav-button {
        width: 40px;
        height: 40px;
    }
    
    .lightbox-close {
        width: 44px;
        height: 44px;
        top: 15px;
        right: 15px;
        background-color: #000000;
        border: 2px solid #ffffff;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
    }
    
    .lightbox-close::before,
    .lightbox-close::after {
        width: 24px;
        height: 3px;
    }
    
    .lightbox-image {
        object-fit: contain;
        max-width: 100%;
        max-height: 100%;
        width: auto;
        height: auto;
    }
    
    .lightbox-content {
        width: 100%;
        height: 100%;
        padding: 0;
    }
    
    .lightbox-counter {
        font-size: 16px;
        padding: 8px 20px;
        bottom: 30px;
    }
    
    .lightbox.zoomed .lightbox-image {
        object-fit: contain;
        transform: scale(1.5);
    }
}
