/**
 * Reset some default styles for forms ignoring Elementor and Wordpress styles
 */
:root {
    --wheelsys-border-color: rgba(216, 218, 220, 1);
    --wheelsys-primary-color: rgba(239, 52, 63, 1);
    --wheelsys-bagde-bg-color: rgba(225, 229, 233, 1);
}

#wheelsys-booking-form {
    margin: 0 auto !important;
    max-width: initial !important;
    padding: 0;
    border: none;
    background: none;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    display: block;
    position: relative;
}

.relative {
    position: relative;
}

.wheelsys-container {
    width: 100%;
    max-width: 1027px;
    display: flex;
    align-items: center;
    box-shadow: 0px 0px 50px 0px rgba(0, 0, 0, 0.1);
    border-radius: 32px;
    padding: 16px 30px;
    flex-direction: row;
    background-color: #fff;
    margin-inline: auto;
    gap: 24px;
    align-items: end;
}


.sys-input-container {
    display: flex;
    flex-direction: column;
    gap: 4px;

    font-size: 1rem;
    font-weight: 500;
    font-style: Regular;
    line-height: 1.5rem;

    &>span {
        font-weight: 600;
        font-size: 0.75rem;
        line-height: 22px;
    }

    & input {
        display: none;
    }



    & .sys-input {
        border: 1px solid rgba(216, 218, 220, 1);
        border-radius: 100px;
        padding: 13px 16px;
        user-select: none;
        cursor: pointer;
        min-width: 300px;
        position: relative;
        padding-inline-start: 48px;

        &>svg {
            position: absolute;
            left: 18px;
            top: 50%;
            transform: translateY(-50%);
        }
    }

    & .sys-popover {
        position: absolute;
        top: 110%;
        left: 0;
        width: 420px;
        z-index: 1;
        background-color: #fff;
        border-radius: 16px;
        padding: 1.5rem 1.75rem;
        display: none;
        border: 1px solid rgba(241, 243, 247, 1);
        box-shadow: 0px 7px 20px 0px rgba(25, 33, 61, 0.04);


        &.show {
            display: block;
            cursor: default;
        }

        & .sys-popover-content {
            display: flex;
            flex-direction: column;
            gap: 1.70rem;

            & .sys-popover-header {
                font-weight: 400;
                font-size: .75rem;
                line-height: 100%;
                letter-spacing: 0%;

            }
        }

        & .sys-popover-station {
            display: grid;
            grid-template-columns: 38px 1fr;
            align-items: center;
        }

        & .sys-popover-station-content {
            display: flex;
            flex-direction: column;
            gap: 2px;
        }

        & .sys-popover-station_name {
            font-weight: 600;
            font-size: 1rem;
            line-height: 1.25rem;
            letter-spacing: 0%;
            color: black;
        }

        & .sys-popover-station_address {
            font-weight: 400;
            font-size: .875rem;
            line-height: 1.25rem;
            line-height: 100%;
            letter-spacing: 0%;
            color: rgba(131, 131, 131, 1);
        }

        & .sys-popover-section {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;

            & span {
                font-weight: 600;
                font-size: 0.875rem;
                line-height: 1.25rem;
                letter-spacing: 0%;
                color: black;
            }

            & div {
                font-weight: 400;
                font-size: 0.875rem;
                line-height: 1.25rem;
                letter-spacing: 0%;
            }

            & table {
                width: 100%;
                border-collapse: collapse;
                max-width: 230px;

                & td,
                th {
                    padding-bottom: 8px;
                }
            }

            & iframe {
                border: none;
                width: 100%;
                height: 100%;
            }

            & .map-container {
                width: 100%;
                height: 150px;
                border-radius: 12px;
                overflow: hidden;
                margin-top: 8px;
            }
        }
    }
}

.date-container {
    position: relative;
    display: flex;
    flex-direction: column;
	gap: 4px;
    justify-content: space-between;

    & span {
        font-weight: 600;
        font-size: 0.75rem;
        line-height: 22px;
        letter-spacing: 0%;
        color: black;
    }

    &>div {
        display: flex;
        flex-direction: row;
        gap: 0px;
    }

    & .date-container_item {
        box-sizing: border-box;

        border: 1px solid var(--wheelsys-border-color);
        user-select: none;
        padding: 0.75rem;
        cursor: pointer;
        font-size: 0.95rem;
        font-weight: 400;
        line-height: 1.5rem;
        color: black;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 4px;
        width: 110px;
        position: relative;

        &>svg {
            flex: none;
            width: 20px;
        }
    }

    & .date-container_item.date {
        border-radius: 100px 0px 0px 100px;

    }

    & .date-container_item.time {
        border-radius: 0px 100px 100px 0px;
    }
}

/* ============================================================================
   Custom Time Select Dropdown Styles
   ============================================================================ */

.custom-time-select {
    position: relative;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 120px;

    &:hover {
        background-color: rgba(0, 0, 0, 0.02);
    }

    &.active {
        border-color: var(--wheelsys-primary-color);

        .dropdown-arrow {
            transform: rotate(180deg);
        }

        .time-dropdown {
            display: block;
        }
    }
}

.custom-time-select .time-display {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 400;
    line-height: 1.5rem;
    color: black;
}

.custom-time-select .dropdown-arrow {
    flex-shrink: 0;
    transition: transform 0.2s ease;
    width: 12px;
    height: 12px;
}

.custom-time-select input[type="hidden"] {
    display: none;
}

.time-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--wheelsys-border-color);
    border-radius: 12px;
    box-shadow: 0px 7px 20px 0px rgba(25, 33, 61, 0.08);
    z-index: 100;
    display: none;
    max-height: 280px;
    overflow-y: auto;
    padding: 8px 0;

    /* Custom scrollbar styling */
    &::-webkit-scrollbar {
        width: 6px;
    }

    &::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.05);
        border-radius: 10px;
        margin: 8px 0;
    }

    &::-webkit-scrollbar-thumb {
        background: rgba(0, 0, 0, 0.2);
        border-radius: 10px;

        &:hover {
            background: rgba(0, 0, 0, 0.3);
        }
    }

    /* Firefox scrollbar */
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) rgba(0, 0, 0, 0.05);
}

.time-dropdown-item {
    padding: 10px 16px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 400;
    color: #333;
    transition: background-color 0.15s ease, color 0.15s ease;

    &:hover {
        background-color: rgba(239, 52, 63, 0.08);
        color: var(--wheelsys-primary-color);
    }

    &.selected {
        background-color: var(--wheelsys-primary-color);
        color: white;
        font-weight: 600;

        &:hover {
            background-color: var(--wheelsys-primary-color);
            color: white;
        }
    }

    &.disabled {
        opacity: 0.4;
        cursor: not-allowed;

        &:hover {
            background-color: transparent;
            color: #333;
        }
    }
}

/* Animation for dropdown appearance */
@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.time-dropdown {
    animation: dropdownFadeIn 0.2s ease;
}

.date-form-submit {
    align-self: end;

    & button {
        background-color: var(--wheelsys-primary-color);
        color: white;
        border: 1px solid var(--wheelsys-primary-color);
        border-radius: 100px;
        padding: 0.70rem 1.5rem;
        font-weight: 600;
        font-size: 1rem;
        line-height: 1.5rem;
        cursor: pointer;
    }

    & button:disabled {
        opacity: 0.4;
        cursor: not-allowed;
    }
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    border: 0;
    clip: rect(0 0 0 0);
    opacity: 0;
    pointer-events: none;
}

/* ============================================================================
   Wheelsys Hours Styles
   ============================================================================ */

.hours-container {
    min-height: auto;
    display: block;
    background-color: transparent;
    border-radius: 0;
    border: none;
}

.hours-container:empty::after {
    content: 'Cargando horarios...';
    display: block;
    text-align: center;
    color: #999;
    font-size: 0.85rem;
    padding: 8px 0;
    font-style: italic;
}

.station-phone {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: #666;
}

.station-phone a {
    color: var(--wheelsys-primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: opacity 0.2s ease;
}

.station-phone a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.wheelsys-hours-wrapper {
    width: 100%;
}

.wheelsys-hours-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    font-weight: 500;
}

.wheelsys-hours-table tbody tr {
    border-bottom: 1px solid rgba(241, 243, 247, 1);
    transition: background-color 0.2s ease;
}

.wheelsys-hours-table tbody tr:last-child {
    border-bottom: none;
}

.wheelsys-hours-table tbody tr:hover {
    background-color: rgba(239, 52, 63, 0.05);
}

.wheelsys-hours-table tbody tr.closed {
    opacity: 0.6;
}

.wheelsys-hours-table td {
    padding: 12px 0;
    vertical-align: middle;
}

.wheelsys-hours-table td.day-name {
    font-weight: 600;
    color: #333;
    width: 120px;
    min-width: 120px;
}

.wheelsys-hours-table td.hours-time {
    text-align: right;
    padding-right: 8px;
}

.time-open,
.time-close {
    font-weight: 600;
    color: #2c7f38;
}

.time-separator {
    margin: 0 6px;
    color: #999;
}

.closed-badge {
    display: inline-block;
    background-color: #f8d7da;
    color: #721c24;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.85rem;
}

/* Station Status Badge */
.wheelsys-status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.wheelsys-status-badge.wheelsys-status-open {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.wheelsys-status-badge.wheelsys-status-closed {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.wheelsys-status-badge .icon {
    font-weight: bold;
    font-size: 1.2rem;
}

.wheelsys-status-badge .text {
    font-size: 0.95rem;
}

/* Responsive */
@media (max-width: 768px) {
    .wheelsys-hours-table td.day-name {
        width: 100px;
        min-width: 100px;
    }

    .wheelsys-hours-table td {
        padding: 10px 0;
    }

    .time-separator {
        margin: 0 4px;
    }
}