/* ---------- BASE ---------- */
* {
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    margin: 0;
    background: linear-gradient(135deg, #e4e9f2, #f2f5f9);
    color: #1f2d3d;
    -webkit-font-smoothing: antialiased;
}

/* ---------- HEADER ---------- */
.app-header {
    background: rgba(255,255,255,0.3);
    backdrop-filter: blur(16px) saturate(180%);
    color: #1e5799;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.4);
    border-radius: 0 0 20px 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.app-header h1 {
    font-weight: 600;
}

/* ---------- LAYOUT ---------- */
.builder-layout {
    display: grid;
    grid-template-columns: 260px 1fr 320px;
    gap: 24px;
    padding: 24px;
    max-width: 1400px;
    margin: auto;
}

/* ---------- SIDEBAR ---------- */
.sidebar {
    background: rgba(255,255,255,0.3);
    backdrop-filter: blur(16px) saturate(180%);
    border-radius: 20px;
    padding: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    position: sticky;
    top: 20px;
    height: fit-content;
    border: 1px solid rgba(255,255,255,0.4);
}

/* Sidebar steps */
.sidebar-step {
    padding: 10px 14px;
    border-radius: 14px;
    margin-bottom: 8px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    transition: all 0.25s;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(8px) saturate(180%);
    color: #1e5799;
    font-weight: 500;
}

.sidebar-step:hover {
    background: rgba(255,255,255,0.35);
}

.sidebar-step.completed {
    background: rgba(39, 174, 96, 0.8);
    color: white;
    font-weight: 700;
}

/* ---------- BUILDER SECTIONS ---------- */
.category {
    background: rgba(255,255,255,0.25);
    backdrop-filter: blur(16px) saturate(180%);
    border-radius: 24px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.06);
    border: 1px solid rgba(255,255,255,0.35);
    transition: all 0.3s;
}

/* Header with toggle button */
.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.category h2 {
    font-weight: 600;
}

.hint {
    font-size: 14px;
    color: #5a6f84;
    margin-bottom: 16px;
}

/* ---------- CARDS GRID ---------- */
.flc-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

/* ---------- CARD ---------- */
.flc-card {
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.35);
    background: rgba(255,255,255,0.25);
    backdrop-filter: blur(14px) saturate(180%);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* keeps button at bottom */
    transition: all 0.3s;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    min-height: 300px; /* ensures button is always visible */
}

.flc-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.08);
}

.flc-card.selected {
    border-color: rgba(30,87,153,0.6);
    background: rgba(30,87,153,0.15);
}

/* Card image wrapper */
.flc-card-img-wrapper {
    position: relative;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.flc-card img {
    width: 100%;
    height: 150px;
    object-fit: contain;
    padding: 12px;
}

/* Info icon */
.info-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    background: rgba(255,255,255,0.3);
    backdrop-filter: blur(8px) saturate(180%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    z-index: 2;
}

.info-icon svg {
    width: 16px;
    height: 16px;
    fill: #1e5799;
}

.info-icon:hover {
    background: rgba(255,255,255,0.5);
    transform: scale(1.15);
}

/* Card body */
.flc-card-body {
    padding: 16px;
    flex-grow: 1;
    color: #1f2d3d;
}


.flc-card-title {
    font-weight: 600;
}

.flc-card-price {
    font-weight: 700;
    margin: 8px 0;
}

/* Card buttons */
.flc-card button {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 16px;
    background: rgba(30,87,153,0.85);
    color: white;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.25s;
    margin-top: 6px;
}

.flc-card button:hover {
    background: rgba(30,87,153,1);
}

.flc-card button.remove {
    background: rgba(192,57,43,0.85);
}

.flc-card button.remove:hover {
    background: rgba(192,57,43,1);
}

/* ---------- REVIEW PANEL ---------- */
.review {
    background: rgba(255,255,255,0.25);
    backdrop-filter: blur(16px) saturate(180%);
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 12px 35px rgba(0,0,0,0.06);
    position: sticky;
    top: 20px;
    height: fit-content;
    border: 1px solid rgba(255,255,255,0.35);
}

/* Review content */
.review ul {
    padding-left: 18px;
}

.total {
    font-size: 20px;
    font-weight: 800;
    margin-top: 14px;
}

/* ---------- MAIN BUTTON ---------- */
.primary-btn {
    width: 100%;
    padding: 14px;
    margin-top: 16px;
    background: rgba(10,61,98,0.85);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 16px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.25s;
}

.primary-btn:hover {
    background: rgba(10,61,98,1);
}

/* ---------- TOGGLE BUTTON ---------- */
.toggle-btn {
    background: rgba(255,255,255,0.3);
    backdrop-filter: blur(10px) saturate(180%);
    color: #1e5799;
    border: none;
    border-radius: 12px;
    padding: 6px 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
}

.toggle-btn:hover {
    background: rgba(255,255,255,0.5);
}

/* ---------- MOBILE ---------- */
@media (max-width: 1000px) {
    .builder-layout {
        grid-template-columns: 1fr;
    }

    .sidebar,
    .review {
        position: relative;
        top: 0;
    }
}

/* ---------- MODAL ---------- */
.flc-modal {
    display: none; /* hidden by default */
    position: fixed;
    z-index: 999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
}

.flc-modal-content {
    background-color: #f9f9f9;
    margin: 10% auto;
    padding: 24px;
    border-radius: 20px;
    width: 90%;
    max-width: 700px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.3);
    position: relative;
}

.flc-modal-content h2 {
    margin-top: 0;
    color: #1e5799;
}

.flc-close-btn {
    position: absolute;
    top: 16px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
}

.flc-close-btn:hover {
    color: #1e5799;
}

/* Compatibility Table */
.flc-compat-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.flc-compat-table th,
.flc-compat-table td {
    border: 1px solid #ddd;
    padding: 12px 8px;
    text-align: left;
}

.flc-compat-table th {
    background-color: #1e5799;
    color: white;
}

.flc-compat-table tr:nth-child(even) {
    background-color: #f2f2f2;
}

.flc-compat-table tr:hover {
    background-color: #d6e0f5;
}

.flc-summary {
    background: #fff;
    border-radius: 14px;
    padding: 14px 16px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    font-size: 14px;
}

.flc-summary-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.flc-summary-item {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    flex-direction: row;
    flex-wrap: wrap;
}

.flc-summary-item:last-child {
    border-bottom: none;
}

.flc-summary-title {
    color: #444;
    font-weight: 500;
    font-size: 12px;   /* smaller name */
    line-height: 1.3;
}

.flc-summary-price {
    color: #111;
    font-weight: 600;
}

.flc-summary-total {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 2px solid #000;
    display: flex;
    justify-content: space-between;
    font-size: 15px;
    font-weight: 700;
}