@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;500;600;700;800&family=Poppins:wght@400;500;600;700&family=Jost:wght@400;500;600;700&display=swap');

:root {
    --accent-color: #4769a4;
    --heading-color: #37517e; /* entête fabriquequebec.ca */
    --text-color: #1f2b3d;
    --surface-color: #ffffff;
    --muted-bg: #f5f6f8;
    --default-font: "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    --heading-font: "Jost", sans-serif;
    --nav-font: "Poppins", sans-serif;
}

body {
    background-color: #ffffff;
    color: var(--text-color);
    font-family: var(--default-font);
}

h1, h2, h3, h4, h5, h6 {
    color: var(--heading-color);
    font-family: var(--heading-font);
}

.navbar {
    box-shadow: 0 2px 10px rgba(55, 81, 126, 0.08);
    background-color: var(--heading-color);
}

.navbar-brand {
    font-family: var(--nav-font);
    font-weight: 600;
    letter-spacing: 0;
    color: #fff;
    padding-top: 6px;
    padding-bottom: 6px;
}

.navbar-brand img,
.brand-logo-img {
    height: 32px;
    width: auto;
    display: block;
}

.nav-link {
    font-family: var(--nav-font);
    color: #f0f4ff;
}

.nav-link:hover,
.nav-link:focus,
.nav-link.active {
    color: var(--accent-color);
}

.card {
    border: 1px solid #e6ecf0;
    background-color: var(--surface-color);
    color: var(--text-color);
}

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

.btn-primary:hover {
    background-color: #3498ce;
    border-color: #3498ce;
}

.btn-outline-primary {
    color: var(--accent-color);
    border-color: var(--accent-color);
}

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

.navbar-dark .navbar-toggler {
    border-color: rgba(255,255,255,0.6);
}

.navbar-dark .navbar-toggler-icon {
    filter: invert(1) brightness(2);
}

.brand-logo span {
    font-size: inherit;
}

.brand-text {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    line-height: 1.2;
}

.text-heading {
    color: var(--heading-color) !important;
}

.navbar.top-nav {
    background-color: var(--heading-color) !important;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.navbar.top-nav .navbar-brand,
.navbar.top-nav .brand-text {
    color: #fff !important;
}

.navbar.top-nav .nav-link {
    color: #f0f4ff !important;
}

.navbar.top-nav .nav-link:hover,
.navbar.top-nav .nav-link:focus,
.navbar.top-nav .nav-link.active {
    color: var(--accent-color) !important;
    font-weight: 600;
}

.navbar.top-nav .btn-info {
    background-color: color-mix(in srgb, var(--accent-color), #fff 25%);
    border-color: color-mix(in srgb, var(--accent-color), #fff 25%);
}

.navbar.top-nav .btn-info:hover {
    background-color: color-mix(in srgb, var(--accent-color), #000 10%);
    border-color: color-mix(in srgb, var(--accent-color), #000 10%);
}

.navbar.top-nav .btn-outline-light {
    color: #fff;
    border-color: rgba(255,255,255,0.7);
}

.navbar.top-nav .btn-outline-light:hover {
    background-color: #fff;
    color: var(--heading-color);
}

.navbar.top-nav .navbar-offcanvas {
    background-color: var(--heading-color);
    color: #fff;
    border-left: 1px solid rgba(255, 255, 255, 0.12);
}

@media (max-width: 991.98px) {
    .navbar.top-nav .navbar-offcanvas {
        width: min(88vw, 360px);
    }

    .navbar.top-nav .navbar-offcanvas .navbar-nav {
        margin-bottom: 10px;
    }

    .navbar.top-nav .navbar-offcanvas .dropdown-menu {
        width: 100%;
    }
}

.btn-signup {
    color: #37517e !important;
    background-color: #fff !important;
    border-color: #fff !important;
    transition: transform 0.18s ease, box-shadow 0.18s ease, color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.btn-signup:hover, .btn-signup:focus {
    color: #fff !important;
    background-color: #4769a4 !important;
    border-color: #4769a4 !important;
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(55,81,126,0.18) !important;
}

.btn-signup:active {
    transform: translateY(0);
    box-shadow: 0 6px 14px rgba(55,81,126,0.18) !important;
}

.nav-greeting {
    font-family: var(--nav-font);
    font-weight: 600;
}

.badge {
    text-transform: none;
}

.product-photo {
    overflow: hidden;
    border: 1px solid #e6ecf0;
}

.product-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.page-body {
    background-color: #ffffff;
    color: var(--text-color);
    border-radius: 0;
    padding: 24px 12px 60px 12px;
}

.page-body-home {
    padding: 0;
}

.landing-wrapper {
    margin: 0;
}

.home-hero {
    padding-bottom: 80px;
}

.home-hero h1,
.home-hero p,
.home-hero li {
    color: var(--heading-color);
}

.home-hero .btn-outline-secondary {
    color: var(--heading-color);
    border-color: rgba(55,81,126,0.4);
}

.home-hero .btn-outline-secondary:hover {
    background-color: var(--heading-color);
    color: #fff;
}

.page-body h1,
.page-body h2,
.page-body h3,
.page-body h4,
.page-body h5,
.page-body h6,
.page-body p,
.page-body li,
.page-body .lead {
    color: var(--text-color);
}

.card h1,
.card h2,
.card h3,
.card h4,
.card h5,
.card h6,
.card p,
.card li,
.card .lead,
.card .text-muted {
    color: var(--text-color);
}

.card .text-muted {
    color: #6c7a93 !important;
}

footer {
    background-color: #f8f9fc;
    color: #6c7a93;
}

.category-chips .category-chip {
    border-radius: 999px;
    padding-left: 14px;
    padding-right: 14px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.category-chips .btn-primary {
    box-shadow: 0 8px 18px rgba(71, 178, 228, 0.22);
}

.catalog-grid {
    --catalog-gap: 14px;
}

.catalog-card {
    border: 1px solid #e4e9f0;
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    min-height: 100%;
    position: relative;
    cursor: pointer;
}

.catalog-boutique-link {
    position: relative;
    z-index: 2;
}

.catalog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 32px rgba(55, 81, 126, 0.16);
    border-color: rgba(55, 81, 126, 0.2);
}

.catalog-thumb {
    min-height: 90px;
}

.catalog-card .card-body {
    padding: 10px 10px 8px;
    background-color: #f8f9fc;
    border-top: 1px solid #e4e9f0;
}

.catalog-card .card-title {
    font-size: 0.78rem;
    font-family: var(--default-font);
    font-weight: 700;
    line-height: 1.2;
}

.catalog-card .badge {
    text-transform: none;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.boutique-card,
.boutique-header,
.storefront-preview {
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #e4e9f0;
}

.boutique-cover,
.storefront-cover {
    height: 140px;
    background-size: cover;
    background-position: center;
    background-color: #eef2f7;
}

.boutique-header .boutique-cover {
    height: 180px;
}

.boutique-logo,
.storefront-logo {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    object-fit: cover;
    background: #fff;
    border: 3px solid #fff;
    box-shadow: 0 10px 24px rgba(55, 81, 126, 0.18);
    margin-top: -34px;
}

.storefront-logo {
    border-radius: 999px;
}

@media (max-width: 575.98px) {
    .boutique-cover,
    .storefront-cover {
        height: 120px;
    }
    .boutique-header .boutique-cover {
        height: 150px;
    }
}

.product-gallery {
    border: 1px solid #e6ecf0;
    border-radius: 16px;
    padding: 14px;
    background: linear-gradient(135deg, #f8fbff 0%, #ffffff 45%, #f6f8fb 100%);
}

.gallery-main {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    background: #f5f6f8;
}

.gallery-slide-wrapper {
    position: relative;
    aspect-ratio: 4 / 3;
    min-height: 260px;
}

.gallery-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.22s ease-in-out;
    border-radius: 12px;
    overflow: hidden;
    background: #eef2f7;
    pointer-events: none;
}

.gallery-slide.is-active {
    opacity: 1;
    pointer-events: auto;
}

.gallery-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    box-shadow: 0 10px 30px rgba(55, 81, 126, 0.18);
    background-color: rgba(255, 255, 255, 0.96);
    border: 1px solid #d9e1ec;
}

.gallery-nav:hover {
    background-color: #fff;
}

.gallery-prev {
    left: 12px;
}

.gallery-next {
    right: 12px;
}

.gallery-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.gallery-thumb {
    width: 78px;
    height: 64px;
    border: 1px solid #d9e1ec;
    border-radius: 12px;
    overflow: hidden;
    padding: 4px;
    background-color: #fff;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 9px;
}

.gallery-thumb:hover {
    transform: translateY(-2px);
}

.gallery-thumb.is-active {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(71, 178, 228, 0.25);
}

.product-detail h2,
.product-detail h3 {
    font-family: var(--default-font);
    color: var(--heading-color);
}

.product-detail h2 {
    font-size: 1.05rem;
    line-height: 1.25;
}

.product-detail h3 {
    font-size: 0.95rem;
    line-height: 1.3;
}

.creator-product-card .card-body {
    padding: 0.75rem;
}

.creator-product-card h5 {
    font-size: 0.95rem;
}

.creator-product-card .ratio {
    --bs-aspect-ratio: 50%;
    border-bottom: 1px solid #e6ecf0;
}

.creator-product-card .btn.btn-sm {
    padding: 0.25rem 0.5rem;
}

.stl-estimator {
    border: 1px solid #e4e9f0;
    border-radius: 16px;
    background: linear-gradient(135deg, #f8fbff 0%, #ffffff 45%, #f6f8fb 100%);
    padding: 12px;
}

.stl-dropzone {
    border: 2px dashed rgba(71, 178, 228, 0.55);
    border-radius: 14px;
    padding: 14px 14px 12px;
    background-color: rgba(255, 255, 255, 0.78);
    cursor: pointer;
    transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.stl-dropzone.is-dragover {
    border-color: rgba(71, 178, 228, 1);
    background-color: rgba(71, 178, 228, 0.08);
    box-shadow: 0 14px 28px rgba(55, 81, 126, 0.12);
    transform: translateY(-1px);
}

.stl-viewer {
    width: 100%;
    height: 220px;
    border-radius: 14px;
    overflow: hidden;
    background-color: #eef4fb;
    border: 1px solid #d9e1ec;
    position: relative;
    display: grid;
    place-items: center;
}

/* Desktop: preview height matches Type d'impression + print-mode-zone */
@media (min-width: 992px) {
    .stl-estimator .row.g-3 {
        align-items: stretch;
    }

    .stl-estimator .row.g-3 > .col-lg-4 {
        display: flex;
        flex-direction: column;
    }

    .stl-estimator .row.g-3 > .col-lg-4 .stl-viewer {
        flex: 1;
        height: auto;
        min-height: 280px;
    }
}

.stl-estimator h6 {
    font-family: var(--default-font);
    font-weight: 800;
    letter-spacing: 0.01em;
}

.stl-estimator [data-floor-price] {
    font-size: 1.05rem;
}

.stl-dropzone .btn-outline-primary {
    border-color: rgba(71, 178, 228, 0.8);
}

.stl-dropzone .btn-outline-primary:hover {
    border-color: var(--accent-color);
    background-color: rgba(71, 178, 228, 0.08);
}

.stl-dropzone input[type="file"] {
    border-radius: 12px;
    border-color: rgba(55, 81, 126, 0.16);
    background-color: rgba(255, 255, 255, 0.9);
}

.stl-dropzone input[type="file"]:focus {
    border-color: rgba(71, 178, 228, 0.85);
    box-shadow: 0 0 0 0.2rem rgba(71, 178, 228, 0.18);
}

.stl-estimator table.table {
    border-color: rgba(55, 81, 126, 0.12);
}

.stl-estimator table.table thead th {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6c7a93;
}

.stl-estimator table.table td {
    vertical-align: middle;
}

.stl-estimator input[type="number"].form-control-sm {
    min-width: 70px;
}

.stl-viewer .stl-placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 12px;
    text-align: center;
    color: #6c7a93;
    pointer-events: none;
}

.stl-viewer.has-model .stl-placeholder {
    display: none;
}

.stl-dropzone {
    display: block;
}

.stl-dropzone .btn {
    border-radius: 12px;
}

/* Zone multicouleur (STEP) */
.stl-dropzone.border-warning {
    border-color: rgba(255, 193, 7, 0.55);
}

.stl-dropzone.border-warning.is-dragover {
    border-color: rgba(255, 193, 7, 1);
    background-color: rgba(255, 193, 7, 0.08);
}

/* STL Estimator - Tableau fichiers */
.stl-estimator table.table td:first-child .badge {
    font-size: 0.7rem;
    padding: 0.2em 0.4em;
    min-height: 20px;
    line-height: 1.3;
    vertical-align: middle;
}

/* Input Qté compact */
.stl-estimator .stl-qty-input {
    width: 38px !important;
    max-width: 38px !important;
    font-size: 0.75rem !important;
    -moz-appearance: textfield;
    appearance: textfield;
}
.stl-estimator .stl-qty-input::-webkit-inner-spin-button,
.stl-estimator .stl-qty-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Écrans 992-1200px: cacher tous les badges */
@media (min-width: 992px) and (max-width: 1199px) {
    .stl-estimator table.table td:first-child .badge {
        display: none;
    }
}

/* Mobile: layout 2 lignes propre */
@media (max-width: 767px) {
    .stl-estimator table.table thead {
        display: none;
    }

    .stl-estimator table.table tbody tr {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
        gap: 0.4rem 0.5rem;
        padding: 0.6rem 0.25rem;
        border-bottom: 1px solid #dee2e6;
        align-items: center;
    }

    .stl-estimator table.table tbody tr td {
        border: none;
        padding: 0;
    }

    /* Ligne 1 col 1: Nom + badges */
    .stl-estimator table.table tbody tr td:nth-child(1) {
        grid-column: 1;
        grid-row: 1;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-weight: 500;
    }

    /* Ligne 1 col 2: Qté */
    .stl-estimator table.table tbody tr td:nth-child(2) {
        grid-column: 2;
        grid-row: 1;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 0.35rem;
    }

    .stl-estimator table.table tbody tr td:nth-child(2)::before {
        content: "Qté:";
        font-size: 0.75rem;
        color: #6c757d;
    }

    /* Ligne 2 col 1: Vol + Dims combinés via JS */
    .stl-estimator table.table tbody tr td:nth-child(3) {
        grid-column: 1;
        grid-row: 2;
        font-size: 0.8rem;
        color: #6c757d;
    }

    .stl-estimator table.table tbody tr td:nth-child(4) {
        display: none;
    }

    /* Ligne 2 col 2: Boutons */
    .stl-estimator table.table tbody tr td:nth-child(5) {
        grid-column: 2;
        grid-row: 2;
        display: flex;
        justify-content: flex-end;
        gap: 0.35rem;
    }

    .stl-estimator table.table tbody tr td:nth-child(5) .btn {
        margin: 0 !important;
        padding: 0.3rem 0.5rem;
    }

    /* Input Qté compact sur mobile */
    .stl-estimator .stl-qty-input {
        width: 40px !important;
        max-width: 40px !important;
        font-size: 0.8rem !important;
    }
}

/* Boutons mode impression */
.btn-group[role="group"] .btn-check:checked + .btn-outline-primary {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

.btn-group[role="group"] .btn-check:checked + .btn-outline-warning {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #212529;
}

/* Arrondis pour les fiches produits de l'espace créateur */
.card.shadow-sm {
    border-radius: 16px;
    overflow: hidden;
}

.card .ratio.ratio-16x9 {
    border-radius: 0;
    overflow: hidden;
}

.card .ratio.ratio-16x9 img.rounded-top {
    border-radius: 0;
}
