/**
 * Listing Grid Styles for Artha Properti.
 */

:root {
    --apt-primary-cyan: #1DB2C9;
    --apt-cyan-hover: #148ea1;
    --apt-midnight-navy: #06323E;
    --apt-steel-blue: #1D4656;
    --apt-wa-green: #0F7C6F;
    --apt-wa-hover: #075E54;
    --apt-pale-mint: #EEF9FA;
    --apt-bg-body: #F8F9FA;
    --apt-text-primary: #151314;
    --apt-text-secondary: #3E3A39;
    --apt-text-muted: #697891;
    --apt-border-soft: #E5E7EB;
    --apt-font-heading: 'Montserrat', -apple-system, sans-serif;
    --apt-font-body: 'Lato', -apple-system, sans-serif;
}

.apt-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
    font-family: var(--apt-font-body);
}

.apt-listing-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px;
    margin-bottom: 40px;
}

.apt-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.apt-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.apt-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 1024px) {
    .apt-listing-grid,
    .apt-cols-3,
    .apt-cols-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 24px;
    }
}

@media (max-width: 640px) {
    .apt-listing-grid,
    .apt-cols-2,
    .apt-cols-3,
    .apt-cols-4 {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

.apt-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid rgba(229, 231, 235, 0.9);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.apt-card:hover {
    transform: translateY(-4px);
    border-color: rgba(29, 178, 201, 0.4);
    box-shadow: 0 20px 25px -5px rgba(6, 50, 62, 0.08), 0 8px 10px -6px rgba(6, 50, 62, 0.04);
}

.apt-card-image-wrap {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #f1f5f9;
}

.apt-card-image-wrap a {
    display: block;
    width: 100%;
    height: 100%;
}

.apt-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.apt-card:hover .apt-card-image {
    transform: scale(1.05);
}

.apt-badge-status {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    z-index: 2;
}

.apt-badge-status.dijual {
    background: var(--apt-midnight-navy);
}

.apt-badge-status.disewa {
    background: var(--apt-steel-blue);
}

.apt-badge-code {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(6, 50, 62, 0.85);
    backdrop-filter: blur(4px);
    color: #a5f3fc;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-family: monospace;
    font-weight: 600;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 2;
}

.apt-card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.apt-card-price {
    font-family: var(--apt-font-heading);
    font-size: 20px;
    font-weight: 800;
    color: var(--apt-midnight-navy);
    margin-bottom: 8px;
    line-height: 1.2;
}

.apt-card-title {
    font-family: var(--apt-font-heading);
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 14px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.apt-card-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.apt-card-title a:hover,
.apt-card:hover .apt-card-title a {
    color: var(--apt-primary-cyan);
}

.apt-card-specs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 12px 0;
    margin-top: auto;
    margin-bottom: 16px;
    border-top: 1px solid #f3f4f6;
    border-bottom: 1px solid #f3f4f6;
    text-align: center;
    font-size: 12px;
    color: #374151;
}

.apt-spec-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.apt-spec-item svg {
    width: 15px;
    height: 15px;
    color: var(--apt-steel-blue);
    flex-shrink: 0;
}

.apt-btn-whatsapp,
a.apt-btn-whatsapp,
.apt-card-content a.apt-btn-whatsapp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    background: var(--apt-wa-green) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 12px;
    font-family: var(--apt-font-heading);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.apt-btn-whatsapp:hover,
a.apt-btn-whatsapp:hover,
.apt-card-content a.apt-btn-whatsapp:hover,
.apt-btn-whatsapp:focus,
a.apt-btn-whatsapp:focus,
.apt-btn-whatsapp:active,
a.apt-btn-whatsapp:active {
    background: var(--apt-wa-hover) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(18, 140, 126, 0.25);
    color: #ffffff !important;
    border: none !important;
    text-decoration: none !important;
}

.apt-btn-whatsapp svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    flex-shrink: 0;
}

.apt-pagination-wrap {
    display: flex;
    justify-content: center;
    margin: 40px 0;
}

.apt-pagination {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.apt-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid var(--apt-border-soft);
    background: #ffffff;
    color: var(--apt-midnight-navy);
    font-family: var(--apt-font-heading);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.apt-pagination .page-numbers:hover {
    background: var(--apt-primary-cyan);
    border-color: var(--apt-primary-cyan);
    color: #ffffff;
}

.apt-pagination .page-numbers.current {
    background: var(--apt-midnight-navy);
    border-color: var(--apt-midnight-navy);
    color: #ffffff;
}

.apt-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: #ffffff;
    border-radius: 20px;
    border: 1px dashed #d1d5db;
}

.apt-empty-state h3 {
    font-family: var(--apt-font-heading);
    font-size: 20px;
    color: var(--apt-midnight-navy);
    margin-bottom: 10px;
}

.apt-empty-state p {
    color: var(--apt-text-muted);
    font-size: 15px;
    max-width: 480px;
    margin: 0 auto;
}

.apt-loading-overlay {
    opacity: 0.5;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
