/* =========================
   GLOBAL SAFETY
========================= */

body {
    overflow-x: hidden;
}

/* =========================
   MAIN SLIDER WRAPPER
========================= */

.ks-slider {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

/* =========================
   SLIDER TRACK
========================= */

.ks-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

/* =========================
   SLIDE FRAME
   (IMPORTANT: FIT MODE)
========================= */

.ks-slide {
    min-width: 100%;
    height: 450px;              /* frame height */
    display: flex;
    justify-content: center;
    align-items: center;
    background: #111;           /* empty space background */
    overflow: hidden;
}

/* =========================
   IMAGE FIT INSIDE FRAME
   (NO ZOOM, NO CROP)
========================= */

.ks-slide img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;       /* 🔥 KEY: FIT INSIDE */
    display: block;
}

/* =========================
   NAVIGATION BUTTONS
========================= */

.ks-prev,
.ks-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    padding: 10px 12px;
    font-size: 18px;
    cursor: pointer;
    border-radius: 50%;
    z-index: 10;
    transition: 0.2s ease;
}

.ks-prev:hover,
.ks-next:hover {
    background: rgba(0,0,0,0.75);
}

.ks-prev {
    left: 10px;
}

.ks-next {
    right: 10px;
}

/* =========================
   ADMIN THUMB GRID
========================= */

#ks_sortable {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    list-style: none;
    padding: 0;
    margin: 0;
}

/* =========================
   ADMIN IMAGE BOX
========================= */

.ks-item {
    position: relative;
    width: 90px;
    height: 90px;
    border: 2px solid #ddd;
    border-radius: 10px;
    overflow: hidden;
    cursor: move;
    background: #fff;
    transition: 0.2s ease;
}

.ks-item:hover {
    transform: scale(1.05);
    border-color: #2271b1;
}

.ks-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* =========================
   REMOVE BUTTON
========================= */

.ks-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    background: #d63638;
    color: #fff;
    font-size: 14px;
    line-height: 18px;
    text-align: center;
    border-radius: 50%;
    cursor: pointer;
    font-weight: bold;
}

/* =========================
   RESPONSIVE MOBILE
========================= */

@media (max-width: 768px) {

    .ks-slide {
        height: 280px;   /* smaller frame on mobile */
    }

    .ks-prev,
    .ks-next {
        padding: 8px;
        font-size: 14px;
    }

    .ks-item {
        width: 70px;
        height: 70px;
    }
}