/* ===================================================================
   Nouveau style premium - Catalogue & Admin
   Palette : Bleu #2563eb (indigo), gris clair, blanc
   Police : Inter / system-ui
=================================================================== */

* {
    box-sizing: border-box;
    font-family: "Inter", system-ui, sans-serif;
    transition: 0.15s ease-in-out;
}

body {
    margin: 0;
    background: #f3f4f6; /* gris clair */
    color: #111827;
}

/* ----------------------- HEADER -------------------------- */

header {
    background: #1f2937; /* gris foncé chic */
    color: #fff;
    padding: 0.9rem 1.6rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.18);
}

header div {
    font-size: 1.3rem;
    font-weight: 600;
}

header nav a {
    color: #e5e7eb;
    text-decoration: none;
    margin-left: 1.2rem;
    font-size: 0.95rem;
    padding-bottom: 2px;
    border-bottom: 2px solid transparent;
}

header nav a:hover {
    color: #fff;
    border-bottom: 2px solid #3b82f6;
}

/* ----------------------- CONTAINER -------------------------- */

.container {
    max-width: 1150px;
    margin: 1.8rem auto;
    padding: 0 1rem;
}

h1, h2 {
    font-weight: 700;
    color: #111827;
}

/* ----------------------- SEARCH + FILTER -------------------------- */

.search-filter form {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.search-filter input[type="text"],
.search-filter select {
    padding: 0.6rem 0.85rem;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    background: #fff;
    font-size: 0.95rem;
}

.search-filter input[type="text"]:focus,
.search-filter select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37,99,235,0.25);
}

.search-filter button {
    padding: 0.6rem 1rem;
    border-radius: 10px;
    border: none;
    background: #2563eb;
    color: #fff;
    cursor: pointer;
    font-weight: 600;
}

.search-filter button:hover {
    background: #1d4ed8;
}

/* ----------------------- CARDS PRODUITS -------------------------- */

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.2rem;
}

/* Carte cliquable (ancre <a>) */
.product-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border-radius: 16px;
    padding: 0.95rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

/* Image de carte : afficher l'image entière */
.product-card-img {
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 14px;
    object-fit: contain;           /* image entière visible */
    background: #0f172a;
    margin-bottom: 0.8rem;
}

.product-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.product-card h3 {
    margin: 0;
    margin-bottom: 0.3rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.product-card-options {
    margin-top: 0.2rem;
}

.product-card-footer {
    margin-top: 0.8rem;
    text-align: center;
}

.product-card-link-label {
    display: inline-block;
    background: #1f2937;
    color: #fff;
    text-decoration: none;
    padding: 0.55rem 1.1rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.88rem;
}

/* Pour compatibilité si le bouton .btn est encore utilisé */
.product-card .btn {
    margin-top: 0.8rem;
    text-align: center;
    background: #1f2937;
    color: #fff;
    text-decoration: none;
    padding: 0.55rem;
    border-radius: 10px;
    font-weight: 600;
}

.product-card .btn:hover {
    background: #111827;
}

/* badges */

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.73rem;
    font-weight: 600;
}

.badge-store {
    background: #2563eb;
    color: #fff;
}

.badge-option {
    background: #f97316;
    color: #fff;
}

/* ----------------------- DETAIL PRODUIT -------------------------- */

.detail {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
}

.detail-img img,
.detail-main-img {
    border-radius: 16px;
    max-width: 380px;
    width: 100%;
    box-shadow: 0 3px 14px rgba(0,0,0,0.15);
}

/* ----------------------- OPTIONS (ancienne liste) -------------------------- */

.options-list {
    list-style: none;
    padding: 0;
}

.option-item {
    background: #fff;
    border-radius: 14px;
    padding: 1rem;
    display: flex;
    gap: 1rem;
    box-shadow: 0 2px 14px rgba(0,0,0,0.07);
}

.option-photo img {
    width: 95px;
    height: 95px;
    border-radius: 12px;
    object-fit: cover;
    background: #e5e7eb;
}

.option-label {
    font-size: 1rem;
    font-weight: 700;
}

.option-store {
    font-size: 0.85rem;
    color: #6b7280;
}

/* ----------------------- OPTIONS EN CARDS DÉFILANTES -------------------------- */

.options-strip {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.3rem;
    scroll-snap-type: x mandatory;
}

.option-card {
    scroll-snap-align: start;
    min-width: 260px;
    background: #ffffff;
    border-radius: 18px;
    border: none;
    padding: 0.6rem;
    display: flex;
    gap: 0.7rem;
    align-items: center;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.15);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.option-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.22);
}

.option-card-photo img {
    width: 82px;
    height: 82px;
    border-radius: 14px;
    object-fit: cover;
    flex-shrink: 0;
}

.option-card-photo-placeholder {
    width: 82px;
    height: 82px;
    border-radius: 14px;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: #6b7280;
}

.option-card-body {
    text-align: left;
    flex: 1;
}

.option-card-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.15rem;
}

.option-label {
    font-weight: 600;
    font-size: 0.9rem;
}

.badge-option-prio {
    background: #f97316;
}

.option-card-title {
    font-size: 0.9rem;
    font-weight: 600;
}

.option-card-meta {
    font-size: 0.8rem;
    color: #6b7280;
}

.options-hint {
    font-size: 0.78rem;
    color: #6b7280;
    margin-top: 0.4rem;
}

/* ----------------------- MODAL FULLSCREEN IMAGE -------------------------- */

.js-fullscreen-image {
    cursor: zoom-in;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease-out;
    z-index: 80;
}

.modal-backdrop.modal-visible {
    opacity: 1;
    pointer-events: auto;
}

.modal-dialog {
    background: #ffffff;
    border-radius: 18px;
    max-width: min(520px, 96vw);
    max-height: 90vh;
    padding: 0.8rem;
    display: flex;
    flex-direction: column;
    animation: modal-pop 0.18s ease-out;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.4);
}

.modal-dialog img {
    width: 100%;
    max-height: 60vh;
    object-fit: contain;
    border-radius: 14px;
    background: #0f172a;
}

.modal-close {
    align-self: flex-end;
    border: none;
    background: transparent;
    font-size: 1.5rem;
    cursor: pointer;
    color: #9ca3af;
    line-height: 1;
}

.modal-caption {
    margin-top: 0.4rem;
    font-size: 0.9rem;
}

@keyframes modal-pop {
    from {
        transform: translateY(10px) scale(0.96);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* ----------------------- ADMIN -------------------------- */

.form-card {
    background: #fff;
    padding: 1.3rem;
    border-radius: 16px;
    box-shadow: 0 3px 14px rgba(0,0,0,0.08);
}

label {
    font-size: 0.95rem;
    font-weight: 500;
    margin-top: 1rem;
    display: block;
}

input[type="text"],
textarea,
select {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    background: #fff;
    font-size: 0.95rem;
}

input:focus,
textarea:focus,
select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37,99,235,0.25);
}

button[type="submit"],
button,
.btn-save {
    background: #2563eb;
    color: #fff !important;
    border-radius: 10px;
    padding: 0.7rem 1.4rem;
    border: none;
    cursor: pointer;
    font-weight: 600;
    margin-top: 1rem;
}

button:hover,
.btn-save:hover {
    background: #1d4ed8;
}

.table {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
}

.table th {
    background: #f9fafb;
    font-weight: 600;
}

/* ----------------------- ASSISTANT FLOTTANT -------------------------- */

.assistant-toggle {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    border-radius: 999px;
    border: none;
    background: #2563eb;
    color: #fff;
    padding: 0.7rem 1.2rem;
    font-weight: 600;
    box-shadow: 0 10px 25px rgba(37,99,235,0.4);
    cursor: pointer;
    z-index: 40;
}

.assistant-toggle:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.assistant-panel {
    position: fixed;
    right: 1rem;
    bottom: 4.2rem;
    width: min(360px, 92vw);
    max-height: 60vh;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 18px 45px rgba(15,23,42,0.35);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 50;
}

.assistant-hidden {
    display: none;
}

.assistant-header {
    padding: 0.75rem 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #1f2937;
    color: #fff;
}

.assistant-header-title {
    font-size: 0.95rem;
    font-weight: 600;
}

.assistant-header-subtitle {
    font-size: 0.8rem;
    color: #9ca3af;
}

.assistant-header button.assistant-close {
    border: none;
    background: transparent;
    color: #9ca3af;
    font-size: 1.1rem;
    cursor: pointer;
}

.assistant-messages {
    padding: 0.75rem 0.9rem;
    overflow-y: auto;
    flex: 1;
    background: #f9fafb;
}

.assistant-message {
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
    padding: 0.45rem 0.6rem;
    border-radius: 12px;
    max-width: 100%;
}

.assistant-message-user {
    background: #2563eb;
    color: #fff;
    margin-left: auto;
}

.assistant-message-bot {
    background: #e5e7eb;
    color: #111827;
    margin-right: auto;
}

.assistant-form {
    display: flex;
    gap: 0.4rem;
    padding: 0.55rem 0.75rem;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

.assistant-form input {
    flex: 1;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    padding: 0.45rem 0.75rem;
    font-size: 0.9rem;
}

.assistant-form button {
    border-radius: 999px;
    border: none;
    background: #2563eb;
    color: #fff;
    padding: 0.45rem 0.9rem;
    font-size: 0.9rem;
    cursor: pointer;
}

.assistant-results {
    list-style: none;
    margin: 0.45rem 0 0;
    padding: 0;
}

.assistant-results li + li {
    margin-top: 0.4rem;
}

.assistant-results a {
    display: block;
    text-decoration: none;
    background: #fff;
    border-radius: 12px;
    padding: 0.5rem 0.6rem;
    border: 1px solid #e5e7eb;
}

.assistant-result-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.1rem;
}

.assistant-result-meta {
    font-size: 0.8rem;
    color: #6b7280;
}

.assistant-options {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.78rem;
    color: #f97316;
}

/* ---------------------- RESPONSIVE MOBILE ------------------------- */

@media (max-width: 768px) {
    header {
        padding: 0.7rem 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
    }

    .container {
        margin: 1rem auto 1.5rem;
    }

    .search-filter {
        flex-direction: column;
        align-items: stretch;
    }

    .search-filter form {
        width: 100%;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }

    .detail {
        flex-direction: column;
    }

    .detail-img img,
    .detail-main-img {
        max-width: 100%;
    }

    .option-card {
        min-width: 85%;
    }
}

@media (max-width: 480px) {
    .assistant-panel {
        right: 0.5rem;
        left: 0.5rem;
        width: auto;
        bottom: 4rem;
    }

    .assistant-toggle {
        right: 0.5rem;
        bottom: 0.5rem;
    }
}
