/**
 * Webba Realworks Sync - Base Styles
 *
 * These styles provide basic layout and appearance for the property templates.
 * Themes can override this file by placing a copy in yourtheme/webbarw/webbarw.css
 *
 * @package Webba_Realworks_Sync
 */

/* ==========================================================================
   CSS Custom Properties (easily overridable)
   ========================================================================== */

:root {
    --webbarw-primary-color: #1e3a5f;
    --webbarw-secondary-color: #2c5282;
    --webbarw-accent-color: #38a169;
    --webbarw-text-color: #2d3748;
    --webbarw-text-light: #718096;
    --webbarw-border-color: #e2e8f0;
    --webbarw-bg-light: #f7fafc;
    --webbarw-white: #ffffff;
    --webbarw-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    --webbarw-shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.15);
    --webbarw-radius: 8px;
    --webbarw-radius-sm: 4px;
    --webbarw-transition: 0.2s ease;
    --webbarw-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --webbarw-grid-gap: 24px;
    --webbarw-sidebar-width: 300px;
}

/* ==========================================================================
   Fallback Header/Footer (used when theme has no header.php/footer.php)
   ========================================================================== */

.webbarw-fallback-header {
    background: var(--webbarw-white);
    border-bottom: 1px solid var(--webbarw-border-color);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.webbarw-fallback-header .site-branding {
    flex-shrink: 0;
}

.webbarw-fallback-header .site-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.webbarw-fallback-header .site-title a {
    color: var(--webbarw-primary-color);
    text-decoration: none;
}

.webbarw-fallback-header .main-navigation ul {
    display: flex;
    gap: 24px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.webbarw-fallback-header .main-navigation a {
    color: var(--webbarw-text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--webbarw-transition);
}

.webbarw-fallback-header .main-navigation a:hover {
    color: var(--webbarw-primary-color);
}

.webbarw-fallback-footer {
    background: var(--webbarw-bg-light);
    border-top: 1px solid var(--webbarw-border-color);
    padding: 24px;
    text-align: center;
    margin-top: 48px;
}

.webbarw-fallback-footer .site-info {
    color: var(--webbarw-text-light);
    font-size: 0.875rem;
}

.webbarw-fallback-footer .site-info a {
    color: var(--webbarw-text-color);
    text-decoration: none;
}

.site-content {
    padding: 24px 0;
}

/* ==========================================================================
   Archive Layout
   ========================================================================== */

.webbarw-archive-wrapper {
    display: grid;
    grid-template-columns: var(--webbarw-sidebar-width) 1fr;
    gap: var(--webbarw-grid-gap);
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

.webbarw-sidebar {
    position: sticky;
    top: 24px;
    align-self: start;
}

.webbarw-content {
    min-width: 0;
}

.webbarw-archive-header {
    margin-bottom: 24px;
}

.webbarw-archive-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--webbarw-text-color);
    margin: 0 0 8px;
}

.webbarw-archive-description {
    color: var(--webbarw-text-light);
}

.webbarw-results-count {
    color: var(--webbarw-text-light);
    font-size: 0.875rem;
    margin-bottom: 16px;
}

/* ==========================================================================
   Property Grid
   ========================================================================== */

.webbarw-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--webbarw-grid-gap);
}

/* ==========================================================================
   Property Card
   ========================================================================== */

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

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

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

.webbarw-card-image {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--webbarw-bg-light);
}

.webbarw-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--webbarw-transition);
}

.webbarw-card:hover .webbarw-card-img {
    transform: scale(1.05);
}

.webbarw-card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--webbarw-text-light);
    font-size: 0.875rem;
}

.webbarw-card-status {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 12px;
    border-radius: var(--webbarw-radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.webbarw-card-content {
    padding: 16px;
}

.webbarw-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--webbarw-text-color);
    margin: 0 0 4px;
    line-height: 1.3;
}

.webbarw-card-location {
    color: var(--webbarw-text-light);
    font-size: 0.875rem;
    margin: 0 0 12px;
}

.webbarw-card-price {
    margin-bottom: 12px;
}

.webbarw-card-specs {
    display: flex;
    gap: 16px;
    list-style: none;
    margin: 0;
    padding: 12px 0 0;
    border-top: 1px solid var(--webbarw-border-color);
}

.webbarw-spec {
    display: flex;
    align-items: baseline;
    gap: 4px;
    font-size: 0.875rem;
}

.webbarw-spec-value {
    font-weight: 600;
    color: var(--webbarw-text-color);
}

.webbarw-spec-label {
    color: var(--webbarw-text-light);
}

/* ==========================================================================
   Status Badges
   ========================================================================== */

.webbarw-status,
.webbarw-card-status {
    background: var(--webbarw-primary-color);
    color: var(--webbarw-white);
}

.webbarw-status--beschikbaar {
    background: var(--webbarw-accent-color);
}

.webbarw-status--verkocht,
.webbarw-status--verhuurd {
    background: #e53e3e;
}

.webbarw-status--onder_optie,
.webbarw-status--onder_bod {
    background: #ed8936;
}

.webbarw-status--in_aanbieding {
    background: var(--webbarw-accent-color);
}

/* ==========================================================================
   Price Display
   ========================================================================== */

.webbarw-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--webbarw-primary-color);
}

.webbarw-price small,
.webbarw-price-label {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--webbarw-text-light);
}

/* ==========================================================================
   Filters
   ========================================================================== */

.webbarw-filters {
    background: var(--webbarw-white);
    border-radius: var(--webbarw-radius);
    box-shadow: var(--webbarw-shadow);
    padding: 20px;
}

.webbarw-filters-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--webbarw-text-color);
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--webbarw-border-color);
}

.webbarw-filter {
    margin-bottom: 20px;
}

.webbarw-filter-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--webbarw-text-color);
    margin-bottom: 8px;
}

.webbarw-filter-input,
.webbarw-filter-select {
    width: 100%;
    padding: 10px 12px;
    font-size: 0.875rem;
    border: 1px solid var(--webbarw-border-color);
    border-radius: var(--webbarw-radius-sm);
    background: var(--webbarw-white);
    color: var(--webbarw-text-color);
    transition: border-color var(--webbarw-transition);
}

.webbarw-filter-input:focus,
.webbarw-filter-select:focus {
    outline: none;
    border-color: var(--webbarw-primary-color);
}

.webbarw-filter-range {
    display: flex;
    gap: 8px;
    align-items: center;
}

.webbarw-filter-range-separator {
    color: var(--webbarw-text-light);
}

.webbarw-filter-input--min,
.webbarw-filter-input--max {
    width: calc(50% - 10px);
}

.webbarw-filter-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--webbarw-border-color);
}

.webbarw-filter-submit {
    flex: 1;
    padding: 12px 16px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--webbarw-white);
    background: var(--webbarw-primary-color);
    border: none;
    border-radius: var(--webbarw-radius-sm);
    cursor: pointer;
    transition: background var(--webbarw-transition);
}

.webbarw-filter-submit:hover {
    background: var(--webbarw-secondary-color);
}

.webbarw-filter-reset {
    padding: 12px 16px;
    font-size: 0.875rem;
    color: var(--webbarw-text-light);
    text-decoration: none;
    border-radius: var(--webbarw-radius-sm);
    transition: color var(--webbarw-transition);
}

.webbarw-filter-reset:hover {
    color: var(--webbarw-text-color);
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.webbarw-pagination {
    margin-top: 40px;
}

.webbarw-pagination .nav-links {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.webbarw-pagination a,
.webbarw-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    font-size: 0.875rem;
    color: var(--webbarw-text-color);
    background: var(--webbarw-white);
    border: 1px solid var(--webbarw-border-color);
    border-radius: var(--webbarw-radius-sm);
    text-decoration: none;
    transition: all var(--webbarw-transition);
}

.webbarw-pagination a:hover {
    background: var(--webbarw-bg-light);
    border-color: var(--webbarw-primary-color);
}

.webbarw-pagination .current {
    color: var(--webbarw-white);
    background: var(--webbarw-primary-color);
    border-color: var(--webbarw-primary-color);
}

/* ==========================================================================
   No Results
   ========================================================================== */

.webbarw-no-results {
    text-align: center;
    padding: 60px 20px;
    background: var(--webbarw-bg-light);
    border-radius: var(--webbarw-radius);
}

.webbarw-no-results p {
    color: var(--webbarw-text-light);
    margin: 0 0 20px;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.webbarw-btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--webbarw-white);
    background: var(--webbarw-primary-color);
    border: none;
    border-radius: var(--webbarw-radius-sm);
    text-decoration: none;
    cursor: pointer;
    transition: background var(--webbarw-transition);
}

.webbarw-btn:hover {
    background: var(--webbarw-secondary-color);
    color: var(--webbarw-white);
}

.webbarw-btn--back {
    background: transparent;
    color: var(--webbarw-primary-color);
    border: 1px solid var(--webbarw-primary-color);
}

.webbarw-btn--back:hover {
    background: var(--webbarw-primary-color);
    color: var(--webbarw-white);
}

/* ==========================================================================
   Single Property
   ========================================================================== */

.webbarw-single {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

.webbarw-single-header {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.webbarw-single-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--webbarw-text-color);
    margin: 0;
}

.webbarw-single .webbarw-status {
    padding: 6px 16px;
    border-radius: var(--webbarw-radius-sm);
    font-size: 0.875rem;
}

.webbarw-single-price {
    margin-bottom: 24px;
}

.webbarw-single-price .webbarw-price {
    font-size: 1.75rem;
}

.webbarw-single-highlights {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
    padding: 24px;
    margin-bottom: 32px;
    background: var(--webbarw-bg-light);
    border-radius: var(--webbarw-radius);
}

.webbarw-highlight {
    text-align: center;
}

.webbarw-highlight-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--webbarw-primary-color);
}

.webbarw-highlight-label {
    display: block;
    font-size: 0.875rem;
    color: var(--webbarw-text-light);
}

.webbarw-single-content {
    padding: 32px 0;
}

.webbarw-single-description {
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px solid var(--webbarw-border-color);
}

.webbarw-single-description > * + * {
    margin-block-start: 1rem;
}

.webbarw-single-description h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 16px;
}

.webbarw-single-nav {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--webbarw-border-color);
}

/* ==========================================================================
   Gallery
   ========================================================================== */

.webbarw-gallery {
    position: relative;
    margin-bottom: 32px;
}

.webbarw-gallery-main {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: var(--webbarw-radius);
    background: var(--webbarw-bg-light);
}

.webbarw-gallery-main-link {
    display: block;
    width: 100%;
    height: 100%;
}

.webbarw-gallery-main-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.webbarw-gallery-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 300px;
    color: var(--webbarw-text-light);
    border-radius: var(--webbarw-radius);
    background: var(--webbarw-bg-light);
}

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

.webbarw-gallery-thumb {
    flex: 0 0 auto;
    width: 80px;
    height: 60px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: var(--webbarw-radius-sm);
    overflow: hidden;
    cursor: pointer;
    transition: border-color var(--webbarw-transition);
    background: none;
}

.webbarw-gallery-thumb:hover,
.webbarw-gallery-thumb.is-active {
    border-color: var(--webbarw-primary-color);
}

.webbarw-gallery-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.webbarw-gallery-counter {
    position: absolute;
    bottom: 12px;
    right: 12px;
    padding: 6px 12px;
    font-size: 0.875rem;
    color: var(--webbarw-white);
    background: rgba(0, 0, 0, 0.6);
    border-radius: var(--webbarw-radius-sm);
}

/* ==========================================================================
   Details
   ========================================================================== */

.webbarw-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
}

.webbarw-details-group {
    background: var(--webbarw-white);
    border: 1px solid var(--webbarw-border-color);
    border-radius: var(--webbarw-radius);
    padding: 20px;
}

.webbarw-details-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--webbarw-text-color);
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--webbarw-border-color);
}

.webbarw-details-list {
    margin: 0;
}

.webbarw-details-item {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 0;
    border-bottom: 1px solid var(--webbarw-bg-light);
}

.webbarw-details-item:last-child {
    border-bottom: none;
}

.webbarw-details-label {
    font-size: 0.875rem;
    color: var(--webbarw-text-light);
    margin: 0;
}

.webbarw-details-value {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--webbarw-text-color);
    text-align: right;
    margin: 0;
}

/* Details - Oppervlakte breakdown */
.webbarw-details-item--total {
    background: var(--webbarw-bg-light);
    margin: -8px -20px 8px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--webbarw-border-color);
}

.webbarw-details-item--total .webbarw-details-label,
.webbarw-details-item--total .webbarw-details-value {
    font-size: 1rem;
}

.webbarw-details-item--breakdown {
    font-weight: 500;
}

.webbarw-details-item--sub {
    padding-left: 16px;
    border-bottom-color: transparent;
}

.webbarw-details-item--sub .webbarw-details-label {
    font-size: 0.8125rem;
}

.webbarw-details-item--sub .webbarw-details-value {
    font-size: 0.8125rem;
    font-weight: 400;
}

.webbarw-details-label--indent {
    padding-left: 16px;
    position: relative;
}

.webbarw-details-label--indent::before {
    content: "–";
    position: absolute;
    left: 0;
    color: var(--webbarw-text-light);
}

.webbarw-details-item--terrein {
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--webbarw-border-color);
}

/* ==========================================================================
   Brochures / Downloads
   ========================================================================== */

.webbarw-brochures {
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px solid var(--webbarw-border-color);
}

.webbarw-brochures-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 16px;
}

.webbarw-brochures-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.webbarw-brochure-item {
    margin: 0;
}

.webbarw-brochure-link {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--webbarw-bg-light);
    border: 1px solid var(--webbarw-border-color);
    border-radius: var(--webbarw-radius);
    text-decoration: none;
    color: inherit;
    transition: all var(--webbarw-transition);
}

.webbarw-brochure-link:hover {
    background: var(--webbarw-white);
    border-color: var(--webbarw-primary-color);
    box-shadow: var(--webbarw-shadow);
}

.webbarw-brochure-icon {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--webbarw-primary-color);
    color: var(--webbarw-white);
    border-radius: var(--webbarw-radius-sm);
}

.webbarw-brochure-icon svg {
    width: 24px;
    height: 24px;
}

.webbarw-brochure-info {
    flex: 1;
    min-width: 0;
}

.webbarw-brochure-name {
    display: block;
    font-weight: 600;
    color: var(--webbarw-text-color);
    font-size: 1rem;
    line-height: 1.3;
}

.webbarw-brochure-size {
    display: block;
    font-size: 0.875rem;
    color: var(--webbarw-text-light);
    margin-top: 2px;
}

.webbarw-brochure-download {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: var(--webbarw-primary-color);
    border-radius: 50%;
    transition: all var(--webbarw-transition);
}

.webbarw-brochure-link:hover .webbarw-brochure-download {
    background: var(--webbarw-primary-color);
    color: var(--webbarw-white);
}

.webbarw-brochure-download svg {
    width: 20px;
    height: 20px;
}

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

@media (max-width: 1024px) {
    .webbarw-archive-wrapper {
        grid-template-columns: 1fr;
    }

    .webbarw-sidebar {
        position: static;
        order: -1;
    }

    .webbarw-filters {
        display: flex;
        flex-wrap: wrap;
        gap: 16px;
    }

    .webbarw-filters-title {
        width: 100%;
        margin-bottom: 8px;
    }

    .webbarw-filter {
        flex: 1 1 200px;
        margin-bottom: 0;
    }

    .webbarw-filter-actions {
        width: 100%;
        margin-top: 8px;
        padding-top: 16px;
    }
}

@media (max-width: 768px) {
    .webbarw-archive-wrapper,
    .webbarw-single {
        padding: 16px;
    }

    .webbarw-archive-title,
    .webbarw-single-title {
        font-size: 1.5rem;
    }

    .webbarw-grid {
        grid-template-columns: 1fr;
    }

    .webbarw-single-highlights {
        gap: 24px;
        padding: 16px;
    }

    .webbarw-highlight-value {
        font-size: 1.25rem;
    }

    .webbarw-details {
        grid-template-columns: 1fr;
    }

    .webbarw-gallery-thumbs {
        gap: 8px;
    }

    .webbarw-gallery-thumb {
        width: 60px;
        height: 45px;
    }
}

@media (max-width: 480px) {
    .webbarw-filters {
        flex-direction: column;
    }

    .webbarw-filter {
        flex: 1 1 100%;
    }

    .webbarw-filter-range {
        flex-direction: column;
    }

    .webbarw-filter-range-separator {
        display: none;
    }

    .webbarw-filter-input--min,
    .webbarw-filter-input--max {
        width: 100%;
    }

    .webbarw-card-specs {
        flex-wrap: wrap;
        gap: 12px;
    }
}
