/* ============================================
   assets/css/calc.css — Стили калькулятора
   ============================================ */

/* ===== ОБЩИЕ ===== */
.slick-slide img { display: block; width: 100%; }
.klassrad        { padding: 0 20px; }
.slick-next      { right: 0; }
.slick-prev      { left: 0; }

/* ===== ПОДСКАЗКА ЗАГРУЗКИ ===== */
.map-loading-hint {
    position:        fixed;
    top:             70px;
    right:           700px;
    font-size:       18px;
    font-weight:     600;
    color:           #6366f1;
    background:      rgba(237, 233, 254, 0.95);
    border:          1px solid #c4b5fd;
    border-radius:   6px;
    padding:         4px 10px;
    z-index:         9999;
    letter-spacing:  0.3px;
    pointer-events:  none;
    backdrop-filter: blur(4px);
    box-shadow:      0 2px 8px rgba(99, 102, 241, 0.15);
    animation:       hint-fade-in 0.5s ease;
}
@keyframes hint-fade-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}
@media (max-width: 768px) {
    .map-loading-hint {
        top:       60px;
        right:     20px;
        font-size: 18px;
        padding:   4px 15px;
    }
}

/* ===== ПОЛЯ ВВОДА ===== */
.input-wrapper {
    position:    relative;
    display:     flex;
    align-items: center;
}
.input-wrapper .form-control {
    padding-right: 45px !important;
}

/* ===== КНОПКА ОЧИСТКИ ===== */
.clear-btn {
    position:        absolute;
    right:           5px;
    top:             50%;
    transform:       translateY(-50%);
    width:           24px;
    height:          24px;
    border-radius:   50%;
    border:          none;
    background:      #4f46e5;
    cursor:          pointer;
    display:         none;
    align-items:     center;
    justify-content: center;
    transition:      all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:      0 2px 8px rgba(239, 68, 68, 0.25);
    z-index:         10;
    padding:         0;
}
.clear-btn svg {
    stroke:      #ffffff;
    transition:  transform 0.2s ease;
    flex-shrink: 0;
}
.input-wrapper.has-value .clear-btn { display: flex; }
.clear-btn:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform:  translateY(-50%) scale(1.15);
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4);
}
.clear-btn:hover svg { transform: rotate(90deg); }
.clear-btn:active {
    transform:  translateY(-50%) scale(0.95);
    box-shadow: 0 1px 4px rgba(239, 68, 68, 0.3);
}
.clear-btn:focus {
    outline:    none;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25);
}

/* ===== КНОПКА РАССЧИТАТЬ ===== */
.calc-route-btn {
    display:         inline-flex;
    align-items:     center;
    justify-content: center;
    gap:             8px;
    width:           100%;
    padding:         9px 24px;
    font-size:       15px;
    font-weight:     700;
    letter-spacing:  0.3px;
    color:           #ffffff;
    background:      linear-gradient(135deg, #6366f1, #4f46e5);
    border:          2px solid #4338ca;
    border-radius:   12px;
    cursor:          pointer;
    transition:      all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:      0 4px 15px rgba(99, 102, 241, 0.35);
    position:        relative;
    overflow:        hidden;
}
.calc-route-btn::before {
    content:    '';
    position:   absolute;
    top:        0;
    left:       -100%;
    width:      100%;
    height:     100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}
.calc-route-btn:hover {
    background:   linear-gradient(135deg, #4f46e5, #4338ca);
    border-color: #3730a3;
    box-shadow:   0 6px 25px rgba(99, 102, 241, 0.5);
    transform:    translateY(-2px);
}
.calc-route-btn:hover::before { left: 100%; }
.calc-route-btn:active {
    transform:  translateY(0);
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
}
.calc-route-btn:focus {
    outline:    none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3);
}
.calc-route-btn svg {
    stroke:      #ffffff;
    flex-shrink: 0;
}
.calc-route-btn:disabled {
    opacity:    0.5;
    cursor:     not-allowed;
    transform:  none;
    box-shadow: none;
}
.calc-route-btn.loading {
    pointer-events: none;
    opacity:        0.8;
}
@keyframes spin-icon {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
.calc-route-btn.loading svg {
    animation: spin-icon 1s linear infinite;
}

/* ===== АВТОКОМПЛИТ ===== */
.autocomplete-list {
    position:      absolute;
    top:           100%;
    left:          0;
    right:         0;
    background:    #ffffff;
    border:        1px solid #c4b5fd;
    border-top:    none;
    border-radius: 0 0 8px 8px;
    max-height:    250px;
    overflow-y:    auto;
    z-index:       1000;
    display:       none;
    box-shadow:    0 8px 24px rgba(99, 102, 241, 0.15);
}
.autocomplete-item {
    padding:       10px 14px;
    cursor:        pointer;
    font-size:     13px;
    color:         #1e293b;
    border-bottom: 1px solid #f1f5f9;
    transition:    all 0.15s ease;
    display:       flex;
    align-items:   center;
    gap:           8px;
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover,
.autocomplete-item.active {
    background: #ede9fe;
    color:      #4f46e5;
}
.autocomplete-item .item-icon {
    flex-shrink:     0;
    width:           18px;
    height:          18px;
    display:         flex;
    align-items:     center;
    justify-content: center;
    font-size:       12px;
}
.autocomplete-item .item-text { flex: 1; }
.autocomplete-item .item-text .item-name {
    font-weight: 600;
    font-size:   13px;
}
.autocomplete-item .item-text .item-desc {
    font-size:  11px;
    color:      #94a3b8;
    margin-top: 1px;
}
.autocomplete-item .item-category {
    flex-shrink:    0;
    font-size:      9px;
    font-weight:    600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding:        2px 6px;
    border-radius:  4px;
    background:     #f1f5f9;
    color:          #64748b;
}
.autocomplete-item:hover .item-category {
    background: #c4b5fd;
    color:      #4f46e5;
}
.autocomplete-item .highlight {
    background:    #fef08a;
    border-radius: 2px;
    padding:       0 1px;
}
.autocomplete-separator {
    padding:        6px 14px;
    font-size:      10px;
    font-weight:    700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color:          #6366f1;
    background:     #f8fafc;
    border-bottom:  1px solid #e2e8f0;
    pointer-events: none;
}
.autocomplete-list::-webkit-scrollbar       { width: 5px; }
.autocomplete-list::-webkit-scrollbar-track  { background: #f1f5f9; }
.autocomplete-list::-webkit-scrollbar-thumb  {
    background:    #c4b5fd;
    border-radius: 4px;
}

/* ===== КНОПКА СМЕНЫ ===== */
.swap-wrap {
    padding-top:     0 !important;
    padding-bottom:  0 !important;
    margin-top:      0 !important;
    margin-bottom:   0 !important;
    height:          30px;
    display:         flex;
    align-items:     center;
    justify-content: flex-start;
}
.swap-btn {
    display:          inline-flex;
    align-items:      center;
    gap:              2px;
    padding:          4px 10px;
    background-color: #6366f1;
    border:           1px solid #4f46e5;
    border-radius:    20px;
    color:            #ffffff;
    cursor:           pointer;
    font-size:        12px;
    line-height:      1;
    transition:       all 0.2s ease;
    height:           26px;
}
.swap-btn:hover {
    background-color: #4f46e5;
    border-color:     #4338ca;
}
.swap-btn:focus {
    outline:    none;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}
.swap-btn svg { stroke: #ffffff; }
@keyframes blink-swap {
    0%, 100% { opacity: 1; background-color: #6366f1; }
    50% { opacity: 0.4; background-color: #4f46e5; }
}
.swap-btn.blinking {
    animation: blink-swap 0.2s ease-in-out 1;
}

.form-group.row .col-12:first-child {
    margin-bottom:  0 !important;
    padding-bottom: 5px !important;
}
.form-group.row .col-12:last-child {
    margin-top:  0 !important;
    padding-top: 0 !important;
}

/* ===== SLICK ===== */
.slick-next:before,
.slick-prev:before { color: #6366f1; }
.klassrad label.active span { border-color: #6366f1; }
.klassrad .pricetime        { color: #6366f1; }

.btn-group.container-fluid .btn-danger:hover {
    background-color: #4f46e5 !important;
    border-color:     #4338ca !important;
    color:            #ffffff !important;
}
.btn-group.container-fluid .btn-warning:hover {
    background-color: #6366f1 !important;
    border-color:     #4f46e5 !important;
    color:            #ffffff !important;
}

/* ===== АДАПТИВ ===== */
@media (max-width: 768px) {
    .calculaytor {
        width:          100% !important;
        max-width:      100% !important;
        overflow-x:     hidden !important;
        box-sizing:     border-box !important;
        padding-left:   5px !important;
        padding-right:  5px !important;
        padding-bottom: 15px !important;
        margin-left:    0 !important;
        margin-right:   0 !important;
        -webkit-text-size-adjust: 100%;
        text-size-adjust:         100%;
    }
    .calculaytor *:not(.slick-slider):not(.slick-list):not(.slick-track):not(.slick-slide):not(.autocomplete-list):not(.autocomplete-item) {
        box-sizing: border-box !important;
    }
    .calculaytor #GetCalc {
        width:      100% !important;
        overflow-x: hidden !important;
        padding:    0 !important;
        margin:     0 !important;
    }
    .calculaytor .form-group.row {
        margin-left:  0 !important;
        margin-right: 0 !important;
        width:        100% !important;
    }
    .calculaytor .col-12 {
        padding-left:  10px !important;
        padding-right: 10px !important;
        width:         100% !important;
    }
    .input-wrapper {
        width:     100% !important;
        max-width: 100% !important;
        position:  relative !important;
    }
    .input-wrapper .form-control {
        width:       100% !important;
        max-width:   100% !important;
        min-width:   0 !important;
        font-size:   14px !important;
        height:      38px !important;
        line-height: 1.4 !important;
    }
    .autocomplete-list {
        z-index:   9999 !important;
        width:     100% !important;
        max-width: 100% !important;
        left:      0 !important;
        right:     0 !important;
    }
    .autocomplete-item .item-text {
        min-width: 0;
        overflow:  hidden;
    }
    .autocomplete-item .item-text .item-name,
    .autocomplete-item .item-text .item-desc {
        white-space:   nowrap;
        overflow:      hidden;
        text-overflow: ellipsis;
    }
    .calc-route-btn {
        width:       100% !important;
        max-width:   100% !important;
        white-space: nowrap;
        font-size:   15px !important;
    }
    .swap-btn {
        white-space: nowrap;
        flex-shrink: 0;
    }
    .btn-group.container-fluid {
        width:         100% !important;
        padding-left:  0 !important;
        padding-right: 0 !important;
        margin-left:   0 !important;
        margin-right:  0 !important;
        overflow:      hidden !important;
    }
    .btn-group.container-fluid .btn {
        white-space: nowrap;
        font-size:   14px !important;
    }
    .btn-group.container-fluid .btn-danger {
        font-size: 15px !important;
    }
    .klassrad {
        width:      100% !important;
        max-width:  100% !important;
        padding:    0 15px !important;
        box-sizing: border-box !important;
    }
    .klassrad .slick-slider,
    .klassrad .slick-list,
    .klassrad .slick-track,
    .klassrad .slick-slide,
    .klassrad .slick-slide > div,
    .klassrad .slick-slide label {
        max-width:  none !important;
        box-sizing: border-box !important;
    }
    .klassrad .slick-track {
        display: flex !important;
    }
    .klassrad .slick-slide {
        float:  left !important;
        height: auto !important;
    }
    .klassrad:not(.slick-initialized) > label {
        display: none !important;
    }
    .klassrad:not(.slick-initialized) > label:nth-child(-n+3) {
        display:        inline-block !important;
        width:          33.333% !important;
        vertical-align: top !important;
    }
}