/**
 * Display Village styles
 */

.sq-village {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    color: #1e293b;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

.sq-village-title {
    margin: 0 0 0.35rem;
    font-size: 1.75rem;
}

.sq-village-intro {
    color: #64748b;
    margin: 0 0 1.5rem;
}

.sq-village-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.sq-village-tab {
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #475569;
    padding: 0.6rem 1rem;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 600;
}

.sq-village-tab.is-active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.sq-village-filters {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.sq-village-filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
}

.sq-village-filter label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 0.25rem;
}

.sq-village-filter input,
.sq-village-filter select {
    width: 100%;
    padding: 0.5rem 0.65rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.9rem;
}

.sq-village-filter-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.sq-village-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
}

.sq-village-btn-primary {
    background: #2563eb;
    color: #fff;
}

.sq-village-btn-secondary {
    background: #fff;
    color: #334155;
    border-color: #cbd5e1;
}

.sq-village-count {
    color: #64748b;
    margin: 0 0 1rem;
}

.sq-village-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.sq-village-grid.is-loading {
    opacity: 0.7;
}

.sq-village-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.sq-village-card-image {
    aspect-ratio: 16 / 10;
    background: #e2e8f0;
    overflow: hidden;
}

.sq-village-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sq-village-card-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
}

.sq-village-card-body {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.sq-village-card-title {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
}

.sq-village-card-location {
    color: #64748b;
    font-size: 0.85rem;
    margin: 0 0 0.5rem;
}

.sq-village-card-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: #64748b;
    padding: 0.5rem 0;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
}

.sq-village-card-types {
    font-size: 0.8rem;
    color: #64748b;
    margin: 0.5rem 0 0;
}

.sq-village-card-price {
    margin: 0.75rem 0 0;
    color: #2563eb;
}

.sq-village-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.75rem;
}

.sq-village-card-actions .sq-village-btn {
    flex: 1;
}

.sq-village-empty,
.sq-village-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    color: #64748b;
}

/* Detail modal */
.sq-village-detail[hidden] {
    display: none !important;
}

.sq-village-detail {
    position: fixed;
    inset: 0;
    z-index: 100000;
}

.sq-village-detail-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
}

.sq-village-detail-panel {
    position: relative;
    z-index: 1;
    max-width: 720px;
    max-height: 90vh;
    overflow-y: auto;
    margin: 5vh auto;
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.sq-village-detail-close {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    border: 0;
    background: transparent;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    color: #64748b;
}

.sq-village-detail-hero img {
    width: 100%;
    border-radius: 8px;
    margin: 0.75rem 0;
}

.sq-village-detail-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 0.75rem;
}

.sq-village-detail-price {
    font-size: 1.2rem;
    color: #2563eb;
    font-weight: 700;
}

.sq-village-thumb-section h3 {
    font-size: 1rem;
    margin: 1rem 0 0.5rem;
}

.sq-village-thumb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.75rem;
}

.sq-village-thumb-grid .sq-thumb-lightbox {
    display: block;
    text-decoration: none;
    color: inherit;
    text-align: center;
}

.sq-village-thumb-grid img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    cursor: zoom-in;
}

.sq-village-thumb-grid span {
    display: block;
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.25rem;
}

.sq-village-detail-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.25rem;
}

body.sq-village-modal-open,
body.sq-lightbox-open {
    overflow: hidden;
}

/* Lightbox */
.sq-lightbox[hidden] {
    display: none !important;
}

.sq-lightbox {
    position: fixed;
    inset: 0;
    z-index: 100001;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.sq-lightbox-stage {
    max-width: 90vw;
    max-height: 75vh;
}

.sq-lightbox-stage img {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
}

.sq-lightbox-close,
.sq-lightbox-prev,
.sq-lightbox-next {
    position: absolute;
    border: 0;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 2rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
}

.sq-lightbox-close {
    top: 1rem;
    right: 1rem;
}

.sq-lightbox-prev {
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

.sq-lightbox-next {
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

.sq-lightbox-caption {
    color: #e2e8f0;
    margin-top: 0.75rem;
    text-align: center;
}

/* Wizard design detail (shared classes) */
.sq-design-detail-modal .sq-village-thumb-grid,
.sq-wizard-container .sq-village-thumb-grid {
    margin-top: 0.75rem;
}

.sq-service-card-thumb {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.sq-service-card-price {
    color: #2563eb;
    font-weight: 700;
    font-size: 0.95rem;
    margin: 0.25rem 0 0;
}

.sq-service-card-specs {
    font-size: 0.8rem;
    color: #64748b;
    margin: 0.25rem 0 0;
}

.sq-design-detail-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
}

.sq-design-detail-modal[hidden] {
    display: none !important;
}

.sq-design-detail-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
}

.sq-design-detail-panel {
    position: relative;
    z-index: 1;
    max-width: 640px;
    max-height: 90vh;
    overflow-y: auto;
    margin: 5vh auto;
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.sq-design-detail-close {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    border: 0;
    background: transparent;
    font-size: 1.75rem;
    cursor: pointer;
    color: #64748b;
}

.sq-design-detail-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}
