.agency-profile-page {
    --agency-red: #dc0000;
    --agency-red-dark: #b80000;
    --agency-border: color-mix(in srgb, var(--text-color, #222) 14%, transparent);
    --agency-muted: var(--text2-color, #717171);
    --agency-surface: var(--bg-color2, #fff);
    --agency-soft: color-mix(in srgb, var(--text-color, #222) 7%, var(--agency-surface));
    direction: rtl;
    padding: 14px 0 34px;
    background: var(--bg-color, #f7f7f7);
}

.agency-profile-page * { box-sizing: border-box; }
.agency-profile-page > .container-xl { max-width: 1500px; padding-right: 8px; padding-left: 8px; }

.agency-profile-hero {
    position: relative;
    overflow: hidden;
    min-height: 250px;
    padding: 20px 16px 0;
    margin-bottom: 20px;
    border-radius: 16px 16px 0 0;
    isolation: isolate;
}

.agency-profile-hero::before {
    position: absolute;
    z-index: -2;
    inset: 0;
    content: "";
    background: linear-gradient(115deg, rgba(87, 31, 35, .55), rgba(255, 255, 255, .12)), var(--agency-cover, linear-gradient(135deg, #79575a, #d7aaa5));
    background-position: center;
    background-size: cover;
    transform: scale(1.05);
    filter: blur(2px);
}

.agency-profile-hero::after {
    position: absolute;
    z-index: -1;
    inset: 0;
    content: "";
    background: rgba(255, 255, 255, .18);
    backdrop-filter: blur(2px);
}

.agency-hero-grid {
    display: grid;
    grid-template-columns: minmax(220px, .82fr) minmax(440px, 1.75fr) minmax(220px, .82fr);
    gap: 18px;
    min-height: 210px;
}

.agency-glass-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border: 8px solid color-mix(in srgb, var(--agency-surface) 36%, transparent);
    border-radius: 13px;
    background: color-mix(in srgb, var(--agency-surface) 96%, transparent);
    box-shadow: 0 8px 28px rgba(35, 20, 20, .12);
    text-align: center;
}

.agency-hero-logo { width: 100%; height: 100%; min-height: 150px; object-fit: contain; }
.agency-hero-logo-placeholder { color: var(--agency-red); font-size: 52px; }
.agency-hero-type-icon { margin-bottom: 12px; color: var(--agency-red); font-size: 40px; }
.agency-hero-type { margin: 0 0 8px; color: var(--text-color, #343434); font-size: 15px; font-weight: 700; }
.agency-hero-category { color: var(--agency-red); font-size: 12px; }
.agency-hero-website { margin-bottom: 8px; color: var(--text-color, #343434); font-size: 13px; word-break: break-all; }
.agency-hero-unavailable { color: var(--agency-muted); font-size: 12px; }
.agency-hero-title {font-family: 'Vazirmatn'; margin: 0 0 8px; color: var(--agency-red); font-size: clamp(22px, 2.4vw, 34px); font-weight: 900; }
.agency-hero-description { max-width: 620px; margin: 0 0 6px; color: var(--text2-color, #444); font-size: 13px; line-height: 2; }
.agency-hero-category-en { margin-bottom: 12px; color: var(--agency-red); font-size: 13px; font-weight: 700; }

.agency-request-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 20px;
    border: 0;
    border-radius: 6px;
    background: var(--agency-red);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    transition: .2s ease;
}

.agency-request-button:hover { background: var(--agency-red-dark); color: #fff; transform: translateY(-1px); }

.agency-stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    position: relative;
    z-index: 1;
    margin-top: 18px;
    margin-bottom: 0;
    color: #fff;
}

.agency-stat {
    display: flex;
    min-height: 62px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 10px 16px;
    border-radius: 10px 10px 0 0;
    background: var(--agency-red);
    font-size: 13px;
    font-weight: 700;
}

.agency-content-grid { display: grid; grid-template-columns: minmax(0, 2.65fr) minmax(280px, .9fr); gap: 18px; align-items: start; }
.agency-content-grid--wide { grid-template-columns: 1fr; }
.agency-content-grid:has(.agency-side-column:empty) { grid-template-columns: 1fr; }
.agency-main-column, .agency-side-column { display: grid; gap: 16px; }
.agency-side-column:empty { display: none; }

.agency-panel {
    overflow: hidden;
    border: 1px solid var(--agency-border);
    border-radius: 8px;
    background: var(--bg-color2, #fff);
    box-shadow: 0 2px 7px rgba(0, 0, 0, .025);
}

.agency-panel-body { padding: 20px 22px; }
.agency-section-title { position: relative; margin: 0 0 16px; padding-right: 12px; color: var(--text-color, #202020); font-size: 16px; font-weight: 800; }
.agency-section-title::before { position: absolute; right: 0; top: 2px; width: 3px; height: 19px; border-radius: 2px; background: var(--agency-red); content: ""; }
.agency-about { color: var(--text2-color, #555); font-size: 13px; line-height: 2.15; text-align: justify; }
.agency-about > :last-child { margin-bottom: 0; }

.agency-services { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 26px; margin: 0; padding: 0 18px 0 0; color: var(--text2-color, #555); font-size: 12px; line-height: 1.8; }
.agency-services li::marker { color: var(--agency-red); }

.agency-contact-list { display: grid; gap: 14px; }
.agency-contact-row { display: flex; align-items: center; gap: 10px; color: var(--text2-color, #555); font-size: 12px; }
.agency-contact-row i { width: 18px; color: var(--agency-red); text-align: center; font-size: 16px; }
.agency-contact-row strong { color: var(--text-color, #222); }
.agency-contact-row a { color: inherit; text-decoration: none; }
.agency-side-logo { display: flex; min-height: 120px; align-items: center; justify-content: center; margin-bottom: 16px; padding: 12px; border-radius: 8px; background: var(--agency-soft); }
.agency-side-logo img { max-width: 100%; max-height: 105px; object-fit: contain; }
.agency-side-logo i { color: #ccc; font-size: 42px; }
.agency-side-request { width: 100%; justify-content: center; }

.agency-socials { display: flex; align-items: center; justify-content: center; gap: 9px; padding: 12px 16px; border-top: 1px solid var(--agency-border); }
.agency-socials a { display: grid; width: 29px; height: 29px; place-items: center; border-radius: 50%; background: #999; color: #fff; font-size: 13px; transition: .2s ease; }
.agency-socials a:hover { background: var(--agency-red); color: #fff; transform: translateY(-2px); }
.agency-location-copy { color: var(--text2-color, #555); font-size: 12px; line-height: 1.9; }
.agency-location-copy p { margin: 0 0 9px; }
.agency-location-copy i { width: 19px; margin-left: 6px; color: var(--agency-red); text-align: center; }
.agency-map { display: block; width: 100%; height: 205px; margin-top: 13px; border: 0; border-radius: 7px; }

.agency-portfolio-track { display: grid; grid-auto-columns: minmax(220px, 1fr); grid-auto-flow: column; gap: 10px; overflow-x: auto; padding-bottom: 5px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.agency-portfolio-btn { position: relative; overflow: hidden; padding: 0; border: 0; border-radius: 7px; background: var(--agency-soft); scroll-snap-align: start; }
.agency-portfolio-img { display: block; width: 100%; height: 175px; object-fit: cover; transition: transform .25s ease; }
.agency-portfolio-btn:hover .agency-portfolio-img { transform: scale(1.035); }
.agency-portfolio-expand { position: absolute; right: 9px; bottom: 9px; display: grid; width: 28px; height: 28px; place-items: center; border-radius: 5px; background: rgba(217, 0, 0, .9); color: #fff; }
.agency-empty-state { margin: 0; color: var(--agency-muted); font-size: 13px; }

.agency-related-panel { margin-top: 18px; }
.agency-related-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.agency-related-card { display: grid; grid-template-columns: 112px minmax(0, 1fr); overflow: hidden; min-height: 118px; border: 1px solid var(--agency-border); border-radius: 7px; background: var(--bg-color2, #fff); }
.agency-related-logo { display: grid; min-height: 118px; place-items: center; background: var(--agency-soft); }
.agency-related-logo img { width: 100%; height: 100%; max-height: 118px; object-fit: contain; }
.agency-related-logo i { color: #bbb; font-size: 34px; }
.agency-related-copy { padding: 12px; }
.agency-related-copy h3 { margin: 0 0 7px; color: var(--text-color, #222); font-size: 13px; font-weight: 800; }
.agency-related-copy p { min-height: 38px; margin: 0 0 8px; color: var(--agency-muted); font-size: 11px; line-height: 1.7; }
.agency-related-copy a { display: inline-block; padding: 5px 10px; border-radius: 4px; background: var(--agency-red); color: #fff; font-size: 10px; text-decoration: none; }

.agency-portfolio-modal-content, .agency-contact-modal-content { overflow: hidden; border: 1px solid var(--agency-border, color-mix(in srgb, var(--text-color, #222) 14%, transparent)); border-radius: 12px; background: var(--agency-surface, var(--bg-color2, #fff)); color: var(--text-color, #222); direction: rtl; }
.agency-portfolio-modal-content .btn-close, .agency-contact-modal-content .btn-close { margin-right: auto; margin-left: 0; }
.agency-modal-image { max-height: 80vh; border-radius: 8px; background: #111; object-fit: contain; }
.agency-contact-form .form-label { margin-bottom: 6px; font-size: 13px; font-weight: 600; }
.agency-contact-form .form-control { padding: 10px 12px; border-color: var(--agency-border, color-mix(in srgb, var(--text-color, #222) 14%, transparent)); border-radius: 7px; background: var(--agency-surface, var(--bg-color2, #fff)); color: var(--text-color, #222); font-size: 13px; }
.agency-contact-form .form-control:focus { border-color: var(--agency-red); box-shadow: 0 0 0 .2rem rgba(217, 0, 0, .12); }
.agency-contact-form textarea { min-height: 95px; resize: vertical; }
.agency-radio-group { display: flex; gap: 18px; min-height: 42px; align-items: center; }
.agency-radio-group label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; }
.agency-radio-group input { accent-color: var(--agency-red); }

[data-theme="dark"] .agency-profile-page, .dark .agency-profile-page { background: var(--bg-color, #151515); }
[data-theme="dark"] .agency-side-logo, [data-theme="dark"] .agency-related-logo, .dark .agency-side-logo, .dark .agency-related-logo { background: rgba(255, 255, 255, .06); color: #ddd; }
[data-theme="dark"] .agency-panel, .dark .agency-panel { border-color: rgba(255, 255, 255, .11); }

@media (max-width: 991.98px) {
    .agency-hero-grid { grid-template-columns: 150px 1fr; }
    .agency-hero-main { grid-column: 2; grid-row: 1 / span 2; }
    .agency-glass-logo { display: none; }
    .agency-content-grid { grid-template-columns: 1fr; }
    .agency-side-column { grid-row: 1; }
    .agency-related-grid { grid-template-columns: 1fr; }
}

@media (max-width: 767.98px) {
    .agency-profile-page { padding-top: 10px; }
    .agency-profile-hero { min-height: 0; padding: 12px 12px 0; border-radius: 13px 13px 0 0; }
    .agency-hero-grid { display: block; min-height: 0; }
    .agency-glass-meta { display: none; }
    .agency-glass-card { padding: 22px 15px; border-width: 5px; }
    .agency-stats-bar { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 12px; }
    .agency-stat { min-height: 46px; border-radius: 8px 8px 0 0; }
    .agency-panel-body { padding: 16px; }
    .agency-portfolio-track { grid-auto-columns: 82%; }
    .agency-portfolio-img { height: 150px; }
    .agency-services { grid-template-columns: 1fr; }
    .agency-related-card { grid-template-columns: 92px minmax(0, 1fr); }
}

@media (max-width: 479.98px) {
    .agency-stats-bar { grid-template-columns: 1fr; }
}
