/* ============================================
   Agency Pages — Profile & For Sale
   ============================================ */

/* Match search-results page container width and search card appearance */
.agency-search-section .container,
.search-section .container,
.agency-results-section .container {
    max-width: 1400px;
}

/* ---- Search section spacing ---- */
.agency-search-section,
.search-section {
    padding-bottom: 0;
}

/* ---- Results section ---- */
.agency-results-section {
    padding: 2rem 0 4rem;
    background: var(--bg-light, #f7f7f7);
    min-height: 60vh;
}

/* ---- Two-column layout (mirrors search results-layout) ---- */
.agency-results-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    align-items: start;
}

/* ---- Sidebar (matches .filter-sidebar exactly) ---- */
.agency-info-sidebar {
    background: #fff;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
    position: sticky;
    top: 1.5rem;
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
    border: 1px solid #ebebeb;
}

.agency-info-sidebar::-webkit-scrollbar { width: 6px; }
.agency-info-sidebar::-webkit-scrollbar-track { background: #f7f7f7; border-radius: 3px; }
.agency-info-sidebar::-webkit-scrollbar-thumb { background: #ddd; border-radius: 3px; }

/* Sidebar header: logo + name */
.agency-sidebar-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #ebebeb;
}

.agency-sidebar-logo {
    width: 96px;
    height: 96px;
    object-fit: contain;
    border-radius: 16px;
    border: 1px solid #ebebeb;
    padding: 6px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

.agency-sidebar-logo-placeholder {
    width: 96px;
    height: 96px;
    border-radius: 16px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    color: #bbb;
}

.agency-sidebar-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: #222;
    margin: 0 0 0.2rem;
    line-height: 1.3;
}

.agency-sidebar-cities {
    font-size: 0.78rem;
    color: #717171;
    margin: 0;
}

/* Sidebar sections (like filter groups) */
.agency-sidebar-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #ebebeb;
}

.agency-sidebar-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.agency-sidebar-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: #222;
    margin: 0 0 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.agency-sidebar-title i {
    color: #717171;
    font-size: 0.8rem;
}

/* Contact links */
.agency-sidebar-contact {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #444;
    text-decoration: none;
    padding: 0.4rem 0;
    border-radius: 8px;
    transition: color 0.2s;
}

.agency-sidebar-contact:hover {
    color: var(--primary-color, #FF5A5F);
}

.agency-sidebar-contact i {
    width: 16px;
    text-align: center;
    color: #717171;
    font-size: 0.85rem;
}

.agency-sidebar-wa i { color: #25d366; }
.agency-sidebar-wa:hover { color: #128c7e; }

/* Contact button (acts like a link row) */
.agency-contact-btn {
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    width: 100%;
    padding: 0.4rem 0;
}

.agency-contact-btn:hover {
    color: var(--primary-color, #FF5A5F);
}

/* ---- Contact Modal ---- */
.agency-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.agency-modal-overlay.open {
    display: flex;
}

.agency-modal {
    background: #fff;
    border-radius: 20px;
    padding: 2rem;
    width: 100%;
    max-width: 520px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    max-height: 90vh;
    overflow-y: auto;
}

.agency-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #f7f7f7;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.85rem;
    color: #444;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.agency-modal-close:hover { background: #ebebeb; }

.agency-modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #222;
    margin: 0 0 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.agency-modal-title i { color: var(--primary-color, #FF5A5F); }

.agency-modal-note {
    font-size: 0.83rem;
    color: #6b7280;
    margin: 0 0 1.25rem;
}

.agency-modal-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.agency-modal-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.agency-modal-field--full {
    grid-column: 1 / -1;
}

.agency-modal-field label {
    font-size: 0.78rem;
    font-weight: 700;
    color: #222;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.agency-modal-field .req { color: var(--primary-color, #FF5A5F); }

.agency-modal-field input,
.agency-modal-field textarea {
    border: 1px solid #ebebeb;
    border-radius: 10px;
    padding: 0.6rem 0.85rem;
    font-size: 0.9rem;
    font-family: inherit;
    color: #222;
    outline: none;
    transition: border-color 0.2s;
    resize: vertical;
}

.agency-modal-field input:focus,
.agency-modal-field textarea:focus {
    border-color: #222;
}

.agency-modal-error {
    font-size: 0.85rem;
    color: #e04e52;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: #fff0f0;
    border-radius: 8px;
}

.agency-modal-submit {
    width: 100%;
    padding: 0.75rem;
    background: var(--primary-color, #FF5A5F);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background 0.2s;
}

.agency-modal-submit:hover:not(:disabled) { background: var(--primary-hover, #e04e52); }
.agency-modal-submit:disabled { opacity: 0.6; cursor: not-allowed; }

.agency-modal-success {
    text-align: center;
    padding: 2rem 1rem;
    color: #128c7e;
}

.agency-modal-success i {
    font-size: 3rem;
    display: block;
    margin-bottom: 0.75rem;
}

.agency-modal-success p { font-weight: 600; }

@media (max-width: 480px) {
    .agency-modal-fields { grid-template-columns: 1fr; }
    .agency-modal { padding: 1.5rem; }
}

.agency-sidebar-address,
.agency-sidebar-desc {
    font-size: 0.85rem;
    color: #717171;
    line-height: 1.65;
    margin: 0;
}

/* For Sale button in sidebar */
.agency-sidebar-forsale-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    width: 100%;
    padding: 0.65rem 1rem;
    background: var(--primary-color, #FF5A5F);
    color: #fff;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.2s, transform 0.15s;
}

.agency-sidebar-forsale-btn:hover {
    background: var(--primary-hover, #E04E52);
    color: #fff;
    transform: scale(1.02);
}

/* Back to fleet link */
.agency-sidebar-back {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    width: 100%;
    padding: 0.65rem 1rem;
    background: #222;
    color: #fff;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.2s, transform 0.15s;
}

.agency-sidebar-back:hover {
    background: #444;
    color: #fff;
    transform: scale(1.02);
}

/* ---- Results header (mirrors .results-header) ---- */
.agency-results-header {
    background: #fff;
    padding: 1.25rem 1.5rem;
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #ebebeb;
}

.agency-results-header h1 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #222;
    margin: 0 0 0.2rem;
}

.agency-results-count {
    font-size: 0.875rem;
    color: #717171;
    margin: 0;
}

/* ---- Fleet Grid ---- */
.agency-fleet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem;
}

/* ---- Car Card (matches vehicle-card style) ---- */
.agency-car-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    border: 1px solid #ebebeb;
    transition: box-shadow 0.2s, transform 0.2s;
}

.agency-car-card:hover {
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
    transform: translateY(-3px);
    color: inherit;
}

.forsale-card { cursor: default; }
.forsale-card:hover { transform: none; box-shadow: 0 1px 2px rgba(0,0,0,0.08); }

.agency-car-img {
    position: relative;
    aspect-ratio: 16/10;
    background: #f0f0f0;
    overflow: hidden;
}

.agency-car-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.agency-car-card:hover:not(.forsale-card) .agency-car-img img {
    transform: scale(1.04);
}

.agency-car-no-img {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: #ccc;
}

.agency-car-cat {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 999px;
    padding: 0.2rem 0.6rem;
    backdrop-filter: blur(4px);
}

.forsale-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--primary-color, #FF5A5F);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 0.25rem 0.7rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.agency-car-body {
    padding: 1rem 1.1rem 1.1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.agency-car-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #222;
    margin: 0 0 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agency-car-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.agency-car-specs span {
    font-size: 0.78rem;
    color: #717171;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.agency-car-price {
    margin-top: auto;
    display: flex;
    align-items: baseline;
    gap: 0.3rem;
    padding-top: 0.75rem;
    border-top: 1px solid #ebebeb;
}

.agency-price-amount {
    font-size: 1.05rem;
    font-weight: 800;
    color: #222;
}

.agency-price-period {
    font-size: 0.78rem;
    color: #717171;
}

/* ---- For Sale specifics ---- */
.forsale-year {
    font-size: 0.8rem;
    color: #717171;
    margin: 0 0 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.forsale-price {
    margin: 0.25rem 0;
    padding-top: 0.75rem;
    border-top: 1px solid #ebebeb;
}

.forsale-price-amount {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--primary-color, #FF5A5F);
}

.forsale-notes {
    font-size: 0.8rem;
    color: #717171;
    margin: 0.5rem 0 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.forsale-contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.75rem;
    padding: 0.5rem 1rem;
    background: #222;
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    transition: background 0.2s;
    align-self: flex-start;
    cursor: pointer;
    position: relative;
    z-index: 1;
}

.forsale-contact-btn:hover {
    background: var(--primary-color, #FF5A5F);
    color: #fff;
}

/* ---- Empty state ---- */
.agency-empty {
    text-align: center;
    padding: 4rem 1rem;
    background: #fff;
    border-radius: 16px;
    border: 1px solid #ebebeb;
    color: #717171;
}

.agency-empty i {
    font-size: 3rem;
    color: #ddd;
    display: block;
    margin-bottom: 1rem;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1024px) {
    .agency-results-layout {
        grid-template-columns: 240px 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .agency-results-layout {
        grid-template-columns: 1fr;
    }

    .agency-info-sidebar {
        position: static;
        max-height: none;
    }

    .agency-fleet-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .agency-fleet-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .agency-car-name { font-size: 0.85rem; }
    .agency-price-amount { font-size: 0.92rem; }
    .forsale-price-amount { font-size: 1rem; }
}
