/* OKZ — Design System */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --accent:       #10B981;
    --accent-dark:  #059669;
    --accent-light: #D1FAE5;
    --accent-rgb:   16, 185, 129;

    --gray-50:  #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;

    --danger:   #EF4444;
    --warning:  #F59E0B;
    --info:     #3B82F6;

    --radius-sm: 8px;
    --radius:    12px;
    --radius-lg: 16px;

    --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --shadow:    0 4px 12px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.04);
    --shadow-lg: 0 12px 32px rgba(0,0,0,.10), 0 4px 8px rgba(0,0,0,.05);

    --transition: .18s cubic-bezier(.4,0,.2,1);
}

/* === Base === */

*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--gray-800);
    background: var(--gray-50);
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
a:hover { color: var(--accent-dark); }

/* === Navbar publique === */

.okz-nav {
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
}

.okz-nav .container {
    display: flex;
    align-items: center;
    gap: 16px;
    height: 60px;
}

.okz-logo {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -.04em;
    color: var(--gray-900);
    text-decoration: none;
    flex-shrink: 0;
}

.okz-logo span {
    color: var(--accent);
}

.okz-search {
    flex: 1;
    max-width: 380px;
    margin-left: auto;
    position: relative;
}

.okz-search input {
    width: 100%;
    height: 38px;
    padding: 0 16px 0 40px;
    border: 1.5px solid var(--gray-200);
    border-radius: 999px;
    font-size: 14px;
    font-family: inherit;
    background: var(--gray-50);
    color: var(--gray-800);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.okz-search input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .12);
    background: #fff;
}

.okz-search .search-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    pointer-events: none;
    font-size: 14px;
}

/* === Navbar admin === */

.okz-admin-nav {
    background: var(--gray-900);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--gray-800);
}

.okz-admin-nav .container-fluid {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 56px;
    padding: 0 20px;
}

.okz-admin-logo {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -.03em;
    color: #fff;
    text-decoration: none;
    flex-shrink: 0;
}

.okz-admin-logo span { color: var(--accent); }

.okz-admin-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-left: auto;
}

.okz-admin-actions .btn-ghost {
    color: var(--gray-400);
}
.okz-admin-actions .btn-ghost:hover {
    background: rgba(255,255,255,.08);
    color: #fff;
}
.okz-admin-actions .btn-primary:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
    color: #fff;
}

/* === Boutons === */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.btn-primary:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
    color: #fff;
}

.btn-outline {
    background: transparent;
    color: var(--gray-700);
    border-color: var(--gray-200);
}
.btn-outline:hover {
    background: var(--gray-100);
    border-color: var(--gray-300);
    color: var(--gray-900);
}

.btn-ghost {
    background: transparent;
    color: var(--gray-500);
    border-color: transparent;
}
.btn-ghost:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}
.btn-danger:hover { background: #DC2626; border-color: #DC2626; color: #fff; }

.btn-danger-outline {
    background: transparent;
    color: var(--danger);
    border-color: #FECACA;
}
.btn-danger-outline:hover { background: #FEF2F2; }

.btn-sm {
    padding: 5px 11px;
    font-size: 13px;
}

.btn-xs {
    padding: 3px 8px;
    font-size: 12px;
    border-radius: 6px;
}

.btn-icon {
    padding: 7px;
    border-radius: var(--radius-sm);
}

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

/* === Cards === */

.card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.card-body { padding: 20px; }
.card-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--gray-100);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--gray-500);
}

/* === Produits — listing === */

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.product-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    color: var(--gray-800);
    display: flex;
    flex-direction: column;
    transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}

.product-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
    border-color: var(--gray-300);
    color: var(--gray-900);
}

.product-card.sold {
    opacity: .55;
    filter: grayscale(.5);
}

.product-thumb-wrap {
    position: relative;
    background: #fff;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

.product-thumb {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform .3s ease;
}

.product-card:hover .product-thumb {
    transform: scale(1.03);
}

.product-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-300);
    font-size: 2.5rem;
}

.product-status-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    backdrop-filter: blur(4px);
}

.status-sold    { background: rgba(239,68,68,.9);   color: #fff; }
.status-reserved { background: rgba(245,158,11,.9); color: #fff; }
.status-available { background: rgba(16,185,129,.9); color: #fff; }

.product-info {
    padding: 12px 14px 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.product-name {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--gray-800);
}

.product-category {
    font-size: 11px;
    color: var(--gray-400);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.product-price-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-top: 4px;
}

.product-price {
    font-size: 17px;
    font-weight: 700;
    color: var(--accent-dark);
}

.product-price-original {
    font-size: 12px;
    color: var(--gray-400);
    text-decoration: line-through;
}

.product-discount {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-light);
    padding: 1px 6px;
    border-radius: 999px;
}

/* === Fiche produit publique === */

.product-detail-img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: contain;
    background: #fff;
    border-radius: var(--radius);
}

.thumb-mini {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color var(--transition), opacity var(--transition);
}

.thumb-mini:hover { opacity: .85; }
.thumb-mini.active { border-color: var(--accent); }

.price-block {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 16px 20px;
}

.price-main {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--accent-dark);
    letter-spacing: -.03em;
    line-height: 1;
}

.price-original {
    font-size: 15px;
    color: var(--gray-400);
    text-decoration: line-through;
}

.price-saving {
    font-size: 13px;
    color: var(--accent);
    font-weight: 600;
}

/* === Badges === */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .01em;
}

.badge-primary  { background: #DBEAFE; color: #1D4ED8; }
.badge-success  { background: var(--accent-light); color: var(--accent-dark); }
.badge-danger   { background: #FEE2E2; color: #B91C1C; }
.badge-warning  { background: #FEF3C7; color: #92400E; }
.badge-secondary { background: var(--gray-100); color: var(--gray-600); }
.badge-dark     { background: var(--gray-800); color: #fff; }
.badge-info     { background: #DBEAFE; color: #1D4ED8; }

/* === Formulaires === */

.form-group { margin-bottom: 18px; }

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.form-control, .form-select {
    width: 100%;
    padding: 9px 13px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    color: var(--gray-800);
    background: #fff;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    appearance: none;
}

.form-control:focus, .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .12);
}

.form-control::placeholder { color: var(--gray-300); }

.form-control[readonly] {
    background: var(--gray-50);
    color: var(--gray-500);
}

textarea.form-control {
    resize: vertical;
    min-height: 90px;
}

.form-text {
    font-size: 12px;
    color: var(--gray-400);
    margin-top: 4px;
}

.input-group {
    display: flex;
    gap: 0;
}

.input-group .form-control {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    flex: 1;
}

.input-group .btn {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    border-left: none;
}

/* === Tables admin === */

.okz-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.okz-table thead th {
    padding: 10px 14px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--gray-400);
    border-bottom: 1px solid var(--gray-200);
    white-space: nowrap;
    background: #fff;
}

.okz-table tbody tr {
    border-bottom: 1px solid var(--gray-100);
    transition: background var(--transition);
}

.okz-table tbody tr:last-child { border-bottom: none; }
.okz-table tbody tr:hover { background: var(--gray-50); }

.okz-table td {
    padding: 12px 14px;
    vertical-align: middle;
}

/* === Stats cards === */

.stat-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -.04em;
    line-height: 1;
}

.stat-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: .05em;
}

/* === Alertes === */

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    border: 1px solid transparent;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.alert-success { background: var(--accent-light); border-color: #6EE7B7; color: #065F46; }
.alert-danger   { background: #FEE2E2; border-color: #FECACA; color: #991B1B; }
.alert-warning  { background: #FEF3C7; border-color: #FDE68A; color: #92400E; }
.alert-info     { background: #DBEAFE; border-color: #BFDBFE; color: #1E40AF; }

.alert-close {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    opacity: .6;
    padding: 0;
    font-size: 16px;
    line-height: 1;
    flex-shrink: 0;
}
.alert-close:hover { opacity: 1; }

/* === Filtres catégories === */

.cat-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 20px;
}

.cat-pill {
    padding: 5px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    border: 1.5px solid var(--gray-200);
    background: #fff;
    color: var(--gray-600);
    text-decoration: none;
    transition: all var(--transition);
}

.cat-pill:hover {
    border-color: var(--accent);
    color: var(--accent-dark);
    background: var(--accent-light);
}

.cat-pill.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* === Footer === */

.okz-footer {
    border-top: 1px solid var(--gray-200);
    padding: 24px 0;
    text-align: center;
    font-size: 13px;
    color: var(--gray-400);
    margin-top: 48px;
}

/* === Spinner === */

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--gray-200);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .7s linear infinite;
    flex-shrink: 0;
}

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

/* === Section heading admin === */

.section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--gray-400);
    margin-bottom: 12px;
}

/* === Collapsible === */

.collapse-toggle {
    font-size: 12px;
    color: var(--gray-400);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    transition: color var(--transition);
}
.collapse-toggle:hover { color: var(--gray-700); }

/* === Mobile === */

@media (max-width: 640px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .product-info { padding: 10px; }
    .product-name { font-size: 12px; }
    .product-price { font-size: 15px; }

    .okz-search { max-width: none; }

    main { padding: 16px 12px; }

    .price-main { font-size: 1.75rem; }

    .okz-table thead { display: none; }
    .okz-table tbody tr {
        display: grid;
        grid-template-columns: auto 1fr auto;
        align-items: center;
        gap: 8px;
        padding: 10px 0;
    }
    .okz-table td { padding: 2px 8px; }
}

@media (max-width: 400px) {
    .product-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
}

/* === Override Bootstrap résiduel === */
.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.rounded   { border-radius: var(--radius) !important; }
.bg-light  { background: var(--gray-50) !important; }
.text-muted { color: var(--gray-400) !important; }
.border    { border-color: var(--gray-200) !important; }
