/* Stokko — styles complémentaires */

/* Page de connexion — mise en page aérée */
.login-page .login-banner {
    padding: 2rem 1.25rem 1.75rem;
    text-align: center;
}
.login-page .login-banner-img {
    display: block;
    width: 100%;
    max-width: 20rem;
    height: auto;
    margin: 0 auto;
    object-fit: contain;
    border-radius: 1.25rem;
    box-shadow:
        0 4px 6px rgba(15, 23, 42, 0.04),
        0 16px 40px rgba(15, 23, 42, 0.1);
}
@media (min-width: 640px) {
    .login-page .login-banner {
        padding-top: 2.25rem;
        padding-bottom: 2rem;
    }
    .login-page .login-banner-img {
        max-width: 22rem;
    }
}
.login-page .login-card {
    padding: 2rem 1.75rem 2.25rem;
    display: flex;
    flex-direction: column;
    gap: 0;
}
@media (min-width: 640px) {
    .login-page .login-card {
        padding: 2.25rem 2rem 2.5rem;
    }
}
.login-page .login-tabs {
    margin-bottom: 2rem;
}
.login-page .login-alert {
    margin-bottom: 1.5rem;
}
.login-page .login-google {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}
.login-page .login-google.hidden {
    display: none;
}
.login-page .login-terms {
    margin-bottom: 1.5rem;
}
.login-page .login-terms.hidden {
    display: none;
}
.login-page .login-divider {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 2rem 0 1.75rem;
    min-height: 1.25rem;
}
.login-page .login-divider.hidden {
    display: none;
}
.login-page .login-divider-line {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
}
.login-page .login-divider-line::before {
    content: '';
    width: 100%;
    border-top: 1px solid #e5e7eb;
}
.dark .login-page .login-divider-line::before {
    border-color: #475569;
}
.login-page .login-divider > span {
    position: relative;
    z-index: 1;
    padding: 0 1rem;
    font-size: 0.75rem;
    letter-spacing: 0.01em;
    color: #9ca3af;
    background: white;
}
.dark .login-page .login-divider > span {
    color: #94a3b8;
    background: #1e293b;
}
.login-page .login-form {
    display: flex;
    flex-direction: column;
    gap: 1.35rem;
}
.login-page .login-form.hidden {
    display: none;
}
.login-page .login-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.login-page .login-field label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}
.dark .login-page .login-field label {
    color: #e2e8f0;
}
.login-page .login-input {
    padding: 0.875rem 1rem;
}
.login-page .login-submit {
    margin-top: 0.5rem;
    padding-top: 0.875rem;
    padding-bottom: 0.875rem;
}
.login-page .login-footer {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.login-page .login-footer-tools {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    max-width: 28rem;
    margin: 0 auto 1.5rem;
    padding: 0 0.25rem;
}
.login-page .login-footer-row {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: center;
    gap: 0.875rem;
    width: 100%;
}
.login-page .lang-btn,
.login-page .login-theme-btn {
    flex: 1 1 0;
    min-width: 0;
    min-height: 2.75rem;
    padding: 0.75rem 0.875rem;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.25;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    background: white;
    color: #374151;
    touch-action: manipulation;
    transition: background 0.15s, border-color 0.15s;
}
.dark .login-page .lang-btn,
.dark .login-page .login-theme-btn {
    border-color: #475569;
    background: #1e293b;
    color: #e2e8f0;
}
.login-page .lang-btn:active,
.login-page .login-theme-btn:active {
    transform: scale(0.98);
}

.tab-btn.active {
    background-color: white;
    color: #3498db;
    box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.dark .tab-btn.active {
    background-color: #334155;
    color: #3498db;
}
.tab-btn:not(.active) {
    color: #6b7280;
}
.dark .tab-btn:not(.active) {
    color: #94a3b8;
}

/* Footer nav — couleurs par onglet (alignées sur l'app native) */
.nav-tab {
    transition: color 0.15s ease;
}

.nav-tab[data-tab="stock"].active { color: #77b300; }
.nav-tab[data-tab="stock"]:not(.active) { color: #77b30088; }

.nav-tab[data-tab="catalog"].active { color: #3498db; }
.nav-tab[data-tab="catalog"]:not(.active) { color: #3498db88; }

.nav-tab[data-tab="cart"].active { color: #f39c12; }
.nav-tab[data-tab="cart"]:not(.active) { color: #f39c1288; }

.nav-tab[data-tab="stores"].active { color: #9b59b6; }
.nav-tab[data-tab="stores"]:not(.active) { color: #9b59b688; }

.nav-tab[data-tab="loyalty"].active { color: #e74c3c; }
.nav-tab[data-tab="loyalty"]:not(.active) { color: #e74c3c88; }

.nav-tab[data-tab="settings"].active { color: #2980b9; }
.nav-tab[data-tab="settings"]:not(.active) { color: #7f8c8d; }

.dark .nav-tab[data-tab="stock"].active { color: #8bc34a; }
.dark .nav-tab[data-tab="stock"]:not(.active) { color: #8bc34a88; }

.dark .nav-tab[data-tab="catalog"].active { color: #5dade2; }
.dark .nav-tab[data-tab="catalog"]:not(.active) { color: #5dade288; }

.dark .nav-tab[data-tab="cart"].active { color: #f5b041; }
.dark .nav-tab[data-tab="cart"]:not(.active) { color: #f5b04188; }

.dark .nav-tab[data-tab="stores"].active { color: #bb8fce; }
.dark .nav-tab[data-tab="stores"]:not(.active) { color: #9b59b688; }

.dark .nav-tab[data-tab="loyalty"].active { color: #ec7063; }
.dark .nav-tab[data-tab="loyalty"]:not(.active) { color: #ec706388; }

.dark .nav-tab[data-tab="settings"].active { color: #3498db; }
.dark .nav-tab[data-tab="settings"]:not(.active) { color: #95a5a6; }

.nav-tab svg {
    stroke: currentColor;
}

.card-stokko {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    border: 1px solid #f3f4f6;
}
.dark .card-stokko {
    background: #1e293b;
    border-color: #334155;
}

.btn-primary {
    padding: 0.75rem 1rem;
    background: #3498db;
    color: white;
    font-weight: 600;
    border-radius: 0.75rem;
    box-shadow: 0 4px 14px rgba(52,152,219,.25);
    transition: transform .15s, background .15s;
}
.btn-primary:hover { background: #2980b9; }
.btn-primary:active { transform: scale(.98); }

.btn-delete-confirm {
    padding: 0.75rem 1rem;
    background: #ef4444;
    color: #fff;
    font-weight: 600;
    border-radius: 0.75rem;
    border: none;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.25);
    transition: transform .15s, background .15s;
}
.btn-delete-confirm:hover { background: #dc2626; }
.btn-delete-confirm:active { transform: scale(.98); }

.btn-secondary {
    padding: 0.625rem 1rem;
    background: #f3f4f6;
    color: #374151;
    font-weight: 500;
    border-radius: 0.75rem;
}
.dark .btn-secondary {
    background: #334155;
    color: #e2e8f0;
}

.input-field {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    outline: none;
}
.dark .input-field {
    background: #0f172a;
    border-color: #475569;
    color: #f1f5f9;
}
.input-field:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52,152,219,.15);
}

/* Champs date dans modales stock — Safari iOS déborde en grille 2 col. */
.stock-date-row {
    min-width: 0;
}
.stock-date-row > div {
    min-width: 0;
}
.stock-date-input {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 0.625rem 0.5rem;
    font-size: 0.875rem;
}
.dark .stock-date-input {
    color-scheme: dark;
}
@media (min-width: 640px) {
    .stock-date-row {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
}

.stokko-switch {
    position: relative;
    display: inline-block;
    width: 3rem;
    height: 1.75rem;
}
.stokko-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.stokko-switch-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #d1d5db;
    border-radius: 9999px;
    transition: background .2s;
}
.stokko-switch-slider::before {
    content: '';
    position: absolute;
    height: 1.25rem;
    width: 1.25rem;
    left: 0.25rem;
    bottom: 0.25rem;
    background: white;
    border-radius: 50%;
    transition: transform .2s;
    box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.stokko-switch input:checked + .stokko-switch-slider {
    background: #3498db;
}
.stokko-switch input:checked + .stokko-switch-slider::before {
    transform: translateX(1.25rem);
}

.product-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.625rem;
    overflow: hidden;
    background: #f3f4f6;
    flex-shrink: 0;
}
.dark .product-thumb {
    background: #334155;
}
.product-thumb-md {
    width: 2.5rem;
    height: 2.5rem;
}
.product-thumb-sm {
    width: 2rem;
    height: 2rem;
}
.product-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.product-thumb-emoji {
    font-size: 1.5rem;
    line-height: 1;
}
.product-thumb-sm.product-thumb-emoji {
    font-size: 1.25rem;
}

.product-row {
    cursor: pointer;
    transition: box-shadow .15s, transform .15s;
}
.product-row-head {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    min-width: 0;
}
.product-row-name {
    flex: 1 1 auto;
    min-width: 0;
}
.product-row-price {
    margin-left: auto;
}
.product-row-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.375rem;
}
.product-row-meta-brand {
    max-width: 8rem;
}
.product-row-actions {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}
.product-row-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.375rem;
    width: 100%;
}
.product-row-actions-delete {
    flex-shrink: 0;
    margin-left: auto;
    padding-left: 0.75rem;
    border-left: 1px solid rgba(148, 163, 184, 0.25);
}
.dark .product-row-actions-delete {
    border-left-color: rgba(71, 85, 105, 0.55);
}
.product-row-actions-delete .btn-icon-delete {
    opacity: 0.45;
}
.product-row-actions-delete .btn-icon-delete:hover,
.product-row-actions-delete .btn-icon-delete:active {
    opacity: 1;
}
.product-row-fav-btn {
    color: #cbd5e1;
    font-size: 1.125rem;
    line-height: 1;
    width: 2.25rem;
    height: 2.25rem;
}
.dark .product-row-fav-btn {
    color: #64748b;
}
.product-row-fav-btn.active {
    color: #fbbf24;
}
.product-row:active {
    transform: scale(.99);
}
.product-row:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

.product-sheet-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 8rem;
    border-radius: 1rem;
    background: #f9fafb;
    overflow: hidden;
}
.product-sheet-hero-sm {
    width: 5.5rem;
    height: 5.5rem;
    min-height: 0;
    border-radius: 0.875rem;
}
.product-sheet-hero-sm .product-sheet-img {
    max-height: 5.5rem;
}
.product-sheet-hero-sm .text-6xl {
    font-size: 2.5rem;
}
.dark .product-sheet-hero {
    background: #0f172a;
}
.product-sheet-img {
    width: 100%;
    max-height: 12rem;
    object-fit: contain;
}
.product-sheet-details {
    display: grid;
    gap: 0.5rem;
}
.product-sheet-info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.35rem;
    padding: 0.65rem 0.75rem;
    border-radius: 0.75rem;
    background: #f9fafb;
    border: 1px solid #f3f4f6;
}
.dark .product-sheet-info-grid {
    background: #0f172a;
    border-color: #334155;
}
.product-sheet-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 1.5rem;
}
.product-sheet-info-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #9ca3af;
    flex-shrink: 0;
}
.dark .product-sheet-info-label {
    color: #94a3b8;
}
.product-sheet-info-value {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #374151;
    text-align: right;
    min-width: 0;
}
.dark .product-sheet-info-value {
    color: #e2e8f0;
}
.product-sheet-details dt {
    font-size: 0.75rem;
    color: #6b7280;
}
.dark .product-sheet-details dt {
    color: #94a3b8;
}
.product-sheet-details dd {
    font-size: 0.875rem;
    font-weight: 500;
    margin: 0;
}

.product-rating-star {
    font-size: 1.35rem;
    line-height: 1;
    padding: 0 0.1rem;
    color: #d1d5db;
}
.product-rating-star.active {
    color: #f59e0b;
}
.product-favorite-btn {
    color: #d1d5db;
    transition: color .15s, transform .15s;
}
.product-favorite-btn.active {
    color: #f59e0b;
}
.product-favorite-btn:active {
    transform: scale(1.15);
}

.filter-fav-toggle {
    display: inline-flex;
    cursor: pointer;
    flex-shrink: 0;
}
.filter-fav-toggle-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.filter-fav-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    background: #fff;
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}
.dark .filter-fav-toggle-btn {
    background: #1e293b;
    border-color: #334155;
}
.filter-fav-star {
    font-size: 1.35rem;
    line-height: 1;
}
.filter-fav-star-on {
    display: none;
    color: #f59e0b;
}
.filter-fav-star-off {
    display: block;
    color: #cbd5e1;
}
.dark .filter-fav-star-off {
    color: #64748b;
}
.filter-fav-toggle-input:checked + .filter-fav-toggle-btn {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.12);
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.18);
}
.filter-fav-toggle-input:checked + .filter-fav-toggle-btn .filter-fav-star-on {
    display: block;
}
.filter-fav-toggle-input:checked + .filter-fav-toggle-btn .filter-fav-star-off {
    display: none;
}
.filter-fav-toggle:active .filter-fav-toggle-btn {
    transform: scale(0.94);
}

.stock-badge-low {
    background: rgba(243,156,18,.15);
    color: #e67e22;
}
.stock-badge-ok {
    background: rgba(119,179,0,.15);
    color: #77b300;
}
.cart-search-stock-empty {
    background: rgba(148, 163, 184, 0.15);
    color: #64748b;
}
.dark .cart-search-stock-empty {
    background: rgba(71, 85, 105, 0.35);
    color: #94a3b8;
}
.cart-search-head {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    min-width: 0;
}
.cart-search-name {
    flex: 1 1 auto;
    min-width: 0;
}
.cart-search-brand {
    flex: 0 1 auto;
    max-width: 40%;
}
.cart-search-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.expiry-soon {
    background: rgba(243,156,18,.08);
    border-color: rgba(243,156,18,.3);
}
.expiry-urgent {
    background: rgba(239,68,68,.08);
    border-color: rgba(239,68,68,.3);
}

.stat-bar-track {
    height: 0.375rem;
    border-radius: 9999px;
    background: rgba(148, 163, 184, 0.25);
    overflow: hidden;
}
.stat-bar-fill {
    height: 100%;
    border-radius: 9999px;
    background: linear-gradient(90deg, #3498db, #2980b9);
    transition: width 0.3s ease;
}

.promo-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: #fff;
    line-height: 1.4;
}
.promo-badge-sm {
    font-size: 0.6rem;
    padding: 0.1rem 0.375rem;
}

/* Modales — z-index explicite (les z-[…] Tailwind ne sont pas toujours compilés) */
.modal {
    position: fixed;
    inset: 0;
    z-index: 9000;
}
#loyalty-view-modal,
.loyalty-view-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    pointer-events: none;
}
#loyalty-view-modal.hidden,
.loyalty-view-modal.hidden {
    display: none !important;
}
.loyalty-view-backdrop {
    position: absolute;
    inset: 0;
    border: none;
    padding: 0;
    margin: 0;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    cursor: pointer;
    pointer-events: auto;
}
.dark .loyalty-view-backdrop {
    background: rgba(15, 23, 42, 0.45);
}
#loyalty-view-modal .loyalty-view-dialog,
.loyalty-view-modal .loyalty-view-dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 28rem;
    max-height: 92vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 1rem;
    padding: 1.25rem;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12);
    pointer-events: auto;
}
.dark #loyalty-view-modal .loyalty-view-dialog,
.dark .loyalty-view-modal .loyalty-view-dialog {
    background: #1e293b;
}
body.ticket-detail-open,
body.loyalty-code-open {
    overflow: hidden;
}

.loyalty-card {
    border-radius: 1rem;
    padding: 1rem;
    color: white;
    box-shadow: 0 4px 14px rgba(0,0,0,.15);
    position: relative;
    overflow: hidden;
}
.loyalty-card > * {
    position: relative;
    z-index: 1;
}
.loyalty-card::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: .2;
    background: radial-gradient(circle at top right, white, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* Espace sous le contenu pour la barre de navigation fixe (+ encoche iOS) */
body {
    padding-bottom: calc(5.75rem + env(safe-area-inset-bottom, 0));
}

.safe-bottom {
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.cart-scan-fab {
    position: fixed;
    right: 1rem;
    bottom: calc(4.75rem + env(safe-area-inset-bottom, 0));
    z-index: 45;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 9999px;
    border: none;
    background: #3498db;
    color: #fff;
    box-shadow: 0 4px 16px rgba(52, 152, 219, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
}
.cart-scan-fab:hover {
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.5);
}
.cart-scan-fab:active {
    transform: scale(.94);
}
.cart-scan-fab.hidden {
    display: none !important;
}

.stokko-toast {
    position: fixed;
    left: 50%;
    bottom: calc(5.25rem + env(safe-area-inset-bottom, 0));
    z-index: 99990;
    max-width: calc(100vw - 2rem);
    padding: 0.65rem 1rem;
    border-radius: 0.75rem;
    background: rgba(52, 73, 94, 0.94);
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    transform: translateX(-50%) translateY(0.5rem);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s, transform .2s;
}
.stokko-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.stokko-toast.hidden {
    display: block;
}

.scan-feedback-ok {
    border: 1px solid rgba(119, 179, 0, 0.35);
    background: rgba(119, 179, 0, 0.08);
}
.scan-feedback-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    background: #77b300;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    flex-shrink: 0;
}
.scan-feedback-err {
    border: 1px solid rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.08);
}

/* Nutri-Score officiel */
.nutriscore {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    height: 1.5rem;
    padding: 0 0.35rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 800;
    color: white;
    line-height: 1;
    letter-spacing: -0.02em;
}
.nutriscore-lg {
    min-width: 2rem;
    height: 2rem;
    font-size: 1rem;
    border-radius: 0.35rem;
}
.nutriscore-a { background: #038141; }
.nutriscore-b { background: #85BB2F; }
.nutriscore-c { background: #FECB02; color: #333; }
.nutriscore-d { background: #EE8100; }
.nutriscore-e { background: #E63E11; }

.ecoscore {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.75rem;
    height: 1.5rem;
    padding: 0 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.6875rem;
    font-weight: 800;
    color: white;
    line-height: 1;
    letter-spacing: -0.02em;
}
.ecoscore-a { background: #038141; }
.ecoscore-b { background: #85BB2F; }
.ecoscore-c { background: #FECB02; color: #333; }
.ecoscore-d { background: #EE8100; }
.ecoscore-e { background: #E63E11; }

.nova-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 1.5rem;
    padding: 0 0.45rem;
    border-radius: 0.25rem;
    font-size: 0.6875rem;
    font-weight: 800;
    color: white;
    line-height: 1;
    letter-spacing: -0.02em;
}
.nova-1 { background: #038141; }
.nova-2 { background: #85BB2F; }
.nova-3 { background: #EE8100; }
.nova-4 { background: #E63E11; }

.product-sheet-quality .product-additives-list {
    font-size: 0.8125rem;
    line-height: 1.35;
    word-break: break-word;
}

#product-sheet-barcode-visual svg {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
}

.product-price-chart {
    background: rgba(248, 250, 252, 0.8);
    border-radius: 0.75rem;
    padding: 0.75rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
}
.dark .product-price-chart {
    background: rgba(30, 41, 59, 0.45);
    border-color: rgba(71, 85, 105, 0.45);
}
.product-price-chart-svg {
    width: 100%;
    height: auto;
    display: block;
}
.product-price-chart-line {
    stroke: #3498db;
    stroke-width: 2;
    stroke-linejoin: round;
    stroke-linecap: round;
}
.dark .product-price-chart-line {
    stroke: #60a5fa;
}
.product-price-chart-axis {
    stroke: rgba(148, 163, 184, 0.35);
    stroke-width: 1;
}
.product-price-chart-label {
    fill: #94a3b8;
    font-size: 9px;
}
.product-purchase-history {
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 0.75rem;
    overflow: hidden;
}
.dark .product-purchase-history {
    border-color: rgba(71, 85, 105, 0.45);
}
.product-purchase-row {
    display: grid;
    grid-template-columns: minmax(4.5rem, auto) 1fr auto;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
    font-size: 0.8125rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}
.product-purchase-row:last-child {
    border-bottom: none;
}
.dark .product-purchase-row {
    border-bottom-color: rgba(71, 85, 105, 0.35);
}
.product-purchase-date {
    color: #64748b;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.dark .product-purchase-date {
    color: #94a3b8;
}
.product-purchase-store {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.product-purchase-price {
    font-weight: 600;
    color: #3498db;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.dark .product-purchase-price {
    color: #60a5fa;
}
.product-store-compare-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: 0.625rem;
    margin-bottom: 0.375rem;
    background: rgba(248, 250, 252, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.15);
}
.dark .product-store-compare-row {
    background: rgba(30, 41, 59, 0.35);
    border-color: rgba(71, 85, 105, 0.4);
}
.product-store-compare-best {
    border-color: rgba(52, 152, 219, 0.45);
    background: rgba(52, 152, 219, 0.08);
}
.dark .product-store-compare-best {
    border-color: rgba(96, 165, 250, 0.45);
    background: rgba(52, 152, 219, 0.12);
}

.household-member-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}
.household-member-row:last-child {
    border-bottom: none;
}
.household-invite-code {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    background: rgba(52, 152, 219, 0.1);
    text-align: center;
}
.dark .household-invite-code {
    background: rgba(52, 152, 219, 0.15);
}

.price-compare-card .product-store-compare-row:last-child {
    margin-bottom: 0;
}

.nutriscore-pick {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.35rem;
    font-weight: 800;
    color: white;
    border: 2px solid transparent;
    transition: transform .1s, border-color .1s;
}
.nutriscore-pick.nutriscore-c { color: #333; }
.nutriscore-pick.active {
    border-color: #34495e;
    transform: scale(1.08);
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.dark .nutriscore-pick.active { border-color: #f1f5f9; }

/* Cartes fidélité — aperçu code */
.loyalty-code-tile {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 0.5rem;
    padding: 0.5rem;
    min-width: 5.5rem;
    text-align: center;
    color: #1e293b;
    box-shadow: 0 1px 4px rgba(0,0,0,.12);
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
    border: none;
    font: inherit;
}
.loyalty-code-tile:hover {
    transform: scale(1.04);
    box-shadow: 0 4px 12px rgba(0,0,0,.18);
}
.loyalty-code-tile:active {
    transform: scale(0.98);
}
.loyalty-code-tile-hint {
    display: block;
    font-size: 0.55rem;
    color: #94a3b8;
    margin-top: 0.25rem;
}
#loyalty-view-container svg {
    max-width: 100%;
    height: auto;
    display: block;
    position: relative;
    z-index: 2;
}
#loyalty-view-container .loyalty-qrcode-render {
    width: min(17.5rem, 100%);
    height: min(17.5rem, 70vw);
}
#loyalty-view-container .loyalty-barcode-mock {
    width: 100%;
    height: 6rem;
}
#loyalty-view-container img,
#loyalty-view-container canvas {
    max-width: 100%;
    height: auto;
}
.loyalty-code-type-label {
    display: block;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    margin-bottom: 0.35rem;
}
.loyalty-barcode-mock {
    display: flex;
    align-items: stretch;
    gap: 1px;
    height: 2.5rem;
    padding: 0.15rem 0.25rem;
    background: white;
    border-radius: 0.25rem;
}
.loyalty-barcode-mock span {
    background: #111;
    border-radius: 1px;
    min-width: 2px;
}
.loyalty-qrcode-render {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    margin: 0 auto;
    padding: 2px;
    background: white;
    border-radius: 0.25rem;
    overflow: hidden;
}
.loyalty-qrcode-render-lg {
    width: min(17.5rem, 100%);
    height: min(17.5rem, 70vw);
    padding: 0.5rem;
}
.loyalty-qrcode-render img,
.loyalty-qrcode-render canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
    max-height: 100%;
}
.loyalty-qrcode-mock {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    width: 2.75rem;
    height: 2.75rem;
    margin: 0 auto;
    padding: 2px;
    background: white;
    border-radius: 0.25rem;
}
.loyalty-qrcode-mock span {
    background: #e2e8f0;
    border-radius: 1px;
}
.loyalty-qrcode-mock span.on {
    background: #111;
}
.scan-reader {
    min-height: 220px;
    width: 100%;
}
.scan-reader video {
    border-radius: 0.75rem;
    object-fit: cover;
}
.scan-reader #qr-shaded-region {
    border-radius: 0.75rem;
}

.btn-qty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2rem;
    padding: 0 0.35rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
    transition: background .15s, transform .15s;
}
.btn-qty-minus {
    background: rgba(239, 68, 68, .12);
    color: #ef4444;
}
.btn-qty-plus {
    background: rgba(119, 179, 0, .15);
    color: #77b300;
}
.btn-qty:hover {
    filter: brightness(.95);
}
.btn-qty:active {
    transform: scale(.92);
}
.qty-stepper-value {
    min-width: 1.75rem;
    text-align: center;
}

.cart-price-edit {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.1rem 0.35rem;
    margin: 0;
    border: none;
    border-radius: 0.375rem;
    background: rgba(52, 152, 219, 0.1);
    color: #3498db;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: background .15s;
}
.dark .cart-price-edit {
    color: #5dade2;
    background: rgba(52, 152, 219, 0.15);
}
.cart-price-edit:hover {
    background: rgba(52, 152, 219, 0.2);
}
.cart-price-edit-icon {
    font-size: 0.75rem;
    opacity: 0.85;
}
.cart-line-price {
    margin-top: 0.15rem;
    line-height: 1.35;
}

.btn-validate-all {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.65rem;
    border-radius: 0.5rem;
    font-size: 0.6875rem;
    font-weight: 700;
    background: rgba(119, 179, 0, 0.15);
    color: #5a8f00;
    flex-shrink: 0;
    border: none;
    cursor: pointer;
    transition: background .15s, transform .15s;
}
.dark .btn-validate-all {
    color: #a3d977;
}
.btn-validate-all:hover {
    background: rgba(119, 179, 0, 0.25);
}
.btn-validate-all:active {
    transform: scale(.95);
}

.cart-caddie-summary {
    border: 2px solid rgba(52, 152, 219, 0.25);
    background: linear-gradient(180deg, rgba(52, 152, 219, 0.06) 0%, transparent 100%);
}

body.cart-tab-active {
    padding-bottom: calc(9.5rem + env(safe-area-inset-bottom, 0));
}

#stock-detail-content,
#catalog-list,
#cart-items-list,
#cart-caddie-list {
    padding-bottom: 0.75rem;
}

.stokko-alerts-banner {
    padding: 0.75rem;
    border-radius: 1rem;
    background: rgba(243, 156, 18, 0.08);
    border: 1px solid rgba(243, 156, 18, 0.25);
}
.dark .stokko-alerts-banner {
    background: rgba(243, 156, 18, 0.1);
    border-color: rgba(243, 156, 18, 0.2);
}
.alert-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: white;
    border: 1px solid #e5e7eb;
    color: #34495e;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
}
.dark .alert-chip {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}
.alert-chip-urgent {
    border-color: rgba(239, 68, 68, 0.45);
    background: rgba(239, 68, 68, 0.08);
    color: #dc2626;
}
.dark .alert-chip-urgent {
    color: #f87171;
}
.alert-chip-count {
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.25rem;
    border-radius: 9999px;
    background: #3498db;
    color: white;
    font-size: 0.6875rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.alert-chip-urgent .alert-chip-count {
    background: #ef4444;
}

.nav-alert-badge {
    position: absolute;
    top: 0;
    right: 0.15rem;
    min-width: 1rem;
    height: 1rem;
    padding: 0 0.2rem;
    border-radius: 9999px;
    background: #ef4444;
    color: white;
    font-size: 0.5625rem;
    font-weight: 800;
    line-height: 1rem;
    text-align: center;
}
.nav-alert-badge.hidden {
    display: none !important;
}

.cart-store-mode-active .cart-caddie-summary {
    border-color: rgba(119, 179, 0, 0.35);
}

.open-carts-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-top: 0.625rem;
}
.open-cart-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(248, 250, 252, 0.9);
    color: #475569;
    transition: background .15s, border-color .15s, color .15s;
}
.dark .open-cart-tab {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(71, 85, 105, 0.5);
    color: #cbd5e1;
}
.open-cart-tab-active {
    background: rgba(52, 152, 219, 0.15);
    border-color: rgba(52, 152, 219, 0.45);
    color: #2980b9;
}
.dark .open-cart-tab-active {
    background: rgba(52, 152, 219, 0.22);
    border-color: rgba(96, 165, 250, 0.45);
    color: #93c5fd;
}
.open-cart-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.125rem;
    height: 1.125rem;
    padding: 0 0.25rem;
    border-radius: 9999px;
    font-size: 0.625rem;
    font-weight: 700;
    background: rgba(52, 152, 219, 0.2);
    color: inherit;
}
.open-cart-tab-active .open-cart-tab-badge {
    background: rgba(52, 152, 219, 0.28);
}

.cart-suggest-row {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    padding: 0.625rem 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
    min-width: 0;
}
.cart-shopping-suggest-overlay {
    padding: max(0.75rem, env(safe-area-inset-top, 0))
        max(1rem, env(safe-area-inset-right, 0))
        max(0.75rem, env(safe-area-inset-bottom, 0))
        max(1rem, env(safe-area-inset-left, 0));
}
.cart-shopping-suggest-dialog {
    max-height: calc(100vh - 1.5rem - env(safe-area-inset-top, 0) - env(safe-area-inset-bottom, 0));
    max-height: min(85dvh, calc(100dvh - 1.5rem - env(safe-area-inset-top, 0) - env(safe-area-inset-bottom, 0)));
    width: 100%;
}
@media (min-width: 640px) {
    .cart-shopping-suggest-dialog {
        max-height: min(88dvh, 40rem);
    }
}
.cart-shopping-suggest-list {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
}
.cart-suggest-row:last-child {
    border-bottom: none;
}
.cart-suggest-info {
    flex: 1 1 0;
    min-width: 0;
}
.cart-suggest-qty {
    flex: 0 0 3.75rem;
    width: 3.75rem;
    min-width: 3.75rem;
    max-width: 3.75rem;
    padding: 0.375rem 0.375rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    font-size: 0.875rem;
    text-align: center;
    outline: none;
    background: #fff;
    margin-top: 0.125rem;
}
.dark .cart-suggest-qty {
    background: #0f172a;
    border-color: #475569;
    color: #f1f5f9;
}
.cart-suggest-qty:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

.cart-close-stock-row {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    padding: 0.625rem 0.75rem;
    border-radius: 0.625rem;
    background: rgba(248, 250, 252, 0.85);
    min-width: 0;
}
.dark .cart-close-stock-row {
    background: rgba(30, 41, 59, 0.45);
}
.cart-close-stock-info {
    flex: 1 1 0;
    min-width: 0;
}
.cart-close-expiry {
    flex: 0 0 auto;
    width: 8.75rem;
    min-width: 8.75rem;
    max-width: 8.75rem;
    padding: 0.375rem 0.5rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    font-size: 0.75rem;
    outline: none;
    background: #fff;
    margin-top: 0.125rem;
}
.dark .cart-close-expiry {
    background: #0f172a;
    border-color: #475569;
    color: #f1f5f9;
    color-scheme: dark;
}
.cart-close-expiry:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

.cart-suggest-badge {
    display: inline-block;
    font-size: 0.625rem;
    font-weight: 700;
    padding: 0.125rem 0.375rem;
    border-radius: 9999px;
    line-height: 1.2;
}
.cart-suggest-badge-fav {
    background: rgba(245, 158, 11, 0.18);
    color: #b45309;
}
.dark .cart-suggest-badge-fav {
    color: #fbbf24;
}
.cart-suggest-badge-low {
    background: rgba(243, 156, 18, 0.15);
    color: #d97706;
}
.cart-suggest-badge-out {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}
.dark .cart-suggest-badge-out {
    color: #f87171;
}
.cart-suggest-badge-exp {
    background: rgba(119, 179, 0, 0.15);
    color: #65a30d;
}
.dark .cart-suggest-badge-exp {
    color: #a3e635;
}

.btn-validate {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.65rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    background: rgba(52, 152, 219, 0.15);
    color: #3498db;
    flex-shrink: 0;
    transition: background .15s, transform .15s;
}
.btn-validate:hover {
    background: rgba(52, 152, 219, 0.25);
}
.btn-validate:active {
    transform: scale(.95);
}

.cart-thumb-btn {
    border: none;
    padding: 0;
    background: transparent;
    cursor: pointer;
    border-radius: 0.625rem;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(52, 152, 219, 0.15);
    transition: transform .15s, box-shadow .15s;
}
.cart-thumb-btn * {
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}
.cart-thumb-btn:hover {
    transform: scale(1.04);
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.cart-thumb-btn:active {
    transform: scale(.98);
}
.cart-thumb-btn:focus-visible {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

#cart-image-modal,
.cart-image-modal {
    position: fixed;
    inset: 0;
    z-index: 99998;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    pointer-events: none;
}
#cart-image-modal.hidden,
.cart-image-modal.hidden {
    display: none !important;
}
.cart-image-backdrop {
    position: absolute;
    inset: 0;
    border: none;
    padding: 0;
    margin: 0;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    cursor: pointer;
    pointer-events: auto;
}
.dark .cart-image-backdrop {
    background: rgba(15, 23, 42, 0.45);
}
.cart-image-sheet {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 22rem;
    max-height: 78vh;
    margin: 0;
    padding: 0.75rem 0.75rem 1rem;
    border-radius: 1rem 1rem 0 0;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.12);
    pointer-events: auto;
    overflow: hidden;
}
@media (min-width: 640px) {
    .cart-image-modal {
        align-items: center;
        padding: 1rem;
    }
    .cart-image-sheet {
        border-radius: 1rem;
        max-height: 85vh;
        box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
    }
}
.cart-image-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.cart-image-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #34495e;
    margin: 0;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dark .cart-image-title {
    color: #f1f5f9;
}
.cart-image-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 0.625rem;
    padding: 0.25rem;
    overflow: hidden;
}
.dark .cart-image-wrap {
    background: #1e293b;
}
.cart-image-full {
    display: block;
    width: 100%;
    max-height: 62vh;
    object-fit: contain;
    border-radius: 0.5rem;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.625rem;
    flex-shrink: 0;
    transition: background .15s, transform .15s;
}
.btn-icon:hover {
    background: rgba(0,0,0,.06);
}
.dark .btn-icon:hover {
    background: rgba(255,255,255,.08);
}
.btn-icon:active {
    transform: scale(.92);
}
.btn-icon-edit { color: #3498db; }
.btn-icon-delete { color: #ef4444; }
.btn-icon-add { color: #77b300; }
.btn-icon-loyalty { color: #9b59b6; }
.btn-icon-loyalty-qrcode { color: #77b300; }
.dark .btn-icon-loyalty-qrcode { color: #8bc34a; }

.dash-tile {
    cursor: pointer;
    transition: box-shadow .15s, transform .15s, border-color .15s;
    border: 2px solid transparent;
}
.dash-tile:hover {
    box-shadow: 0 2px 10px rgba(0,0,0,.08);
}
.dash-tile.active {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52,152,219,.15);
}

/* ——— Tickets / reçus ——— */
.ticket-cards-stack {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ticket-archive-link {
    color: #3498db;
    font-weight: 600;
    white-space: nowrap;
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
    transition: background 0.15s;
}
.ticket-archive-link:hover {
    background: rgba(52, 152, 219, 0.1);
}

.ticket-card {
    position: relative;
    display: block;
    width: 100%;
    text-align: left;
    padding: 0;
    border: none;
    cursor: pointer;
    background: #fff;
    border-radius: 0.875rem;
    box-shadow: 0 2px 12px rgba(52, 73, 94, 0.08);
    overflow: hidden;
    transition: transform 0.15s, box-shadow 0.15s;
}
.dark .ticket-card {
    background: #1e293b;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}
.ticket-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(52, 73, 94, 0.12);
}
.dark .ticket-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}
.ticket-card::before {
    content: '';
    display: block;
    height: 4px;
    background: var(--ticket-accent, #3498db);
}
.ticket-card-body {
    padding: 0.875rem 1rem 0.5rem;
}
.ticket-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.625rem;
}
.ticket-card-date {
    font-size: 0.75rem;
    color: #94a3b8;
    white-space: nowrap;
    flex-shrink: 0;
}
.ticket-card-main {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
}
.ticket-card-total {
    font-size: 1.375rem;
    font-weight: 800;
    color: #34495e;
    letter-spacing: -0.02em;
}
.dark .ticket-card-total {
    color: #f1f5f9;
}
.ticket-card-meta {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 500;
}
.ticket-card-label {
    font-size: 0.6875rem;
    color: #94a3b8;
    margin-top: 0.375rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ticket-card-tear {
    height: 10px;
    margin-top: 0.625rem;
    background:
        radial-gradient(circle at 6px 0, transparent 5px, #f8fafc 5px) repeat-x;
    background-size: 12px 10px;
}
.dark .ticket-card-tear {
    background:
        radial-gradient(circle at 6px 0, transparent 5px, #0f172a 5px) repeat-x;
    background-size: 12px 10px;
}

.ticket-store-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    max-width: 100%;
    padding: 0.2rem 0.55rem 0.2rem 0.35rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--store-color, #3498db);
    background: color-mix(in srgb, var(--store-color, #3498db) 14%, transparent);
}
.ticket-store-badge-sm {
    font-size: 0.6875rem;
    padding: 0.15rem 0.45rem 0.15rem 0.3rem;
}
.ticket-store-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
    background: var(--store-color, #3498db);
    flex-shrink: 0;
}

.ticket-receipt {
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 28rem;
    max-height: 90vh;
}
.dark .ticket-receipt {
    background: #1e293b;
}
.ticket-receipt-header-wrap {
    position: relative;
    flex-shrink: 0;
}
.ticket-detail-close-x {
    position: absolute;
    top: 0.625rem;
    right: 0.625rem;
    z-index: 2;
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.85);
    color: #64748b;
    font-size: 1.375rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}
.dark .ticket-detail-close-x {
    background: rgba(15, 23, 42, 0.85);
    color: #cbd5e1;
}
.ticket-detail-close-x:hover {
    color: #34495e;
    background: #fff;
}
.ticket-receipt-header {
    padding: 1.25rem 2.75rem 1rem 1.25rem;
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--ticket-accent, #3498db) 18%, #fff),
        #fff
    );
    border-bottom: 1px dashed rgba(148, 163, 184, 0.45);
}
.dark .ticket-receipt-header {
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--ticket-accent, #3498db) 22%, #1e293b),
        #1e293b
    );
}
.ticket-receipt-store {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 0.5rem;
}
.ticket-receipt-store-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ticket-accent, #3498db);
    color: #fff;
    font-size: 1.125rem;
    font-weight: 800;
    flex-shrink: 0;
    box-shadow: 0 4px 12px color-mix(in srgb, var(--ticket-accent, #3498db) 40%, transparent);
}
.ticket-receipt-store-logo {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    object-fit: contain;
    background: #fff;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.dark .ticket-receipt-store-logo {
    background: #0f172a;
}
.ticket-receipt-store-name {
    font-size: 1.125rem;
    font-weight: 800;
    color: #34495e;
    line-height: 1.2;
}
.dark .ticket-receipt-store-name {
    color: #f1f5f9;
}
.ticket-receipt-date {
    font-size: 0.8125rem;
    color: #64748b;
}
.ticket-receipt-label {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 0.25rem;
}
.ticket-receipt-items {
    padding: 0.75rem 1.25rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}
.ticket-line {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.25rem 1rem;
    padding: 0.625rem 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
    font-size: 0.8125rem;
}
.ticket-line:last-child {
    border-bottom: none;
}
.ticket-line-name {
    font-weight: 600;
    color: #34495e;
    line-height: 1.3;
}
.dark .ticket-line-name {
    color: #e2e8f0;
}
.ticket-line-brand {
    font-size: 0.6875rem;
    color: #94a3b8;
    margin-top: 0.125rem;
}
.ticket-line-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.5rem;
    margin-top: 0.2rem;
    font-size: 0.6875rem;
    line-height: 1.35;
}
.ticket-line-contenance {
    color: #64748b;
    font-weight: 500;
}
.ticket-line-normalized {
    color: var(--color-primary-600, #2563eb);
    font-weight: 600;
}
.dark .ticket-line-normalized {
    color: var(--color-primary-400, #60a5fa);
}
.ticket-line-qty {
    font-size: 0.6875rem;
    color: #64748b;
    grid-column: 1;
}
.ticket-line-price {
    font-weight: 700;
    color: #34495e;
    text-align: right;
    align-self: start;
}
.dark .ticket-line-price {
    color: #f1f5f9;
}
.ticket-receipt-footer {
    padding: 1rem 1.25rem 1.25rem;
    background: #f8fafc;
    border-top: 2px dashed rgba(148, 163, 184, 0.35);
}
.dark .ticket-receipt-footer {
    background: #0f172a;
}
.ticket-receipt-total-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
}
.ticket-receipt-total-label {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}
.ticket-receipt-total-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--ticket-accent, #3498db);
    letter-spacing: -0.02em;
}
.ticket-receipt-bottom {
    flex-shrink: 0;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
}
.ticket-receipt-actions {
    padding: 0 1.25rem 1.25rem;
}
.ticket-receipt-actions .btn-secondary {
    width: 100%;
}

.ticket-archive-group {
    margin-bottom: 1.25rem;
}
.ticket-archive-group:last-child {
    margin-bottom: 0;
}
.ticket-archive-month {
    font-size: 0.6875rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    margin-bottom: 0.5rem;
    padding-left: 0.125rem;
}
.ticket-archive-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 0.375rem;
    border: none;
    border-radius: 0.75rem;
    background: #f8fafc;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
}
.dark .ticket-archive-row {
    background: #0f172a;
}
.ticket-archive-row:hover {
    background: rgba(52, 152, 219, 0.08);
}
.ticket-archive-row-main {
    flex: 1;
    min-width: 0;
}
.ticket-archive-row-date {
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 0.125rem;
}
.ticket-archive-row-total {
    font-size: 1rem;
    font-weight: 800;
    color: #34495e;
}
.dark .ticket-archive-row-total {
    color: #f1f5f9;
}

/* ——— Magasins : logo + accordéon tickets ——— */
.store-card {
    background: #fff;
    border-radius: 0.875rem;
    box-shadow: 0 2px 12px rgba(52, 73, 94, 0.08);
    overflow: hidden;
    margin-bottom: 0.75rem;
}
.dark .store-card {
    background: #1e293b;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}
.store-card-expanded {
    box-shadow: 0 4px 20px rgba(52, 152, 219, 0.12);
}
.store-card-row {
    display: flex;
    align-items: stretch;
    gap: 0.25rem;
}
.store-card-toggle {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 0.75rem 0.875rem 0.875rem;
    border: none;
    background: transparent;
    cursor: pointer;
    text-align: left;
    min-width: 0;
}
.store-card-actions {
    display: flex;
    align-items: center;
    gap: 0.125rem;
    padding-right: 0.5rem;
}
.store-brand-col {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}
.store-logo-md {
    width: 2.5rem;
    height: 2.5rem;
}
.store-logo-sm {
    width: 2rem;
    height: 2rem;
}
.store-logo-img,
.store-logo-fallback {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.625rem;
    object-fit: contain;
    background: #f8fafc;
    flex-shrink: 0;
}
.store-logo-sm.store-logo-img,
.store-logo-sm.store-logo-fallback {
    width: 2rem;
    height: 2rem;
}
.dark .store-logo-img {
    background: #0f172a;
}
.store-logo-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 1rem;
}
.store-color-bar {
    width: 4px;
    height: 2.5rem;
    border-radius: 9999px;
    flex-shrink: 0;
}
.store-card-chevron {
    transition: transform 0.2s ease;
}
.store-card-expanded .store-card-chevron {
    transform: rotate(180deg);
}
.store-accordion-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.28s ease;
}
.store-accordion-panel-open {
    max-height: 2000px;
}
.store-accordion-inner {
    padding: 0 0.875rem 0.875rem 4.75rem;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    background: linear-gradient(180deg, rgba(52, 152, 219, 0.04), transparent);
}
.dark .store-accordion-inner {
    border-top-color: rgba(148, 163, 184, 0.12);
    background: linear-gradient(180deg, rgba(52, 152, 219, 0.08), transparent);
}
.store-accordion-label {
    font-size: 0.6875rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    padding: 0.625rem 0 0.375rem;
}
.store-no-tickets {
    font-size: 0.8125rem;
    color: #94a3b8;
    padding: 0.25rem 0 0.5rem;
}
.store-tickets-list {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}
.store-ticket-row {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: none;
    border-radius: 0.625rem;
    background: #fff;
    cursor: pointer;
    text-align: left;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    transition: background 0.15s, transform 0.15s;
}
.dark .store-ticket-row {
    background: #0f172a;
}
.store-ticket-row:hover {
    background: rgba(52, 152, 219, 0.08);
    transform: translateX(2px);
}
.store-ticket-row-main {
    flex: 1;
    min-width: 0;
}
.store-ticket-row-date {
    font-size: 0.75rem;
    color: #64748b;
}
.store-ticket-row-total {
    font-size: 0.9375rem;
    font-weight: 800;
    color: #34495e;
    margin-top: 0.125rem;
}
.dark .store-ticket-row-total {
    color: #f1f5f9;
}
.store-ticket-row-meta {
    font-size: 0.6875rem;
    color: #94a3b8;
    margin-top: 0.125rem;
}
.store-ticket-row-chevron {
    width: 1rem;
    height: 1rem;
    min-width: 1rem;
    max-width: 1rem;
    flex: 0 0 1rem;
    color: #94a3b8;
}
.store-ticket-row svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}
.ticket-archive-row-chevron {
    width: 1.25rem;
    height: 1.25rem;
    min-width: 1.25rem;
    flex: 0 0 1.25rem;
    color: #94a3b8;
}
.ticket-archive-row svg {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}
.store-logo-preview {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    overflow: hidden;
    flex-shrink: 0;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
}
.store-logo-preview .store-logo-img,
.store-logo-preview .store-logo-fallback {
    width: 100%;
    height: 100%;
}
.product-image-preview {
    width: 4rem;
    height: 4rem;
    border-radius: 0.75rem;
    overflow: hidden;
    flex-shrink: 0;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e7eb;
}
.dark .product-image-preview {
    background: #0f172a;
    border-color: #334155;
}
.product-image-preview .product-thumb-img,
.product-image-preview .product-thumb-emoji {
    width: 100%;
    height: 100%;
    object-fit: cover;
    font-size: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.off-legal-text a.off-legal-link {
    color: #3498db;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.dark .off-legal-text a.off-legal-link {
    color: #60a5fa;
}
.product-sheet-off-attribution {
    padding: 0.625rem 0.75rem;
    border-radius: 0.75rem;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}
.dark .product-sheet-off-attribution {
    background: #0f172a;
    border-color: #334155;
}

.google-signin-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    min-height: 48px;
    padding: 0.75rem 1rem;
    border-radius: 9999px;
    background: #fff;
    color: #1f2937;
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid #d1d5db;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    cursor: pointer;
    touch-action: manipulation;
}

html.dark .google-signin-btn {
    background: #fff;
    color: #1f2937;
    border-color: #cbd5e1;
}

.apple-signin-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    min-height: 48px;
    padding: 0.75rem 1rem;
    border-radius: 9999px;
    background: #000;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    touch-action: manipulation;
}

.apple-signin-btn:disabled {
    cursor: not-allowed;
}

.login-apple {
    margin-top: 0.75rem;
}

#google-btn-container iframe {
    display: block !important;
    margin: 0 auto !important;
    min-height: 44px !important;
}

.stokko-copyright-link {
    color: #3498db;
    text-decoration: underline;
    text-underline-offset: 2px;
}
html.dark .stokko-copyright-link {
    color: #60a5fa;
}
.stokko-copyright-link:hover {
    opacity: 0.85;
}
.dash-tile:active {
    transform: scale(.98);
}
