/* Reset et variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #fbbf24;
    --primary-dark: #f59e0b;
    --secondary-color: #1a1a1a;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-color: #fafafa;
    --card-bg: #ffffff;
    --text-color: #1a1a1a;
    --text-light: #4a4a4a;
    --border-color: #e5e5e5;
    --hover-bg: #fef3c7;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    font-size: 16px;
}

/* Amélioration du viewport mobile */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }

    * {
        -webkit-tap-highlight-color: transparent;
    }

    /* Améliorer les zones de clic sur mobile */
    button, .btn, .category-folder, .product-card-image {
        touch-action: manipulation;
        min-height: 44px; /* Taille minimale recommandée pour le tactile */
    }
}

/* Navigation */
.navbar {
    background: var(--card-bg);
    box-shadow: var(--shadow);
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-container h2 {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.5rem;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Authentification */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-box {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 2rem;
    width: 100%;
    max-width: 450px;
}

.auth-box h1 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.auth-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.tab-btn {
    flex: 1;
    padding: 0.75rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-light);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s;
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

/* Formulaires */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input,
.form-group textarea,
.form-group input[type="file"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input[type="file"] {
    cursor: pointer;
    background: var(--bg-color);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-group select {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text-color);
    font-size: 1rem;
    transition: border-color 0.3s;
    cursor: pointer;
}

#product-category-new {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text-color);
    font-size: 1rem;
    transition: border-color 0.3s;
}

#product-category-new:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.1);
}

/* Zone d'upload d'image */
.image-upload-wrapper {
    width: 100%;
}

.image-upload-area {
    position: relative;
    width: 100%;
    min-height: 280px;
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    background: var(--bg-color);
    transition: all 0.3s ease;
    cursor: pointer;
    overflow: hidden;
}

.image-upload-area:hover {
    border-color: var(--primary-color);
    background: rgba(79, 70, 229, 0.02);
}

.image-upload-area.dragover {
    border-color: var(--primary-color);
    background: rgba(79, 70, 229, 0.08);
    transform: scale(1.01);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
    color: var(--text-light);
    min-height: 280px;
    transition: opacity 0.3s;
}

.upload-icon {
    color: var(--primary-color);
    margin-bottom: 1rem;
    opacity: 0.6;
    transition: all 0.3s;
}

.image-upload-area:hover .upload-icon {
    opacity: 1;
    transform: translateY(-5px);
}

.upload-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0.5rem 0 0.25rem 0;
}

.upload-hint {
    font-size: 0.95rem;
    color: var(--text-light);
    margin: 0.25rem 0;
}

.upload-formats {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(79, 70, 229, 0.05);
    border-radius: 6px;
}

.image-preview {
    position: relative;
    width: 100%;
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 1.5rem;
}

.image-preview img {
    max-width: 100%;
    max-height: 400px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    background: white;
    padding: 0.5rem;
    background: white;
}

.preview-overlay {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}

.preview-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.preview-btn:hover {
    background: white;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.preview-btn-change {
    color: var(--primary-color);
}

.preview-btn-change:hover {
    background: var(--primary-color);
    color: var(--text-color);
}

.preview-btn-delete {
    color: var(--danger-color);
}

.preview-btn-delete:hover {
    background: var(--danger-color);
    color: white;
}

.preview-btn svg {
    stroke: currentColor;
}

/* Animation de chargement */
.image-upload-area.uploading {
    pointer-events: none;
    opacity: 0.7;
}

.upload-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.progress-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.progress-text {
    font-size: 0.9rem;
    color: var(--text-light);
    margin: 0;
    font-weight: 500;
}

/* Conteneur pour plusieurs images */
.images-preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.image-preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.image-preview-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview-item .preview-item-overlay {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s;
}

.image-preview-item:hover .preview-item-overlay {
    opacity: 1;
}

.preview-item-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.preview-item-btn:hover {
    background: white;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.preview-item-btn-delete {
    color: var(--danger-color);
}

.preview-item-btn-delete:hover {
    background: var(--danger-color);
    color: white;
}

.preview-item-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

.images-count {
    position: absolute;
    bottom: 0.5rem;
    left: 0.5rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Boutons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--text-color);
    width: 100%;
    font-weight: 600;
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: var(--text-color);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #000000;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-warning {
    background: #f59e0b;
    color: white;
}

.btn-warning:hover {
    background: #d97706;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

/* Dashboard */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

/* Dossiers de catégories */
.categories-folder {
    margin-bottom: 2rem;
}

.categories-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.category-folder {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 180px;
}

.category-folder:hover {
    background: var(--hover-bg);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.category-folder.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--text-color);
}

.category-folder.active .folder-name {
    color: var(--text-color);
    font-weight: 600;
}

.folder-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.folder-name {
    flex: 1;
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.95rem;
}

.folder-count {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-color);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    min-width: 30px;
    text-align: center;
}

.category-folder.active .folder-count {
    background: rgba(0, 0, 0, 0.2);
}

/* Pagination des catégories */
.categories-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
    padding: 0.75rem;
}

.category-pagination-btn {
    width: 36px;
    height: 36px;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-color);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.category-pagination-btn:hover:not(.disabled) {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--text-color);
    transform: translateY(-2px);
}

.category-pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.category-pagination-info {
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 500;
    min-width: 80px;
    text-align: center;
}

.dashboard-header h1 {
    color: var(--text-color);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.product-card {
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.product-card-header {
    position: relative;
}

.product-card-image {
    width: 100%;
    height: 140px;
    object-fit: cover;
    transition: transform 0.3s;
}

.product-card-image:hover {
    transform: scale(1.05);
}

.image-count-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.product-card-body {
    padding: 1rem;
}

.product-card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-color);
    line-height: 1.3;
}

.product-card-description {
    color: var(--text-light);
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.product-card-footer {
    padding: 0.75rem 1rem;
    background: var(--bg-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.product-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    padding: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.3s;
}

.btn-icon:hover {
    background: var(--bg-color);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: auto;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-light);
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: var(--text-color);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.form-actions .btn {
    width: auto;
}

/* Messages */
.message {
    position: fixed;
    top: 1rem;
    right: 1rem;
    padding: 1rem 1.5rem;
    border-radius: 6px;
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    display: none;
    max-width: 400px;
}

.message.show {
    display: block;
    animation: slideIn 0.3s;
}

.message.success {
    background: var(--success-color);
    color: white;
}

.message.error {
    background: var(--danger-color);
    color: white;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Page produit publique */
.product-page {
    min-height: 100vh;
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-container {
    max-width: 800px;
    width: 100%;
}

.product-card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.product-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
}

.product-info {
    padding: 2rem;
}

.product-info h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.business-name {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 1rem;
}

.product-description {
    margin: 1.5rem 0;
    line-height: 1.8;
    color: var(--text-color);
}

.product-price {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 1rem 0;
}

.product-category {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.contact-info {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.contact-info h3 {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.contact-info p {
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.contact-info a {
    color: var(--primary-color);
    text-decoration: none;
}

.contact-info a:hover {
    text-decoration: underline;
}

.loading, .error-message {
    text-align: center;
    padding: 3rem;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.error-message h2 {
    color: var(--danger-color);
    margin-bottom: 1rem;
}

/* QR Code */
.qr-code-section {
    margin-top: 0.5rem;
}

.qr-code-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--text-color);
    transition: all 0.3s;
}

.qr-code-toggle:hover {
    background: var(--hover-bg);
    border-color: var(--primary-color);
}

.qr-code-toggle-icon {
    transition: transform 0.3s;
}

.qr-code-container {
    text-align: center;
    padding: 0.75rem;
    background: var(--bg-color);
    border-radius: 6px;
    margin-top: 0.75rem;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.qr-code-container img {
    max-width: 100px;
    height: auto;
    margin-bottom: 0.5rem;
}

.qr-code-actions {
    margin-top: 0.5rem;
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

/* Modal d'images (Lightbox) */
.image-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    overflow: hidden;
}

.image-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 2rem;
    box-sizing: border-box;
    overflow: hidden;
}

.image-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 3rem;
    font-weight: bold;
    color: white;
    cursor: pointer;
    z-index: 2001;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    transition: all 0.3s;
}

.image-modal-close:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.image-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 2001;
    backdrop-filter: blur(10px);
}

.image-modal-nav:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.image-modal-prev {
    left: 2rem;
}

.image-modal-next {
    right: 2rem;
}

.image-modal-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 90vw;
    min-height: 0;
    margin: 1rem 0;
    overflow: hidden;
}

.image-modal-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.image-modal-info {
    color: white;
    text-align: center;
    margin: 0.5rem 0;
    font-size: 1.1rem;
    font-weight: 500;
    flex-shrink: 0;
}

.image-modal-thumbnails {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    overflow-x: auto;
    max-width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    flex-shrink: 0;
    max-height: 150px;
    box-sizing: border-box;
}

.image-modal-thumbnails .thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s;
    opacity: 0.6;
}

.image-modal-thumbnails .thumbnail:hover {
    opacity: 1;
    transform: scale(1.1);
}

.image-modal-thumbnails .thumbnail.active {
    border-color: var(--primary-color);
    opacity: 1;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.5);
}

.product-card-image {
    cursor: pointer;
    transition: transform 0.3s;
}

.product-card-image:hover {
    transform: scale(1.05);
}

/* Pagination */
.pagination-container {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination-btn {
    min-width: 40px;
    height: 40px;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-color);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    font-size: 0.9rem;
    font-weight: 500;
}

.pagination-btn:hover:not(.disabled):not(.active) {
    background: var(--primary-color);
    color: var(--text-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.pagination-btn.active {
    background: var(--primary-color);
    color: var(--text-color);
    border-color: var(--primary-color);
    font-weight: 600;
}

.pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-ellipsis {
    padding: 0 0.5rem;
    color: var(--text-light);
}

.pagination-info {
    color: var(--text-light);
    font-size: 0.9rem;
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    /* Navigation */
    .navbar {
        padding: 0.75rem 0;
    }

    .nav-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 0 0.75rem;
    }

    .nav-container h2 {
        font-size: 1.25rem;
    }

    .nav-user {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .nav-user span {
        font-size: 0.9rem;
    }

    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
        width: 100%;
    }

    /* Container */
    .container {
        padding: 0 0.75rem;
    }

    /* Dashboard Header */
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }

    .dashboard-header h1 {
        font-size: 1.5rem;
    }

    /* Dossiers de catégories */
    .categories-folder {
        margin-bottom: 1.5rem;
    }

    .categories-list {
        padding: 0.75rem;
        gap: 0.75rem;
        flex-direction: column;
    }

    .category-folder {
        min-width: 100%;
        padding: 0.75rem 1rem;
        width: 100%;
    }

    .folder-icon {
        font-size: 1.25rem;
    }

    .folder-name {
        font-size: 0.85rem;
    }

    .folder-count {
        font-size: 0.75rem;
        padding: 0.2rem 0.5rem;
    }

    .categories-pagination {
        gap: 0.5rem;
        padding: 0.5rem;
        flex-wrap: wrap;
    }

    .category-pagination-btn {
        width: 32px;
        height: 32px;
    }

    .category-pagination-info {
        font-size: 0.85rem;
        min-width: 70px;
    }

    /* Grille de produits */
    .products-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .product-card {
        border-radius: 8px;
    }

    .product-card-image {
        height: 180px;
    }

    .product-card-body {
        padding: 1rem;
    }

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

    .product-card-description {
        font-size: 0.8rem;
    }

    .product-card-footer {
        padding: 0.75rem 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .product-actions {
        width: 100%;
        justify-content: flex-end;
    }

    /* Formulaires */
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .form-group {
        margin-bottom: 1rem;
    }

    .form-group label {
        font-size: 0.9rem;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 0.9rem;
        padding: 0.65rem;
    }

    /* Zone d'upload d'images */
    .image-upload-area {
        min-height: 200px;
        padding: 1rem;
    }

    .upload-placeholder {
        padding: 1.5rem 1rem;
    }

    .upload-icon svg {
        width: 36px;
        height: 36px;
    }

    .upload-text {
        font-size: 0.9rem;
    }

    .upload-hint {
        font-size: 0.8rem;
    }

    .upload-formats {
        font-size: 0.75rem;
        margin-top: 0.5rem;
    }

    .images-preview-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .image-preview-item {
        aspect-ratio: 1;
    }

    .preview-item-overlay {
        padding: 0.5rem;
    }

    .preview-btn {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }

    /* Actions du formulaire */
    .form-actions {
        flex-direction: column;
        gap: 0.75rem;
    }

    .form-actions .btn {
        width: 100%;
    }

    /* Modal */
    .modal-content {
        margin: 0.5rem;
        padding: 1rem;
        max-height: 95vh;
        overflow-y: auto;
        width: calc(100% - 1rem);
    }

    .modal-content h2 {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }

    /* Modal d'images */
    .image-modal-content {
        padding: 0.5rem;
    }

    .image-modal-container {
        max-height: 50vh;
        margin: 0.5rem 0;
    }

    .image-modal-nav {
        width: 36px;
        height: 36px;
    }

    .image-modal-prev {
        left: 0.25rem;
    }

    .image-modal-next {
        right: 0.25rem;
    }

    .image-modal-close {
        top: 0.25rem;
        right: 0.25rem;
        width: 36px;
        height: 36px;
        font-size: 1.5rem;
    }

    .image-modal-info {
        font-size: 0.85rem;
        margin: 0.25rem 0;
    }

    .image-modal-thumbnails {
        padding: 0.5rem;
        max-height: 80px;
        gap: 0.5rem;
        overflow-x: auto;
        justify-content: flex-start;
    }

    .image-modal-thumbnails .thumbnail {
        width: 50px;
        height: 50px;
        flex-shrink: 0;
    }

    /* Pagination produits */
    .pagination-container {
        margin-top: 1.5rem;
    }

    .pagination {
        gap: 0.25rem;
        flex-wrap: wrap;
    }

    .pagination-btn {
        min-width: 36px;
        height: 36px;
        font-size: 0.85rem;
        padding: 0.25rem 0.5rem;
    }

    .pagination-info {
        font-size: 0.8rem;
        width: 100%;
        margin-top: 0.5rem;
    }

    /* QR Code */
    .qr-code-section {
        margin-top: 0.5rem;
    }

    .qr-code-toggle {
        padding: 0.5rem;
        font-size: 0.85rem;
    }

    .qr-code-container {
        padding: 0.75rem;
    }

    .qr-code-container img {
        max-width: 80px;
    }

    .qr-code-actions {
        margin-top: 0.5rem;
        flex-direction: column;
        gap: 0.5rem;
    }

    .qr-code-actions .btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.75rem;
        width: 100%;
    }

    /* Messages */
    .message {
        font-size: 0.85rem;
        padding: 0.75rem 1rem;
        margin: 0 0.75rem;
    }
}

/* Responsive pour très petits écrans */
@media (max-width: 480px) {
    body {
        font-size: 13px;
    }

    .container {
        padding: 0 0.5rem;
    }

    .dashboard-header h1 {
        font-size: 1.25rem;
    }

    .products-grid {
        gap: 0.75rem;
    }

    .product-card-image {
        height: 160px;
    }

    .categories-list {
        padding: 0.5rem;
        gap: 0.5rem;
    }

    .category-folder {
        padding: 0.65rem 0.75rem;
    }

    .modal-content {
        margin: 0.25rem;
        padding: 0.75rem;
        width: calc(100% - 0.5rem);
    }

    .image-upload-area {
        min-height: 150px;
        padding: 0.75rem;
    }

    .images-preview-container {
        grid-template-columns: 1fr;
    }
}

