/* ==========================================================================
   OLX Adverts – dopasowane do zestawylesne.pl
   Kolory, fonty i styl kart zgodne z motywem strony.
   ========================================================================== */

/* Wrapper – pełna szerokość strony + padding pod fixed menu */
.olx-wrapper {
    max-width: 1140px;
    margin: 0 auto;
    padding: 80px 20px 40px;
}

/* Toolbar – search & price filter */
.olx-toolbar {
    margin-bottom: 20px;
}

.olx-toolbar-row {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.olx-search-box {
    flex: 1;
    min-width: 200px;
}

.olx-search-input {
    width: 100%;
    padding: 12px 18px;
    font-family: 'Source Sans 3', 'Segoe UI', sans-serif;
    font-size: 15px;
    border: 1.5px solid #e2ddd4;
    border-radius: 10px;
    background: #fff;
    color: #1a1a18;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.olx-search-input:focus {
    border-color: #1e4d2b;
    box-shadow: 0 0 0 3px rgba(30, 77, 43, 0.08);
}

.olx-search-input::placeholder {
    color: #a8a49a;
}

.olx-price-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.olx-price-input {
    width: 120px;
    padding: 12px 14px;
    font-family: 'Source Sans 3', 'Segoe UI', sans-serif;
    font-size: 15px;
    border: 1.5px solid #e2ddd4;
    border-radius: 10px;
    background: #fff;
    color: #1a1a18;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    -moz-appearance: textfield;
}

.olx-price-input::-webkit-outer-spin-button,
.olx-price-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.olx-price-input:focus {
    border-color: #1e4d2b;
    box-shadow: 0 0 0 3px rgba(30, 77, 43, 0.08);
}

.olx-price-input::placeholder {
    color: #a8a49a;
}

.olx-price-sep {
    color: #a8a49a;
    font-size: 14px;
}

/* Pagination */
.olx-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 32px;
    padding: 0;
    flex-wrap: wrap;
}

.olx-page-btn {
    font-family: 'Source Sans 3', 'Segoe UI', sans-serif;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 18px;
    border: 1.5px solid #e2ddd4;
    border-radius: 10px;
    background: #fff;
    color: #1a1a18;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.olx-page-btn:hover {
    border-color: #1e4d2b;
    color: #1e4d2b;
    background: #f2f7f3;
}

.olx-page-btn.olx-page-active {
    background: #1e4d2b;
    color: #fff;
    border-color: #1e4d2b;
}

.olx-page-num {
    min-width: 42px;
    text-align: center;
    padding: 10px 12px;
}

.olx-page-dots {
    font-size: 14px;
    color: #a8a49a;
    padding: 0 4px;
}

/* Category Filters */
.olx-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 28px;
    padding: 0;
}

.olx-filter-btn {
    display: inline-block;
    padding: 10px 20px;
    font-family: 'Source Sans 3', 'Segoe UI', sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    color: #1a1a18;
    background: #ffffff;
    border: 1.5px solid #e2ddd4;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.olx-filter-btn:hover {
    border-color: #1e4d2b;
    color: #1e4d2b;
    background: #f2f7f3;
}

.olx-filter-btn.olx-filter-active {
    background: #1e4d2b;
    color: #fff;
    border-color: #1e4d2b;
    box-shadow: 0 2px 12px rgba(30, 77, 43, 0.15);
}

/* Loading state */
.olx-adverts-container {
    position: relative;
    transition: opacity 0.25s ease;
}

.olx-adverts-container.olx-loading {
    opacity: 0.35;
    pointer-events: none;
    min-height: 200px;
}

.olx-adverts-container.olx-loading::after {
    content: '';
    position: absolute;
    top: 80px;
    left: 50%;
    width: 36px;
    height: 36px;
    margin-left: -18px;
    border: 3px solid #e2ddd4;
    border-top-color: #1e4d2b;
    border-radius: 50%;
    animation: olx-spin 0.7s linear infinite;
}

@keyframes olx-spin {
    to { transform: rotate(360deg); }
}

/* Adverts Grid */
.olx-adverts {
    display: grid;
    gap: 20px;
    margin: 0;
}

.olx-columns-1 { grid-template-columns: 1fr; }
.olx-columns-2 { grid-template-columns: repeat(2, 1fr); }
.olx-columns-3 { grid-template-columns: repeat(3, 1fr); }
.olx-columns-4 { grid-template-columns: repeat(4, 1fr); }

/* Card */
.olx-advert-card {
    background: #ffffff;
    border: 1px solid #e2ddd4;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(30, 28, 20, 0.06);
    transition: box-shadow 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
}

.olx-advert-card:hover {
    box-shadow: 0 8px 32px rgba(30, 28, 20, 0.10);
    transform: translateY(-3px);
    border-color: #cfc8bb;
}

.olx-advert-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* Image */
.olx-advert-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #f3f0ea;
}

.olx-advert-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.olx-advert-card:hover .olx-advert-image img {
    transform: scale(1.04);
}

.olx-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a8a49a;
    font-family: 'Source Sans 3', 'Segoe UI', sans-serif;
    font-size: 14px;
}

/* Content */
.olx-advert-content {
    padding: 16px 20px 20px;
}

.olx-advert-title {
    font-family: 'Source Sans 3', 'Segoe UI', sans-serif;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 10px;
    color: #1a1a18;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.olx-advert-card:hover .olx-advert-title {
    color: #1e4d2b;
}

.olx-advert-price {
    font-family: 'Source Sans 3', 'Segoe UI', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #1e4d2b;
    margin-bottom: 6px;
}

.olx-negotiable {
    font-size: 12px;
    font-weight: 400;
    color: #7a776e;
}

.olx-advert-location {
    font-family: 'Source Sans 3', 'Segoe UI', sans-serif;
    font-size: 13px;
    color: #7a776e;
    margin-top: 6px;
}

/* Inactive advert */
.olx-advert-inactive {
    opacity: 0.55;
}

.olx-advert-inactive:hover {
    opacity: 0.8;
}

.olx-advert-status {
    display: inline-block;
    font-family: 'Source Sans 3', 'Segoe UI', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #b8872b;
    background: #f5edd9;
    padding: 3px 10px;
    border-radius: 6px;
    margin-bottom: 8px;
}

/* Notice */
.olx-notice {
    font-family: 'Source Sans 3', 'Segoe UI', sans-serif;
    padding: 16px 20px;
    background: #f5edd9;
    border: 1px solid #e2ddd4;
    border-radius: 10px;
    color: #4a4840;
    font-size: 15px;
}

/* ==========================================================================
   Single advert detail view
   ========================================================================== */

/* Back link */
.olx-back-link {
    display: inline-block;
    font-family: 'Source Sans 3', 'Segoe UI', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #1e4d2b;
    text-decoration: none;
    margin-bottom: 24px;
    transition: color 0.2s ease;
}

.olx-back-link:hover {
    color: #2a6b3c;
}

/* Two-column layout */
.olx-single-layout {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 40px;
    align-items: start;
}

/* Gallery */
.olx-single-gallery {
    position: sticky;
    top: 100px;
}

.olx-single-main-image {
    display: inline-block;
    border-radius: 12px;
    overflow: hidden;
    background: #f3f0ea;
    border: 1px solid #e2ddd4;
    line-height: 0;
}

.olx-single-main-image img {
    max-width: 100%;
    height: auto;
    display: block;
}

.olx-single-main-image.olx-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a8a49a;
    font-size: 16px;
}

/* Thumbs wrapper with optional slider */
.olx-single-thumbs-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    position: relative;
}

.olx-single-thumbs-track {
    overflow: hidden;
    /* exactly 4 thumbs: 4×80px + 3×10px gap */
    width: 350px;
    flex-shrink: 0;
}

.olx-single-thumbs-wrapper:not(.olx-has-slider) .olx-single-thumbs-track {
    width: auto;
    overflow: visible;
}

.olx-single-thumbs {
    display: flex;
    gap: 10px;
    transition: transform 0.3s ease;
    width: max-content;
}

.olx-thumb-arrow {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border: 1.5px solid #e2ddd4;
    border-radius: 50%;
    background: #fff;
    color: #1a1a18;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 2;
}

.olx-thumb-arrow:hover {
    border-color: #1e4d2b;
    color: #1e4d2b;
    background: #f2f7f3;
}

.olx-single-thumb {
    width: 80px;
    height: 60px;
    min-width: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #e2ddd4;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s ease, border-color 0.2s ease;
    flex-shrink: 0;
}

.olx-single-thumb:hover {
    opacity: 0.9;
    border-color: #cfc8bb;
}

.olx-single-thumb.olx-thumb-active {
    opacity: 1;
    border-color: #1e4d2b;
}

/* Details */
.olx-single-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(24px, 3vw, 32px);
    font-weight: 700;
    color: #1a1a18;
    line-height: 1.25;
    margin: 0 0 16px;
}

.olx-single-price {
    font-family: 'Source Sans 3', 'Segoe UI', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: #1e4d2b;
    margin-bottom: 12px;
}

.olx-single-price .olx-negotiable {
    font-size: 14px;
}

.olx-single-meta {
    font-family: 'Source Sans 3', 'Segoe UI', sans-serif;
    font-size: 14px;
    color: #7a776e;
    margin-bottom: 24px;
}

/* Buttons */
.olx-single-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.olx-btn {
    display: inline-block;
    font-family: 'Source Sans 3', 'Segoe UI', sans-serif;
    font-size: 15px;
    font-weight: 600;
    padding: 14px 26px;
    border-radius: 10px;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    line-height: 1.4;
}

.olx-btn-primary {
    background: #1e4d2b;
    color: #fff;
    border: 1.5px solid #1e4d2b;
    box-shadow: 0 2px 12px rgba(30, 77, 43, 0.15);
}

.olx-btn-primary:hover {
    background: #2a6b3c;
    border-color: #2a6b3c;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(30, 77, 43, 0.25);
    color: #fff;
}

.olx-btn-outline {
    background: transparent;
    color: #1a1a18;
    border: 1.5px solid #cfc8bb;
}

.olx-btn-outline:hover {
    border-color: #1e4d2b;
    color: #1e4d2b;
}

/* Sections */
.olx-single-section {
    margin-bottom: 28px;
    padding-top: 24px;
    border-top: 1px solid #e2ddd4;
}

.olx-single-section-title {
    font-family: 'Source Sans 3', 'Segoe UI', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #1a1a18;
    margin: 0 0 14px;
}

.olx-single-description {
    font-family: 'Source Sans 3', 'Segoe UI', sans-serif;
    font-size: 15px;
    line-height: 1.7;
    color: #4a4840;
}

/* Attributes */
.olx-single-attributes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.olx-single-attr {
    display: flex;
    justify-content: space-between;
    padding: 10px 14px;
    background: #f3f0ea;
    border-radius: 8px;
    font-family: 'Source Sans 3', 'Segoe UI', sans-serif;
    font-size: 14px;
}

.olx-attr-label {
    color: #7a776e;
    text-transform: capitalize;
}

.olx-attr-value {
    color: #1a1a18;
    font-weight: 600;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 900px) {
    .olx-columns-3,
    .olx-columns-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .olx-single-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .olx-single-gallery {
        position: static;
    }

    .olx-single-attributes {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .olx-columns-2,
    .olx-columns-3,
    .olx-columns-4 {
        grid-template-columns: 1fr;
    }

    .olx-advert-content {
        padding: 14px 16px 16px;
    }

    .olx-advert-price {
        font-size: 18px;
    }

    .olx-toolbar-row {
        flex-direction: column;
    }

    .olx-price-filter {
        width: 100%;
    }

    .olx-price-input {
        flex: 1;
        width: auto;
    }

    .olx-single-actions {
        flex-direction: column;
    }

    .olx-btn {
        width: 100%;
    }

    .olx-page-btn {
        padding: 8px 14px;
        font-size: 13px;
    }
}
