/* EKR Vehicle - Hyva Garage Phase 1
 * Plain CSS migration layer. It can be moved into the child theme Tailwind source later.
 */

[x-cloak] {
    display: none !important;
}

.ekr-hyva-garage {
    display: inline-flex;
    align-items: center;
    min-width: 0;
}

.ekr-hyva-garage__trigger {
    appearance: none;
    width: 46px;
    height: 46px;
    min-width: 46px;
    min-height: 46px;
    padding: 8px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #111827;
    display: inline-grid;
    place-items: center;
    cursor: pointer;
    transition: background-color .15s ease, box-shadow .15s ease;
}

.ekr-hyva-garage__trigger:hover,
.ekr-hyva-garage__trigger:focus-visible {
    background: #f3f4f6;
    outline: none;
    box-shadow: 0 0 0 3px rgba(17, 24, 39, .06);
}

.ekr-hyva-garage__icon {
    display: block;
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.ekr-hyva-garage__overlay {
    position: fixed;
    inset: 0;
    z-index: 1000000;
    display: grid;
    place-items: center;
    padding: 24px;
}

.ekr-hyva-garage__backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: rgba(17, 24, 39, .62);
    backdrop-filter: blur(2px);
    cursor: default;
}

.ekr-hyva-garage__panel {
    position: relative;
    z-index: 1;
    width: min(100%, 980px);
    max-height: calc(100vh - 48px);
    overflow: auto;
    border-radius: 14px;
    background: #fff;
    color: #111827;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .24);
}

.ekr-hyva-garage-enter,
.ekr-hyva-garage-leave {
    transition: opacity .15s ease, transform .15s ease;
}

.ekr-hyva-garage-enter-start,
.ekr-hyva-garage-leave-end {
    opacity: 0;
    transform: translateY(10px) scale(.985);
}

.ekr-hyva-garage-enter-end,
.ekr-hyva-garage-leave-start {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.ekr-hyva-garage__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 28px 30px 22px;
    border-bottom: 1px solid #e5e7eb;
}

.ekr-hyva-garage__eyebrow {
    margin-bottom: 5px;
    color: #dc2626;
    font-size: 12px;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: .12em;
}

.ekr-hyva-garage__title {
    margin: 0;
    color: #111827;
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.1;
    font-weight: 800;
}

.ekr-hyva-garage__close {
    appearance: none;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    background: #fff;
    color: #111827;
    display: grid;
    place-items: center;
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
}

.ekr-hyva-garage__close:hover,
.ekr-hyva-garage__close:focus-visible {
    background: #f3f4f6;
    outline: none;
}

.ekr-hyva-garage__body {
    padding: 28px 30px 32px;
}

.ekr-hyva-garage__status {
    margin: 0 0 14px;
    color: #6b7280;
    font-size: 13px;
}

.ekr-hyva-garage__error {
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #fef2f2;
    color: #991b1b;
    font-size: 14px;
}

.ekr-hyva-garage__controls {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
    gap: 16px;
    align-items: end;
}

.ekr-hyva-garage__field {
    min-width: 0;
}

.ekr-hyva-garage__field > span {
    display: block;
    margin-bottom: 7px;
    color: #4b5563;
    font-size: 12px;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.ekr-hyva-garage__field select {
    width: 100%;
    min-height: 48px;
    padding: 0 40px 0 13px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background-color: #fff;
    color: #111827;
    font-size: 15px;
}

.ekr-hyva-garage__field select:focus {
    border-color: #111827;
    outline: none;
    box-shadow: 0 0 0 3px rgba(17, 24, 39, .08);
}

.ekr-hyva-garage__field select:disabled {
    background: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
}

.ekr-hyva-garage__actions {
    display: flex;
    gap: 10px;
    align-items: stretch;
    margin: 0;
}

.ekr-hyva-garage__shop,
.ekr-hyva-garage__reset {
    min-height: 48px;
    padding: 0 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .04em;
    cursor: pointer;
}

.ekr-hyva-garage__shop {
    border: 1px solid #dc2626;
    background: #dc2626;
    color: #fff;
}

.ekr-hyva-garage__shop:hover:not(:disabled),
.ekr-hyva-garage__shop:focus-visible:not(:disabled) {
    background: #b91c1c;
    border-color: #b91c1c;
}

.ekr-hyva-garage__reset {
    border: 1px solid #d1d5db;
    background: #fff;
    color: #111827;
}

.ekr-hyva-garage__reset:hover:not(:disabled),
.ekr-hyva-garage__reset:focus-visible:not(:disabled) {
    background: #f3f4f6;
}

.ekr-hyva-garage__shop:disabled,
.ekr-hyva-garage__reset:disabled {
    opacity: .48;
    cursor: not-allowed;
}

.ekr-hyva-garage__recent {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

.ekr-hyva-garage__recent h3 {
    margin: 0 0 12px;
    font-size: 12px;
    font-weight: 850;
    letter-spacing: .08em;
    color: #4b5563;
}

.ekr-hyva-garage__recent-list {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.ekr-hyva-garage__recent-item {
    min-height: 38px;
    padding: 0 13px;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    background: #fff;
    color: #374151;
    cursor: pointer;
    font-size: 13px;
}

.ekr-hyva-garage__recent-item:hover,
.ekr-hyva-garage__recent-item:focus-visible {
    border-color: #111827;
    color: #111827;
    outline: none;
}

@media (max-width: 1023px) {
    .ekr-hyva-garage__trigger {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        padding: 8px;
    }

    .ekr-hyva-garage__overlay {
        padding: 16px;
    }

    .ekr-hyva-garage__controls {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: end;
    }

    .ekr-hyva-garage__actions {
        grid-column: 1 / -1;
    }
}

@media (max-width: 767px) {
    /* Mobile uses a right-side drawer instead of the old bottom sheet. */
    .ekr-hyva-garage__overlay {
        display: flex;
        align-items: stretch;
        justify-content: flex-end;
        padding: 0;
    }

    .ekr-hyva-garage__panel {
        width: min(92vw, 420px);
        height: 100dvh;
        max-height: 100dvh;
        margin: 0;
        border-radius: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .ekr-hyva-garage-enter-start,
    .ekr-hyva-garage-leave-end {
        opacity: 1;
        transform: translateX(100%);
    }

    .ekr-hyva-garage-enter-end,
    .ekr-hyva-garage-leave-start {
        opacity: 1;
        transform: translateX(0);
    }

    .ekr-hyva-garage__header {
        padding: 22px 18px 18px;
    }

    .ekr-hyva-garage__body {
        padding: 22px 18px 26px;
    }

    .ekr-hyva-garage__controls {
        grid-template-columns: 1fr;
        gap: 13px;
    }

    .ekr-hyva-garage__actions {
        grid-column: auto;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        margin-top: 2px;
    }

    .ekr-hyva-garage__shop,
    .ekr-hyva-garage__reset {
        width: 100%;
        padding-inline: 12px;
    }
}
