.ah-controls{
    --ah-field-placeholder: #7b8794;
}

/* Labels */
.ah-controls .form-label{
    margin-bottom: .55rem;
    font-weight: 700;
    color: #212529;
}

/* Basis: Inputs + Selects */
.ah-controls .form-control,
.ah-controls .form-select{
    height: var(--ah-field-height);
    min-height: var(--ah-field-height);
    padding: .55rem 1rem;
    border: 1px solid var(--ah-field-border);
    border-radius: var(--ah-field-radius) !important;
    background: var(--ah-field-bg);
    color: #212529;
    box-sizing: border-box;
    transition: .2s ease;
}

.ah-controls .form-control::placeholder{
    color: var(--ah-field-placeholder);
}

.ah-controls .form-select{
    padding-right: 2.75rem;
}

.ah-controls .form-control:focus,
.ah-controls .form-select:focus{
    border-color: rgba(255, 165, 0, .55);
    box-shadow: 0 0 0 .25rem rgba(255, 165, 0, .14);
}

/* Passwortfelder */
.ah-controls .input-group > .form-control{
    height: var(--ah-field-height);
    min-height: var(--ah-field-height);
    padding: .55rem 1rem;
    border-top-left-radius: var(--ah-field-radius) !important;
    border-bottom-left-radius: var(--ah-field-radius) !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.ah-controls .input-group > .btn.ah-pw-toggle{
    height: var(--ah-field-height);
    min-height: var(--ah-field-height);
    min-width: 54px;
    padding: 0 .9rem;
    border: 1px solid var(--ah-field-border);
    border-left: 0;
    background: #fff;
    color: #6c757d;
    border-top-right-radius: var(--ah-field-radius) !important;
    border-bottom-right-radius: var(--ah-field-radius) !important;
    transition: .2s ease;
}

.ah-controls .input-group > .btn.ah-pw-toggle:hover{
    background: #fff;
    color: #495057;
    border-color: #cfd6dd;
}

.ah-controls .input-group > .btn.ah-pw-toggle:focus{
    background: #fff;
    color: #495057;
    border-color: rgba(255, 165, 0, .55);
    box-shadow: 0 0 0 .25rem rgba(255, 165, 0, .14);
}

/* Datei-Input */
.ah-controls input[type="file"].form-control{
    height: 42px;
    min-height: var(--ah-field-height);
    padding: .35rem .5rem;
    border: 1px solid var(--ah-field-border);
    border-radius: 16px !important;
    background: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
}

.ah-controls input[type="file"].form-control::file-selector-button{
    height: 40px;
    min-width: 190px;
    margin: -.35rem 1rem -.35rem -.5rem;
    padding: 0 1.4rem;
    border: 0;
    border-right: 1px solid #e8ecf1;
    border-radius: 12px 0 0 12px;
    background: linear-gradient(180deg, #f9fafb 0%, #f1f3f5 100%);
    color: #212529;
    font-weight: 700;
    cursor: pointer;
    transition: .2s ease;
}

.ah-controls input[type="file"].form-control:hover::file-selector-button{
    background: linear-gradient(180deg, #ffffff 0%, #f4f6f8 100%);
}

.ah-controls input[type="file"].form-control:focus{
    border-color: rgba(255, 165, 0, .55);
    box-shadow: 0 0 0 .25rem rgba(255, 165, 0, .14);
}


/* Validation */
.ah-controls .is-invalid{
    border-color: #dc3545 !important;
}

.ah-controls .input-group > .form-control.is-invalid + .ah-pw-toggle{
    border-color: #dc3545 !important;
}

.ah-controls .invalid-feedback{
    display: none;
    font-size: .875rem;
    margin-top: .4rem;
}

.ah-controls .invalid-feedback.d-block{
    display: block;
}

/* Checkbox */
.ah-controls .form-check-input:checked{
    background-color: var(--ah-accent);
    border-color: var(--ah-accent);
}

.ah-controls .form-check-input:focus{
    box-shadow: 0 0 0 .2rem rgba(255, 165, 0, .25);
}

.ah-controls .form-check-input:hover{
    border-color: var(--ah-accent);
}

.ah-controls .form-check-input.is-invalid{
    border-color: #dc3545 !important;
}

.ah-controls .form-check-input.is-invalid:focus{
    box-shadow: 0 0 0 .2rem rgba(220, 53, 69, .15);
}

/* Captcha */
.ah-captcha-block{
    width: 100%;
}

.ah-captcha{
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    width: 100%;
}

.ah-captcha__img{
    min-width: 150px;
    height: 42px;
    padding: .35rem .8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #e7dfd2;
    border-radius: 12px;
    overflow: hidden;
    line-height: 1;
    flex: 0 0 auto;
}

.ah-captcha__img span{
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    max-height: 100%;
}

.ah-captcha__img img,
.ah-captcha__img svg,
.ah-captcha__img canvas{
    display: block !important;
    width: auto !important;
    height: 42px !important;
    max-height: 40px !important;
    max-width: 100% !important;
}

.ah-captcha__btn{
    min-height: 42px;
    padding: .75rem 1rem !important;
    border-radius: 18px !important;
    font-weight: 700;
    white-space: nowrap;
    flex: 0 0 auto;
}

.ah-captcha__input{
    min-height: 42px;
    flex: 1 1 260px;
}

.ah-captcha-input-wrap{
    flex: 1 1 320px;
    min-width: 260px;
}

.ah-captcha-input-wrap .invalid-feedback{
    margin-top: .45rem;
}

/* Gemeinsamer CTA-Button wie "Inserat aufgeben" */
.btn-ah-cta,
.btn-ah-cta:link,
.btn-ah-cta:visited{
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    padding: .68rem 1.15rem;
    border: 1px solid transparent !important;
    border-radius: 999px !important;
    background: linear-gradient(135deg, #f59f00, #cc7a00) !important;
    color: #fff !important;
    text-decoration: none !important;
    font-weight: 800;
    letter-spacing: .01em;
    line-height: 1;
    white-space: nowrap;
    box-shadow: 0 12px 24px rgba(245, 159, 0, .24);
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}

.btn-ah-cta:hover,
.btn-ah-cta:focus,
.btn-ah-cta:active{
    color: #fff !important;
    text-decoration: none !important;
}

.btn-ah-cta:hover{
    transform: translateY(-1px);
    box-shadow: 0 16px 28px rgba(245, 159, 0, .30);
    filter: brightness(.99);
}

.btn-ah-cta:focus-visible{
    outline: 0;
    box-shadow:
        0 0 0 .22rem rgba(255, 190, 59, .24),
        0 16px 28px rgba(245, 159, 0, .30);
}

.btn-ah-cta:active{
    transform: translateY(0);
    box-shadow: 0 10px 18px rgba(245, 159, 0, .22);
}

.btn-ah-cta i{
    line-height: 1;
}

/* ================================
   Sortierung + Ansicht (global)
   custom-ah-controls.css
================================ */

.btn-box{
    display:flex;
    align-items:center;
}

.anasayfa-chip{
    min-height:46px;
    padding:.72rem 1rem;
    border-radius:999px;
    border:1px solid #e7dcc8;
    background:#fff;
    color:#4b5563;
    text-decoration:none;
    font-weight:600;
    box-shadow:0 6px 18px rgba(17, 24, 39, .05);
    transition:.18s ease;
}

.anasayfa-chip:hover{
    color:#1f2937;
    border-color:#dcc79d;
    background:#fff9ef;
    transform:translateY(-1px);
}

.anasayfa-sort{
    white-space:nowrap;
    font-weight:600;
}

.anasayfa-viewbtn{
    width:48px;
    height:48px;
    min-width:48px;
    padding:0;
    border-radius:50%;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    flex:0 0 48px;
    background:#fff;
}

.anasayfa-viewbtn i{
    font-size:1.1rem;
    line-height:1;
}

.ah-dd--sort .dropdown-menu{
    min-width:320px;
    border:none;
    border-radius:18px;
    padding:.55rem;
    box-shadow:0 20px 44px rgba(17, 24, 39, .12);
    border:1px solid #eee3cf;
}

.ah-dd--sort .dropdown-item{
    border-radius:12px;
    padding:.72rem .9rem;
    font-weight:700;
    color:#374151;
}

.ah-dd--sort .dropdown-item:hover{
    background:#fff6e6;
    color:#9a5b00;
}

.ah-photo-manager .pm-grid .row{
    min-height: 1px;
}

.ah-photo-manager .pm-editor-image{
    display:block;
    max-width:100%;
}

.ah-photo-manager .pm-preview-target{
    width:100%;
    height:100%;
    overflow:hidden;
}

.ah-photo-manager .pm-delete-modal .modal-content,
.ah-photo-manager .pm-editor-modal .modal-content{
    overflow:hidden;
}

.ah-photo-manager .btn-icon{
    width:44px;
    height:44px;
    padding:0;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    border-radius:999px;
}

/* Datei upload */
.ah-upload-inline{
    display:flex;
    flex-direction:column;
    gap:.75rem;
}

.ah-upload-row{
    display:flex;
    align-items:center;
    gap:.85rem;
    min-height:54px;
    padding:.6rem;
    border:1px solid #eadfcb;
    border-radius:18px;
    background:#fff;
}

.ah-upload-trigger{
    flex:0 0 auto;
    min-height:42px;
    padding:.7rem 1.1rem;
    white-space:nowrap;
}

.ah-upload-filename{
    flex:1 1 auto;
    min-width:0;
    color:#6b7280;
    font-weight:600;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}

.ah-upload-input-hidden{
    display:none;
}

.ah-category-menu{
    width:100%;
    max-width:none;
    background:#fff;
    border:1px solid rgba(15, 23, 42, .08);
    border-radius:1rem;
    box-shadow:0 1rem 2.5rem rgba(15, 23, 42, .05);
    overflow:hidden;
}

/*
 * Alle drei Sidebar-Blöcke auf Desktop gleich breit:
 * - Kategorien
 * - Filtern
 * - Höhepunkte
 *
 * Die zusätzliche Breite wird nur nach links aufgebaut.
 * Die rechte Kante und der Inseratebereich bleiben unverändert.
 */
@media (min-width: 992px){
    #mt-main .sidebarkategoriler{
        --ah-sidebar-left-offset:40px;

        position:relative;
        overflow:visible;
        z-index:2;
    }

    #mt-main .sidebarkategoriler .ah-category-menu,
    #mt-main .sidebarkategoriler .ah-sf,
    #mt-main .sidebarkategoriler .ah-hl{
        position:relative;
        left:calc(-1 * var(--ah-sidebar-left-offset));
        width:calc(100% + var(--ah-sidebar-left-offset));
        max-width:none;
    }

    #mt-main .sidebarkategoriler .ah-hl > .card{
        width:100%;
    }
    
    .ah-category-menu__body{
        max-height:none;
        overflow:visible;
    }
}

@media (min-width: 1400px){
    #mt-main .sidebarkategoriler{
        --ah-sidebar-left-offset:clamp(120px, 8vw, 180px);
    }
}

.ah-category-menu__header{
    padding:1.15rem 1.15rem .55rem;
}

.ah-category-menu__title{
    margin: 0 0 .3rem !important;
    font-weight: 900;
    font-size: 1rem;
    letter-spacing: .10em;
    text-transform: uppercase;
    color: rgba(0, 0, 0, .72);
}

.ah-category-menu__body{
    padding: 0 1.15rem .75rem;
    max-height: 530px;
    overflow-y: auto;
    scrollbar-width:thin;
    scrollbar-color:rgba(15, 23, 42, .16) transparent;
}

.ah-category-menu__body::-webkit-scrollbar{
    width:8px;
}

.ah-category-menu__body::-webkit-scrollbar-thumb{
    background:rgba(15, 23, 42, .16);
    border-radius:999px;
}

.ah-category-menu__body::-webkit-scrollbar-track{
    background:transparent;
}

.ah-category-menu__list{
    margin:0;
    padding:0;
    list-style:none;
}

.ah-category-menu__item{
    margin:0;
}

.ah-category-menu__link{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem 0;
    padding: .72rem 0; /* vorher z.B. 1rem 0 */
    border-bottom: 1px solid rgba(15, 23, 42, .08);
    text-decoration: none;
    color: #2f3640;
    transition: color .18s ease, padding-left .18s ease;
}

.ah-category-menu__item:last-child .ah-category-menu__link{
    border-bottom:0;
}

.ah-category-menu__link:hover{
    color:#d88900;
    padding-left:.3rem;
}

.ah-category-menu__link.is-active{
    color:#111827;
    font-weight:700;
}

.ah-category-menu__name{
    min-width: 0;
    flex: 1 1 auto;
    font-size: .98rem;
    font-weight: 600;
    line-height: 1.2; /* kompakter */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ah-category-menu__count{
    flex:0 0 auto;
    min-width:2.5rem;
    padding:.28rem .7rem;
    border-radius:999px;
    background:#f3f4f6;
    border:1px solid rgba(15, 23, 42, .08);
    color:#5b6472;
    text-align:center;
    font-size:.82rem;
    font-weight:800;
    line-height:1;
}

.ah-category-menu__link.is-active .ah-category-menu__count{
    background:rgba(245, 159, 0, .12);
    border-color:rgba(245, 159, 0, .18);
    color:#d88900;
}

/* =========================================================
   AH File Upload
   ========================================================= */

.ah-file-upload-field {
    margin-bottom: 1rem;
}

.ah-file-upload {
    display: flex;
    align-items: stretch;
    width: 100%;
    min-height: 52px;
    border: 1px solid var(--ah-border, rgba(15, 23, 42, .10));
    border-radius: 18px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .04);
    transition:
        border-color .18s ease,
        box-shadow .18s ease,
        background-color .18s ease;
}

.ah-file-upload:focus-within {
    border-color: rgba(245, 159, 0, .55);
    box-shadow:
        0 0 0 .22rem rgba(245, 159, 0, .14),
        0 10px 24px rgba(15, 23, 42, .04);
}

.ah-file-upload__input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
}

.ah-file-upload__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 190px;
    margin: 0;
    padding: .8rem 1.15rem;
    background: linear-gradient(180deg, #f8fafc, #eef2f7);
    border-right: 1px solid var(--ah-border, rgba(15, 23, 42, .10));
    color: #111827;
    font-size: .95rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition:
        background .18s ease,
        color .18s ease,
        border-color .18s ease;
}

.ah-file-upload__button:hover {
    background: linear-gradient(180deg, #fff7df, #ffe8a3);
    color: #111827;
}

.ah-file-upload__name {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
    padding: .8rem 1rem;
    color: #374151;
    font-size: .95rem;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: #fff;
}

/* Fehlerzustand */
.ah-file-upload.is-invalid,
.ah-file-upload:has(.ah-file-upload__input.is-invalid) {
    border-color: #dc3545;
}

.ah-file-upload.is-invalid:focus-within {
    border-color: #dc3545;
    box-shadow: 0 0 0 .22rem rgba(220, 53, 69, .14);
}

/* Falls du direkt dem Input is-invalid gibst */
.ah-file-upload:has(.ah-file-upload__input.is-invalid):focus-within {
    box-shadow: 0 0 0 .22rem rgba(220, 53, 69, .14);
}

/* Disabled */
.ah-file-upload:has(.ah-file-upload__input:disabled) {
    background: #f8fafc;
    opacity: .72;
    cursor: not-allowed;
}

.ah-file-upload:has(.ah-file-upload__input:disabled) .ah-file-upload__button,
.ah-file-upload:has(.ah-file-upload__input:disabled) .ah-file-upload__name {
    cursor: not-allowed;
}

.ah-results-count {
    display: inline-flex !important;
    align-items: center !important;
    gap: .55rem;
}

.ah-results-count-dot {
    width: 14px;
    height: 14px;
    min-width: 14px;
    flex: 0 0 14px;
    display: inline-block;
    align-self: center;
    margin: 0 !important;
    transform: none !important;
    border-radius: 999px;
}

.ah-results-count .ah-section-titel {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
    display: block;
}

/* Mobil */
@media (max-width: 576px) {
.ah-file-upload {
        flex-direction: column;
        min-height: 0;
    }

    .ah-file-upload__button {
        width: 100%;
        min-width: 0;
        border-right: 0;
        border-bottom: 1px solid var(--ah-border, rgba(15, 23, 42, .10));
        padding: .85rem 1rem;
    }

    .ah-file-upload__name {
        min-height: 46px;
        padding: .8rem 1rem;
    }

.btn-box{
        width:100%;
    }

    .btn-box > ul{
        width:100%;
        justify-content:space-between !important;
        flex-wrap:wrap !important;
    }

    .ah-dd--sort{
        flex:1 1 auto;
        min-width:0;
    }

    .anasayfa-sort{
        width:100%;
        justify-content:space-between;
    }
}

@media (max-width: 768px){
    .ah-captcha{
        align-items: stretch;
    }

    .ah-captcha__img,
    .ah-captcha__btn,
    .ah-captcha__input{
        width: 100%;
    }

    .ah-captcha__btn{
        justify-content: center;
    }
}