/* Real Estate Apartments - Clean final style V4
   تعديل نهائي: إطار موحد، عنوان ذهبي، بدون قائمة أنواع تحت العنوان، وجوال بطاقتين في كل صف. */

/* General */
.rea-archive-wrapper {
    font-family: 'Tajawal', sans-serif;
    direction: rtl;
    background: #f4f6f8;
    padding: 30px 15px;
    box-sizing: border-box;
}

.rea-archive-inner {
    max-width: 1200px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Brand Title */
.rea-brand-title {
    text-align: center;
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 22px;
    padding: 16px 14px;
    background: linear-gradient(135deg, #2F2F2F, #3A3A3A);
    color: #C9A24D !important;
    border-bottom: 3px solid #C9A24D;
    border-radius: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    line-height: 1.6;
}

/* إلغاء قائمة الأنواع القديمة إن ظهرت من أي كاش أو نسخة سابقة */
.rea-type-filter {
    display: none !important;
}

/* Search Bar */
.rea-search-bar {
    background: #fff;
    padding: 20px;
    border-radius: 14px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    display: flex;
    gap: 10px;
    margin-bottom: 26px;
    justify-content: center;
    flex-wrap: wrap;
    box-sizing: border-box;
}

.rea-search-bar select,
.rea-search-bar input {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    min-width: 200px;
    flex: 1;
    font-family: inherit;
    background: #fff;
    min-height: 44px;
    box-sizing: border-box;
}

.rea-search-bar button {
    background: #BFA26B;
    color: #fff;
    border: none;
    padding: 10px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 800;
    font-family: inherit;
    min-height: 44px;
}

.rea-search-bar button:hover {
    background: #a28856;
}

/* Grid */
.rea-apartments-grid-wrapper {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    align-items: stretch;
    box-sizing: border-box;
}

/* Card */
.rea-card {
    background: #fff;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s;
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
    border: 1px solid rgba(191,162,107,0.16);
    box-sizing: border-box;
}

.rea-card:hover {
    transform: translateY(-5px);
}

/* Image frame - موحد لكل البطاقات */
.rea-card .rea-card-img-link,
.rea-apartments-grid-wrapper .rea-card .rea-card-img-link {
    display: block !important;
    position: relative !important;
    width: 100% !important;
    height: 280px !important;
    overflow: hidden !important;
    border: 10px solid #4A453D !important;
    border-bottom: 0 !important;
    background: #4A453D !important;
    border-radius: 15px 15px 0 0 !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    text-decoration: none !important;
}

.rea-card .rea-card-img-link::before,
.rea-card .rea-card-img-link::after {
    content: none !important;
    display: none !important;
}

.rea-card .rea-card-image,
.rea-apartments-grid-wrapper .rea-card .rea-card-image {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center center !important;
    border: 0 !important;
    border-radius: 4px 4px 0 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    box-sizing: border-box !important;
}

/* Price Overlay */
.rea-price-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(35, 35, 35, 0.88);
    color: #fff;
    padding: 8px 15px;
    text-align: right;
    font-weight: 800;
    font-size: 15px;
    z-index: 5;
    box-sizing: border-box;
    line-height: 1.4;
}

/* Badges */
.rea-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #BFA26B;
    color: #fff;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 800;
    z-index: 6;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.rea-badge.rented {
    background: #e74c3c !important;
}

.rea-type-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(47,47,47,0.88);
    color: #fff;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 800;
    z-index: 6;
}

/* Body */
.rea-card-body {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    box-sizing: border-box;
}

.rea-head {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 15px;
}

.rea-head h3 {
    margin: 0;
    font-size: 16px;
    color: #333;
    line-height: 1.55;
    font-weight: 800;
}

.rea-features {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.rea-features span {
    font-size: 13px;
    color: #666;
    background: #f9f9f9;
    padding: 5px 10px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    box-sizing: border-box;
}

.rea-features i {
    color: #BFA26B;
}

.rea-loc {
    color: #888;
    font-size: 13px;
    margin-bottom: 15px;
    line-height: 1.5;
}

.rea-wa-btn {
    margin-top: auto;
    background: #BFA26B;
    color: #fff !important;
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 800;
    display: block;
    transition: background 0.3s;
}

.rea-wa-btn:hover {
    background: #a28856;
    color: #fff !important;
}

.rea-empty,
.rea-no-items {
    grid-column: 1 / -1;
    text-align: center;
    background: #fff;
    padding: 22px;
    border-radius: 12px;
    color: #555;
}

/* Frontend Admin Panel */
.rea-frontend-admin {
    font-family: 'Tajawal', sans-serif;
    direction: rtl;
    max-width: 1220px;
    margin: 30px auto;
    padding: 0 15px 30px;
    color: #2f2f2f;
    box-sizing: border-box;
}

.rea-access-box {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    padding: 30px;
    text-align: center;
}

.rea-admin-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    background: linear-gradient(135deg, #2F2F2F, #3A3A3A);
    color: #fff;
    padding: 24px;
    border-radius: 22px;
    border-bottom: 4px solid #C9A24D;
    margin-bottom: 22px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    box-sizing: border-box;
}

.rea-admin-head h1,
.rea-admin-head p {
    margin: 0;
}

.rea-admin-head h1,
.rea-frontend-admin .rea-admin-head h1 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 0;
    color: #C9A24D !important;
}

.rea-admin-head p {
    color: rgba(255,255,255,0.82);
}

.rea-admin-head-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.rea-admin-view-site {
    background: #BFA26B;
    color: #fff !important;
    border-radius: 999px;
    padding: 11px 18px;
    text-decoration: none;
    white-space: nowrap;
    font-weight: 800;
}

.rea-admin-view-site.logout {
    background: #f3f0e8;
    color: #2f2f2f !important;
}

.rea-admin-card {
    background: #fff;
    border-radius: 18px;
    padding: 22px;
    margin-bottom: 24px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.07);
    border: 1px solid #f0eadc;
    box-sizing: border-box;
}

.rea-admin-card h2 {
    margin-top: 0;
    font-size: 22px;
    font-weight: 800;
    color: #2f2f2f;
}

.rea-admin-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.rea-admin-field {
    flex: 1 1 220px;
}

.rea-admin-wide {
    flex-basis: 100%;
}

.rea-admin-field label {
    display: block;
    font-weight: 800;
    margin-bottom: 6px;
    color: #343434;
}

.rea-admin-field input,
.rea-admin-field select,
.rea-admin-field textarea,
.rea-admin-filters select {
    width: 100%;
    min-height: 44px;
    border: 1px solid #e1dccf;
    border-radius: 10px;
    padding: 10px 12px;
    background: #fff;
    font-family: inherit;
    box-sizing: border-box;
}

.rea-admin-field textarea {
    min-height: 120px;
}

.rea-admin-field small {
    display: block;
    margin-top: 7px;
    color: #777;
}

.rea-admin-current-image {
    margin-bottom: 10px;
}

.rea-admin-current-image img {
    max-width: 180px;
    height: auto;
    border-radius: 12px;
    background: #f5efe2;
    border: 4px solid #4A453D;
    box-sizing: border-box;
    padding: 2px;
}

.rea-admin-actions,
.rea-row-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
    margin-top: 18px;
}

.rea-admin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: #BFA26B;
    color: #fff !important;
    border-radius: 10px;
    padding: 11px 18px;
    text-decoration: none;
    font-family: inherit;
    font-weight: 800;
    cursor: pointer;
    line-height: 1.2;
}

.rea-admin-btn.primary {
    background: #2F2F2F;
}

.rea-admin-btn.secondary {
    background: #f3f0e8;
    color: #2f2f2f !important;
}

.rea-admin-btn.danger {
    background: #e74c3c;
}

.rea-admin-btn.small {
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
}

.rea-admin-notice {
    padding: 13px 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-weight: 800;
}

.rea-admin-notice.success {
    background: #eaf8ef;
    color: #1f7a3e;
}

.rea-admin-notice.danger {
    background: #fdeceb;
    color: #a43126;
}

.rea-list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.rea-list-head h2 {
    margin: 0;
}

.rea-admin-filters {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.rea-admin-filters select {
    min-width: 150px;
    width: auto;
}

.rea-admin-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.rea-admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 850px;
}

.rea-admin-table th,
.rea-admin-table td {
    border-bottom: 1px solid #f0eadc;
    padding: 12px 10px;
    text-align: right;
    vertical-align: middle;
}

.rea-admin-table th {
    background: #faf8f1;
    font-weight: 800;
}

.rea-admin-thumb img {
    width: 58px;
    height: 58px;
    object-fit: cover;
    border-radius: 10px;
    background: #f5efe2;
    border: 3px solid #4A453D;
    box-sizing: border-box;
    padding: 1px;
}

.rea-type-chip {
    display: inline-flex;
    background: #f4efe4;
    color: #6f5929;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

/* Login */
.rea-login-box {
    max-width: 520px;
}

.rea-login-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: right;
    margin-top: 18px;
}

.rea-login-form label {
    font-weight: 800;
    color: #343434;
}

.rea-login-form input {
    width: 100%;
    min-height: 46px;
    border: 1px solid #e1dccf;
    border-radius: 10px;
    padding: 10px 12px;
    background: #fff;
    font-family: inherit;
    box-sizing: border-box;
}

.rea-login-form button {
    margin-top: 8px;
    width: 100%;
}

/* Single page basic support */
.rea-single-wrapper {
    direction: rtl;
    font-family: 'Tajawal', sans-serif;
    background: #f4f6f8;
    padding: 30px 15px;
}

.rea-single-inner {
    max-width: 1100px;
    margin: 0 auto;
}

.rea-single-main-image {
    background: #4A453D;
    border: 10px solid #4A453D;
    border-radius: 18px;
    overflow: hidden;
    box-sizing: border-box;
}

.rea-single-main-image img {
    display: block;
    width: 100%;
    height: auto;
}

/* Mobile: بطاقتين في كل صف */
@media (max-width: 767px) {
    .rea-archive-wrapper {
        padding: 16px 7px !important;
    }

    .rea-archive-inner {
        max-width: 100% !important;
        width: 100% !important;
    }

    .rea-brand-title {
        font-size: 20px !important;
        padding: 12px 10px !important;
        border-radius: 18px !important;
        margin-bottom: 14px !important;
    }

    .rea-search-bar {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
        padding: 12px !important;
        margin-bottom: 14px !important;
        border-radius: 14px !important;
    }

    .rea-search-bar select,
    .rea-search-bar input,
    .rea-search-bar button {
        min-width: 0 !important;
        width: 100% !important;
        min-height: 40px !important;
        font-size: 12px !important;
        padding: 8px 7px !important;
    }

    .rea-search-bar button {
        grid-column: 1 / -1 !important;
    }

    .rea-apartments-grid-wrapper {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
        width: 100% !important;
    }

    .rea-apartments-grid-wrapper > .rea-card,
    .rea-card {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        border-radius: 13px !important;
        overflow: hidden !important;
        box-shadow: 0 4px 12px rgba(0,0,0,0.08) !important;
    }

    .rea-card .rea-card-img-link,
    .rea-apartments-grid-wrapper .rea-card .rea-card-img-link {
        height: 138px !important;
        min-height: 138px !important;
        border-width: 7px !important;
        border-bottom: 0 !important;
        border-radius: 13px 13px 0 0 !important;
    }

    .rea-card .rea-card-image,
    .rea-apartments-grid-wrapper .rea-card .rea-card-image {
        object-fit: cover !important;
        object-position: center center !important;
        border-radius: 3px 3px 0 0 !important;
    }

    .rea-price-overlay {
        font-size: 10.5px !important;
        padding: 5px 6px !important;
        line-height: 1.25 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .rea-badge,
    .rea-type-badge {
        top: 7px !important;
        font-size: 9.5px !important;
        padding: 3px 6px !important;
        border-radius: 999px !important;
        max-width: 72px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .rea-badge {
        right: 7px !important;
    }

    .rea-type-badge {
        left: 7px !important;
    }

    .rea-card-body {
        padding: 9px 8px 10px !important;
    }

    .rea-head {
        margin-bottom: 7px !important;
    }

    .rea-head h3 {
        font-size: 11.5px !important;
        line-height: 1.45 !important;
        min-height: 33px !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
    }

    .rea-features {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 5px !important;
        margin-bottom: 8px !important;
        padding-bottom: 8px !important;
    }

    .rea-features span {
        justify-content: center !important;
        font-size: 9.5px !important;
        padding: 4px 3px !important;
        gap: 3px !important;
        min-width: 0 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .rea-loc {
        font-size: 10.5px !important;
        margin-bottom: 8px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .rea-wa-btn {
        padding: 7px 5px !important;
        font-size: 11px !important;
        border-radius: 7px !important;
        white-space: nowrap !important;
    }

    .rea-admin-head,
    .rea-list-head,
    .rea-admin-filters {
        align-items: stretch;
        flex-direction: column;
    }

    .rea-admin-head-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .rea-admin-view-site,
    .rea-admin-btn,
    .rea-admin-filters select {
        width: 100%;
    }

    .rea-admin-card {
        padding: 16px;
    }
}

/* موبايلات ضيقة جدًا: نبقي بطاقتين لكن بصورة أقل ارتفاعًا */
@media (max-width: 380px) {
    .rea-card .rea-card-img-link,
    .rea-apartments-grid-wrapper .rea-card .rea-card-img-link {
        height: 124px !important;
        min-height: 124px !important;
        border-width: 6px !important;
    }

    .rea-card-body {
        padding: 8px 7px 9px !important;
    }

    .rea-head h3 {
        font-size: 10.8px !important;
    }

    .rea-features span {
        font-size: 9px !important;
    }
}
