/* =============================================
   LpsDesign - Configurateur Front Office
   ============================================= */
:root {
    --lpsdc-accent: #6b3a2a;
    --lpsdc-accent-light: #8b5e3c;
    --lpsdc-gold: #b8860b;
    --lpsdc-text: #333;
    --lpsdc-text-light: #777;
    --lpsdc-border: #e8e2dc;
    --lpsdc-bg: #faf7f4;
    --lpsdc-bg-sidebar: #fdf9f5;
    --lpsdc-green: #5a9a5a;
    --lpsdc-red: #a0522d;
}

/* ── Layout ───────────────────────────────────── */
#lpsdesign-configurateur {
    max-width: 1320px;
    margin: 0 auto;
    padding: 20px 20px 60px;
}

.lpsdc-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 32px;
    align-items: start;
}

.lpsdc-main {
    min-width: 0;
}

/* ── Top bar ──────────────────────────────────── */
.lpsdc-topbar {
    margin-bottom: 28px;
}

.lpsdc-topbar__step {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.lpsdc-topbar__label {
    font-size: 11px;
    letter-spacing: 2px;
    color: var(--lpsdc-text-light);
    text-transform: uppercase;
    font-weight: 600;
}

.lpsdc-topbar__badge {
    font-size: 10px;
    letter-spacing: 1.5px;
    padding: 3px 10px;
    border: 1px solid var(--lpsdc-border);
    border-radius: 20px;
    color: var(--lpsdc-text);
    font-weight: 600;
    text-transform: uppercase;
}

.lpsdc-title {
    font-size: 30px;
    font-weight: 800;
    color: var(--lpsdc-text);
    margin: 0;
    font-style: italic;
    border-bottom: 3px solid var(--lpsdc-accent);
    display: inline-block;
    padding-bottom: 4px;
}

/* ── Navigation buttons ───────────────────────── */
.lpsdc-nav {
    display: flex;
    gap: 12px;
    margin-top: 32px;
    padding-top: 20px;
}

.lpsdc-btn {
    padding: 12px 28px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    border-radius: 6px;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.lpsdc-btn--primary {
    background: var(--lpsdc-accent);
    color: #fff;
}

.lpsdc-btn--primary:hover:not(:disabled) {
    background: var(--lpsdc-accent-light);
}

.lpsdc-btn--primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.lpsdc-btn--outline {
    background: #fff;
    color: var(--lpsdc-text);
    border: 1px solid var(--lpsdc-border);
}

.lpsdc-btn--outline:hover {
    border-color: #999;
}

.lpsdc-btn--danger {
    background: var(--lpsdc-accent);
    color: #fff;
}

.lpsdc-btn--large {
    width: 100%;
    justify-content: center;
    padding: 16px;
    font-size: 14px;
}

/* ── Sidebar ──────────────────────────────────── */
.lpsdc-sidebar {
    position: sticky;
    top: 20px;
    background: var(--lpsdc-bg-sidebar);
    border: 1px solid var(--lpsdc-border);
    border-radius: 10px;
    overflow: hidden;
}

.lpsdc-sidebar__section {
    padding: 18px 20px;
    border-bottom: 1px solid var(--lpsdc-border);
}

.lpsdc-sidebar__section:last-child {
    border-bottom: none;
}

.lpsdc-sidebar__heading {
    font-size: 10px;
    letter-spacing: 2px;
    color: var(--lpsdc-text-light);
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.lpsdc-sidebar__row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--lpsdc-text);
    padding: 3px 0;
}

.lpsdc-sidebar__row span:last-child {
    font-weight: 600;
    text-align: right;
}

.lpsdc-sidebar__price {
    font-size: 32px;
    font-weight: 800;
    color: var(--lpsdc-accent);
    font-style: italic;
}

.lpsdc-sidebar__preview {
    background: #fff;
    border: 1px solid var(--lpsdc-border);
    border-radius: 6px;
    padding: 10px;
    min-height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lpsdc-preview-placeholder svg {
    width: 100%;
    height: auto;
}

/* Config items */
.lpsdc-sidebar__config {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.lpsdc-config-item {
    font-size: 13px;
    color: var(--lpsdc-text);
    display: flex;
    align-items: center;
    gap: 6px;
}

.lpsdc-config-item strong {
    font-weight: 600;
}

.lpsdc-config-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ccc;
    flex-shrink: 0;
}

.lpsdc-config-item.is-set .lpsdc-config-dot {
    background: var(--lpsdc-green);
}

/* Sidebar footer */
.lpsdc-sidebar__footer {
    text-align: center;
    padding: 16px 20px;
    font-size: 12px;
    color: var(--lpsdc-text-light);
    font-style: italic;
    line-height: 1.6;
}

.lpsdc-sidebar__star {
    color: var(--lpsdc-gold);
    font-size: 16px;
    font-style: normal;
}

/* =============================================
   STEP 1: Material categories
   ============================================= */
.lpsdc-catmat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.lpsdc-catmat-card {
    background: #fff;
    border: 2px solid var(--lpsdc-border);
    border-radius: 10px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.lpsdc-catmat-card:hover {
    border-color: #ccc;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.lpsdc-catmat-card.is-selected {
    border-color: var(--lpsdc-accent);
    background: #fef8f5;
}

.lpsdc-catmat-card__icon {
    width: 32px;
    height: 32px;
    margin-bottom: 12px;
    color: var(--lpsdc-gold);
}

.lpsdc-catmat-card__icon svg {
    width: 100%;
    height: 100%;
}

.lpsdc-catmat-card__name {
    font-size: 18px;
    font-weight: 800;
    color: var(--lpsdc-text);
    margin-bottom: 4px;
}

.lpsdc-catmat-card__desc {
    font-size: 12px;
    color: var(--lpsdc-text-light);
    line-height: 1.5;
    margin-bottom: 10px;
}

.lpsdc-catmat-card__count {
    font-size: 12px;
    color: var(--lpsdc-accent);
    font-weight: 600;
}

/* =============================================
   STEP 2: Products
   ============================================= */
.lpsdc-products-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.lpsdc-products-filters {
    display: flex;
    align-items: center;
    gap: 6px;
}

.lpsdc-products-filters__label {
    font-size: 12px;
    color: var(--lpsdc-text-light);
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 600;
    margin-right: 4px;
}

.lpsdc-filter-tab {
    padding: 5px 14px;
    font-size: 12px;
    border: 1px solid var(--lpsdc-border);
    border-radius: 20px;
    cursor: pointer;
    background: #fff;
    color: var(--lpsdc-text);
    font-weight: 600;
    transition: all 0.2s;
}

.lpsdc-filter-tab:hover {
    border-color: #999;
}

.lpsdc-filter-tab.is-active {
    background: var(--lpsdc-text);
    color: #fff;
    border-color: var(--lpsdc-text);
}

.lpsdc-products-count {
    font-size: 12px;
    color: var(--lpsdc-text-light);
}

.lpsdc-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 16px;
}

.lpsdc-product-card {
    background: #fff;
    border: 2px solid var(--lpsdc-border);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
}

.lpsdc-product-card:hover {
    border-color: #ccc;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.lpsdc-product-card.is-selected {
    border-color: var(--lpsdc-accent);
}

.lpsdc-product-card__img {
    width: 100%;
    aspect-ratio: 4/3;
    background: #f0ebe6;
    overflow: hidden;
}

.lpsdc-product-card__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lpsdc-product-card__body {
    padding: 10px 12px 12px;
}

.lpsdc-product-card__name {
    font-size: 13px;
    font-weight: 700;
    color: var(--lpsdc-text);
    line-height: 1.3;
    margin-bottom: 4px;
}

.lpsdc-product-card__info {
    font-size: 11px;
    color: var(--lpsdc-text-light);
}

.lpsdc-product-card__info .price {
    color: var(--lpsdc-accent);
    font-weight: 700;
    margin-left: 6px;
}

/* =============================================
   STEP 3: Epaisseurs
   ============================================= */
.lpsdc-epaisseurs-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

.lpsdc-epaisseur-card {
    background: #fff;
    border: 2px solid var(--lpsdc-border);
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.lpsdc-epaisseur-card:hover {
    border-color: #ccc;
}

.lpsdc-epaisseur-card.is-selected {
    border-color: var(--lpsdc-accent);
    background: #fef8f5;
}

.lpsdc-epaisseur-card__value {
    font-size: 28px;
    font-weight: 800;
    color: var(--lpsdc-text);
    line-height: 1;
}

.lpsdc-epaisseur-card__unit {
    font-size: 11px;
    color: var(--lpsdc-text-light);
    margin-top: 2px;
    margin-bottom: 10px;
}

.lpsdc-epaisseur-card__detail {
    font-size: 11px;
    line-height: 1.5;
}

.lpsdc-epaisseur-card__detail .poids {
    color: var(--lpsdc-accent);
    font-weight: 600;
}

.lpsdc-epaisseur-card__detail .dim {
    color: var(--lpsdc-text-light);
}

/* =============================================
   STEP 4: Formes
   ============================================= */
.lpsdc-formes-category {
    margin-bottom: 24px;
}

.lpsdc-formes-category__title {
    font-size: 11px;
    letter-spacing: 2px;
    color: var(--lpsdc-text-light);
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--lpsdc-border);
}

.lpsdc-formes-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

.lpsdc-forme-card {
    background: #fff;
    border: 2px solid var(--lpsdc-border);
    border-radius: 10px;
    padding: 16px 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.lpsdc-forme-card:hover {
    border-color: #ccc;
}

.lpsdc-forme-card.is-selected {
    border-color: var(--lpsdc-accent);
    background: #fef8f5;
}

.lpsdc-forme-card__icon {
    width: 42px;
    height: 42px;
    margin: 0 auto 8px;
}

.lpsdc-forme-card__icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0.6;
}

.lpsdc-forme-card__icon svg {
    width: 100%;
    height: 100%;
    color: var(--lpsdc-gold);
    opacity: 0.6;
}

.lpsdc-forme-card__name {
    font-size: 12px;
    font-weight: 700;
    color: var(--lpsdc-text);
    margin-bottom: 2px;
}

.lpsdc-forme-card__champs {
    font-size: 10px;
    color: var(--lpsdc-accent);
    font-weight: 600;
}

/* =============================================
   STEP 5: Dimensions
   ============================================= */
.lpsdc-dimensions-form {
    max-width: 500px;
}

.lpsdc-dimension-field {
    margin-bottom: 20px;
}

.lpsdc-dimension-field__header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
}

.lpsdc-dimension-field__label {
    font-size: 14px;
    font-weight: 700;
    color: var(--lpsdc-text);
}

.lpsdc-dimension-field__range {
    font-size: 12px;
    color: var(--lpsdc-text-light);
}

.lpsdc-dimension-field__input {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lpsdc-dimension-field__input input {
    width: 100%;
    padding: 14px 16px;
    font-size: 22px;
    font-weight: 700;
    border: 2px solid var(--lpsdc-border);
    border-radius: 8px;
    text-align: right;
    color: var(--lpsdc-text);
    outline: none;
    transition: border-color 0.2s;
}

.lpsdc-dimension-field__input input:focus {
    border-color: var(--lpsdc-accent);
}

.lpsdc-dimension-field__input .unit {
    font-size: 14px;
    font-weight: 700;
    color: var(--lpsdc-accent);
    flex-shrink: 0;
}

/* =============================================
   STEP 6: Options
   ============================================= */
.lpsdc-options-list {
    display: flex;
    flex-direction: column;
}

.lpsdc-option-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid var(--lpsdc-border);
    cursor: pointer;
}

.lpsdc-option-item:last-child {
    border-bottom: none;
}

.lpsdc-option-item input[type="checkbox"] {
    margin-top: 3px;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    accent-color: var(--lpsdc-accent);
}

.lpsdc-option-item__body {
    flex: 1;
    text-align: left;
}

.lpsdc-option-item__name {
    font-size: 14px;
    font-weight: 700;
    color: var(--lpsdc-text);
}

.lpsdc-option-item__desc {
    font-size: 12px;
    color: var(--lpsdc-text-light);
    margin-top: 2px;
}

.lpsdc-option-item__price {
    font-size: 13px;
    font-weight: 700;
    color: var(--lpsdc-accent);
    white-space: nowrap;
    flex-shrink: 0;
}

/* =============================================
   STEP 7: Commande / Recap
   ============================================= */
.lpsdc-commande__product {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--lpsdc-text);
    color: #fff;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 24px;
}

.lpsdc-commande__product-img {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: #555;
}

.lpsdc-commande__product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lpsdc-commande__product-name {
    font-size: 16px;
    font-weight: 700;
}

.lpsdc-commande__product-info {
    font-size: 12px;
    opacity: 0.7;
}

.lpsdc-commande__table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
}

.lpsdc-commande__table tr {
    border-bottom: 1px solid var(--lpsdc-border);
}

.lpsdc-commande__table td {
    padding: 10px 0;
    font-size: 14px;
}

.lpsdc-commande__table td:first-child {
    color: var(--lpsdc-text-light);
    font-weight: 500;
}

.lpsdc-commande__table td:last-child {
    text-align: right;
    font-weight: 700;
    color: var(--lpsdc-text);
}

/* Quantity */
.lpsdc-commande__qty {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.lpsdc-commande__qty-label {
    font-size: 14px;
    font-weight: 600;
}

.lpsdc-qty-control {
    display: inline-flex;
    align-items: center;
    border: 2px solid var(--lpsdc-border);
    border-radius: 6px;
    overflow: hidden;
}

.lpsdc-qty-btn {
    width: 36px;
    height: 36px;
    background: #fff;
    border: none;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--lpsdc-text);
}

.lpsdc-qty-btn:hover {
    background: var(--lpsdc-bg);
}

.lpsdc-qty-value {
    width: 48px;
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    border: none;
    border-left: 1px solid var(--lpsdc-border);
    border-right: 1px solid var(--lpsdc-border);
    padding: 6px;
}

/* Action buttons */
.lpsdc-commande__actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 460px;
}

.lpsdc-btn--cart {
    background: var(--lpsdc-accent);
    color: #fff;
}

.lpsdc-btn--pdf {
    background: #fff;
    color: var(--lpsdc-text);
    border: 1px solid var(--lpsdc-border);
}

/* ── Loading spinner ──────────────────────────── */
.lpsdc-loading {
    text-align: center;
    padding: 40px;
    color: var(--lpsdc-text-light);
    font-size: 14px;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 1024px) {
    .lpsdc-layout {
        grid-template-columns: 1fr;
    }

    .lpsdc-sidebar {
        position: static;
        order: -1;
    }

    .lpsdc-catmat-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .lpsdc-epaisseurs-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .lpsdc-formes-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .lpsdc-title {
        font-size: 22px;
    }

    .lpsdc-catmat-grid {
        grid-template-columns: 1fr 1fr;
    }

    .lpsdc-products-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .lpsdc-epaisseurs-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .lpsdc-formes-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
