/* B4M Real Estate — strony agenta (header, bio, certyfikaty, oferty) + karuzela agentów. */

/* ===== Header ===== */
.esticrm-agent-header {
    display: flex;
    gap: 32px;
    align-items: flex-start;
    flex-wrap: wrap;
}
.esticrm-agent-header__photo {
    flex: 0 0 auto;
    width: 240px;
    max-width: 100%;
    aspect-ratio: 3 / 4 !important;
    overflow: hidden !important;
    background: #f2f2f0;
}
.esticrm-agent-header__photo img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
    max-width: none !important;
}
.esticrm-agent-header__body {
    flex: 1 1 320px;
    min-width: 0;
}
.esticrm-agent-header__name {
    margin: 0 0 4px;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    line-height: 1.1;
}
.esticrm-agent-header__role {
    font-size: 1rem;
    opacity: .7;
    margin-bottom: var(--esticrm-agent-el-gap, 16px);
}
.esticrm-agent-header__license {
    font-size: .9rem;
    margin-bottom: var(--esticrm-agent-el-gap, 16px);
    display: flex;
    align-items: center;
    gap: 8px;
}
.esticrm-agent-header__license-label { opacity: .6; }
.esticrm-agent-header__contact {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: var(--esticrm-agent-el-gap, 16px);
}
.esticrm-agent-header__link {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.esticrm-agent-header__office {
    font-size: .9rem;
    opacity: .7;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
/* Ikony wierszy kontaktu (licencja / telefon / email / biuro) */
.esticrm-agent-header__ico {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}
.esticrm-agent-header__ico svg {
    width: var(--esticrm-agent-ico-size, 18px);
    height: var(--esticrm-agent-ico-size, 18px);
}
.esticrm-agent-header__ico i { font-size: var(--esticrm-agent-ico-size, 18px); }
.esticrm-agent-header__ico img { width: var(--esticrm-agent-ico-size, 18px); height: var(--esticrm-agent-ico-size, 18px); }
.esticrm-agent-header__socials {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.esticrm-agent-header__social {
    font-size: .82rem;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: .04em;
    opacity: .7;
}
.esticrm-agent-header__social:hover { opacity: 1; }

/* ===== Bio ===== */
.esticrm-agent-bio__title {
    margin: 0 0 12px;
    font-size: clamp(1.3rem, 2.4vw, 1.8rem);
}
.esticrm-agent-bio__text { line-height: 1.7; }
.esticrm-agent-bio__text p { margin: 0 0 1em; }
.esticrm-agent-bio__section { margin-top: 24px; }
.esticrm-agent-bio__subtitle {
    margin: 0 0 8px;
    font-size: clamp(1.05rem, 1.6vw, 1.25rem);
    font-weight: 600;
}
.esticrm-agent-bio__sectext { line-height: 1.7; }
.esticrm-agent-bio__sectext p { margin: 0 0 1em; }
.esticrm-agent-bio__sectext p:last-child { margin-bottom: 0; }

/* ===== Certyfikaty ===== */
.esticrm-agent-certs__title {
    margin: 0 0 16px;
    font-size: clamp(1.3rem, 2.4vw, 1.8rem);
}
.esticrm-agent-certs {
    display: grid;
    gap: 16px;
}
.esticrm-agent-certs--cols-1 { grid-template-columns: repeat(1, 1fr); }
.esticrm-agent-certs--cols-2 { grid-template-columns: repeat(2, 1fr); }
.esticrm-agent-certs--cols-3 { grid-template-columns: repeat(3, 1fr); }
.esticrm-agent-certs--cols-4 { grid-template-columns: repeat(4, 1fr); }
.esticrm-agent-certs--cols-5 { grid-template-columns: repeat(5, 1fr); }
.esticrm-agent-certs--cols-6 { grid-template-columns: repeat(6, 1fr); }
.esticrm-agent-certs__item {
    display: block;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .08);
    aspect-ratio: 3 / 4;
}
.esticrm-agent-certs__item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: transform .3s ease, filter .3s ease;
}
.esticrm-agent-certs--grayscale .esticrm-agent-certs__item img { filter: grayscale(1); }
.esticrm-agent-certs--grayscale .esticrm-agent-certs__item:hover img { filter: grayscale(0); }
a.esticrm-agent-certs__item:hover img { transform: scale(1.03); }

/* Karuzela certyfikatów — dzieli powłokę .esticrm-carousel; szerokość slajdu steruje
   --esticrm-carousel-visible (ustawiane per urządzenie z widgetu). */
.esticrm-agent-certs-carousel { --esticrm-carousel-visible: 4; }
body .esticrm-agent-certs-carousel .esticrm-carousel__track > .esticrm-agent-certs__item {
    flex: 0 0 calc((100% - (var(--esticrm-carousel-gap) * (var(--esticrm-carousel-visible) - 1))) / var(--esticrm-carousel-visible)) !important;
    width: calc((100% - (var(--esticrm-carousel-gap) * (var(--esticrm-carousel-visible) - 1))) / var(--esticrm-carousel-visible)) !important;
    max-width: calc((100% - (var(--esticrm-carousel-gap) * (var(--esticrm-carousel-visible) - 1))) / var(--esticrm-carousel-visible)) !important;
    min-width: 0 !important;
}

/* ===== Oferty agenta (wrapper — siatka dziedziczy z esticrm-cards-grid) ===== */
.esticrm-agent-offers { width: 100%; }
.esticrm-agent-offers__count {
    font-size: .95rem;
    opacity: .7;
    margin-bottom: 14px;
}

/* ===== Karta agenta (karuzela / grid na stronie głównej) ===== */
.esticrm-agents-grid {
    display: grid;
    gap: 24px;
}
.esticrm-agents-grid--cols-2 { grid-template-columns: repeat(2, 1fr); }
.esticrm-agents-grid--cols-3 { grid-template-columns: repeat(3, 1fr); }
.esticrm-agents-grid--cols-4 { grid-template-columns: repeat(4, 1fr); }
.esticrm-agents-grid--cols-5 { grid-template-columns: repeat(5, 1fr); }
.esticrm-agents-grid--cols-6 { grid-template-columns: repeat(6, 1fr); }

.esticrm-agent-card {
    position: relative;
    display: flex;
    flex-direction: column;
    color: inherit;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .08);
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease;
}
.esticrm-agent-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .08);
}
/* Stretch link — cała karta klikalna bez zagnieżdżania <a> w <a>. */
.esticrm-agent-card__stretch { position: absolute; inset: 0; z-index: 1; }

/* Efekty hover karty (sterowane z widgetu — klasa na kontenerze grid/karuzeli). */
.esticrm-agents--hover-none .esticrm-agent-card:hover { transform: none; box-shadow: none; }
.esticrm-agents--hover-none .esticrm-agent-card:hover .esticrm-agent-card__photo img { transform: none; }
.esticrm-agents--hover-lift .esticrm-agent-card:hover { transform: translateY(-4px); box-shadow: none; }
.esticrm-agents--hover-lift .esticrm-agent-card:hover .esticrm-agent-card__photo img { transform: none; }
.esticrm-agents--hover-zoom .esticrm-agent-card:hover { transform: none; box-shadow: none; }
.esticrm-agents--hover-zoom .esticrm-agent-card:hover .esticrm-agent-card__photo img { transform: scale(1.06); }
.esticrm-agents--hover-shadow .esticrm-agent-card:hover { transform: none; box-shadow: 0 12px 30px rgba(0, 0, 0, .12); }
.esticrm-agents--hover-shadow .esticrm-agent-card:hover .esticrm-agent-card__photo img { transform: none; }
.esticrm-agents--hover-lift-zoom .esticrm-agent-card:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(0, 0, 0, .08); }
.esticrm-agents--hover-lift-zoom .esticrm-agent-card:hover .esticrm-agent-card__photo img { transform: scale(1.04); }

.esticrm-agent-card__photo {
    position: relative;
    display: block !important;
    width: 100% !important;
    aspect-ratio: 3 / 4 !important;
    overflow: hidden !important;
    background: #f2f2f0;
}
.esticrm-agent-card__photo--noimg { aspect-ratio: 3 / 4 !important; }
/* Okładkowe kadrowanie — !important bije motyw (Astra: img{height:auto}) który psuł równe rozmiary. */
.esticrm-agent-card__photo img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
    max-width: none !important;
    transition: transform .35s ease;
}
.esticrm-agent-card:hover .esticrm-agent-card__photo img { transform: scale(1.04); }

/* Hover overlay: ikony kontakt/socjale. Overlay nie łapie kliknięć (przepuszcza na stretch), tylko ikony. */
.esticrm-agent-card__hover {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 14px;
    background: rgba(20, 18, 18, .45);
    opacity: 0;
    transition: opacity .25s ease;
    pointer-events: none;
}
.esticrm-agent-card:hover .esticrm-agent-card__hover { opacity: 1; }
.esticrm-agent-card__icons { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.esticrm-agent-card__ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #fff;
    color: #1a1818;
    text-decoration: none;
    pointer-events: auto;
    transition: transform .15s ease, background .15s ease, color .15s ease;
}
.esticrm-agent-card__ico:hover { transform: translateY(-2px); }

.esticrm-agent-card__body {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px;
    pointer-events: none; /* klik łapie stretch; tylko link-CTA ma pointer-events auto */
}
.esticrm-agent-card__name { font-weight: 600; font-size: 1.05rem; }
.esticrm-agent-card__role { font-size: .85rem; opacity: .65; }

/* CTA — 3 warianty stylu */
.esticrm-agent-card__cta {
    margin-top: 10px;
    align-self: flex-start;
    display: inline-block;
    padding: 8px 16px;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    text-decoration: none;
    border: 1px solid currentColor;
    border-radius: 2px;
    position: relative;
    z-index: 3;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
a.esticrm-agent-card__cta { pointer-events: auto; }
.esticrm-agent-card__cta--filled { background: #1a1818; color: #fff; border-color: #1a1818; }
.esticrm-agent-card__cta--outline { background: transparent; color: #1a1818; border-color: #1a1818; }
.esticrm-agent-card__cta--text { background: transparent; border-color: transparent; padding-left: 0; padding-right: 0; }

/* Karuzela agentów dzieli powłokę .esticrm-carousel — karta jako slajd toru.
   Reguły szerokości mirrorują .esticrm-card z carousel.css (inna klasa = własne reguły). */
/* Szerokość kart steruje zmienna --esticrm-carousel-visible, którą Elementor ustawia
   per-urządzenie (desktop/tablet/telefon). Bez sztywnych breakpointów — pełna kontrola z widgetu. */
.esticrm-agents-carousel { --esticrm-carousel-visible: 4; }
body .esticrm-agents-carousel .esticrm-carousel__track > .esticrm-agent-card {
    flex: 0 0 calc((100% - (var(--esticrm-carousel-gap) * (var(--esticrm-carousel-visible) - 1))) / var(--esticrm-carousel-visible)) !important;
    width: calc((100% - (var(--esticrm-carousel-gap) * (var(--esticrm-carousel-visible) - 1))) / var(--esticrm-carousel-visible)) !important;
    max-width: calc((100% - (var(--esticrm-carousel-gap) * (var(--esticrm-carousel-visible) - 1))) / var(--esticrm-carousel-visible)) !important;
    min-width: 0 !important;
}

/* ===== Responsywność ===== */
@media (max-width: 1024px) {
    .esticrm-agent-certs--cols-5, .esticrm-agent-certs--cols-6 { grid-template-columns: repeat(4, 1fr); }
    .esticrm-agents-grid--cols-5, .esticrm-agents-grid--cols-6 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .esticrm-agent-header { gap: 20px; }
    .esticrm-agent-header__photo { width: 160px; }
    .esticrm-agent-certs--cols-3, .esticrm-agent-certs--cols-4, .esticrm-agent-certs--cols-5, .esticrm-agent-certs--cols-6 { grid-template-columns: repeat(2, 1fr); }
    .esticrm-agents-grid { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 480px) {
    .esticrm-agent-certs { grid-template-columns: repeat(2, 1fr); }
    .esticrm-agents-grid { grid-template-columns: 1fr !important; }
}
