/* ============================================================
   Nexo Estates — Public Styles
   ============================================================ */

/* -- Variables ------------------------------------------------ */
:root {
    --nexo-primary:    #1a3c5e;
    --nexo-accent:     #c9a84c;
    --nexo-text:       #2d2d2d;
    --nexo-text-light: #6b7280;
    --nexo-bg:         #f9fafb;
    --nexo-white:      #ffffff;
    --nexo-border:     #e5e7eb;
    --nexo-radius:     12px;
    --nexo-radius-sm:  8px;
    --nexo-shadow:     0 2px 16px rgba(0,0,0,.08);
    --nexo-shadow-lg:  0 8px 32px rgba(0,0,0,.12);
    --nexo-transition: .2s ease;
    --nexo-wa-green:   #25d366;
}

/* -- Wrap ----------------------------------------------------- */
.nexo-wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* -- Buttons -------------------------------------------------- */
.nexo-btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px; padding: 12px 24px;
    border-radius: var(--nexo-radius-sm);
    font-size: .9rem; font-weight: 600; text-decoration: none;
    cursor: pointer; border: none; transition: all var(--nexo-transition);
    line-height: 1.2;
}
.nexo-btn--primary  { background: var(--nexo-primary); color: var(--nexo-white); }
.nexo-btn--primary:hover { background: #142e4a; color: var(--nexo-white); }
.nexo-btn--outline  { background: transparent; border: 2px solid var(--nexo-primary); color: var(--nexo-primary); }
.nexo-btn--outline:hover { background: var(--nexo-primary); color: var(--nexo-white); }
.nexo-btn--ghost    { background: var(--nexo-bg); border: 1px solid var(--nexo-border); color: var(--nexo-text); }
.nexo-btn--ghost:hover { border-color: var(--nexo-primary); color: var(--nexo-primary); }
.nexo-btn--whatsapp { background: var(--nexo-wa-green); color: var(--nexo-white); }
.nexo-btn--whatsapp:hover { background: #1da851; color: var(--nexo-white); }
.nexo-btn--full     { width: 100%; }

/* -- Badge ---------------------------------------------------- */
.nexo-badge {
    display: inline-block; padding: 4px 12px;
    background: var(--nexo-accent); color: var(--nexo-white);
    border-radius: 999px; font-size: .75rem; font-weight: 700;
    letter-spacing: .04em; text-transform: uppercase;
}
.nexo-badge--lg { font-size: .8rem; padding: 5px 14px; }

/* ============================================================
   SEARCH BAR
   ============================================================ */
.nexo-search-bar {
    background: var(--nexo-white);
    border: 1px solid var(--nexo-border);
    border-radius: var(--nexo-radius);
    padding: 20px 24px;
    margin-bottom: 32px;
    box-shadow: var(--nexo-shadow);
}
.nexo-search-form {
    display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end;
}
.nexo-search-field { display: flex; flex-direction: column; gap: 4px; flex: 1 1 160px; }
.nexo-search-field--sm  { flex: 0 1 130px; }
.nexo-search-field--submit { flex: 0 1 auto; }
.nexo-search-label { font-size: .75rem; font-weight: 600; color: var(--nexo-text-light); text-transform: uppercase; letter-spacing: .04em; }
.nexo-search-input,
.nexo-search-select {
    height: 44px; padding: 0 12px;
    border: 1.5px solid var(--nexo-border); border-radius: var(--nexo-radius-sm);
    font-size: .9rem; color: var(--nexo-text); background: var(--nexo-white);
    transition: border-color var(--nexo-transition);
}
.nexo-search-input:focus,
.nexo-search-select:focus { outline: none; border-color: var(--nexo-primary); }
.nexo-search-btn { height: 44px; padding: 0 24px; }
.nexo-search-clear { font-size: .8rem; color: var(--nexo-text-light); margin-left: 8px; text-decoration: underline; cursor: pointer; }

/* ============================================================
   LISTING GRID
   ============================================================ */
.nexo-results-bar { margin-bottom: 16px; }
.nexo-results-count { font-size: .9rem; color: var(--nexo-text-light); }

.nexo-grid { display: grid; gap: 28px; }
.nexo-grid--3col { grid-template-columns: repeat(3,1fr); }
.nexo-grid--2col { grid-template-columns: repeat(2,1fr); }

.nexo-card-property {
    background: var(--nexo-white);
    border-radius: var(--nexo-radius);
    overflow: hidden;
    box-shadow: var(--nexo-shadow);
    transition: transform var(--nexo-transition), box-shadow var(--nexo-transition);
}
.nexo-card-property:hover {
    transform: translateY(-4px);
    box-shadow: var(--nexo-shadow-lg);
}
.nexo-card-thumb {
    display: block; position: relative; overflow: hidden;
    aspect-ratio: 4/3;
}
.nexo-card-thumb img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform .4s ease;
}
.nexo-card-property:hover .nexo-card-thumb img { transform: scale(1.04); }
.nexo-card-thumb .nexo-badge { position: absolute; top: 12px; left: 12px; }

.nexo-card-body { padding: 20px; }
.nexo-card-title { font-size: 1rem; font-weight: 700; margin: 0 0 6px; line-height: 1.3; }
.nexo-card-title a { color: var(--nexo-text); text-decoration: none; }
.nexo-card-title a:hover { color: var(--nexo-primary); }
.nexo-card-location { font-size: .8rem; color: var(--nexo-text-light); margin: 0 0 12px; display: flex; align-items: center; gap: 4px; }
.nexo-card-specs { display: flex; gap: 14px; margin-bottom: 12px; font-size: .82rem; color: var(--nexo-text-light); }
.nexo-card-price { font-size: 1.2rem; font-weight: 800; color: var(--nexo-primary); margin: 0 0 14px; }
.nexo-card-price--poa { font-size: 1rem; font-weight: 600; color: var(--nexo-text-light); }

/* No results */
.nexo-no-results { text-align: center; padding: 60px 20px; color: var(--nexo-text-light); }

/* Pagination */
.page-numbers { list-style: none; padding: 0; margin: 40px 0 0; display: flex; gap: 8px; justify-content: center; }
.page-numbers li a,
.page-numbers li span {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: var(--nexo-radius-sm);
    border: 1.5px solid var(--nexo-border); color: var(--nexo-text);
    font-size: .9rem; text-decoration: none; transition: all var(--nexo-transition);
}
.page-numbers li .current { background: var(--nexo-primary); color: var(--nexo-white); border-color: var(--nexo-primary); }
.page-numbers li a:hover { border-color: var(--nexo-primary); color: var(--nexo-primary); }

/* ============================================================
   PROPERTY DETAIL
   ============================================================ */
.nexo-detail { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* Gallery */
.nexo-gallery { margin-bottom: 32px; }
.nexo-gallery__main {
    position: relative; border-radius: var(--nexo-radius); overflow: hidden;
    aspect-ratio: 16/9; background: #eee;
}
.nexo-gallery__main img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nexo-gallery__nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(255,255,255,.85); border: none; border-radius: 50%;
    width: 44px; height: 44px; font-size: 1.2rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--nexo-shadow);
    transition: background var(--nexo-transition);
}
.nexo-gallery__nav:hover { background: var(--nexo-white); }
.nexo-gallery__nav--prev { left: 12px; }
.nexo-gallery__nav--next { right: 12px; }
.nexo-gallery__thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; }
.nexo-gallery__thumb {
    width: 80px; height: 60px; object-fit: cover;
    border-radius: 6px; cursor: pointer; opacity: .65;
    border: 2px solid transparent;
    transition: opacity var(--nexo-transition), border-color var(--nexo-transition);
    flex-shrink: 0;
}
.nexo-gallery__thumb.active, .nexo-gallery__thumb:hover { opacity: 1; border-color: var(--nexo-primary); }

/* Detail body layout */
.nexo-detail__body {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 40px;
    align-items: start;
}
.nexo-detail__header { margin-bottom: 20px; }
.nexo-detail__title { font-size: 1.8rem; font-weight: 800; margin: 8px 0 4px; color: var(--nexo-text); line-height: 1.2; }
.nexo-detail__location { font-size: .9rem; color: var(--nexo-text-light); display: flex; align-items: center; gap: 6px; margin: 0; }

.nexo-detail__summary {
    background: var(--nexo-bg); border-radius: var(--nexo-radius);
    padding: 20px 24px; margin-bottom: 28px;
    display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
}
.nexo-price { font-size: 2rem; font-weight: 800; color: var(--nexo-primary); }
.nexo-price--poa { font-size: 1.3rem; }
.nexo-detail__specs { display: flex; gap: 20px; flex-wrap: wrap; }
.nexo-spec { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--nexo-text-light); }

.nexo-detail__description { margin-bottom: 32px; }
.nexo-detail__description h2,
.nexo-detail__features h2,
.nexo-detail__map h2 { font-size: 1.2rem; font-weight: 700; margin: 0 0 12px; color: var(--nexo-text); }

.nexo-features-list {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(160px,1fr));
    gap: 8px; list-style: none; padding: 0; margin: 0;
}
.nexo-features-list li {
    background: var(--nexo-bg); border-radius: var(--nexo-radius-sm);
    padding: 8px 12px; font-size: .85rem; color: var(--nexo-text);
}
.nexo-features-list li::before { content: '✓ '; color: var(--nexo-accent); font-weight: 700; }

.nexo-detail__map { margin-bottom: 32px; }
.nexo-detail__features { margin-bottom: 32px; }

/* ============================================================
   AGENT CARD
   ============================================================ */
.nexo-agent-card {
    background: var(--nexo-white);
    border: 1px solid var(--nexo-border);
    border-radius: var(--nexo-radius);
    padding: 24px;
    box-shadow: var(--nexo-shadow);
    margin-bottom: 20px;
}
.nexo-agent-card__inner { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.nexo-agent-avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; border: 3px solid var(--nexo-accent); }
.nexo-agent-card__name  { font-size: 1rem; font-weight: 700; margin: 0 0 2px; }
.nexo-agent-card__title { font-size: .8rem; color: var(--nexo-text-light); margin: 0; }
.nexo-agent-card__actions { display: flex; flex-direction: column; gap: 8px; }

/* ============================================================
   CONTACT FORM
   ============================================================ */
.nexo-contact-form {
    background: var(--nexo-white);
    border: 1px solid var(--nexo-border);
    border-radius: var(--nexo-radius);
    padding: 24px;
    box-shadow: var(--nexo-shadow);
    margin-bottom: 16px;
}
.nexo-contact-form h3 { font-size: 1rem; font-weight: 700; margin: 0 0 16px; }

.nexo-form-tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.nexo-tab {
    padding: 6px 14px; border-radius: 999px;
    border: 1.5px solid var(--nexo-border);
    background: transparent; font-size: .8rem; cursor: pointer;
    color: var(--nexo-text-light); transition: all var(--nexo-transition);
}
.nexo-tab.active, .nexo-tab:hover {
    background: var(--nexo-primary); color: var(--nexo-white); border-color: var(--nexo-primary);
}

.nexo-form-field { margin-bottom: 14px; }
.nexo-form-field label { display: block; font-size: .8rem; font-weight: 600; color: var(--nexo-text); margin-bottom: 4px; }
.nexo-form-field input,
.nexo-form-field textarea {
    width: 100%; padding: 10px 14px;
    border: 1.5px solid var(--nexo-border);
    border-radius: var(--nexo-radius-sm);
    font-size: .9rem; color: var(--nexo-text);
    transition: border-color var(--nexo-transition);
    box-sizing: border-box;
}
.nexo-form-field input:focus,
.nexo-form-field textarea:focus { outline: none; border-color: var(--nexo-primary); }
.nexo-form-field textarea { resize: vertical; }

#nexo-form-response { margin-top: 10px; font-size: .85rem; }
#nexo-form-response.nexo-success { color: #16a34a; }
#nexo-form-response.nexo-error   { color: #dc2626; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .nexo-detail__body { grid-template-columns: 1fr; }
    .nexo-detail__sidebar { order: -1; }
    .nexo-grid--3col { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 640px) {
    .nexo-grid--3col,
    .nexo-grid--2col { grid-template-columns: 1fr; }
    .nexo-search-form { flex-direction: column; }
    .nexo-search-field,
    .nexo-search-field--sm { flex: 1 1 100%; }
    .nexo-detail__summary { flex-direction: column; align-items: flex-start; }
    .nexo-detail__title { font-size: 1.4rem; }
    .nexo-price { font-size: 1.5rem; }
}
