/* ==========================================================================
   Owl Agent Widget Stylesheet (Smile Angel Type)
   Version: 1.3.0 (Phase 7: Typography Break Shield & Disabled State Edition)
   SSoT v14.0.0 Compliant

   [Architecture Log]
   - Theme Bleeding Lock: .owl-agent-widget-wrapper 내부 강제 초기화 및 Isolation 적용.
   - Dynamic Fallbacks: PHP 컨트롤러 설정 전에도 시안과 동일하게 렌더링되도록 기본값 구성.
   - GPU Acceleration: Hover 시 transform 애니메이션에 60fps 부드러움을 보장하는 최적화 적용.
   
   🚨 [Optimization 1.3.0 - UI/UX Layout Integrity]
   - Typography Break Shield: .agent-position-tag 에 line-clamp: 2 를 적용하여 긴 인사말로 인한 카드 수직 팽창(CLS) 원천 차단.
   - Disabled State Shield: .is-disabled 상태일 때 엘리멘터 호버 모션과 그림자를 무력화하고 
     cursor: not-allowed 를 띄워 시각적 헛클릭 방어. (JS 토스트 알림을 위해 pointer-events는 유지)

   🚨 [Optimization 1.2.0 - UI/UX Refinement & Security]
   - Phantom Shield: .agent-photo에 pointer-events: none !important; 속성을 주입하여 OS 레벨의 네이티브 이미지 인식(꾹 누르기 저장 등)을 렌더링 레벨에서 원천 차단.
   - Baseline Sync: .legal-item의 정렬을 baseline으로 변경하여 이기종 폰트 간의 미세한 수직 단차를 완벽히 교정.

   🚨 [Optimization 1.1.0 - Decoupling & Security]
   - Mobile Decoupling: 모바일 해상도에서 margin, width, border-radius를 억압하던 하드코딩 !important 락 전면 철거 (Elementor 제어권 복구).
   - Anti-Theft Shield: 사진 꾹 누르기(Touch Callout) 및 드래그, 텍스트 선택을 원천 차단하는 방어막 결속.
   ========================================================================== */

/* --------------------------------------------------------------------------
   [1] Base Wrapper & Isolation Reset
   -------------------------------------------------------------------------- */
.owl-agent-widget-wrapper {
    width: 100%;
    position: relative;
    box-sizing: border-box;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
    
    /* 🎯 테마 간섭 방어 및 렌더링 최적화 스태킹 컨텍스트 생성 */
    isolation: isolate;
    transform: translateZ(0); 
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 외부 글로벌 테마의 마진/패딩 침범 원천 차단 */
.owl-agent-widget-wrapper * {
    box-sizing: border-box !important;
    margin: 0;
    padding: 0;
}

.owl-agent-widget-wrapper a {
    text-decoration: none !important;
    outline: none !important;
    display: block;
}

/* --------------------------------------------------------------------------
   [2] Agent Card Container
   -------------------------------------------------------------------------- */
.owl-agent-widget-wrapper .owl-agent-card {
    width: 100%;
    /* max-width, background, radius, shadow 등은 PHP 엘리멘터 제어기에서 주입됨 */
    max-width: 320px;
    background-color: #ffffff;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    border: 1px solid #eaecf0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s ease;
    position: relative;
    margin: 0 auto;
    
    /* GPU 하드웨어 가속 렌더링 락 */
    transform: translateZ(0); 
    will-change: transform, box-shadow;
}

/* Hover Lift Effect */
@media (hover: hover) {
    .owl-agent-widget-wrapper .owl-agent-card:hover {
        /* 호버 떠오름 수치는 PHP 컨트롤러로 덮어쓰기됨 */
        transform: translateY(-8px) translateZ(0);
        box-shadow: 0 20px 40px rgba(0,0,0,0.1);
        z-index: 10;
    }
}

/* --------------------------------------------------------------------------
   [3] Profile Photo Area
   -------------------------------------------------------------------------- */
.owl-agent-widget-wrapper .agent-photo-wrap {
    /* 외부 여백(margin)은 PHP 반응형 컨트롤러에서 동적 주입됨. 기본값 세팅 */
    width: calc(100% - 20px);
    margin: 10px;
    aspect-ratio: 3 / 4;
    border-radius: 15px;
    background-color: #eeeeee;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
    
    /* Safari Border-Radius 클리핑 버그 쉴드 */
    -webkit-mask-image: -webkit-radial-gradient(white, black);
}

.owl-agent-widget-wrapper .agent-photo {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center top !important;
    transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: block;
    transform: translateZ(0);
    
    /* 🚨 [Optimization 1.2.0] Phantom Shield: 이벤트 투과로 OS 레벨 이미지 인식/저장 원천 차단 */
    pointer-events: none !important;
    
    /* 🚨 [Optimization 1.1.0] Anti-Theft Shield: 구형 모바일 꾹 누르기 및 드래그 방어 */
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
}

/* 호버 시 줌인 효과 */
@media (hover: hover) {
    .owl-agent-widget-wrapper .owl-agent-card:hover .agent-photo {
        transform: scale(1.08) translateZ(0);
    }
}

/* --------------------------------------------------------------------------
   [4] Content Area (Typography & Legal Box)
   -------------------------------------------------------------------------- */
.owl-agent-widget-wrapper .agent-content {
    /* Padding은 PHP 컨트롤에서 동적 주입됨 */
    padding: 20px 24px 24px;
    display: flex;
    flex-direction: column;
    text-align: center;
    flex-grow: 1;
}

.owl-agent-widget-wrapper .agent-name-row {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 6px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.owl-agent-widget-wrapper .agent-name {
    font-size: 22px;
    font-weight: 800;
    color: #1A2B3C;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.owl-agent-widget-wrapper .agent-title-label {
    font-size: 13px;
    font-weight: 500;
    color: #888888;
    line-height: 1.2;
}

.owl-agent-widget-wrapper .agent-position-tag {
    font-size: 14px;
    font-weight: 600;
    color: #C5A065;
    margin-bottom: 18px;
    word-break: keep-all;
    line-height: 1.4;
    
    /* 🚨 [Optimization 1.3.0] Typography Break Shield: 2줄 초과 텍스트 말줄임표 락 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --------------------------------------------------------------------------
   [5] Legal Information Box (표시광고법)
   -------------------------------------------------------------------------- */
.owl-agent-widget-wrapper .agent-legal-box {
    text-align: left;
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.owl-agent-widget-wrapper .legal-item {
    display: flex;
    /* 🚨 [Optimization 1.2.0] Typography Baseline Sync: 서로 다른 폰트의 글자 밑단(Baseline)을 완벽히 맞추어 칼각 정렬 */
    align-items: baseline;
    font-size: 11px;
    line-height: 1.6;
    color: #777777;
}

.owl-agent-widget-wrapper .legal-label {
    flex: 0 0 65px;
    font-weight: 700;
    color: #555555;
    flex-shrink: 0;
    letter-spacing: -0.03em;
}

.owl-agent-widget-wrapper .legal-value {
    flex: 1;
    min-width: 0;
    word-break: keep-all;
    font-family: 'Roboto Mono', 'Pretendard', sans-serif;
}

.owl-agent-widget-wrapper .legal-divider {
    width: 100%;
    height: 1px;
    background-color: #e9ecef;
    margin: 8px 0;
}

/* --------------------------------------------------------------------------
   [6] Action Button (하이브리드 스마트 연락처 버튼)
   -------------------------------------------------------------------------- */
.owl-agent-widget-wrapper .agent-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 50px;
    background-color: #2271b1;
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    border-radius: 12px;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 10px rgba(34, 113, 177, 0.2);
    margin-top: auto; /* 상단 내용 길이가 달라도 버튼을 바닥에 칼각 정렬 */
    border: 1px solid transparent; /* 호버 테두리 1px 흔들림 쉴드 */
    cursor: pointer;
    line-height: 1;
    font-family: 'Roboto Mono', 'Pretendard', sans-serif;
}

/* 🚨 1em Fluid Icon Engine (텍스트 크기 변경 시 자동 비례 스케일링) */
.owl-agent-widget-wrapper .agent-action-btn i,
.owl-agent-widget-wrapper .agent-action-btn svg {
    display: block;
    width: 1.1em !important;
    height: 1.1em !important;
    font-size: inherit;
    fill: currentColor;
    flex-shrink: 0;
}

.owl-agent-widget-wrapper .agent-action-btn span {
    padding-top: 1px; /* 아이콘과 텍스트 수직 영점 조절 */
    letter-spacing: -0.01em;
}

@media (hover: hover) {
    /* 🚨 :not(.is-disabled) 가드 결속 */
    .owl-agent-widget-wrapper .agent-action-btn:not(.is-disabled):hover {
        background-color: #1a5c91;
        box-shadow: 0 6px 15px rgba(34, 113, 177, 0.3);
        transform: scale(1.02);
    }
}

.owl-agent-widget-wrapper .agent-action-btn:not(.is-disabled):active {
    transform: scale(0.98);
    box-shadow: 0 2px 5px rgba(34, 113, 177, 0.15);
}

.owl-agent-widget-wrapper .agent-action-btn:not(.is-disabled):focus-visible {
    outline: 3px solid #C5A065;
    outline-offset: 2px;
}

/* 🚨 [Optimization 1.3.0] Disabled State Shield (빈 연락처 깡통 매물 방어막) */
.owl-agent-widget-wrapper .agent-action-btn.is-disabled {
    background-color: #f1f3f5 !important;
    color: #adb5bd !important;
    box-shadow: none !important;
    border-color: transparent !important;
    cursor: not-allowed !important;
    /* pointer-events: none 은 쓰지 않음으로써 JS 엔진에서 이벤트를 캐치하여 에러 토스트를 띄우게 함 */
}

/* 엘리멘터가 주입하는 호버/액티브 스타일 강제 덮어쓰기 무력화 */
.owl-agent-widget-wrapper .agent-action-btn.is-disabled:hover,
.owl-agent-widget-wrapper .agent-action-btn.is-disabled:active,
.owl-agent-widget-wrapper .agent-action-btn.is-disabled:focus-visible {
    background-color: #f1f3f5 !important;
    color: #adb5bd !important;
    box-shadow: none !important;
    transform: none !important;
    outline: none !important;
}

.owl-agent-widget-wrapper .agent-action-btn.is-disabled i,
.owl-agent-widget-wrapper .agent-action-btn.is-disabled svg {
    opacity: 0.6;
}

/* --------------------------------------------------------------------------
   [7] Mobile Responsive Fallbacks
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    /* 🚨 Elementor 제어권 회복을 위해 .agent-photo-wrap 하드코딩 완전 철거 완료 */
    
    .owl-agent-widget-wrapper .agent-content {
        padding: 20px;
    }
}