/* =====================================================
   SGP PROPERTY PAGES — property-styles.css
   Place at: /wp-content/themes/my-theme-child/sgp/property-styles.css
   ===================================================== */


/* ════════════════════════════════
   SEARCH BAR
════════════════════════════════ */
.sgp-search-wrap {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.sgp-search-tabs {
    display: flex;
    background: #1f2937;
}

.sgp-tab {
    padding: 13px 28px;
    border: none;
    background: transparent;
    color: rgba(255,255,255,.5);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--sans);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all .2s;
    letter-spacing: .3px;
}

.sgp-tab.active,
.sgp-tab:hover {
    color: var(--white);
    border-bottom-color: var(--red);
}

/* ── SEARCH FIELDS: horizontal flex row ── */
.sgp-search-form { width: 100%; }

.sgp-search-fields {
    display: flex;
    align-items: flex-end;
    gap: 0;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    flex-wrap: nowrap;
    overflow-x: auto;
}

.sgp-field-group {
    flex: 1;
    min-width: 0;
    padding: 0 12px;
    border-right: 1px solid var(--border);
}

.sgp-field-group:first-child { padding-left: 4px; }
.sgp-field-group:last-child  { border-right: none; padding-right: 4px; }

.sgp-field-group label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: var(--grey);
    margin-bottom: 6px;
    white-space: nowrap;
}

.sgp-field-group select,
.sgp-field-group input[type="text"],
.sgp-field-group input[type="number"],
.sgp-field-group input[type="email"] {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 9px 10px;
    font-size: 13px;
    font-family: var(--sans);
    color: var(--dark);
    background: #fafafa;
    transition: all .2s;
    outline: none;
    min-width: 0;
}

.sgp-field-group select:focus,
.sgp-field-group input:focus {
    border-color: var(--red);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(192,57,43,.1);
}

/* Price group — two inputs side by side */
.sgp-price-group { flex: 1.2; }

.sgp-price-inputs {
    display: flex;
    align-items: center;
    gap: 4px;
}

.sgp-price-inputs span { color: var(--grey); font-size: 12px; flex-shrink: 0; }
.sgp-price-inputs input { flex: 1; min-width: 0; }

/* Submit group */
.sgp-submit-group {
    flex: 0 0 auto;
    border-right: none !important;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 110px;
}

.sgp-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--red);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 700;
    font-family: var(--sans);
    cursor: pointer;
    transition: background .2s;
    white-space: nowrap;
    width: 100%;
}

.sgp-search-btn:hover { background: var(--red-dark); }

.sgp-reset-btn {
    text-align: center;
    font-size: 12px;
    color: var(--grey);
    text-decoration: none;
    padding: 2px;
    display: block;
}

.sgp-reset-btn:hover { color: var(--red); }

.sgp-checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    cursor: pointer;
}

/* ════════════════════════════════
   ARCHIVE HERO
════════════════════════════════ */
.sgp-archive-hero {
    background: linear-gradient(135deg, var(--dark) 0%, #2c2c54 100%);
    padding: 48px 0 0;
    position: relative;
    overflow: hidden;
}

.sgp-archive-hero::before {
    content: '';
    position: absolute; inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/svg%3E");
}

.sgp-archive-title {
    font-family: var(--serif);
    font-size: clamp(28px, 4vw, 44px);
    color: var(--white);
    font-weight: 700;
    margin-bottom: 8px;
    position: relative;
}

.sgp-archive-sub {
    color: rgba(255,255,255,.6);
    font-size: 15px;
    margin-bottom: 28px;
    font-family: var(--sans);
    position: relative;
}

/* ════════════════════════════════
   ACTIVE FILTER TAGS
════════════════════════════════ */
.sgp-active-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    padding: 14px 18px;
    background: var(--white);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.sgp-af-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--grey);
    margin-right: 4px;
}

.sgp-af-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--blue-light);
    border: 1px solid #bfdbfe;
    border-radius: 20px;
    padding: 4px 10px 4px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--blue);
}

.sgp-af-tag a {
    color: var(--blue);
    text-decoration: none;
    font-size: 13px;
    line-height: 1;
    opacity: .7;
    transition: opacity .2s;
}

.sgp-af-tag a:hover { opacity: 1; }

.sgp-af-clear {
    font-size: 12px;
    color: var(--red);
    text-decoration: none;
    font-weight: 600;
    margin-left: 4px;
    transition: opacity .2s;
}

.sgp-af-clear:hover { opacity: .7; }

/* ════════════════════════════════
   RESULTS SECTION
════════════════════════════════ */
.sgp-results-section {
    background: var(--light);
    padding: 32px 0 60px;
}

.sgp-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
    flex-wrap: wrap;
    gap: 12px;
}

.sgp-result-count {
    font-size: 14px;
    color: var(--grey);
    font-family: var(--sans);
}

.sgp-result-count strong { color: var(--dark); }

.sgp-sort select {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 13px;
    color: var(--dark);
    background: var(--white);
    font-family: var(--sans);
    outline: none;
}

/* ════════════════════════════════
   PROPERTY CARD GRID
════════════════════════════════ */
.sgp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 22px;
}

.sgp-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform .22s, box-shadow .22s;
}

.sgp-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.sgp-card-link { text-decoration: none; color: inherit; display: block; }

.sgp-card-image {
    position: relative;
    height: 210px;
    background: #e5e7eb center/cover no-repeat;
}

.sgp-no-image {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
}

.sgp-card-badges {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.sgp-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .4px;
    text-transform: uppercase;
    font-family: var(--sans);
}

.sgp-badge-type.sale { background: var(--sale-green); color: #fff; }
.sgp-badge-type.rent { background: var(--rent-orange); color: #fff; }
.sgp-badge-unit      { background: #7c3aed; color: #fff; }
.sgp-badge-status    { background: #b45309; color: #fff; }
.sgp-badge-proptype  { background: var(--dark); color: #fff; }

.sgp-card-body { padding: 16px 18px 18px; }

.sgp-card-price {
    font-family: var(--serif);
    font-size: 22px;
    font-weight: 700;
    color: var(--red);
    margin-bottom: 5px;
}

.sgp-card-title {
    font-family: var(--serif);
    font-size: 16px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 4px;
    line-height: 1.4;
}

.sgp-card-district {
    font-size: 13px;
    color: var(--grey);
    margin-bottom: 10px;
    font-family: var(--sans);
    display: flex;
    align-items: center;
    gap: 4px;
}

.sgp-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.sgp-meta-pill {
    background: var(--light);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 11px;
    padding: 3px 10px;
    color: var(--grey);
    font-family: var(--sans);
}

.sgp-card-specs {
    display: flex;
    gap: 14px;
    font-size: 12px;
    color: var(--grey);
    font-family: var(--sans);
    flex-wrap: wrap;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    margin-top: 8px;
}

.sgp-card-specs span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ════════════════════════════════
   PAGINATION
════════════════════════════════ */
.sgp-pagination {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}

.sgp-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-size: 14px;
    text-decoration: none;
    color: var(--dark);
    font-family: var(--sans);
    background: var(--white);
    transition: all .2s;
}

.sgp-pagination .page-numbers.current,
.sgp-pagination .page-numbers:hover {
    background: var(--red);
    color: #fff;
    border-color: var(--red);
}

/* ════════════════════════════════
   NO RESULTS
════════════════════════════════ */
.sgp-no-results {
    text-align: center;
    padding: 80px 20px;
    color: var(--grey);
    font-family: var(--sans);
    background: var(--white);
    border-radius: var(--radius);
}

.sgp-no-results h3 { font-family: var(--serif); font-size: 22px; margin: 16px 0 8px; color: var(--dark); }
.sgp-no-results p  { margin-bottom: 24px; }

.sgp-btn {
    display: inline-block;
    background: var(--red);
    color: #fff;
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    font-family: var(--sans);
    transition: background .2s;
}

.sgp-btn:hover { background: var(--red-dark); }

/* ════════════════════════════════
   SINGLE PROPERTY PAGE
════════════════════════════════ */
.sgp-single { padding: 32px 0 60px; background: var(--light); }

.sgp-breadcrumb {
    font-size: 13px;
    color: var(--grey);
    margin-bottom: 22px;
    font-family: var(--sans);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.sgp-breadcrumb a { color: var(--grey); text-decoration: none; }
.sgp-breadcrumb a:hover { color: var(--red); }
.sgp-breadcrumb span { color: var(--dark); font-weight: 600; }

.sgp-single-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 28px;
    align-items: start;
}

/* Gallery */
.sgp-gallery { margin-bottom: 24px; }

.sgp-gallery-main {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: #111;
    aspect-ratio: 16/9;
}

.sgp-gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity .25s;
}

.sgp-gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,.5);
    color: #fff;
    border: none;
    width: 42px; height: 42px;
    border-radius: 50%;
    font-size: 26px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
    z-index: 2;
}

.sgp-gallery-nav:hover { background: var(--red); }
.sgp-gallery-nav.prev { left: 12px; }
.sgp-gallery-nav.next { right: 12px; }

.sgp-gallery-counter {
    position: absolute;
    bottom: 10px; right: 12px;
    background: rgba(0,0,0,.6);
    color: #fff;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-family: var(--sans);
}

.sgp-gallery-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.sgp-thumb {
    width: 72px; height: 50px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all .2s;
    flex-shrink: 0;
    opacity: .65;
}

.sgp-thumb.active,
.sgp-thumb:hover { border-color: var(--red); opacity: 1; }

.sgp-no-gallery {
    aspect-ratio: 16/9;
    background: #f3f4f6;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--grey);
    font-family: var(--sans);
    margin-bottom: 24px;
}

/* Single header */
.sgp-single-header { margin-bottom: 24px; }
.sgp-single-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }

.sgp-single-title {
    font-family: var(--serif);
    font-size: clamp(22px, 3vw, 30px);
    font-weight: 700;
    color: var(--dark);
    line-height: 1.3;
    margin-bottom: 8px;
}

.sgp-single-address {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--grey);
    margin-bottom: 14px;
}

.sgp-single-price {
    font-family: var(--serif);
    font-size: clamp(24px, 4vw, 36px);
    font-weight: 700;
    color: var(--red);
}

.sgp-single-psf { font-size: 13px; color: var(--grey); margin-top: 4px; }

/* Facts grid */
.sgp-facts-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 24px;
}

.sgp-fact-item { background: var(--white); padding: 14px 16px; }
.sgp-fact-label { font-size: 10px; text-transform: uppercase; letter-spacing: .8px; color: var(--grey); font-family: var(--sans); font-weight: 700; margin-bottom: 4px; }
.sgp-fact-value { font-size: 14px; font-weight: 700; color: var(--dark); font-family: var(--sans); }

/* Description, Map, Mortgage */
.sgp-description,
.sgp-map-section,
.sgp-mortgage-section {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px 26px;
    margin-bottom: 22px;
    box-shadow: var(--shadow);
}

.sgp-description h2,
.sgp-map-section h2,
.sgp-mortgage-section h2 {
    font-family: var(--serif);
    font-size: 20px;
    color: var(--dark);
    margin-bottom: 16px;
}

.sgp-description p { line-height: 1.75; color: var(--mid); font-size: 14px; }

.sgp-map { width: 100%; height: 320px; border-radius: var(--radius-sm); overflow: hidden; background: #e8e8e8; }

/* Mortgage */
.sgp-mortgage-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }

.sgp-m-field { margin-bottom: 14px; }

.sgp-m-field label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: var(--grey);
    margin-bottom: 5px;
}

.sgp-m-field input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    font-size: 14px;
    font-family: var(--sans);
    color: var(--dark);
    outline: none;
    transition: all .2s;
}

.sgp-m-field input:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(192,57,43,.1); }

.sgp-mortgage-result {
    background: var(--dark);
    border-radius: var(--radius);
    padding: 24px 20px;
    color: var(--white);
    text-align: center;
}

.sgp-m-result-label { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: rgba(255,255,255,.55); margin-bottom: 10px; }
.sgp-m-result-value { font-family: var(--serif); font-size: 30px; font-weight: 700; margin-bottom: 16px; }

.sgp-m-breakdown {
    font-size: 12px;
    color: rgba(255,255,255,.65);
    line-height: 2;
    border-top: 1px solid rgba(255,255,255,.12);
    padding-top: 14px;
    text-align: left;
}

.sgp-m-breakdown div { display: flex; justify-content: space-between; }
.sgp-m-disclaimer { font-size: 11px; color: rgba(255,255,255,.35); margin-top: 12px; line-height: 1.6; }

/* Sidebar */
.sgp-single-sidebar { position: sticky; top: 90px; }

.sgp-enquiry-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 22px;
    margin-bottom: 14px;
}

.sgp-agent-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
}

.sgp-agent-avatar {
    width: 46px; height: 46px;
    background: var(--dark); color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; font-weight: 700;
    font-family: var(--serif); flex-shrink: 0;
}

.sgp-agent-name { font-weight: 700; font-size: 14px; color: var(--dark); }
.sgp-agent-role { font-size: 12px; color: var(--grey); }

.sgp-whatsapp-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    background: #25D366; color: #fff; text-decoration: none;
    border-radius: var(--radius-sm);
    padding: 12px; font-weight: 700; font-size: 14px;
    font-family: var(--sans); transition: background .2s; margin-bottom: 18px;
}

.sgp-whatsapp-btn:hover { background: #128C7E; }

.sgp-enquiry-form h3 { font-family: var(--serif); font-size: 17px; color: var(--dark); margin-bottom: 12px; }

.sgp-enquiry-form input,
.sgp-enquiry-form textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 9px 11px;
    font-size: 13px; font-family: var(--sans); color: var(--dark);
    margin-bottom: 8px; outline: none;
    transition: border-color .2s; resize: vertical;
}

.sgp-enquiry-form input:focus,
.sgp-enquiry-form textarea:focus { border-color: var(--red); }

.sgp-submit-enquiry {
    width: 100%; background: var(--red); color: #fff; border: none;
    border-radius: var(--radius-sm); padding: 12px;
    font-size: 14px; font-weight: 700; font-family: var(--sans);
    cursor: pointer; transition: background .2s; margin-top: 2px;
}

.sgp-submit-enquiry:hover { background: var(--red-dark); }
.sgp-submit-enquiry:disabled { background: #ccc; }

.sgp-listing-meta {
    margin-top: 18px; padding-top: 18px;
    border-top: 1px solid var(--border);
    display: flex; flex-direction: column; gap: 9px;
}

.sgp-listing-meta > div { display: flex; justify-content: space-between; font-size: 13px; }
.sgp-listing-meta span { color: var(--grey); }
.sgp-listing-meta strong { color: var(--dark); text-align: right; }

.sgp-share-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 22px; }
.sgp-share-card h4 { font-family: var(--serif); font-size: 15px; color: var(--dark); margin-bottom: 12px; }
.sgp-share-btns { display: flex; gap: 8px; flex-wrap: wrap; }

.sgp-share-btn {
    padding: 8px 14px; border-radius: var(--radius-sm);
    font-size: 12px; font-weight: 600; font-family: var(--sans);
    text-decoration: none; border: none; cursor: pointer;
    transition: opacity .2s; display: inline-block;
}

.sgp-share-btn:hover { opacity: .85; }
.sgp-share-btn.wa   { background: #25D366; color: #fff; }
.sgp-share-btn.fb   { background: #1877f2; color: #fff; }
.sgp-share-btn.copy { background: var(--light); color: var(--dark); border: 1px solid var(--border); }

/* ════════════════════════════════
   RESPONSIVE
════════════════════════════════ */
@media (max-width: 1024px) {
    .sgp-single-layout { grid-template-columns: 1fr; }
    .sgp-single-sidebar { position: static; }
    .sgp-mortgage-grid { grid-template-columns: 1fr; }
    .sgp-facts-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
    /* Stack search fields on tablet */
    .sgp-search-fields {
        flex-wrap: wrap;
        padding: 14px 16px;
        gap: 8px;
    }
    .sgp-field-group {
        flex: 1 1 calc(50% - 8px);
        border-right: none;
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        padding: 10px 12px;
        background: #fafafa;
    }
    .sgp-submit-group {
        flex: 1 1 100%;
        min-width: 0;
    }
    .sgp-search-btn { padding: 12px; }
}

@media (max-width: 600px) {
    .sgp-field-group { flex: 1 1 100%; }
    .sgp-grid { grid-template-columns: 1fr; }
    .sgp-archive-hero { padding: 28px 0 0; }
    .sgp-results-header { flex-direction: column; align-items: flex-start; }
    .sgp-facts-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
    .sgp-facts-grid { grid-template-columns: 1fr 1fr; }
}
