/**
 * Kursevi Widget Styles
 */

.ks-widget-wrap {
    padding: 48px 18px;
    border-radius: 24px;
    margin: 20px 0;
}

.ks-widget-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.ks-top {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.ks-widget-title {
    margin-bottom: 0;
}

.ks-widget-title h2 {
    margin: 0;
    font-size: clamp(22px, 3vw, 34px);
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: #0f172a;
}

.ks-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.ks-pill {
    cursor: pointer;
    user-select: none;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.10);
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 8px 20px rgba(2, 6, 23, 0.06);
    font-weight: 700;
    font-size: 12.5px;
    letter-spacing: 0.02em;
    color: #312450;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.ks-pill:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(2, 6, 23, 0.10);
}

.ks-pill.is-active {
    background: linear-gradient(90deg, #f26a1b, #ff9a3d);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 18px 40px rgba(242, 106, 27, .25);
}

.ks-widget-grid {
    display: grid;
    gap: 18px;
    margin-bottom: 28px;
}

/* Card */
.ks-card {
    position: relative;
    border-radius: 22px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 10px 30px rgba(2, 6, 23, 0.12);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
    transform-style: preserve-3d;
    perspective: 900px;
}

.ks-card:hover {
    transform: translateY(-6px) rotateX(4deg) rotateY(-4deg);
    box-shadow: 0 28px 70px rgba(2, 6, 23, 0.22);
    border-color: rgba(242, 106, 27, 0.35);
}

/* Media */
.ks-media {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: #0b1220;
}

.ks-media-link {
    display: block;
    width: 100%;
    height: 100%;
}

.ks-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: scale(1.04);
    transition: transform 0.35s ease, filter 0.35s ease;
    filter: saturate(1.05) contrast(1.02);
}

.ks-card:hover .ks-media img {
    transform: scale(1.1);
    filter: saturate(1.15) contrast(1.05);
}

/* Shine effect */
.ks-shine {
    position: absolute;
    inset: -40% -70%;
    background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.18) 45%, transparent 60%);
    transform: rotate(10deg) translateX(-20%);
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.ks-card:hover .ks-shine {
    opacity: 1;
    animation: ks-sweep 0.9s ease;
}

@keyframes ks-sweep {
    from { transform: rotate(10deg) translateX(-40%); }
    to { transform: rotate(10deg) translateX(40%); }
}

/* Badge */
.ks-badge {
    position: absolute;
    left: 14px;
    top: 14px;
    padding: 8px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: white;
    display: flex;
    gap: 8px;
    align-items: center;
    box-shadow: 0 14px 30px rgba(43, 108, 255, 0.22);
}

.ks-badge-default {
    background: linear-gradient(90deg, #2b6cff, #58b6ff);
}

.ks-badge-discount {
    background: linear-gradient(90deg, #ff3b59, #ffb703);
    box-shadow: 0 14px 30px rgba(255, 59, 89, 0.22);
}

.ks-badge-hot {
    background: linear-gradient(90deg, #f26a1b, #ff9a3d);
    box-shadow: 0 14px 30px rgba(242, 106, 27, 0.25);
}

.ks-badge-top {
    background: linear-gradient(90deg, #2b6cff, #58b6ff);
}

/* Price */
.ks-price {
    position: absolute;
    right: 14px;
    top: 14px;
    padding: 8px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    color: #0b1220;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 14px 30px rgba(2, 6, 23, 0.1);
}

.ks-price s {
    color: #94a3b8;
    font-weight: 700;
    margin-right: 6px;
}

/* Content */
.ks-content {
    padding: 16px;
}

.ks-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 10px;
}

.ks-chip {
    font-size: 11.5px;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 999px;
    color: rgba(15, 23, 42, 0.85);
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(15, 23, 42, 0.1);
}

.ks-name {
    margin: 0;
    font-size: 18px;
    letter-spacing: -0.02em;
    line-height: 1.25;
    color: #0f172a;
}

.ks-name a {
    color: inherit;
    text-decoration: none;
}

.ks-name a:hover {
    color: #f26a1b;
}

.ks-desc {
    margin: 8px 0 0;
    color: #64748b;
    font-size: 13.5px;
    line-height: 1.45;
}

.ks-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed rgba(15, 23, 42, 0.14);
}

/* Button */
.ks-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-weight: 800;
    font-size: 13px;
    padding: 10px 12px;
    border-radius: 14px;
    color: white;
    background: linear-gradient(90deg, #f26a1b, #ff9a3d);
    box-shadow: 0 16px 40px rgba(242, 106, 27, 0.22);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.ks-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 55px rgba(242, 106, 27, 0.28);
    filter: saturate(1.06);
    text-decoration: none;
}

/* Info */
.ks-info {
    font-size: 12.5px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.ks-pulse {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(242, 106, 27, 0.75);
    box-shadow: 0 0 0 4px rgba(242, 106, 27, 0.15);
}

/* Duration */
.ks-duration {
    position: relative;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 10px 26px rgba(2, 6, 23, 0.08);
    overflow: hidden;
}

.ks-duration::before {
    content: "";
    position: absolute;
    inset: -2px;
    background: radial-gradient(60% 120% at 20% 20%, rgba(242, 106, 27, 0.18) 0%, transparent 60%),
                radial-gradient(60% 120% at 80% 30%, rgba(43, 108, 255, 0.14) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.ks-duration-text {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.ks-num {
    font-weight: 900;
    font-size: 14px;
}

.ks-unit {
    font-size: 11px;
}

.ks-duration.swap-out {
    transform: translateY(2px) scale(0.985);
    opacity: .65;
}

.ks-duration.swap-in {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* More button */
.ks-widget-more {
    display: flex;
    justify-content: center;
    margin-top: 28px;
}

.ks-more-btn {
    text-decoration: none;
    font-weight: 900;
    letter-spacing: 0.02em;
    padding: 14px 18px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #0f172a;
    box-shadow: 0 18px 50px rgba(2, 6, 23, 0.12);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    display: inline-block;
}

.ks-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 26px 70px rgba(2, 6, 23, 0.16);
    border-color: rgba(242, 106, 27, 0.35);
    text-decoration: none;
}

/* Responsive */
@media (max-width: 1024px) {
    .ks-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .ks-filters {
        justify-content: flex-start;
    }

    .ks-widget-grid {
        gap: 14px;
    }
}

@media (max-width: 768px) {
    .ks-widget-wrap {
        padding: 28px 14px;
    }

    .ks-widget-title h2 {
        font-size: clamp(18px, 2vw, 28px);
    }

    .ks-media {
        height: 180px;
    }

    .ks-card {
        border-radius: 16px;
    }

    .ks-bottom {
        flex-direction: column;
        align-items: flex-start;
    }

    .ks-btn {
        width: 100%;
    }

    .ks-info {
        align-self: flex-start;
    }
}

@media (max-width: 560px) {
    .ks-widget-wrap {
        padding: 20px 12px;
    }

    .ks-widget-title h2 {
        font-size: 20px;
    }

    .ks-media {
        height: 200px;
    }

    .ks-price,
    .ks-badge {
        font-size: 11px;
    }

    .ks-name {
        font-size: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ks-card,
    .ks-btn,
    .ks-more-btn,
    .ks-media img,
    .ks-shine,
    .ks-duration,
    .ks-duration::before {
        transition: none !important;
        animation: none !important;
    }
}
