/* RLT Vehicle Catalog - Frontend styles */

/* ---------- Search form ---------- */
.rlt-vs {
    background: #f4f4f4;
    padding: 30px;
    border-radius: 6px;
    max-width: 420px;
    font-family: inherit;
    box-sizing: border-box;
}

.rlt-vs * {
    box-sizing: border-box;
}

.rlt-vs__title {
    margin: 0 0 20px 0;
    font-weight: 600;
    color: #333;
    font-size: 22px;
    line-height: 1.3;
}

.rlt-vs__field {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 15px;
    padding: 10px 15px;
}

.rlt-vs__step {
    font-size: 14px;
    color: #666;
    margin-right: 15px;
    border-right: 1px solid #ddd;
    padding-right: 10px;
    min-width: 20px;
}

.rlt-vs__input {
    flex: 1;
    position: relative;
}

.rlt-vs__label {
    display: block;
    font-size: 10px;
    color: #888;
    margin-bottom: 2px;
    letter-spacing: 1px;
}

.rlt-vs__select {
    width: 100%;
    border: none;
    font-size: 16px;
    color: #333;
    background: transparent;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    outline: none;
    cursor: pointer;
    padding-right: 25px;
}

.rlt-vs__input::after {
    content: "\25BE";
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-35%);
    color: #888;
    pointer-events: none;
}

.rlt-vs__button {
    width: 100%;
    text-align: center;
    margin-top: 10px;
}

/* Hidden state for cascading filter */
.rlt-vs__select option[hidden] {
    display: none;
}

/* Loading state during cross-filter fetch */
.rlt-vs--loading .rlt-vs__select {
    opacity: 0.55;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.rlt-vs--loading .rlt-vs__field {
    position: relative;
}

.rlt-vs--loading .rlt-vs__field::after {
    content: "";
    position: absolute;
    right: 12px;
    top: 50%;
    width: 14px;
    height: 14px;
    margin-top: -7px;
    border: 2px solid #ccc;
    border-top-color: #555;
    border-radius: 50%;
    animation: rlt-vs-spin 0.7s linear infinite;
}

@keyframes rlt-vs-spin {
    to { transform: rotate(360deg); }
}

/* ---------- Vehicle bar ---------- */
.rlt-bar {
    display: inline-block;
    line-height: 1;
}

.rlt-bar__inner {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #eef3ff;
    border: 1px solid #d8e1f5;
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    color: #2b3a55;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.2;
    transition: background 0.15s ease;
}

.rlt-bar__inner:hover {
    background: #e3eaff;
}

.rlt-bar__icon {
    position: relative;
    display: inline-flex;
    width: 32px;
    height: 18px;
    color: #2b3a55;
}

.rlt-bar__icon svg {
    width: 100%;
    height: 100%;
}

.rlt-bar__count {
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #25b369;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.rlt-bar__label {
    font-weight: 500;
}

/* ---------- Modal ---------- */
.rlt-modal[hidden] {
    display: none;
}

.rlt-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.rlt-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.rlt-modal__panel {
    position: relative;
    background: #fff;
    border-radius: 8px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px 24px 22px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    font-family: inherit;
}

.rlt-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: 0;
    cursor: pointer;
    color: #999;
    padding: 6px;
    line-height: 1;
}

.rlt-modal__close:hover {
    color: #333;
}

.rlt-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 18px;
}

.rlt-modal__title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
}

.rlt-modal__clear {
    background: transparent;
    border: 0;
    color: #2563eb;
    font-size: 14px;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
}

.rlt-modal__clear:hover {
    text-decoration: underline;
}

.rlt-modal__list {
    list-style: none;
    margin: 0 0 16px 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rlt-modal__empty {
    text-align: center;
    padding: 30px 10px;
    color: #888;
    font-size: 14px;
}

.rlt-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #f5f7fb;
    border-radius: 6px;
    padding: 14px;
    border-left: 4px solid transparent;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.rlt-item--main {
    background: #eef3ff;
    border-left-color: #2563eb;
}

.rlt-item__radio {
    position: relative;
    margin-top: 2px;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.rlt-item__radio input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    margin: 0;
}

.rlt-item__radio-mark {
    display: block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #b7c0d4;
    background: #fff;
    transition: border-color 0.15s ease;
}

.rlt-item__radio input:checked + .rlt-item__radio-mark {
    border-color: #f0a800;
    background: radial-gradient(circle, #f0a800 0%, #f0a800 45%, #fff 50%);
}

.rlt-item__body {
    flex: 1;
    min-width: 0;
}

.rlt-item__head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.rlt-item__label {
    font-weight: 600;
    color: #1a1a1a;
    font-size: 15px;
}

.rlt-item__main-badge[hidden] {
    display: none;
}

.rlt-item__main-badge {
    background: #e02929;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 3px;
    letter-spacing: 0.5px;
}

.rlt-item__browse {
    display: inline-block;
    background: #fff;
    border: 1px solid #2563eb;
    color: #2563eb;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    transition: background 0.15s ease, color 0.15s ease;
}

.rlt-item__browse:hover {
    background: #2563eb;
    color: #fff;
}

.rlt-item__delete {
    background: transparent;
    border: 0;
    color: #999;
    cursor: pointer;
    padding: 4px;
    flex-shrink: 0;
}

.rlt-item__delete:hover {
    color: #e02929;
}

.rlt-modal__add {
    display: block;
    width: 100%;
    background: #fff;
    border: 1px solid #cfd6e4;
    color: #1a1a1a;
    font-size: 14px;
    font-weight: 600;
    padding: 14px;
    border-radius: 6px;
    cursor: pointer;
    letter-spacing: 0.5px;
    font-family: inherit;
    transition: background 0.15s ease;
}

.rlt-modal__add:hover {
    background: #f5f7fb;
}

/* ---------- Modal: view switching ---------- */
.rlt-modal__view[hidden] {
    display: none;
}

/* ---------- Modal: back button ---------- */
.rlt-modal__back {
    background: transparent;
    border: 0;
    color: #2563eb;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: inherit;
    line-height: 1;
}

.rlt-modal__back:hover {
    text-decoration: underline;
}

.rlt-modal__view[data-rlt-view="form"] .rlt-modal__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

/* ---------- Embedded form inside modal ---------- */
.rlt-modal__form-wrap {
    display: flex;
    justify-content: center;
}

.rlt-vs--in-modal {
    background: transparent;
    padding: 0;
    border-radius: 0;
    max-width: none;
    width: 100%;
}

.rlt-vs--in-modal .rlt-vs__field {
    background: #f5f7fb;
    border-color: transparent;
}

/* ---------- Inline garage trigger ---------- */
.rlt-garage-trigger {
    display: inline-block;
    background: #fff;
    border: 1px solid #cfd6e4;
    color: #1a1a1a;
    font-size: 14px;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
}

.rlt-garage-trigger:hover {
    background: #f5f7fb;
}
