/* ==========================================================
   AGENCY DESKTOP STYLE (Giao diện Hệ thống Đại lý trên Desktop)
   ========================================================== */

/* Khung tổng thể Desktop */
.agency-desktop-container,
.agency-sidebar,
.agency-main-content,
.agency-detail-box,
.agency-detail-title,
.agency-detail-info,
.agency-card {
    text-align: left !important;
    box-sizing: border-box;
}

.agency-desktop-container {
    display: flex;
    gap: 24px;
    max-width: 1200px;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ----------------------------------------------------------
   Cột Sidebar Trái (Danh mục khu vực / Tỉnh thành)
   ---------------------------------------------------------- */
.agency-sidebar {
    width: 220px;
    flex-shrink: 0;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 16px;
}

.agency-sidebar h2 {
    font-size: 16px;
    font-weight: 700;
    color: #1b5e20;
    text-transform: uppercase;
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #2e7d32;
}

.agency-sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.agency-sidebar-menu li {
    margin-bottom: 8px;
}

.agency-sidebar-menu a {
    text-decoration: none;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    display: block;
    padding: 6px 10px;
    border-radius: 4px;
    transition: all 0.2s;
}

.agency-sidebar-menu a:hover,
.agency-sidebar-menu a.doimau {
    background: #e8f5e9;
    color: #2e7d32;
    font-weight: 700;
}

/* ----------------------------------------------------------
   Cột Nội dung Phải (Khung chính)
   ---------------------------------------------------------- */
.agency-main-content {
    flex-grow: 1;
}

/* Thanh Điều Hướng Breadcrumb Nav */
.agency-breadcrumb {
    list-style: none;
    padding: 10px 14px;
    margin: 0 0 20px 0;
    background: #f1f3f5;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.agency-breadcrumb a {
    color: #2e7d32;
    text-decoration: none;
    font-weight: 600;
}

.agency-breadcrumb select {
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #ccc;
    font-size: 13px;
    background-color: #ffffff;
    cursor: pointer;
}

/* ----------------------------------------------------------
   Grid Danh Sách Đại Lý (2 cột trên Desktop)
   ---------------------------------------------------------- */
.agency-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.agency-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.03);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.agency-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.agency-card-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.agency-card-title a {
    color: #1b5e20;
    text-decoration: none;
}

.agency-card-title a:hover {
    color: #2e7d32;
}

.agency-card-address {
    font-size: 14px;
    color: #555;
    margin-bottom: 12px;
    line-height: 1.5;
    flex-grow: 1; /* Đảm bảo các nút phía dưới luôn nằm thẳng hàng ngang */
}

/* KHẮC PHỤC LỖI NÚT XEM CHI TIẾT CĂN GIỮA DẠNG BUTTON */
.agency-card-link {
    display: block !important;
    width: fit-content;
    margin: 12px auto 0 auto !important; /* Căn giữa tự động */
    padding: 6px 20px;
    color: #2e7d32;
    border: 1px solid #2e7d32;
    border-radius: 20px;
    font-weight: 600;
    font-size: 12px;
    text-decoration: none !important;
    background: #ffffff;
    transition: all 0.2s ease;
    text-align: center !important;
}

.agency-card-link:hover {
    background: #2e7d32;
    color: #ffffff !important;
}

/* ----------------------------------------------------------
   Đại Lý Nổi Bật (Featured Agency Styling)
   ---------------------------------------------------------- */
.agency-card.featured,
.agency-detail-box.featured {
    border: 2px solid #2e7d32 !important;
    background-color: #f1f8e9 !important;
    position: relative;
    box-shadow: 0 4px 10px rgba(46, 125, 50, 0.12);
}

.agency-card.featured .agency-card-link {
    background-color: #2e7d32;
    color: #ffffff;
}

.agency-card.featured .agency-card-link:hover {
    background-color: #1b5e20;
}

.agency-badge-hot {
    display: inline-block;
    background-color: #d32f2f;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    margin-left: 6px;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* ----------------------------------------------------------
   Trang Chi Tiết 1 Đại Lý
   ---------------------------------------------------------- */
.agency-detail-box {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 24px;
}

.agency-detail-title {
    font-size: 22px;
    color: #1b5e20;
    margin: 0 0 16px 0;
    font-weight: 700;
}

.agency-detail-info p {
    font-size: 15px;
    margin: 8px 0;
    color: #333;
    line-height: 1.6;
}

/* Banner Showroom */
.agency-banner-img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}
/* ----------------------------------------------------------
   Phân trang Desktop (Pagination)
   ---------------------------------------------------------- */
.agency-desktop-pagination {
    margin-top: 24px;
    margin-bottom: 12px;
    text-align: center !important;
    font-size: 14px;
}

.agency-desktop-pagination a, 
.agency-desktop-pagination span {
    display: inline-block;
    padding: 6px 12px;
    margin: 0 3px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.agency-desktop-pagination a:hover {
    background-color: #e8f5e9;
    border-color: #2e7d32;
    color: #2e7d32;
}

.agency-desktop-pagination span.hientai {
    background-color: #2e7d32;
    color: #ffffff;
    border-color: #2e7d32;
    font-weight: 700;
}