/* RAL — two columns: left stretched preview, right chips */

/* ====== Layout ====== */
.ral-layout {
    display: flex;
    min-height: 75vh;
    gap: 0;
}

/* Left: full-height preview */
.ral-left {
    flex: 0 0 50%;
    position: sticky;
    top: 0;
    height: 85vh;
    display: flex;
    align-items: stretch;
}

.ral-preview {
    width: 100%;
    height: 100%;
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    margin: 20px 15px 20px 20px;
    box-shadow: 0 4px 30px rgba(0,0,0,0.4);
}

.ral-preview-color {
    width: 100%;
    height: 100%;
    background-color: #CABF8E;
    transition: background-color 0.3s;
}

.ral-preview-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(transparent, rgba(0,0,0,0.5));
}

#ralCode {
    font-size: 22px;
    font-weight: bold;
    color: #000;
    text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

#ralName {
    font-size: 16px;
    color: #222;
    text-shadow: 0 1px 4px rgba(0,0,0,0.3);
    margin-top: 4px;
}

/* Right: chips + search */
.ral-right {
    flex: 0 0 50%;
    padding: 20px 20px 20px 0;
    overflow-y: auto;
    max-height: 85vh;
}

.ral-search-bar {
    margin-bottom: 15px;
    position: sticky;
    top: 0;
    background: transparent;
    padding: 10px 0;
    z-index: 10;
}

.ral-search-bar input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #0df;
    border-radius: 8px;
    background-color: rgba(255,255,255,0.05);
    color: #bebdbd;
    font: 14px 'GOST Common', system-ui;
    backdrop-filter: blur(8px);
    box-sizing: border-box;
}

.ral-search-bar input:focus {
    outline: none;
    border-color: #9fa;
    box-shadow: 0 0 0 2px rgba(159,250,160,0.3);
}

/* Chips grid */
.ral-chips {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 8px;
}

.ral-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    background-color: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    cursor: pointer;
    transition: all 0.2s;
}

.ral-chip:hover {
    background-color: rgba(255,255,255,0.08);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
}

.ral-chip-swatch {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.1);
}

.ral-chip-text {
    color: #bebdbd;
    font-size: 13px;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ====== MOBILE ====== */
@media screen and (max-width: 1080px) {
    .ral-layout {
        flex-direction: column;
    }

    .ral-left {
        flex: none;
        position: relative;
        top: auto;
        height: 250px;
        margin-bottom: 15px;
    }

    .ral-preview {
        margin: 10px;
        border-radius: 12px;
    }

    #ralCode { font-size: 18px; }
    #ralName { font-size: 13px; }

    .ral-right {
        flex: none;
        max-height: none;
        padding: 0 10px 20px;
    }

    .ral-chips {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

@media screen and (max-width: 480px) {
    .ral-left {
        height: 200px;
    }

    .ral-chips {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 6px;
    }

    .ral-chip {
        padding: 6px 8px;
    }

    .ral-chip-swatch {
        width: 30px;
        height: 30px;
    }

    .ral-chip-text {
        font-size: 11px;
    }

    #ralCode { font-size: 15px; }
    #ralName { font-size: 12px; }
}
