/* =============================================
   TIPERUMAH.CSS — Public Tipe Rumah Page Styles
   Bukit Shangrilla Asri
   ============================================= */

/* ── Section Wrapper ── */
.tr-section {
    max-width: 1440px;
    margin: 0 auto;
    padding: 64px 80px;
}

@media (max-width: 1024px) {
    .tr-section {
        padding: 48px 32px;
    }
}

@media (max-width: 640px) {
    .tr-section {
        padding: 40px 20px;
    }
}

/* ── Page Header ── */
.tr-header {
    text-align: center;
    margin-bottom: 48px;
}

.tr-header h1 {
    font-size: 2.25rem;
    font-weight: 800;
    color: #1a1a1a;
    letter-spacing: -0.5px;
    margin-bottom: 10px;
    line-height: 1.2;
}

.tr-header p {
    font-size: 1rem;
    color: #6b7280;
    max-width: 480px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ── Grid Layout ── */
.tr-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

@media (max-width: 1024px) {
    .tr-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 640px) {
    .tr-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }
}

/* ── Card ── */
.tr-card {
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    cursor: default;
}

.tr-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.13);
}

/* ── Card Image ── */
.tr-card-img {
    position: relative;
    height: 210px;
    overflow: hidden;
    background: #f3f4f6;
}

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

.tr-card:hover .tr-card-img img {
    transform: scale(1.06);
}

/* ── Badges ── */
.tr-badge {
    position: absolute;
    top: 12px;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 50px;
    letter-spacing: 0.3px;
}

.tr-badge-diskon {
    left: 12px;
    background: #ef4444;
    color: #ffffff;
}

.tr-badge-status {
    right: 12px;
}

.tr-badge-tersedia {
    background: #d1fae5;
    color: #065f46;
}

.tr-badge-habis {
    background: #fee2e2;
    color: #991b1b;
}

/* ── Card Body ── */
.tr-card-body {
    padding: 20px 22px 22px;
}

.tr-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 5px;
}

.tr-card-meta {
    font-size: 0.78rem;
    color: #9ca3af;
    margin-bottom: 14px;
}

.tr-card-meta span {
    margin: 0 4px;
    opacity: 0.5;
}

/* ── Pricing ── */
.tr-price-original {
    font-size: 0.82rem;
    color: #9ca3af;
    text-decoration: line-through;
    margin-bottom: 2px;
}

.tr-price-main {
    font-size: 1.35rem;
    font-weight: 800;
    color: #1a1a1a;
    line-height: 1.2;
}

.tr-price-main.is-diskon {
    color: #ef4444;
}

/* ── Description ── */
.tr-card-desc {
    font-size: 0.82rem;
    color: #6b7280;
    line-height: 1.55;
    margin-top: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Empty State ── */
.tr-empty {
    text-align: center;
    padding: 80px 20px;
    color: #9ca3af;
}

.tr-empty svg {
    width: 72px;
    height: 72px;
    margin: 0 auto 16px;
    color: #d1d5db;
    display: block;
}

.tr-empty p {
    font-size: 1rem;
    font-weight: 500;
}

/* =============================================
   ADMIN TABLE STYLES — Tabel Tipe Rumah
   ============================================= */

/* ── Search Bar ── */
.tr-search-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.tr-search-input-wrap {
    position: relative;
    flex: 1;
    min-width: 220px;
    max-width: 420px;
}

.tr-search-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
}

.tr-search-input {
    width: 100%;
    padding: 9px 38px 9px 38px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.875rem;
    color: #111827;
    background: #ffffff;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.tr-search-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.tr-search-input::placeholder {
    color: #b0bac8;
}

.tr-search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: #e5e7eb;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    padding: 0;
}

.tr-search-clear:hover {
    background: #d1d5db;
    color: #374151;
}

.tr-search-clear.hidden {
    display: none;
}

.tr-search-count {
    font-size: 0.8rem;
    color: #6b7280;
    white-space: nowrap;
    font-weight: 500;
}

/* ── Wrapper Tabel ── */
.tr-table-wrapper {
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08), 0 0 0 1px #e5e7eb;
    overflow: hidden;
}

/* ── Table ── */
.tr-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

/* ── Thead ── */
.tr-table thead {
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
}

.tr-table thead th {
    padding: 13px 16px;
    text-align: left;
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    white-space: nowrap;
    border-right: 1px solid #e9edf2;
}

.tr-table thead th:last-child {
    border-right: none;
    text-align: center;
}

.tr-table thead th.center {
    text-align: center;
}

/* ── Tbody rows ── */
.tr-table tbody tr {
    border-bottom: 1px solid #e9edf2;
    transition: background 0.15s ease;
}

.tr-table tbody tr:last-child {
    border-bottom: none;
}

.tr-table tbody tr:hover {
    background: #f1f5fb;
}

/* ── Tbody cells ── */
.tr-table tbody td {
    padding: 12px 16px;
    color: #374151;
    vertical-align: middle;
    border-right: 1px solid #e9edf2;
}

.tr-table tbody td:last-child {
    border-right: none;
}

.tr-table tbody td.center {
    text-align: center;
}

/* ── Thumbnail gambar ── */
.tr-thumb {
    width: 68px;
    height: 52px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #f3f4f6;
    display: block;
}

/* ── Nama tipe ── */
.tr-cell-name {
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
}

/* ── Ukuran (LB / LT) ── */
.tr-cell-ukuran {
    color: #6b7280;
    white-space: nowrap;
}

/* ── Harga ── */
.tr-cell-harga {
    font-weight: 500;
    color: #1e293b;
    white-space: nowrap;
}

.tr-cell-diskon-harga {
    font-weight: 500;
    color: #16a34a;
    white-space: nowrap;
}

/* ── Badge Diskon ── */
.tr-badge-on {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #dcfce7;
    color: #15803d;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 50px;
}

.tr-badge-off {
    display: inline-flex;
    align-items: center;
    background: #f1f5f9;
    color: #94a3b8;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 50px;
}

/* ── Stok ── */
.tr-stok {
    font-weight: 700;
    color: #1e293b;
}

/* ── Tombol Aksi ── */
.tr-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.tr-btn-edit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #2563eb;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

.tr-btn-edit:hover {
    background: #dbeafe;
    border-color: #93c5fd;
    transform: scale(1.08);
}

.tr-btn-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid #fecaca;
    background: #fff1f2;
    color: #dc2626;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

.tr-btn-delete:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    transform: scale(1.08);
}

/* ── Empty state row ── */
.tr-empty-row td {
    padding: 48px 20px;
    text-align: center;
    color: #9ca3af;
    font-size: 0.9rem;
}

/* ── Page header row ── */
.tr-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.tr-page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
}

.tr-page-header p {
    font-size: 0.82rem;
    color: #6b7280;
    margin-top: 3px;
}

/* =============================================
   ADMIN MODAL STYLES — Tambah & Edit Tipe Rumah
   ============================================= */

/* ── Overlay ── */
.tr-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.tr-modal-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

/* ── Modal Box ── */
.tr-modal-box {
    background: #ffffff;
    border-radius: 20px;
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.2);
    transform: translateY(24px) scale(0.97);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tr-modal-overlay.is-open .tr-modal-box {
    transform: translateY(0) scale(1);
}

/* ── Scrollbar inside modal ── */
.tr-modal-box::-webkit-scrollbar {
    width: 5px;
}

.tr-modal-box::-webkit-scrollbar-track {
    background: #f9fafb;
}

.tr-modal-box::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 10px;
}

/* ── Modal Header ── */
.tr-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #f3f4f6;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
}

.tr-modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #111827;
}

.tr-modal-close {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: #f3f4f6;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

.tr-modal-close:hover {
    background: #e5e7eb;
    color: #111827;
}

/* ── Modal Form Body ── */
.tr-modal-body {
    padding: 24px;
}

.tr-modal-body .form-group {
    margin-bottom: 16px;
}

.tr-modal-body .form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.tr-modal-body .form-group label .req {
    color: #ef4444;
    margin-left: 2px;
}

.tr-modal-body .form-input {
    width: 100%;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.875rem;
    color: #111827;
    background: #fafafa;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    font-family: inherit;
}

.tr-modal-body .form-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    background: #fff;
}

.tr-modal-body textarea.form-input {
    resize: none;
}

/* ── Two-column grid ── */
.tr-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

/* ── Three-column grid ── */
.tr-form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

/* ── Checkbox toggle ── */
.tr-checkbox-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    background: #fafafa;
    transition: border-color 0.2s, background 0.2s;
}

.tr-checkbox-wrap:hover {
    border-color: #2563eb;
    background: #eff6ff;
}

.tr-checkbox-wrap input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #2563eb;
    cursor: pointer;
    flex-shrink: 0;
}

.tr-checkbox-wrap label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    margin: 0;
}

.tr-checkbox-wrap label .highlight {
    color: #16a34a;
    font-weight: 700;
}

/* ── File input ── */
.tr-file-input {
    width: 100%;
    border: 1.5px dashed #d1d5db;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.82rem;
    background: #fafafa;
    cursor: pointer;
    transition: border-color 0.2s;
}

.tr-file-input:hover {
    border-color: #2563eb;
}

.tr-file-hint {
    font-size: 0.72rem;
    color: #9ca3af;
    margin-top: 4px;
}

/* ── Modal Footer / Submit ── */
.tr-modal-footer {
    padding: 16px 24px 24px;
}

.tr-btn-submit {
    display: block;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
    letter-spacing: 0.2px;
}

.tr-btn-submit:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}

.tr-btn-submit:active {
    transform: translateY(0);
}

/* ── Open Modal Button (Tambah) ── */
.tr-btn-tambah {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
    text-decoration: none;
}

.tr-btn-tambah:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.4);
}