/* ============================================================
   Property Hero Search Widget — v2.4
   Hover + focus-within + .is-open expand
   Drag & drop (JS switches to position:fixed)
   Bigger fonts, transparent + blur
   Aligned: right edge of 1300px container, top 200px
   ============================================================ */

/* ---------- Wrap ---------- */
.phs-wrap {
    position: relative;
    width: 360px;
    font-family: 'Rosario', sans-serif;
    font-size: 15px;
    color: #1a1a2e;
    z-index: 9999;
    overflow: visible;
}

/* ---------- Trigger bar (always visible) ---------- */
.phs-trigger {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    padding: 15px 22px;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1.5px solid rgba(255, 118, 118, 0.55);
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
    cursor: grab;
    color: #1a1a2e;
    font-family: 'Rosario', sans-serif;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    transition:
        background 0.3s ease,
        border-radius 0.3s ease,
        border-color 0.3s ease,
        box-shadow 0.3s ease;
    position: relative;
    z-index: 2;
    user-select: none;
}

.phs-trigger:active {
    cursor: grabbing;
}

/* Trigger icon */
.phs-trigger-icon {
    flex-shrink: 0;
    color: #FF7676;
    width: 22px;
    height: 22px;
}

/* Label */
.phs-trigger-label {
    flex: 1;
    text-align: left;
}

/* Chevron */
.phs-trigger-chevron {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: #FF7676;
    transition: transform 0.35s ease;
}

/* ---------- Panel ---------- */
.phs-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease,
                visibility 0.3s ease;
    opacity: 0;
    visibility: hidden;

    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1.5px solid rgba(255, 118, 118, 0.45);
    border-top: none;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.18);
    position: relative;
    z-index: 1;
    margin-top: -2px;
}

/* ---------- Expand: hover OR focus-within OR .is-open (JS) ---------- */
.phs-wrap:hover .phs-trigger,
.phs-wrap:focus-within .phs-trigger,
.phs-wrap.is-open .phs-trigger {
    background: rgba(255, 255, 255, 0.95);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom-color: rgba(255, 118, 118, 0.15);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.10);
}

.phs-wrap:hover .phs-trigger-chevron,
.phs-wrap:focus-within .phs-trigger-chevron,
.phs-wrap.is-open .phs-trigger-chevron {
    transform: rotate(180deg);
}

.phs-wrap:hover .phs-panel,
.phs-wrap:focus-within .phs-panel,
.phs-wrap.is-open .phs-panel {
    max-height: 720px;
    opacity: 1;
    visibility: visible;
}

/* ---------- Panel inner ---------- */
.phs-panel-inner {
    padding: 20px 22px 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ---------- Field ---------- */
.phs-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.phs-label {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: #999;
    margin: 0;
}

/* ---------- Select ---------- */
.phs-select {
    width: 100%;
    padding: 10px 34px 10px 12px;
    background:
        rgba(255, 255, 255, 0.72)
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23FF7676' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E")
        no-repeat right 12px center;
    border: 1.5px solid rgba(0, 0, 0, 0.12);
    border-radius: 7px;
    font-family: 'Rosario', sans-serif;
    font-size: 15px;
    color: #1a1a2e;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.phs-select:focus {
    outline: none;
    border-color: #FF7676;
    background-color: rgba(255, 255, 255, 0.92);
}

.phs-select:disabled {
    opacity: 0.38;
    cursor: not-allowed;
}

/* ---------- Checkbox grid ---------- */
.phs-checkbox-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 14px;
}

.phs-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    color: #1a1a2e;
    line-height: 1.3;
}

.phs-checkbox-label input[type="checkbox"] {
    accent-color: #FF7676;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    cursor: pointer;
}

/* ---------- Street field: hidden until city with streets is chosen ---------- */
.phs-field--street {
    display: none;
}
.phs-field--street.is-visible {
    display: flex;
}

/* ---------- Divider ---------- */
.phs-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.38);
    margin: 2px 0;
}

/* ---------- Submit button ---------- */
.phs-submit {
    width: 100%;
    padding: 14px;
    background: #FF7676;
    color: #fff;
    border: none;
    border-radius: 0;
    text-align: center;
    font-family: 'Rosario', sans-serif;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    margin-top: 4px;
    box-shadow: 0 4px 14px rgba(255, 118, 118, 0.35);
}

.phs-submit:hover {
    background: #ff5151;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(255, 118, 118, 0.45);
}

.phs-submit:active {
    transform: translateY(0);
}

/* ---- Pozycja: wyrównanie do prawego boku containera 1300px, 200px od góry ---- */
#brxe-phscon1 {
    z-index: 9999 !important;
    overflow: visible !important;
    top: 200px !important;
    right: calc((100% - 1300px) / 2) !important;
}

#brxe-phssc01 {
    overflow: visible !important;
}

#brxe-lgyvbj {
    overflow: visible !important;
}

/* ---------- Responsive ---------- */
@media (max-width: 1380px) {
    /* Na mniejszych ekranach 20px margines od krawędzi */
    #brxe-phscon1 {
        right: 20px !important;
    }
}

@media (max-width: 768px) {
    .phs-wrap {
        width: 310px;
    }
}

@media (max-width: 480px) {
    .phs-wrap {
        width: calc(100vw - 32px);
    }
}


/* ============================================================

/* ============================================================
   WIDGET CIEMNY — wspólny styl dla headera
   ============================================================ */
header .phs-wrap {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 6px;
    overflow: visible;
    width: fit-content;
    min-width: 0;
}

header .phs-trigger {
    background: rgba(0, 0, 0, 0.38);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1.5px solid rgba(255,255,255,0.6);
    border-radius: 6px;
    color: #fff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 10px;
    padding: 12px 18px;
    font-size: 13px;
    white-space: nowrap;
    box-shadow: none;
}

header .phs-trigger-icon { color: #FF7676; }
header .phs-trigger-chevron { color: #fff; }

header .phs-trigger-label {
    display: none; /* subtitle wystarczy w headerze */
}

header .phs-trigger-subtitle {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: none;
    color: #fff;
    line-height: 1;
    flex: 1;
}

header .phs-wrap:hover .phs-trigger,
header .phs-wrap:focus-within .phs-trigger,
header .phs-wrap.is-open .phs-trigger {
    background: rgba(255,255,255,0.08);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom-color: transparent;
}

header .phs-panel {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    left: auto;
    max-width: calc(100vw - 60px);
    width: 360px;
    z-index: 99999;
    background: rgba(12,12,12,0.92);
    border-color: rgba(255,255,255,0.12);
    color: #fff;
    overflow: visible;
}

header .phs-label {
    color: rgba(255,255,255,0.5);
    font-size: 13px;
    letter-spacing: 0.07em;
}
header .phs-select {
    background-color: rgba(255,255,255,0.07);
    border-color: rgba(255,255,255,0.18);
    color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23FF7676' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
}
header .phs-select option { color: #1a1a2e; background: #fff; }
header .phs-select:focus {
    color: #1a1a2e;
    background-color: rgba(255,255,255,0.95) !important;
}
header .phs-select:focus::placeholder { color: #555; }
header .phs-checkbox-label { color: rgba(255,255,255,0.9); }
header .phs-divider { background: rgba(255,255,255,0.1); }

/* ── Widget na prawo od Kontaktu — w normalnym flex flow ── */
#brxe-phssrch1,
#brxe-phssrch2 {
    position: absolute !important;
    top: 50% !important;
    right: 50px !important;
    left: auto !important;
    transform: translateY(-50%) !important;
    margin: 0 !important;
    z-index: 99999 !important;
    width: fit-content !important;
    flex-shrink: 0;
}

/* Tylko bezpośredni rodzic widgetu musi mieć overflow visible */
#brxe-sxfzda,
#brxe-jjvqvs {
    overflow: visible !important;
}

/* Zabezpieczenie: panel nie może powodować poziomego scrolla */
#brxe-phssrch1,
#brxe-phssrch2 {
    max-width: calc(100vw - 60px);
}

