/* EnFavori reusable image cropper */
.ef-image-field {
    --ef-image-accent: #12b8a6;
    --ef-image-danger: #c93c54;
    --ef-image-border: #dce6ef;
    --ef-image-muted: #66778c;
    width: 100%;
}

.ef-image-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    align-items: center;
    margin-top: 8px;
}

.ef-image-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 42px;
    padding: 9px 15px;
    border: 1px solid transparent;
    border-radius: 9px;
    font: inherit;
    font-weight: 800;
    line-height: 1.2;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.ef-image-btn:hover { transform: translateY(-1px); }
.ef-image-btn:disabled { cursor: not-allowed; opacity: .45; transform: none; }
.ef-image-btn-primary { background: var(--ef-image-accent); color: #fff; box-shadow: 0 8px 18px rgba(18,184,166,.16); }
.ef-image-btn-light { background: #fff; color: #132f50; border-color: var(--ef-image-border); }
.ef-image-btn-danger { background: #fff5f6; color: var(--ef-image-danger); border-color: #f3c6ce; }

.ef-image-input {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.ef-image-preview-wrap {
    position: relative;
    display: none;
    width: min(100%, 680px);
    margin-top: 12px;
    padding: 10px;
    border: 1px solid var(--ef-image-border);
    border-radius: 12px;
    background: #f8fbfd;
}

.ef-image-preview-wrap.is-visible { display: block; }
.ef-image-field[data-ef-ratio="1"] .ef-image-preview-wrap { max-width: 330px; }

.ef-image-preview {
    display: block;
    width: 100%;
    max-height: 390px;
    border-radius: 9px;
    background: #eef4fb;
    object-fit: cover;
}

.ef-image-field[data-ef-ratio="1"] .ef-image-preview {
    aspect-ratio: 1 / 1;
}

.ef-image-field[data-ef-ratio="1.8181818"] .ef-image-preview,
.ef-image-field[data-ef-ratio="20/11"] .ef-image-preview {
    aspect-ratio: 20 / 11;
}

.ef-image-note {
    display: block;
    margin-top: 7px;
    color: var(--ef-image-muted);
    font-size: 12px;
    line-height: 1.45;
}

.ef-image-status {
    display: none;
    margin-top: 8px;
    color: #0b766d;
    font-size: 12px;
    font-weight: 700;
}
.ef-image-status.is-visible { display: block; }

.ef-crop-modal {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
}
.ef-crop-modal.is-open { display: flex; }
.ef-crop-backdrop { position: absolute; inset: 0; background: rgba(7,22,39,.78); backdrop-filter: blur(3px); }
.ef-crop-dialog {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(920px, 100%);
    max-height: calc(100vh - 36px);
    overflow: hidden;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 24px 80px rgba(0,0,0,.34);
}
.ef-crop-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 18px 13px;
    border-bottom: 1px solid #dce6ef;
}
.ef-crop-title { margin: 0; color: #132f50; font-size: 19px; font-weight: 900; }
.ef-crop-subtitle { margin: 4px 0 0; color: #66778c; font-size: 13px; line-height: 1.4; }
.ef-crop-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border: 1px solid #dce6ef;
    border-radius: 10px;
    background: #fff;
    color: #132f50;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}
.ef-crop-stage {
    min-height: 330px;
    height: min(62vh, 590px);
    padding: 12px;
    overflow: hidden;
    background: #101b2a;
}
.ef-crop-stage img { display: block; max-width: 100%; }
.ef-crop-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 11px 16px;
    border-top: 1px solid #dce6ef;
    background: #f8fbfd;
}
.ef-crop-tool {
    min-width: 42px;
    min-height: 38px;
    padding: 7px 10px;
    border: 1px solid #dce6ef;
    border-radius: 8px;
    background: #fff;
    color: #132f50;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}
.ef-crop-spacer { flex: 1 1 auto; }
.ef-crop-cancel { color: #4f6175; }
.ef-crop-apply { min-width: 150px; border-color: #12b8a6; background: #12b8a6; color: #fff; }
.ef-crop-help {
    padding: 0 16px 12px;
    color: #66778c;
    font-size: 12px;
    line-height: 1.4;
    background: #f8fbfd;
}
body.ef-crop-lock { overflow: hidden !important; }

@media (max-width: 640px) {
    .ef-image-actions { align-items: stretch; }
    .ef-image-btn { flex: 1 1 145px; min-height: 40px; padding: 8px 11px; }
    .ef-crop-modal { padding: 0; }
    .ef-crop-dialog { width: 100%; height: 100%; max-height: none; border-radius: 0; }
    .ef-crop-header { padding: 13px 14px 11px; }
    .ef-crop-title { font-size: 17px; }
    .ef-crop-stage { flex: 1 1 auto; height: auto; min-height: 300px; }
    .ef-crop-toolbar { padding: 9px 10px; gap: 6px; }
    .ef-crop-tool { min-height: 40px; }
    .ef-crop-spacer { display: none; }
    .ef-crop-cancel, .ef-crop-apply { flex: 1 1 45%; }
    .ef-crop-help { padding: 0 12px 10px; }
}

/* Eski form önizleme sınıflarının ölçüyü daraltmasını engelle. */
.ef-image-field .ef-image-preview {
    width: 100% !important;
    max-width: none !important;
    max-height: 390px !important;
    margin: 0 !important;
}
.ef-image-field[data-ef-ratio="1"] .ef-image-preview {
    max-height: none !important;
}
