/**
 * TPB Properties — Main Stylesheet
 */

/* ===== CSS Variables (injected from admin, these are fallbacks) ===== */
:root {
    --tpb-primary: #1a1a2e;
    --tpb-secondary: #e94560;
    --tpb-accent: #f5f5f0;
    --tpb-text: #333333;
    --tpb-text-light: #666666;
    --tpb-text-muted: #999999;
    --tpb-bg: #ffffff;
    --tpb-card-bg: #f8f9fa;
    --tpb-border: #e5e7eb;
    --tpb-heading-font: inherit;
    --tpb-body-font: inherit;
    --tpb-heading-size: 28px;
    --tpb-body-size: 16px;
    --tpb-grid-cols: 3;
    --tpb-radius: 12px;
    --tpb-radius-sm: 8px;
    --tpb-shadow-sm: 0 2px 12px rgba(0,0,0,0.06);
    --tpb-shadow-md: 0 8px 30px rgba(0,0,0,0.08);
    --tpb-transition: 0.2s ease;
}

/* ===== Reset for theme independence ===== */
.tpb-properties-wrapper {
    font-family: var(--tpb-body-font, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    font-size: var(--tpb-body-size, 16px);
    line-height: 1.6;
    color: var(--tpb-text);
    -webkit-font-smoothing: antialiased;
}
.tpb-properties-wrapper *,
.tpb-properties-wrapper *::before,
.tpb-properties-wrapper *::after {
    box-sizing: border-box;
}
.tpb-properties-wrapper img {
    max-width: 100%;
    height: auto;
}
.tpb-properties-wrapper a {
    text-decoration: none;
    color: inherit;
}
.tpb-properties-wrapper h1,
.tpb-properties-wrapper h2,
.tpb-properties-wrapper h3 {
    font-family: var(--tpb-heading-font, inherit);
    margin: 0 0 16px 0;
    line-height: 1.3;
    color: var(--tpb-text);
}

/* ===== Container ===== */
.tpb-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== Breadcrumb ===== */
.tpb-breadcrumb {
    font-size: 13px;
    color: var(--tpb-text-muted);
    padding: 16px 0;
}
.tpb-breadcrumb a {
    color: var(--tpb-text-light);
    transition: color var(--tpb-transition);
}
.tpb-breadcrumb a:hover { color: var(--tpb-secondary); }
.tpb-breadcrumb__sep { margin: 0 8px; }

/* ===== Archive ===== */
.tpb-archive__title {
    font-size: var(--tpb-heading-size);
    font-weight: 700;
    margin-bottom: 24px;
}
.tpb-archive__meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 16px;
}
.tpb-archive__count {
    font-size: 14px;
    color: var(--tpb-text-light);
}

/* ===== Filters ===== */
.tpb-filters {
    background: var(--tpb-card-bg);
    border: 1px solid var(--tpb-border);
    border-radius: var(--tpb-radius);
    padding: 20px;
    margin-bottom: 24px;
}
.tpb-filters__row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}
.tpb-filter-group {
    flex: 1 1 160px;
    min-width: 140px;
}
.tpb-filter-group--search {
    flex: 2 1 280px;
}
.tpb-filters__actions {
    margin-top: 12px;
    text-align: right;
}

/* ===== Inputs ===== */
.tpb-input, .tpb-select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--tpb-border);
    border-radius: var(--tpb-radius-sm);
    font-size: 14px;
    font-family: inherit;
    color: var(--tpb-text);
    background: var(--tpb-bg);
    transition: border-color var(--tpb-transition);
    outline: none;
}
.tpb-input:focus, .tpb-select:focus {
    border-color: var(--tpb-secondary);
}
.tpb-input--sm { padding: 8px 12px; font-size: 13px; }
.tpb-select--sm { padding: 8px 12px; font-size: 13px; }
.tpb-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--tpb-border);
    border-radius: var(--tpb-radius-sm);
    font-size: 14px;
    font-family: inherit;
    color: var(--tpb-text);
    background: var(--tpb-bg);
    resize: vertical;
    min-height: 80px;
    outline: none;
}
.tpb-textarea:focus { border-color: var(--tpb-secondary); }

/* ===== Buttons ===== */
.tpb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: var(--tpb-radius-sm);
    cursor: pointer;
    transition: all var(--tpb-transition);
    text-decoration: none;
    line-height: 1.4;
}
.tpb-btn--primary {
    background: var(--tpb-secondary);
    color: #fff;
}
.tpb-btn--primary:hover { opacity: 0.9; }
.tpb-btn--dark {
    background: var(--tpb-primary);
    color: #fff;
}
.tpb-btn--dark:hover { opacity: 0.9; }
.tpb-btn--outline {
    background: transparent;
    border: 1px solid var(--tpb-border);
    color: var(--tpb-text-light);
}
.tpb-btn--outline:hover {
    border-color: var(--tpb-text-light);
    color: var(--tpb-text);
}
.tpb-btn--whatsapp {
    background: #25D366;
    color: #fff;
}
.tpb-btn--whatsapp:hover { background: #1da851; }
.tpb-btn--sm { padding: 6px 14px; font-size: 13px; }
.tpb-btn--lg { padding: 14px 32px; font-size: 16px; }
.tpb-btn--block { width: 100%; }
.tpb-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== Grid ===== */
.tpb-grid {
    display: grid;
    grid-template-columns: repeat(var(--tpb-grid-cols, 3), 1fr);
    gap: 24px;
}
@media (max-width: 1024px) { .tpb-grid { --tpb-grid-cols: 2 !important; } }
@media (max-width: 640px)  { .tpb-grid { --tpb-grid-cols: 1 !important; } }

/* ===== Card ===== */
.tpb-card {
    background: var(--tpb-bg);
    border-radius: var(--tpb-radius);
    overflow: hidden;
    box-shadow: var(--tpb-shadow-sm);
    transition: transform var(--tpb-transition), box-shadow var(--tpb-transition);
}
.tpb-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--tpb-shadow-md);
}
.tpb-card__link {
    display: block;
    color: inherit;
    text-decoration: none;
}
.tpb-card__image {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--tpb-accent);
}
.tpb-card__img,
.tpb-card__slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.tpb-card__slide {
    opacity: 0;
    transition: opacity 0.3s ease;
}
.tpb-card__slide--active { opacity: 1; }
.tpb-card__dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 2;
}
.tpb-card__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: background var(--tpb-transition);
}
.tpb-card__dot--active { background: #fff; }
.tpb-card__badges {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    z-index: 2;
}
.tpb-badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.tpb-badge--status {
    background: var(--tpb-secondary);
    color: #fff;
}
.tpb-badge--type {
    background: rgba(0,0,0,0.6);
    color: #fff;
}
.tpb-card__body {
    padding: 16px;
}
.tpb-card__title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 6px 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.tpb-card__price {
    font-size: 15px;
    font-weight: 700;
    color: var(--tpb-secondary);
    margin-bottom: 8px;
}
.tpb-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    color: var(--tpb-text-light);
    margin-bottom: 4px;
}
.tpb-card__meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.tpb-card__meta-item svg {
    flex-shrink: 0;
    opacity: 0.6;
}
.tpb-card__size {
    font-size: 12px;
    color: var(--tpb-text-muted);
    margin-top: 4px;
}

/* ===== Pagination ===== */
.tpb-pagination {
    text-align: center;
    padding: 40px 0;
}

/* ===== Empty State ===== */
.tpb-empty-state {
    text-align: center;
    padding: 60px 20px;
}
.tpb-empty-state h3 {
    font-size: 18px;
    margin-top: 16px;
    color: var(--tpb-text);
}
.tpb-empty-state p {
    color: var(--tpb-text-light);
    font-size: 14px;
    margin-top: 8px;
}

/* ===== Single Property Layout ===== */
.tpb-single__layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 40px;
    margin-top: 24px;
}
@media (max-width: 1024px) {
    .tpb-single__layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}
.tpb-single__main { min-width: 0; }
.tpb-single__sidebar {
    position: sticky;
    top: 24px;
    align-self: start;
}

/* ===== Single Header ===== */
.tpb-single__header {
    margin-bottom: 32px;
}
.tpb-single__title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}
.tpb-single__price {
    font-size: 22px;
    font-weight: 700;
    color: var(--tpb-secondary);
    margin-bottom: 8px;
}
.tpb-single__location {
    font-size: 15px;
    color: var(--tpb-text-light);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}
.tpb-single__developer {
    font-size: 14px;
    color: var(--tpb-text-muted);
}
.tpb-single__status-badge {
    display: inline-block;
    padding: 4px 14px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 4px;
    background: var(--tpb-secondary);
    color: #fff;
    margin-top: 8px;
    text-transform: uppercase;
}

/* ===== Sections ===== */
.tpb-section {
    margin-bottom: 40px;
}
.tpb-section__title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--tpb-border);
}

/* ===== Overview Grid ===== */
.tpb-overview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    background: var(--tpb-card-bg);
    border-radius: var(--tpb-radius);
    padding: 24px;
}
@media (max-width: 640px) {
    .tpb-overview { grid-template-columns: repeat(2, 1fr); }
}
.tpb-overview__item {}
.tpb-overview__label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--tpb-text-muted);
    margin-bottom: 4px;
}
.tpb-overview__value {
    font-size: 15px;
    font-weight: 600;
    color: var(--tpb-text);
}

/* ===== Description ===== */
.tpb-description {
    font-size: 15px;
    line-height: 1.8;
    color: var(--tpb-text-light);
}
.tpb-description p { margin: 0 0 16px 0; }
.tpb-description ul,
.tpb-description ol {
    margin: 0 0 16px 0;
    padding-left: 24px;
}

/* ===== Room Types ===== */
.tpb-room-types {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.tpb-room-type-chip {
    display: inline-block;
    padding: 6px 16px;
    background: var(--tpb-accent);
    border: 1px solid var(--tpb-border);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--tpb-text);
}

/* ===== Amenities ===== */
.tpb-amenities-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
@media (max-width: 640px) {
    .tpb-amenities-grid { grid-template-columns: repeat(2, 1fr); }
}
.tpb-amenity-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--tpb-card-bg);
    border-radius: var(--tpb-radius-sm);
    font-size: 14px;
}
.tpb-amenity-item__icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--tpb-secondary);
}

/* ===== Payment Plans ===== */
.tpb-payment-plan {
    margin-bottom: 24px;
}
.tpb-payment-plan__name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}
.tpb-installments {
    display: grid;
    gap: 8px;
}
.tpb-installment {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: var(--tpb-card-bg);
    border-radius: var(--tpb-radius-sm);
}
.tpb-installment__pct {
    font-size: 18px;
    font-weight: 700;
    color: var(--tpb-secondary);
    min-width: 60px;
}
.tpb-installment__label {
    font-size: 14px;
    font-weight: 500;
    flex: 1;
}
.tpb-installment__milestone {
    font-size: 13px;
    color: var(--tpb-text-muted);
}

/* ===== Floor Plans ===== */
.tpb-floor-plans__tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}
.tpb-floor-plan-tab {
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid var(--tpb-border);
    border-radius: 20px;
    background: transparent;
    cursor: pointer;
    transition: all var(--tpb-transition);
    font-family: inherit;
    color: var(--tpb-text);
}
.tpb-floor-plan-tab--active,
.tpb-floor-plan-tab:hover {
    background: var(--tpb-secondary);
    color: #fff;
    border-color: var(--tpb-secondary);
}
.tpb-floor-plan-panel {
    display: none;
}
.tpb-floor-plan-panel--active {
    display: block;
}
.tpb-floor-plan-panel img {
    max-width: 100%;
    border-radius: var(--tpb-radius);
}

/* ===== Distances ===== */
.tpb-distances {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
@media (max-width: 640px) {
    .tpb-distances { grid-template-columns: 1fr; }
}
.tpb-distance-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--tpb-card-bg);
    border-radius: var(--tpb-radius-sm);
}
.tpb-distance-item__icon {
    width: 24px;
    height: 24px;
    color: var(--tpb-secondary);
}
.tpb-distance-item__name {
    font-size: 14px;
    font-weight: 500;
}
.tpb-distance-item__value {
    font-size: 13px;
    color: var(--tpb-text-muted);
    margin-left: auto;
}

/* ===== Map ===== */
.tpb-map {
    width: 100%;
    height: 400px;
    border-radius: var(--tpb-radius);
    overflow: hidden;
}
.tpb-map iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

/* ===== Lead Form ===== */
.tpb-lead-card {
    background: var(--tpb-bg);
    border: 1px solid var(--tpb-border);
    border-radius: var(--tpb-radius);
    padding: 24px;
    box-shadow: var(--tpb-shadow-sm);
}
.tpb-lead-card__title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}
.tpb-lead-form { display: grid; gap: 12px; }
.tpb-lead-form__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
@media (max-width: 480px) {
    .tpb-lead-form__row { grid-template-columns: 1fr; }
}
.tpb-lead-form__phone-row {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 8px;
}
.tpb-lead-form__message {
    padding: 10px;
    border-radius: var(--tpb-radius-sm);
    font-size: 14px;
    text-align: center;
    display: none;
}
.tpb-lead-form__message--success {
    display: block;
    background: #d4edda;
    color: #155724;
}
.tpb-lead-form__message--error {
    display: block;
    background: #f8d7da;
    color: #721c24;
}
.tpb-lead-form__actions {
    display: grid;
    gap: 10px;
}

/* ===== Similar ===== */
.tpb-similar {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--tpb-border);
}
.tpb-similar__title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 24px;
}

/* ===== Mobile Sticky Bar ===== */
.tpb-mobile-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--tpb-bg);
    border-top: 1px solid var(--tpb-border);
    padding: 12px 16px;
    z-index: 100;
    gap: 12px;
}
@media (max-width: 1024px) {
    .tpb-mobile-bar { display: flex; }
    .tpb-single__sidebar { display: none; }
    body.tpb-has-mobile-bar { padding-bottom: 70px; }
}
.tpb-mobile-bar .tpb-btn { flex: 1; }

/* ===== Loading Spinner ===== */
.tpb-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: tpb-spin 0.6s linear infinite;
}
@keyframes tpb-spin {
    to { transform: rotate(360deg); }
}
