/* ============================================
   MonPanier - Application Mobile
   Design Premium avec Ergonomie Optimisée
   ============================================ */

/* === VARIABLES === */
:root {
    /* Couleurs principales */
    --primary: #2E7D32;
    --primary-dark: #1B5E20;
    --primary-light: #4CAF50;
    --primary-bg: #E8F5E9;
    --secondary: #FF6F00;
    --secondary-light: #FFF3E0;
    --accent: #1976D2;
    
    /* État */
    --success: #2E7D32;
    --danger: #D32F2F;
    --warning: #F57C00;
    --info: #1565C0;
    
    /* Neutres */
    --text-primary: #1A1A2E;
    --text-secondary: #4A4A5A;
    --text-muted: #888899;
    --text-light: #AAAAAA;
    
    /* Fond */
    --bg-white: #FFFFFF;
    --bg-light: #F5F6FA;
    --bg-gray: #EEEEF2;
    --bg-dark: #1A1A2E;
    
    /* Ombres */
    --shadow-xs: 0 1px 3px rgba(0,0,0,0.04);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.15);
    --shadow-xl: 0 16px 48px rgba(0,0,0,0.20);
    
    /* Rayons */
    --radius-xs: 6px;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-full: 9999px;
    
    /* Dimensions */
    --header-height: 60px;
    --bottom-nav-height: 65px;
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    
    /* Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* === MODE SOMBRE === */
[data-theme="dark"] {
    --text-primary: #EEEEF2;
    --text-secondary: #BBBBC8;
    --text-muted: #888899;
    --bg-white: #1A1A2E;
    --bg-light: #12121F;
    --bg-gray: #2A2A3E;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
    --primary-bg: #1A2A1A;
}

/* === RESET & BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-light);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === SCROLLBAR === */
::-webkit-scrollbar {
    width: 3px;
    height: 3px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* === SELECTION === */
::selection {
    background: var(--primary);
    color: white;
}

/* === LOADING OVERLAY === */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 9999;
    transition: opacity 0.3s ease;
}
[data-theme="dark"] .loading-overlay {
    background: rgba(26,26,46,0.92);
}
.loading-overlay.active {
    display: flex;
}

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 40px;
}

.loading-spinner {
    width: 52px;
    height: 52px;
    border: 4px solid var(--bg-gray);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.loading-progress {
    width: 200px;
    height: 4px;
    background: var(--bg-gray);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.loading-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-light), var(--primary));
    width: 0%;
    border-radius: var(--radius-full);
    animation: progress 1.5s ease-in-out infinite;
}

.loading-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.3px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes progress {
    0% { width: 0%; transform: translateX(-100%); }
    50% { width: 70%; transform: translateX(0%); }
    100% { width: 100%; transform: translateX(100%); }
}

/* === HEADER === */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-white);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--bg-gray);
    transition: var(--transition-base);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.header-logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-logo {
    height: 36px;
    width: 36px;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

.header-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.3px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-icon {
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    position: relative;
}
.btn-icon:hover {
    background: var(--bg-gray);
    color: var(--text-primary);
}
.btn-icon:active {
    transform: scale(0.88);
}
.btn-icon .badge {
    position: absolute;
    top: 2px;
    right: 2px;
}

.panier-btn {
    position: relative;
    color: var(--text-primary);
}
.panier-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    box-shadow: 0 2px 6px rgba(211, 47, 47, 0.3);
    animation: badgePop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes badgePop {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

/* === RECHERCHE RAPIDE === */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-white);
    z-index: 1100;
    display: none;
    flex-direction: column;
    animation: slideDown 0.3s ease;
}
.search-overlay.active {
    display: flex;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.search-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.search-header {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--bg-gray);
}

.search-input {
    flex: 1;
    border: none;
    background: var(--bg-light);
    padding: 12px 16px;
    border-radius: var(--radius-full);
    font-size: 16px;
    font-family: inherit;
    color: var(--text-primary);
    outline: none;
    transition: var(--transition-fast);
}
.search-input:focus {
    background: var(--bg-white);
    box-shadow: 0 0 0 2px var(--primary-bg);
}

.search-suggestions {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
}

.search-suggestion-group {
    margin-bottom: 20px;
}

.suggestion-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.suggestion-item {
    padding: 10px 12px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition-fast);
}
.suggestion-item:hover {
    background: var(--bg-light);
}
.suggestion-item i {
    color: var(--text-muted);
    font-size: 14px;
}
.suggestion-item .text {
    flex: 1;
    font-size: 14px;
}

.search-results {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
}

/* === MENU LATERAL === */
.side-menu {
    position: fixed;
    top: 0;
    left: -320px;
    width: 320px;
    max-width: 85%;
    height: 100%;
    background: var(--bg-white);
    z-index: 1050;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-lg);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.side-menu.open {
    left: 0;
}

.side-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1040;
    display: none;
    animation: fadeIn 0.3s ease;
}
.side-menu-overlay.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.side-menu-header {
    padding: 20px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    gap: 16px;
    color: white;
    flex-shrink: 0;
}

.user-avatar {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-full);
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    text-transform: uppercase;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    min-width: 0;
}
.user-name {
    display: block;
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-email {
    display: block;
    font-size: 12px;
    opacity: 0.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.close-menu-btn {
    color: white !important;
    flex-shrink: 0;
}
.close-menu-btn:hover {
    background: rgba(255,255,255,0.15) !important;
}

.side-menu-list {
    list-style: none;
    padding: 8px 0;
    flex: 1;
    overflow-y: auto;
}
.side-menu-list li {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    cursor: pointer;
    transition: var(--transition-fast);
    color: var(--text-secondary);
    gap: 14px;
    font-weight: 500;
}
.side-menu-list li:hover {
    background: var(--bg-light);
}
.side-menu-list li.active {
    color: var(--primary);
    background: var(--primary-bg);
    font-weight: 600;
    border-right: 3px solid var(--primary);
}
.side-menu-list li i {
    width: 24px;
    font-size: 18px;
    text-align: center;
    flex-shrink: 0;
}
.side-menu-list li .menu-badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 22px;
    height: 22px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}
.side-menu-list li.danger {
    color: var(--danger);
}
.side-menu-list li.danger:hover {
    background: var(--danger-light);
}
.side-menu-list .separator {
    height: 1px;
    background: var(--bg-gray);
    padding: 0;
    margin: 8px 20px;
    cursor: default;
}

.side-menu-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--bg-gray);
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.theme-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    background: var(--bg-light);
    transition: var(--transition-fast);
}
.theme-toggle:hover {
    background: var(--bg-gray);
}
.theme-toggle i {
    font-size: 14px;
}

/* === CONTENU PRINCIPAL === */
.main-content {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: calc(var(--bottom-nav-height) + var(--safe-area-bottom));
    overflow-y: auto;
    background: var(--bg-light);
    padding: 12px 16px 20px;
    -webkit-overflow-scrolling: touch;
    transition: var(--transition-base);
}

.page {
    display: none;
    animation: pageIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.page.active {
    display: block;
}

@keyframes pageIn {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === BOTTOM NAVIGATION === */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--bottom-nav-height) + var(--safe-area-bottom));
    padding-bottom: var(--safe-area-bottom);
    background: var(--bg-white);
    display: flex;
    align-items: stretch;
    border-top: 1px solid var(--bg-gray);
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 10px;
    cursor: pointer;
    transition: var(--transition-fast);
    position: relative;
    padding: 4px 0;
    font-family: inherit;
    font-weight: 500;
}
.bottom-nav-item i {
    font-size: 22px;
    transition: var(--transition-fast);
}
.bottom-nav-item span {
    font-size: 10px;
    font-weight: 500;
}
.bottom-nav-item.active {
    color: var(--primary);
}
.bottom-nav-item.active i {
    transform: scale(1.1);
}
.bottom-nav-item:active {
    transform: scale(0.92);
}
.bottom-nav-item .nav-badge {
    position: absolute;
    top: 2px;
    right: 50%;
    transform: translateX(calc(50% + 16px));
    background: var(--danger);
    color: white;
    font-size: 9px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* === FLOATING ACTION BUTTON === */
.fab {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + var(--safe-area-bottom) + 16px);
    right: 16px;
    width: 52px;
    height: 52px;
    border: none;
    border-radius: var(--radius-full);
    background: var(--primary);
    color: white;
    font-size: 20px;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: var(--transition-bounce);
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
}
.fab:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-xl);
}
.fab:active {
    transform: scale(0.88);
}
.fab.show {
    display: flex;
    animation: fabIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes fabIn {
    from { opacity: 0; transform: scale(0); }
    to { opacity: 1; transform: scale(1); }
}

/* === TOAST === */
.toast-container {
    position: fixed;
    top: calc(var(--header-height) + 12px);
    right: 12px;
    left: 12px;
    z-index: 1100;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.toast {
    pointer-events: auto;
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    background: var(--text-primary);
    color: var(--bg-white);
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 480px;
    width: 100%;
}
.toast i {
    font-size: 18px;
    flex-shrink: 0;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); }
.toast.info { background: var(--info); }

.toast.out {
    animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-30px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(40px); }
}

/* === CARTES === */
.card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 12px;
    transition: var(--transition-base);
    border: 1px solid var(--bg-gray);
}
.card:active {
    transform: scale(0.98);
}
.card-header {
    padding: 14px 16px;
    font-weight: 600;
    font-size: 15px;
    border-bottom: 1px solid var(--bg-gray);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-light);
}
.card-body {
    padding: 14px 16px;
}

/* === FORMULAIRES === */
.form-group {
    margin-bottom: 14px;
}
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
}
.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--bg-gray);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: inherit;
    transition: var(--transition-fast);
    background: var(--bg-white);
    color: var(--text-primary);
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-bg);
}
.form-control::placeholder {
    color: var(--text-muted);
}
.form-control.error {
    border-color: var(--danger);
    box-shadow: 0 0 0 4px var(--danger-light);
}

/* === BOUTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
    width: 100%;
    position: relative;
    overflow: hidden;
}
.btn:active {
    transform: scale(0.96);
}
.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow-md);
}
.btn-secondary {
    background: var(--bg-gray);
    color: var(--text-secondary);
}
.btn-secondary:hover {
    background: #d5d5d5;
}
.btn-success {
    background: var(--success);
    color: white;
}
.btn-danger {
    background: var(--danger);
    color: white;
}
.btn-warning {
    background: var(--warning);
    color: white;
}
.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}
.btn-outline:hover {
    background: var(--primary);
    color: white;
}
.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}
.btn-lg {
    padding: 16px 32px;
    font-size: 17px;
}
.btn-block {
    width: 100%;
}
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* === BADGES === */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
}
.badge-success { background: var(--primary-bg); color: var(--primary); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-warning { background: var(--secondary-light); color: var(--warning); }
.badge-info { background: #E3F2FD; color: var(--info); }

/* === LISTES === */
.list-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    background: var(--bg-white);
    border-bottom: 1px solid var(--bg-gray);
    gap: 14px;
    cursor: pointer;
    transition: var(--transition-fast);
}
.list-item:active {
    background: var(--bg-light);
    transform: scale(0.98);
}
.list-item:last-child {
    border-bottom: none;
}
.list-item .item-image {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--bg-gray);
    flex-shrink: 0;
}
.list-item .item-content {
    flex: 1;
    min-width: 0;
}
.list-item .item-title {
    font-weight: 600;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.list-item .item-subtitle {
    font-size: 13px;
    color: var(--text-muted);
}
.list-item .item-price {
    font-weight: 700;
    color: var(--primary);
    font-size: 16px;
    flex-shrink: 0;
}
.list-item .item-action {
    flex-shrink: 0;
}
.list-item .item-chevron {
    color: var(--text-muted);
    font-size: 14px;
}

/* === PRODUIT CARD (grille) === */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.product-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
    transition: var(--transition-base);
    cursor: pointer;
    border: 1px solid var(--bg-gray);
}
.product-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.product-card:active {
    transform: scale(0.96);
}
.product-card .product-image-wrapper {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1/1;
    background: var(--bg-light);
}
.product-card .product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-slow);
}
.product-card:hover .product-image {
    transform: scale(1.05);
}
.product-card .product-fav {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    border: none;
    background: rgba(255,255,255,0.85);
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-fast);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
}
.product-card .product-fav:hover {
    background: white;
}
.product-card .product-fav.active {
    color: var(--danger);
}
.product-card .product-fav:active {
    transform: scale(0.8);
}

.product-card .product-info {
    padding: 12px 14px 14px;
}
.product-card .product-name {
    font-size: 14px;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 40px;
}
.product-card .product-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
    margin-top: 4px;
}
.product-card .product-old-price {
    font-size: 12px;
    color: var(--text-muted);
    text-decoration: line-through;
    margin-left: 6px;
}
.product-card .product-add {
    margin-top: 10px;
    width: 100%;
    padding: 8px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--primary);
    color: white;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition-fast);
    font-family: inherit;
}
.product-card .product-add:active {
    transform: scale(0.96);
}
.product-card .product-add.out-of-stock {
    background: var(--bg-gray);
    color: var(--text-muted);
    cursor: not-allowed;
}
.product-card .product-add.out-of-stock:active {
    transform: none;
}
.product-card .product-add.in-cart {
    background: var(--success);
}

/* === PANIER ITEM === */
.cart-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    background: var(--bg-white);
    border-bottom: 1px solid var(--bg-gray);
    gap: 14px;
}
.cart-item .item-image {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--bg-gray);
    flex-shrink: 0;
}
.cart-item .item-info {
    flex: 1;
    min-width: 0;
}
.cart-item .item-name {
    font-weight: 600;
    font-size: 14px;
}
.cart-item .item-price {
    font-size: 12px;
    color: var(--text-muted);
}
.cart-item .item-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.cart-item .qty-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: var(--radius-full);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}
.cart-item .qty-btn:active {
    transform: scale(0.88);
}
.cart-item .qty-btn.minus {
    background: var(--bg-gray);
    color: var(--text-secondary);
}
.cart-item .qty-btn.plus {
    background: var(--primary);
    color: white;
}
.cart-item .qty-value {
    font-weight: 600;
    font-size: 15px;
    min-width: 28px;
    text-align: center;
}
.cart-item .item-total {
    font-weight: 700;
    color: var(--primary);
    font-size: 15px;
    min-width: 80px;
    text-align: right;
}
.cart-item .item-remove {
    color: var(--danger);
    cursor: pointer;
    padding: 4px;
    transition: var(--transition-fast);
}
.cart-item .item-remove:active {
    transform: scale(0.8);
}

/* === PAGE LOGIN === */
.login-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    padding: 24px 20px;
}
.login-page .login-logo {
    width: 100px;
    height: 100px;
    margin-bottom: 16px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}
.login-page .login-title {
    font-size: 30px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.login-page .login-subtitle {
    color: var(--text-muted);
    margin-bottom: 28px;
    font-size: 15px;
}
.login-page .login-form {
    width: 100%;
    max-width: 360px;
}
.login-page .login-form .form-group {
    margin-bottom: 16px;
}
.login-page .login-form .form-control {
    background: var(--bg-light);
    border-color: transparent;
    padding: 14px 18px;
}
.login-page .login-form .form-control:focus {
    background: var(--bg-white);
}
.login-page .login-switch {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-secondary);
}
.login-page .login-switch a {
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition-fast);
}
.login-page .login-switch a:hover {
    text-decoration: underline;
}
.login-page .login-message {
    text-align: center;
    font-size: 13px;
    min-height: 24px;
    margin-top: 8px;
    padding: 8px;
    border-radius: var(--radius-sm);
}
.login-page .login-message.error {
    color: var(--danger);
    background: var(--danger-light);
}
.login-page .login-message.success {
    color: var(--success);
    background: var(--primary-bg);
}

/* === PAGE ACCUEIL === */
.welcome-section {
    padding: 4px 0 16px;
}
.welcome-title {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
}
.welcome-title span {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.welcome-subtitle {
    color: var(--text-muted);
    font-size: 15px;
    margin-top: 2px;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.section-title .see-all {
    font-size: 13px;
    font-weight: 500;
    color: var(--primary);
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition-fast);
}
.section-title .see-all:hover {
    text-decoration: underline;
}

.scroll-horizontal {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 4px 0 16px;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}
.scroll-horizontal::-webkit-scrollbar {
    display: none;
}
.scroll-item {
    flex-shrink: 0;
    scroll-snap-align: start;
    width: 160px;
}
.scroll-item .card {
    margin-bottom: 0;
}

.panier-card {
    cursor: pointer;
    transition: var(--transition-base);
}
.panier-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.panier-card:active {
    transform: scale(0.96);
}
.panier-card .card-image {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    background: var(--bg-light);
}
.panier-card .card-content {
    padding: 12px 14px 14px;
}
.panier-card .card-title {
    font-weight: 600;
    font-size: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 40px;
}
.panier-card .card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}
.panier-card .card-price {
    font-weight: 700;
    color: var(--primary);
    font-size: 15px;
}
.panier-card .card-count {
    font-size: 12px;
    color: var(--text-muted);
}

/* === PAGE PANIER STANDARD === */
.panier-detail-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1060;
    display: none;
    align-items: flex-end;
    justify-content: center;
}
.panier-detail-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}
.panier-detail-modal {
    background: var(--bg-white);
    width: 100%;
    max-height: 85vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    overflow: hidden;
    animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}
.panier-detail-modal .modal-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--bg-gray);
    background: var(--bg-light);
}
.panier-detail-modal .modal-header h3 {
    font-size: 18px;
    font-weight: 700;
}
.panier-detail-modal .modal-close {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--bg-gray);
    border-radius: var(--radius-full);
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}
.panier-detail-modal .modal-close:hover {
    background: #d5d5d5;
}
.panier-detail-modal .modal-close:active {
    transform: scale(0.88);
}
.panier-detail-modal .modal-body {
    padding: 16px 20px 20px;
    overflow-y: auto;
    max-height: calc(85vh - 140px);
}
.panier-detail-modal .modal-footer {
    padding: 12px 20px 20px;
    border-top: 1px solid var(--bg-gray);
    background: var(--bg-light);
}

/* === PAGE PANIER === */
.cart-summary {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    margin-top: 12px;
    border: 1px solid var(--bg-gray);
}
.cart-summary .summary-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 14px;
}
.cart-summary .summary-row.total {
    font-weight: 700;
    font-size: 18px;
    border-top: 2px solid var(--bg-gray);
    padding-top: 12px;
    margin-top: 8px;
}
.cart-summary .summary-row.total .amount {
    color: var(--primary);
}

/* === EMPTY STATE === */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.empty-state i {
    font-size: 56px;
    opacity: 0.3;
    margin-bottom: 16px;
}
.empty-state h4 {
    color: var(--text-secondary);
    font-size: 20px;
    margin-bottom: 4px;
}
.empty-state p {
    font-size: 14px;
    max-width: 280px;
    margin: 0 auto 16px;
}

/* === RESPONSIVE === */
@media (min-width: 480px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .scroll-item {
        width: 180px;
    }
}

@media (min-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .main-content {
        padding: 16px 24px 24px;
    }
    .scroll-item {
        width: 200px;
    }
}

@media (max-width: 360px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .product-card .product-info {
        padding: 8px 10px 10px;
    }
    .product-card .product-name {
        font-size: 12px;
        min-height: 32px;
    }
    .product-card .product-price {
        font-size: 14px;
    }
    .header-title {
        font-size: 16px;
    }
}

/* === UTILITAIRES === */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-small { font-size: 13px; }
.text-large { font-size: 18px; }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 24px; }

.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-col { flex-direction: column; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

.w-full { width: 100%; }
.h-full { height: 100%; }
.relative { position: relative; }
.absolute { position: absolute; }

.hidden { display: none !important; }
.visible { display: block !important; }

.rounded { border-radius: var(--radius-sm); }
.rounded-lg { border-radius: var(--radius-md); }
.rounded-full { border-radius: var(--radius-full); }

.shadow { box-shadow: var(--shadow-sm); }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* === ANIMATIONS SUPPLEMENTAIRES === */
.pulse {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.bounce-in {
    animation: bounceIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes bounceIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.slide-in-right {
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

/* === ACCESSIBILITE === */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible pour accessibilité */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Support pour les écrans de grande taille */
@media (min-width: 1024px) {
    .main-content {
        max-width: 480px;
        margin: 0 auto;
        padding: 16px 20px 24px;
    }
    .bottom-nav {
        max-width: 480px;
        margin: 0 auto;
        left: 50%;
        transform: translateX(-50%);
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }
    .app-header {
        max-width: 480px;
        margin: 0 auto;
        left: 50%;
        transform: translateX(-50%);
        border-radius: 0 0 var(--radius-md) var(--radius-md);
    }
}