/**
 * LP Masonry Listings - Styles
 *
 * @package LP_Masonry_Listings
 */

/* CSS Variables for customization */
.lpml-container {
    --lpml-columns-desktop: 4;
    --lpml-columns-tablet: 2;
    --lpml-columns-mobile: 1;
    --lpml-gap: 20px;
    --lpml-primary-color: #2563eb;
    --lpml-primary-hover: #1d4ed8;
    --lpml-text-color: #1f2937;
    --lpml-text-muted: #6b7280;
    --lpml-bg-color: #f9fafb;
    --lpml-card-bg: #ffffff;
    --lpml-border-color: #e5e7eb;
    --lpml-border-radius: 12px;
    --lpml-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --lpml-shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --lpml-transition: all 0.3s ease;

    position: relative;
    width: 100%;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* ===== CATEGORY TABS ===== */
.lpml-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    padding: 5px;
    border-radius: var(--lpml-border-radius);
}

.lpml-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: var(--lpml-text-muted);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 25px;
    transition: var(--lpml-transition);
}

.lpml-tab:hover {
    background: var(--lpml-card-bg);
    color: var(--lpml-text-color);
}

.lpml-tab.active {
    background: #1a1a2e;
    color: #ffffff;
}

.lpml-tab-count {
    font-size: 13px;
    font-weight: 500;
    color: inherit;
}

.lpml-tab.active .lpml-tab-count {
    color: #ffffff;
}

/* Tab Icons */
.lpml-tab-icon {
    font-size: 16px;
    margin-right: 6px;
    opacity: 0.8;
}

.lpml-tab.active .lpml-tab-icon {
    opacity: 1;
}

.lpml-tab-icon-img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    margin-right: 6px;
    vertical-align: middle;
    opacity: 0.8;
}

.lpml-tab.active .lpml-tab-icon-img {
    opacity: 1;
}

/* ===== MASONRY GRID ===== */
.lpml-masonry-grid {
    column-count: var(--lpml-columns-desktop);
    column-gap: var(--lpml-gap);
    margin:0 10px;
}

/* ===== LISTING CARD ===== */
.lpml-card {
    break-inside: avoid;
    margin-bottom: var(--lpml-gap);
    background: var(--lpml-card-bg);
    border-radius: var(--lpml-border-radius);
    overflow: hidden;
    box-shadow: var(--lpml-shadow);
    transition: var(--lpml-transition);
}

.lpml-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--lpml-shadow-hover);
}

.lpml-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.lpml-card-image {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: var(--lpml-bg-color);
}

.lpml-card-image img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.lpml-card:hover .lpml-card-image img {
    transform: scale(1.05);
}

.lpml-card-content {
    padding: 16px;
}

.lpml-card-title {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--lpml-text-color);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.lpml-card-price {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--lpml-text-muted);
}

.lpml-price-label {
    font-weight: 500;
}

.lpml-price-value {
    color: var(--lpml-primary-color);
    font-weight: 600;
}

.lpml-price-na {
    color: var(--lpml-text-muted);
    font-style: italic;
    font-size: 13px;
}

/* ===== LOAD MORE BUTTON ===== */
.lpml-load-more-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.lpml-load-more {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    border: none;
    background: var(--lpml-primary-color);
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: var(--lpml-transition);
}

.lpml-load-more:hover {
    background: var(--lpml-primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--lpml-shadow);
}

.lpml-load-more:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.lpml-load-more.loading .lpml-spinner {
    display: block;
}

/* ===== SPINNERS ===== */
.lpml-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: lpml-spin 0.8s linear infinite;
}

.lpml-loading-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    z-index: 10;
    align-items: center;
    justify-content: center;
    border-radius: var(--lpml-border-radius);
}

.lpml-loading-overlay.active {
    display: flex;
}

.lpml-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--lpml-border-color);
    border-top-color: var(--lpml-primary-color);
    border-radius: 50%;
    animation: lpml-spin 0.8s linear infinite;
}

@keyframes lpml-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== NO LISTINGS MESSAGE ===== */
.lpml-no-listings {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--lpml-text-muted);
    font-size: 16px;
}

/* ===== FADE IN ANIMATION ===== */
.lpml-card {
    animation: lpml-fadeIn 0.4s ease forwards;
}

@keyframes lpml-fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== RESPONSIVE DESIGN ===== */

/* Tablet */
@media (max-width: 992px) {
    .lpml-masonry-grid {
        column-count: var(--lpml-columns-tablet);
    }

    .lpml-tabs {
        gap: 8px;
    }

    .lpml-tab {
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* Mobile */
@media (max-width: 576px) {
    .lpml-masonry-grid {
        column-count: var(--lpml-columns-mobile);
    }

    .lpml-tabs {
        gap: 6px;
        padding: 4px;
    }
 

    .lpml-card-title {
        font-size: 15px;
    }

    .lpml-card-content {
        padding: 12px;
    }

    .lpml-load-more {
        width: 100%;
        justify-content: center;
    }
}