/* ==========================================================================
   Wtyczka: System Nieruchomości - Główne Style
   ========================================================================== */

/* Slider na stronę główną */
.hero-slider-container {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    height: 60vh;
    min-height: 400px;
    overflow: hidden;
    margin-bottom: 40px;
    margin-top: -30px;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    background-size: cover;
    background-position: center;
}

.hero-slide.active {
    opacity: 1;
}

/* Ukrywamy domyślny tytuł tylko na stronie głównej */
.home .entry-header,
.home .wp-block-post-title,
.home h1.entry-title {
    display: none !important;
}

.home .site-main {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* ==========================================================================
   FORMULARZ: Chcę sprzedać
   ========================================================================== */
.sn-sell-form {
    max-width: 500px;
    margin: 0 auto;
}

.sn-form-group {
    margin-bottom: 24px;
}

.sn-form-label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 12px;
    color: #1a1a1a;
}

.sn-property-types {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.sn-type-option {
    cursor: pointer;
}

.sn-type-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.sn-type-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    border: 2px solid #e5e5e5;
    border-radius: 8px;
    background: #fff;
    transition: all 0.3s ease;
    text-align: center;
}

.sn-type-box:hover {
    border-color: #E07650;
}

.sn-type-option input[type="radio"]:checked+.sn-type-box,
.sn-type-box.selected {
    border-color: #E07650;
    background: rgba(224, 118, 80, 0.05);
}

.sn-type-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.sn-type-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1a1a1a;
}

.sn-form-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e5e5e5;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #fff;
}

.sn-form-input:focus {
    outline: none;
    border-color: #E07650;
    box-shadow: 0 0 0 3px rgba(224, 118, 80, 0.1);
}

.sn-form-checks {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.sn-check-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 0.8rem;
    line-height: 1.4;
    color: #666;
}

.sn-check-option input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    accent-color: #E07650;
}

.sn-submit-btn {
    width: 100%;
    padding: 16px;
    background: #E07650;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sn-submit-btn:hover {
    background: #C95F3B;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(224, 118, 80, 0.3);
}

.sn-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.sn-form-message {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 8px;
    font-size: 0.95rem;
    text-align: center;
}

.sn-form-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.sn-form-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

@media (max-width: 480px) {
    .sn-property-types {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   FILTRY ARCHIWUM OFERT
   ========================================================================== */
.sn-filters {
    background: #f5f5f5;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
}

.sn-filters-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    align-items: end;
}

.sn-filter-group {
    display: flex;
    flex-direction: column;
}

.sn-filter-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sn-filter-input {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.sn-filter-input:focus {
    outline: none;
    border-color: #E07650;
    box-shadow: 0 0 0 3px rgba(224, 118, 80, 0.1);
}

.sn-filter-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sn-filter-submit {
    padding: 10px 24px;
    background: #E07650;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.sn-filter-submit:hover {
    background: #C95F3B;
}

.sn-filter-reset {
    color: #d63638;
    font-size: 0.85rem;
    text-decoration: none;
    white-space: nowrap;
}

.sn-filter-reset:hover {
    text-decoration: underline;
}

.sn-results-count {
    margin-bottom: 24px;
    color: #666;
    font-size: 0.95rem;
}

.sn-no-results {
    text-align: center;
    padding: 64px 20px;
    background: #f9f9f9;
    border-radius: 12px;
    color: #666;
}

.sn-no-results a {
    color: #E07650;
    font-weight: 600;
}

.sn-pagination {
    margin-top: 48px;
    text-align: center;
}

.sn-pagination .page-numbers {
    display: inline-block;
    padding: 8px 14px;
    margin: 0 4px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    color: #1a1a1a;
    text-decoration: none;
    transition: all 0.2s ease;
}

.sn-pagination .page-numbers:hover,
.sn-pagination .page-numbers.current {
    background: #E07650;
    color: white;
    border-color: #E07650;
}

/* ==========================================================================
   HERO SEARCH WIDGET
   ========================================================================== */
.sn-hero-search {
    max-width: 800px;
    margin: 32px auto 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.sn-hero-search-form {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 12px;
    align-items: stretch;
}

.sn-hero-search input,
.sn-hero-search select {
    padding: 12px 14px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    font-size: 0.95rem;
    background: #fff;
    color: #1a1a1a;
}

.sn-hero-search input:focus,
.sn-hero-search select:focus {
    outline: none;
    border-color: #E07650;
}

.sn-hero-search button {
    padding: 12px 28px;
    background: #E07650;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.sn-hero-search button:hover {
    background: #C95F3B;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(224, 118, 80, 0.3);
}

@media (max-width: 768px) {
    .sn-hero-search-form {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   GALERIA AIRBNB-STYLE (1 duże + 4 miniatury 2x2)
   ========================================================================== */
.sn-gallery-wrap {
    margin: 0 0 48px;
}

.sn-gallery-airbnb {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 8px;
    height: 480px;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
}

.sn-gallery-link {
    position: relative;
    display: block;
    overflow: hidden;
    background: #EFEAE0;
    cursor: pointer;
}

.sn-gallery-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.sn-gallery-link:hover img {
    transform: scale(1.05);
}

.sn-gallery-link::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(15, 20, 25, 0);
    transition: background 0.3s ease;
    pointer-events: none;
}

.sn-gallery-link:hover::after {
    background: rgba(15, 20, 25, 0.08);
}

/* Główne zdjęcie zajmuje 2 rzędy */
.sn-gallery-main {
    grid-row: 1 / 3;
    grid-column: 1 / 2;
}

/* Ukryte zdjęcia (dostępne tylko w lightboxie) */
.sn-gallery-hidden {
    display: none;
}

/* Przycisk "Pokaż wszystkie zdjęcia" */
.sn-gallery-show-all {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: #FFFFFF;
    color: #0F1419;
    border: 1px solid #0F1419;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 5;
    font-family: inherit;
}

.sn-gallery-show-all:hover {
    background: #0F1419;
    color: #FFFFFF;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Layout dla różnej liczby zdjęć */
.sn-gallery-count-1 {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
}

.sn-gallery-count-1 .sn-gallery-main {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
}

.sn-gallery-count-2 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr;
}

.sn-gallery-count-2 .sn-gallery-main {
    grid-row: 1 / 2;
}

.sn-gallery-count-3 {
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.sn-gallery-count-3 .sn-gallery-main {
    grid-row: 1 / 3;
}

.sn-gallery-count-4 {
    grid-template-columns: 2fr 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.sn-gallery-count-4 .sn-gallery-main {
    grid-row: 1 / 3;
    grid-column: 1 / 2;
}

.sn-gallery-count-4 .sn-gallery-link:nth-child(4) {
    grid-column: 2 / 4;
}

/* Responsywność galerii */
@media (max-width: 768px) {
    .sn-gallery-airbnb {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr;
        height: 280px;
    }

    .sn-gallery-airbnb .sn-gallery-link:not(.sn-gallery-main) {
        display: none;
    }

    .sn-gallery-main {
        grid-row: 1 / 2 !important;
        grid-column: 1 / 2 !important;
    }

    .sn-gallery-show-all {
        bottom: 14px;
        right: 14px;
        font-size: 0.8rem;
        padding: 8px 14px;
    }
}

/* Badge z liczbą zdjęć w karcie oferty */
.offer-card-photo-count {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(15, 20, 25, 0.75);
    color: #fff;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    z-index: 2;
    backdrop-filter: blur(4px);
}

.offer-card-photo-count svg {
    width: 12px;
    height: 12px;
}
/* ==========================================================================
   GALERIA – Overlay (pełnoekranowa lista zdjęć w stylu Airbnb)
   ========================================================================== */
.sn-gallery-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: #fff;
    overflow-y: auto;
    overscroll-behavior: contain;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}
.sn-gallery-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.sn-gallery-overlay-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 16px 32px;
    background: rgba(255,255,255,0.96);
    backdrop-filter: saturate(180%) blur(8px);
    -webkit-backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid #eee;
}

.sn-gallery-overlay-close {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    color: #0F1419;
    padding: 10px 14px;
    border-radius: 999px;
    cursor: pointer;
    font: 500 0.95rem/1 'Inter', sans-serif;
    transition: background 0.2s;
}
.sn-gallery-overlay-close:hover {
    background: #f5f5f0;
}
.sn-gallery-overlay-close svg {
    width: 18px;
    height: 18px;
}

.sn-gallery-overlay-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.1rem;
    color: #0F1419;
    font-weight: 500;
}
.sn-gallery-overlay-count {
    display: inline-block;
    margin-left: 12px;
    color: #8B8680;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
}

.sn-gallery-overlay-grid {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 32px 64px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.sn-gallery-overlay-item {
    display: block;
    overflow: hidden;
    border-radius: 12px;
    background: #f5f5f0;
    aspect-ratio: 4 / 3;
    cursor: zoom-in;
    transition: opacity 0.2s;
}
.sn-gallery-overlay-item.is-wide {
    grid-column: 1 / -1;
    aspect-ratio: 16 / 9;
}
.sn-gallery-overlay-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}
.sn-gallery-overlay-item:hover img {
    transform: scale(1.02);
}
.sn-gallery-overlay-item:hover {
    opacity: 0.95;
}

@media (max-width: 768px) {
    .sn-gallery-overlay-header { padding: 12px 16px; gap: 12px; }
    .sn-gallery-overlay-title  { font-size: 0.95rem; }
    .sn-gallery-overlay-count  { display: block; margin-left: 0; font-size: 0.8rem; }
    .sn-gallery-overlay-grid   { grid-template-columns: 1fr; padding: 16px 16px 48px; gap: 8px; }
    .sn-gallery-overlay-item,
    .sn-gallery-overlay-item.is-wide { aspect-ratio: 4 / 3; grid-column: auto; }
}

/* PhotoSwipe – upewnijmy się, że overlay nie blokuje lightboxa */
.pswp { z-index: 10000; }
