/**
 * Car Appraisal Section Styles
 *
 * @package Media_Khodro
 * @since 1.0.0
 */

/* === Appraisal Section === */
.mk-appraisal-section {
    padding: 4rem 0 3rem;
    background: #fff;
    direction: rtl;
    text-align: right;
    position: relative;
    overflow-x: clip;
    overflow-y: visible;
    max-width: 100%;
    font-family: var(--mk-font-primary, 'IRANYekan', 'Vazirmatn', 'Segoe UI', Tahoma, Arial, sans-serif);
}

.mk-appraisal-section input,
.mk-appraisal-section select,
.mk-appraisal-section button,
.mk-appraisal-section textarea,
.mk-appraisal-section option,
.mk-appraisal-modal input,
.mk-appraisal-modal select,
.mk-appraisal-modal button,
.mk-appraisal-modal textarea,
.mk-appraisal-modal option {
    font-family: inherit;
}

.mk-appraisal-section .mk-container {
    position: relative;
    overflow: visible;
    max-width: var(--mk-container-max, 1320px);
    padding: 0 var(--mk-container-padding, 1.5rem);
}

.mk-appraisal-wrapper {
    display: grid;
    grid-template-columns: 1.15fr 1fr 1.15fr;
    gap: 0;
    border-radius: 16px;
    overflow: visible;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
    min-height: 340px;
}

/* Left Section - Third in RTL */
.mk-appraisal-left {
    padding: 2rem 2.5rem;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: stretch;
    overflow: visible;
    border-radius: 0 16px 16px 0;
    z-index: 1;
    min-width: 0;
}

.mk-appraisal-man-image {
    position: absolute;
    top: -72px;
    right: 50%;
    transform: translateX(50%);
    width: min(240px, 42%);
    height: auto;
    max-height: 360px;
    z-index: 1;
    overflow: visible;
    padding: 0;
    box-sizing: border-box;
    pointer-events: none;
}

.mk-appraisal-man-image img {
    width: 100%;
    height: auto;
    max-height: 360px;
    object-fit: contain;
    object-position: center bottom;
    display: block;
}

/* White Card */
.mk-appraisal-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    position: relative;
    z-index: 2;
    max-width: 400px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.mk-appraisal-card-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1D3557;
    margin: 0 0 0.75rem 0;
}

.mk-appraisal-card-text {
    font-size: 0.95rem;
    color: #666;
    margin: 0 0 1.5rem 0;
    line-height: 1.6;
}

.mk-appraisal-progress {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mk-appraisal-percentage {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1D3557;
    min-width: 50px;
}

.mk-appraisal-progress-bar {
    flex: 1;
    height: 12px;
    background: #E0E0E0;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.mk-appraisal-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #1D3557 0%, #4FC3F7 100%);
    border-radius: 6px;
    transition: width 0.5s ease;
}

/* Center — CTA trigger panel */
.mk-appraisal-center.mk-appraisal-cta {
    padding: 2rem 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: linear-gradient(165deg, #ffffff 0%, #f4f8fc 100%);
    z-index: 1;
    border-right: 1px solid rgba(29, 53, 87, 0.06);
    border-left: 1px solid rgba(29, 53, 87, 0.06);
}

.mk-appraisal-cta-inner {
    width: 100%;
    max-width: 360px;
    text-align: center;
}

.mk-appraisal-cta-graphic {
    position: relative;
    width: 180px;
    height: 180px;
    margin: 0 auto 1.25rem;
}

.mk-appraisal-cta-orbit {
    position: absolute;
    border-radius: 50%;
    border: 2px dashed rgba(79, 195, 247, 0.35);
    inset: 0;
    animation: mkAppraisalOrbitSpin 24s linear infinite;
}

.mk-appraisal-cta-orbit--2 {
    inset: 18px;
    border-color: rgba(255, 102, 0, 0.25);
    animation-direction: reverse;
    animation-duration: 18s;
}

@keyframes mkAppraisalOrbitSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.mk-appraisal-cta-icon-ring {
    position: absolute;
    inset: 32px;
    border-radius: 50%;
    background: linear-gradient(145deg, #1d3557 0%, #26466d 55%, #4fc3f7 100%);
    box-shadow: 0 16px 40px rgba(29, 53, 87, 0.22);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mk-appraisal-cta-icon {
    position: absolute;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #fff;
    color: #1d3557;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
}

.mk-appraisal-cta-icon--main {
    position: relative;
    width: 52px;
    height: 52px;
    font-size: 1.25rem;
    color: #fff;
    background: linear-gradient(135deg, #ff6600, #ff8c42);
    box-shadow: 0 8px 20px rgba(255, 102, 0, 0.35);
}

.mk-appraisal-cta-icon--sat-1 { top: -6px; right: 50%; transform: translateX(50%); }
.mk-appraisal-cta-icon--sat-2 { bottom: 8px; left: -4px; }
.mk-appraisal-cta-icon--sat-3 { bottom: 8px; right: -4px; }

.mk-appraisal-cta-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: #1d3557;
    margin: 0 0 0.5rem;
}

.mk-appraisal-cta-desc {
    font-size: 0.88rem;
    color: #64748b;
    line-height: 1.7;
    margin: 0 0 1rem;
}

.mk-appraisal-cta-features {
    list-style: none;
    margin: 0 0 1.35rem;
    padding: 0;
    text-align: right;
}

.mk-appraisal-cta-features li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: #475569;
    padding: 0.35rem 0;
}

.mk-appraisal-cta-features i {
    color: #10b981;
    flex-shrink: 0;
}

.mk-appraisal-cta-button {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    padding: 0.95rem 1.25rem;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #4fc3f7 0%, #1d3557 100%);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(29, 53, 87, 0.22);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.mk-appraisal-cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(29, 53, 87, 0.28);
}

.mk-appraisal-cta-button i {
    font-size: 0.85rem;
    transition: transform 0.25s ease;
}

.mk-appraisal-cta-button:hover i {
    transform: translateX(-4px);
}

/* Modal */
.mk-appraisal-modal {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    direction: rtl;
    text-align: right;
    font-family: var(--mk-font-primary, 'IRANYekan', 'Vazirmatn', 'Segoe UI', Tahoma, Arial, sans-serif);
}

.mk-appraisal-modal.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

body.mk-appraisal-modal-open {
    overflow: hidden;
}

.mk-appraisal-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.62);
    backdrop-filter: blur(6px);
}

.mk-appraisal-modal-shell {
    position: relative;
    z-index: 1;
    width: min(960px, 100%);
    max-height: min(92vh, 820px);
    animation: mkAppraisalModalIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes mkAppraisalModalIn {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.mk-appraisal-modal-panel {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
    max-height: min(92vh, 820px);
}

.mk-appraisal-modal-aside {
    position: relative;
    background: linear-gradient(160deg, #ff6600 0%, #e63946 45%, #1d3557 100%);
    color: #fff;
    padding: 2rem 1.5rem;
    overflow: hidden;
}

.mk-appraisal-modal-aside-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.18;
    background-image:
        radial-gradient(circle at 20% 20%, #fff 0%, transparent 35%),
        repeating-linear-gradient(-45deg, transparent, transparent 14px, rgba(255,255,255,0.08) 14px, rgba(255,255,255,0.08) 28px);
}

.mk-appraisal-modal-aside-content {
    position: relative;
    z-index: 1;
}

.mk-appraisal-modal-aside-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    font-size: 0.78rem;
    margin-bottom: 1rem;
}

.mk-appraisal-modal-aside-content h4 {
    font-size: 1.35rem;
    margin: 0 0 0.75rem;
    line-height: 1.45;
}

.mk-appraisal-modal-aside-content p {
    font-size: 0.9rem;
    line-height: 1.75;
    color: rgba(255, 255, 255, 0.92);
    margin: 0 0 1.25rem;
}

.mk-appraisal-modal-aside-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mk-appraisal-modal-aside-list li {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.88rem;
    padding: 0.4rem 0;
    color: rgba(255, 255, 255, 0.95);
}

.mk-appraisal-modal-body {
    position: relative;
    padding: 1.75rem 1.75rem 1.5rem;
    overflow-y: auto;
    max-height: min(92vh, 820px);
}

.mk-appraisal-modal-close {
    position: absolute;
    top: 1rem;
    left: 1rem;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: #f1f5f9;
    color: #475569;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: background 0.2s ease, color 0.2s ease;
}

.mk-appraisal-modal-close:hover {
    background: #e2e8f0;
    color: #1d3557;
}

.mk-appraisal-modal .mk-appraisal-form {
    max-width: none;
    padding-top: 0.5rem;
}

/* Form Fields */
.mk-appraisal-form {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    max-width: 420px;
}

.mk-appraisal-steps {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.mk-appraisal-step-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #94a3b8;
    font-size: 0.85rem;
    flex: 1;
    min-width: 0;
}

.mk-appraisal-step-indicator.is-active {
    color: #1d3557;
    font-weight: 600;
}

.mk-appraisal-step-indicator.is-done {
    color: #0f766e;
}

.mk-appraisal-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}

.mk-appraisal-step-indicator.is-active .mk-appraisal-step-num {
    background: #4fc3f7;
    color: #fff;
}

.mk-appraisal-step-indicator.is-done .mk-appraisal-step-num {
    background: #d1fae5;
    color: #065f46;
}

.mk-appraisal-step-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mk-appraisal-step-line {
    flex: 0 0 24px;
    height: 2px;
    background: #e2e8f0;
}

.mk-appraisal-field-group {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 0.25rem;
}

.mk-appraisal-field-group-head {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.mk-appraisal-field-group-head > i {
    color: #4fc3f7;
    font-size: 1.1rem;
    margin-top: 0.15rem;
}

.mk-appraisal-field-group-head strong {
    display: block;
    color: #1d3557;
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
}

.mk-appraisal-field-group-head small {
    display: block;
    color: #64748b;
    font-size: 0.78rem;
    line-height: 1.5;
}

.mk-appraisal-field-row {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
}

.mk-appraisal-field-row .mk-appraisal-field {
    flex: 1;
    flex-direction: column;
    align-items: stretch;
    min-width: 0;
}

.mk-appraisal-field-connector {
    flex-shrink: 0;
    color: #94a3b8;
    padding-bottom: 1.1rem;
    font-size: 0.75rem;
}

.mk-appraisal-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.35rem;
}

.mk-appraisal-field-row .mk-appraisal-field i {
    top: auto;
    bottom: 1rem;
    right: 0.85rem;
}

.mk-appraisal-summary {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    padding: 0.85rem 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.88rem;
}

.mk-appraisal-summary strong {
    display: block;
    color: #1d3557;
    margin-bottom: 0.5rem;
}

.mk-appraisal-summary ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.mk-appraisal-summary li {
    color: #334155;
    padding: 0.2rem 0;
    line-height: 1.5;
}

.mk-appraisal-summary li span {
    color: #64748b;
}

.mk-appraisal-form-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1D3557;
    margin: 0 0 1.5rem 0;
    text-align: right;
}

.mk-appraisal-field {
    position: relative;
    display: flex;
    align-items: center;
}

.mk-appraisal-field i {
    position: absolute;
    right: 1rem;
    color: #999;
    z-index: 3;
    pointer-events: none;
}

.mk-appraisal-select {
    width: 100%;
    padding: 1rem 3rem 1rem 1rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    color: #333;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.mk-appraisal-select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 195, 247, 0.3);
}

.mk-appraisal-button {
    padding: 1rem 2rem;
    background: #4FC3F7;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    text-align: center;
    transition: background 0.3s ease, transform 0.3s ease;
    display: block;
    border: none;
    cursor: pointer;
}

.mk-appraisal-button:hover {
    background: #1D3557;
    transform: translateY(-2px);
    color: #fff;
}

.mk-appraisal-button:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

.mk-appraisal-button--secondary {
    background: #e2e8f0;
    color: #1d3557;
}

.mk-appraisal-button--secondary:hover {
    background: #cbd5e1;
    color: #1d3557;
}

.mk-appraisal-step {
    display: none;
    width: 100%;
}

.mk-appraisal-step.is-active {
    display: block;
}

.mk-appraisal-step-desc {
    font-size: 0.9rem;
    color: #64748b;
    margin: -0.75rem 0 1rem;
    line-height: 1.6;
}

.mk-appraisal-field--input input {
    width: 100%;
    padding: 1rem 3rem 1rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
}

.mk-appraisal-field--input input:focus {
    outline: none;
    border-color: #4FC3F7;
    box-shadow: 0 0 0 3px rgba(79, 195, 247, 0.2);
}

.mk-appraisal-form-actions {
    display: flex;
    gap: 0.75rem;
}

.mk-appraisal-form-actions .mk-appraisal-button {
    flex: 1;
    border: none;
    cursor: pointer;
}

.mk-appraisal-message {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.mk-appraisal-message--error {
    background: #fee2e2;
    color: #991b1b;
}

.mk-appraisal-message--success {
    background: #d1fae5;
    color: #065f46;
}

.mk-appraisal-message--info {
    background: #e0f2fe;
    color: #0c4a6e;
}

.mk-appraisal-select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Right Section (Orange Background) - First in RTL */
.mk-appraisal-right {
    background: #FF6600;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: visible;
    border-radius: 16px 0 0 16px;
    z-index: 1;
    min-width: 0;
}

.mk-appraisal-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #fff;
    margin: 0 13px 1.5rem 0;
    line-height: 1.2;
}

.mk-appraisal-subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 0 21px 1rem 0;
}

.mk-appraisal-car-image {
    flex: 1;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    margin-top: auto;
    position: relative;
    z-index: 2;
    padding-bottom: 0;
}

.mk-appraisal-car-image img {
    max-width: 100%;
    width: auto;
    height: auto;
    max-height: 220px;
    object-fit: contain;
    object-position: bottom center;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
    display: block;
}

/* === Responsive === */
@media (min-width: 993px) {
    .mk-appraisal-section {
        padding-top: 4.5rem;
    }

    .mk-appraisal-left {
        padding-top: 5rem;
    }

    .mk-appraisal-man-image {
        top: 15px;
        max-height: 300px;
    }

    .mk-appraisal-man-image img {
        max-height: 300px;
    }
}
@media (max-width: 1200px) {
    .mk-appraisal-wrapper {
        grid-template-columns: 1fr 1fr 1.2fr;
    }
    
    .mk-appraisal-left {
        padding: 7rem 1.5rem 2.5rem;
    }
    
    .mk-appraisal-center {
        padding: 2.5rem 1.5rem;
    }
    
    .mk-appraisal-right {
        padding: 2.5rem 1.5rem;
    }
}

@media (max-width: 992px) {
    .mk-appraisal-wrapper {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .mk-appraisal-section {
        padding-top: 2.5rem;
    }

    .mk-appraisal-left {
        padding: 1.5rem;
        padding-top: 1.5rem;
    }

    .mk-appraisal-center.mk-appraisal-cta {
        padding: 1.75rem 1.5rem;
        border-right: none;
        border-left: none;
        border-top: 1px solid rgba(29, 53, 87, 0.06);
        border-bottom: 1px solid rgba(29, 53, 87, 0.06);
    }

    .mk-appraisal-cta-inner {
        max-width: 420px;
    }

    .mk-appraisal-modal-panel {
        grid-template-columns: 1fr;
    }

    .mk-appraisal-modal-aside {
        display: none;
    }

    .mk-appraisal-man-image {
        position: relative;
        top: auto;
        right: auto;
        transform: none;
        width: 100%;
        max-width: 220px;
        max-height: 200px;
        margin: 0 auto 1rem;
    }

    .mk-appraisal-man-image img {
        max-height: 200px;
    }

    .mk-appraisal-right {
        padding: 1.5rem;
        border-radius: 16px 16px 0 0;
    }

    .mk-appraisal-left {
        border-radius: 0;
    }

    .mk-appraisal-title {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .mk-appraisal-section {
        padding: 2rem 0;
        overflow-x: clip;
        overflow-y: visible;
    }

    .mk-appraisal-wrapper {
        width: 100%;
        max-width: 100%;
        overflow: visible;
    }

    .mk-appraisal-left {
        padding: 1.5rem 1rem;
        overflow: visible;
    }

    .mk-appraisal-man-image {
        max-width: 200px;
        max-height: 180px;
        margin-bottom: 1rem;
    }

    .mk-appraisal-center.mk-appraisal-cta {
        padding: 1.5rem 1rem;
    }

    .mk-appraisal-cta-graphic {
        width: 150px;
        height: 150px;
    }

    .mk-appraisal-card {
        padding: 1.5rem;
        max-width: 100%;
    }

    .mk-appraisal-card-title {
        font-size: 1.25rem;
    }

    .mk-appraisal-form {
        max-width: 100%;
    }

    .mk-appraisal-field-row {
        flex-direction: column;
        align-items: stretch;
    }

    .mk-appraisal-field-connector {
        display: none;
    }

    .mk-appraisal-step-label {
        font-size: 0.75rem;
    }

    .mk-appraisal-right {
        padding: 1.5rem 1rem;
        min-height: 0;
    }

    .mk-appraisal-title {
        font-size: 1.75rem;
    }

    .mk-appraisal-subtitle {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .mk-appraisal-section {
        padding: 2rem 0;
        overflow-x: clip;
        overflow-y: visible;
    }

    .mk-appraisal-wrapper {
        overflow: visible;
    }

    .mk-appraisal-left {
        overflow: visible;
    }

    .mk-appraisal-man-image {
        max-width: 180px;
        max-height: 160px;
    }

    .mk-appraisal-card {
        padding: 1.25rem;
    }

    .mk-appraisal-card-title {
        font-size: 1.1rem;
    }

    .mk-appraisal-card-text {
        font-size: 0.85rem;
    }

    .mk-appraisal-modal-body {
        padding: 1.25rem 1rem 1rem;
    }

    .mk-appraisal-modal-close {
        top: 0.75rem;
        left: 0.75rem;
    }

    .mk-appraisal-title {
        font-size: 1.5rem;
    }
}

