:root {
    --primary: #0d6efd;
    --dark: #1f2937;
    --muted: #6b7280;
    --border: #e5e7eb;
    --bg: #f6f7fb;
    --card: #ffffff;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--dark);
}

.app-header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.app-header-inner {
    max-width: 760px;
    margin: 0 auto;
    padding: 1rem;
}

.app-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.app-subtitle {
    color: var(--muted);
    font-size: .9rem;
    margin-top: .15rem;
}

.app-main {
    max-width: 760px;
    margin: 0 auto;
    padding: 1rem;
}

.search-card,
.product-card,
.results-card,
.notice {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 1rem;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .05);
    margin-bottom: 1rem;
}

.search-form label {
    display: block;
    font-weight: 700;
    margin-bottom: .5rem;
}

.search-row {
    display: flex;
    gap: .5rem;
}

input[type="search"] {
    flex: 1 1 auto;
    width: 100%;
    min-height: 44px;
    padding: .75rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
}

button,
.secondary-button {
    min-height: 44px;
    border: 0;
    border-radius: 12px;
    padding: .75rem 1rem;
    font-weight: 700;
    cursor: pointer;
    background: var(--primary);
    color: #fff;
}

.secondary-button {
    width: 100%;
    margin-top: .75rem;
    background: #111827;
}

.help-text {
    color: var(--muted);
    font-size: .85rem;
    margin-bottom: 0;
}

.scanner {
    overflow: hidden;
    margin-top: .75rem;
    border-radius: 16px;
    border: 1px solid var(--border);
}

.product-card h1 {
    margin: .25rem 0 1rem;
    font-size: 1.45rem;
}

.product-card h2 {
    margin: 1rem 0 .35rem;
    font-size: 1rem;
    color: var(--primary);
}

.product-card p {
    line-height: 1.5;
    margin: 0;
}

.product-code {
    color: var(--muted);
    font-size: .85rem;
}

.ean-badge {
    display: inline-flex;
    padding: .4rem .65rem;
    border-radius: 999px;
    background: #eef4ff;
    color: #0b5ed7;
    font-weight: 700;
    font-size: .85rem;
    margin-bottom: .5rem;
}

.result-row {
    display: block;
    text-decoration: none;
    color: var(--dark);
    padding: .8rem 0;
    border-bottom: 1px solid var(--border);
}

.result-row:last-child {
    border-bottom: 0;
}

.result-row strong,
.result-row span {
    display: block;
}

.result-row span {
    margin-top: .15rem;
    color: var(--muted);
    font-size: .85rem;
}

.notice {
    color: #92400e;
    background: #fff7ed;
    border-color: #fed7aa;
}

@media (max-width: 560px) {
    .search-row {
        flex-direction: column;
    }

    button {
        width: 100%;
    }
}

/* Complément CSS — résultat produit en popup plein écran */

body.modal-open {
    overflow: hidden;
}

.result-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    background: #f6f7fb;
    color: var(--dark, #1f2937);
}

.result-modal[hidden] {
    display: none !important;
}

.result-modal-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .85rem 1rem;
    background: #ffffff;
    border-bottom: 1px solid var(--border, #e5e7eb);
    box-shadow: 0 8px 22px rgba(15, 23, 42, .06);
}

.result-modal-title {
    font-weight: 700;
    font-size: 1rem;
}

.result-modal-close {
    min-height: 40px;
    width: auto;
    border: 0;
    border-radius: 999px;
    padding: .6rem 1rem;
    background: #111827;
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
}

.result-modal-content {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 1rem;
    -webkit-overflow-scrolling: touch;
}

.product-detail {
    max-width: 820px;
    margin: 0 auto;
    background: #ffffff;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 18px;
    padding: 1rem;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .05);
}

.product-detail h1 {
    margin: 0 0 1rem;
    font-size: 1.35rem;
    line-height: 1.2;
}

.product-detail h2 {
    margin: 1rem 0 .35rem;
    font-size: 1rem;
    color: var(--primary, #0d6efd);
}

.product-detail p {
    line-height: 1.55;
    margin: 0;
    font-size: 1rem;
}

@media (max-width: 560px) {
    .result-modal-header {
        padding: .75rem;
    }

    .result-modal-content {
        padding: .75rem;
    }

    .product-detail {
        border-radius: 16px;
        padding: 1rem;
    }

    .product-detail h1 {
        font-size: 1.25rem;
    }
}


/* Footer public */
.app-footer {
    margin: 1rem 0 0;
    padding: .75rem 0 1rem;
    text-align: center;
    color: var(--muted, #6b7280);
    font-size: .85rem;
}

.app-footer a {
    color: var(--muted, #6b7280);
    text-decoration: none;
    font-weight: 700;
}

.app-footer a:hover {
    text-decoration: underline;
}

.search-card h1 {
    margin-top: 0;
}

