/* ================================================================
   Parts Marketplace — Main Stylesheet
   ================================================================ */

/* ─── CSS Variables ─── */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --primary-bg: #eff6ff;

    --secondary: #64748b;
    --secondary-dark: #475569;

    --success: #16a34a;
    --success-bg: #f0fdf4;
    --warning: #d97706;
    --warning-bg: #fffbeb;
    --danger: #dc2626;
    --danger-bg: #fef2f2;
    --info: #0891b2;
    --info-bg: #ecfeff;

    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    --white: #ffffff;
    --black: #000000;

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

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.04);

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    --nav-height: 56px;
    --sidebar-width: 240px;
    --container-max: 1440px;

    --transition: 150ms ease;
}

/* ─── Reset / Normalize ─── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--gray-800);
    background: var(--gray-50);
    min-height: 100vh;
}

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

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style: none;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--gray-900);
    font-weight: 600;
    line-height: 1.3;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

/* ─── Navigation ─── */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.nav-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 1rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-left,
.nav-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-logo {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary);
    margin-right: 1rem;
    white-space: nowrap;
}

.nav-logo:hover {
    color: var(--primary-dark);
    text-decoration: none;
}

.nav-link {
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--gray-600);
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    transition: color var(--transition), background var(--transition);
}

.nav-link:hover {
    color: var(--primary);
    background: var(--primary-bg);
    text-decoration: none;
}

.nav-link.active {
    color: var(--primary);
    background: var(--primary-bg);
}

.nav-cart {
    position: relative;
}

.nav-user {
    font-size: 0.875rem;
    color: var(--gray-600);
    padding: 0 0.5rem;
}

/* ─── Layout ─── */
.main-content {
    margin-top: var(--nav-height);
    min-height: calc(100vh - var(--nav-height));
}

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h1,
.page-header h2 {
    margin: 0;
}

/* Sidebar layout (for admin/supplier dashboards) */
.layout-sidebar {
    display: flex;
    gap: 1.5rem;
}

.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
}

.sidebar-nav {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.sidebar-nav a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--gray-700);
    font-size: 0.875rem;
    border-bottom: 1px solid var(--gray-100);
    transition: background var(--transition);
}

.sidebar-nav a:last-child {
    border-bottom: none;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: var(--primary-bg);
    color: var(--primary);
    text-decoration: none;
}

.content-area {
    flex: 1;
    min-width: 0;
}

/* ─── Cards ─── */
.card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3,
.card-header h4 {
    margin: 0;
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
    border-radius: 0 0 var(--radius) var(--radius);
}

/* ─── Product Grid ─── */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}

.product-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow var(--transition), transform var(--transition);
    display: flex;
    flex-direction: column;
}

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

.product-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--gray-100);
}

.product-card-image-placeholder {
    width: 100%;
    height: 200px;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    font-size: 0.875rem;
}

.product-card-body {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-card-title {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--gray-800);
}

.product-card-title a {
    color: inherit;
}

.product-card-title a:hover {
    color: var(--primary);
    text-decoration: none;
}

.product-card-oem {
    font-size: 0.8125rem;
    color: var(--gray-500);
    margin-bottom: 0.5rem;
    font-family: var(--font-mono);
}

.product-card-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.product-card-price {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ─── Product Detail ─── */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.product-gallery {
    border-radius: var(--radius);
    overflow: hidden;
}

.product-gallery img {
    width: 100%;
    border-radius: var(--radius);
}

.product-info h1 {
    margin-bottom: 0.5rem;
}

.product-info .price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 1rem 0;
}

.product-specs {
    margin: 1rem 0;
}

.product-specs dt {
    font-weight: 600;
    color: var(--gray-600);
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.75rem;
}

.product-specs dd {
    color: var(--gray-800);
    margin-top: 0.125rem;
}

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    line-height: 1.5;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    text-decoration: none;
}

.btn:hover {
    text-decoration: none;
}

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

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

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: var(--white);
}

.btn-secondary {
    background: var(--white);
    color: var(--gray-700);
    border-color: var(--gray-300);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--gray-50);
    border-color: var(--gray-400);
    color: var(--gray-800);
}

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

.btn-danger:hover:not(:disabled) {
    background: #b91c1c;
    border-color: #b91c1c;
    color: var(--white);
}

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

.btn-success:hover:not(:disabled) {
    background: #15803d;
    border-color: #15803d;
    color: var(--white);
}

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

.btn-warning:hover:not(:disabled) {
    background: #b45309;
    border-color: #b45309;
    color: var(--white);
}

.btn-ghost {
    background: transparent;
    color: var(--gray-600);
    border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
    background: var(--gray-100);
    color: var(--gray-800);
}

.btn-sm {
    padding: 0.25rem 0.625rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 0.625rem 1.5rem;
    font-size: 1rem;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ─── Forms ─── */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.25rem;
}

.form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-family: inherit;
    line-height: 1.5;
    color: var(--gray-800);
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

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

.form-control:disabled {
    background: var(--gray-100);
    cursor: not-allowed;
}

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

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8.825L.35 3.175l.7-.7L6 7.425l4.95-4.95.7.7z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
}

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

.form-hint {
    font-size: 0.8125rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.form-error {
    font-size: 0.8125rem;
    color: var(--danger);
    margin-top: 0.25rem;
}

/* ─── Tables ─── */
.table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    background: var(--white);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--gray-100);
}

th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-600);
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: var(--gray-50);
}

.table-actions {
    display: flex;
    gap: 0.375rem;
}

/* ─── Badges ─── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    white-space: nowrap;
    line-height: 1.6;
}

.badge-primary {
    background: var(--primary-bg);
    color: var(--primary);
}

.badge-success {
    background: var(--success-bg);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge-danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.badge-info {
    background: var(--info-bg);
    color: var(--info);
}

.badge-secondary {
    background: var(--gray-100);
    color: var(--gray-600);
}

/* ─── Modal ─── */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
    animation: fadeIn 150ms ease;
}

.modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 200ms ease;
}

.modal-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.125rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: var(--gray-700);
}

.modal-body {
    padding: 1.25rem;
}

.modal-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ─── Toast Notifications ─── */
#toast-container {
    position: fixed;
    top: calc(var(--nav-height) + 1rem);
    right: 1rem;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 360px;
}

.toast {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    box-shadow: var(--shadow-lg);
    transform: translateX(120%);
    transition: transform 300ms ease;
    line-height: 1.4;
}

.toast.show {
    transform: translateX(0);
}

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

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

.toast-warning {
    background: var(--warning);
    color: var(--white);
}

.toast-info {
    background: var(--primary);
    color: var(--white);
}

/* ─── Spinner / Loading ─── */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.spinner-sm {
    width: 18px;
    height: 18px;
    border-width: 2px;
}

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

/* ─── Auth Pages ─── */
.auth-container {
    min-height: calc(100vh - var(--nav-height));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 2rem;
    width: 100%;
    max-width: 400px;
}

.auth-card-wide {
    max-width: 560px;
}

.auth-card h2 {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-link {
    text-align: center;
    margin-top: 1.25rem;
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* ─── Cart & Checkout ─── */
.cart-table td {
    vertical-align: middle;
}

.cart-item-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.cart-item-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    background: var(--gray-100);
}

.cart-item-title {
    font-weight: 500;
}

.cart-item-oem {
    font-size: 0.8125rem;
    color: var(--gray-500);
    font-family: var(--font-mono);
}

.cart-qty {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cart-qty input {
    width: 60px;
    text-align: center;
    padding: 0.25rem;
}

.cart-summary {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-size: 0.9375rem;
}

.cart-summary-total {
    font-size: 1.125rem;
    font-weight: 700;
    border-top: 2px solid var(--gray-200);
    padding-top: 0.75rem;
    margin-top: 0.5rem;
}

.checkout-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 1.5rem;
    align-items: start;
}

.checkout-section {
    margin-bottom: 1.5rem;
}

.checkout-section h3 {
    margin-bottom: 0.75rem;
}

/* ─── Stats / Dashboard ─── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.stat-card-label {
    font-size: 0.8125rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.stat-card-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
}

/* ─── Empty State ─── */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--gray-500);
}

.empty-state h2 {
    color: var(--gray-600);
    margin-bottom: 0.5rem;
}

.empty-state p {
    margin-bottom: 1.25rem;
}

/* ─── Filter / Search Bar ─── */
.filter-bar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-bar .form-group {
    margin-bottom: 0;
    flex: 1;
    min-width: 160px;
}

.search-input-wrapper {
    position: relative;
}

.search-input-wrapper input {
    padding-left: 2.25rem;
}

.search-input-wrapper::before {
    content: "\1F50D";
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.875rem;
    opacity: 0.4;
}

/* ─── Pagination ─── */
.pagination {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.pagination-btn {
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--gray-300);
    background: var(--white);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
}

.pagination-btn:hover {
    background: var(--gray-50);
    border-color: var(--primary);
    color: var(--primary);
}

.pagination-btn.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* ─── Tabs ─── */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--gray-200);
    margin-bottom: 1.5rem;
    gap: 0;
}

.tab {
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-500);
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color var(--transition), border-color var(--transition);
    font-family: inherit;
}

.tab:hover {
    color: var(--gray-700);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* ─── Photo Upload ─── */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.photo-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--gray-200);
}

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

.photo-item-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: var(--white);
    border: none;
    cursor: pointer;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-upload-btn {
    aspect-ratio: 1;
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--gray-400);
    font-size: 0.8125rem;
    transition: border-color var(--transition), color var(--transition);
}

.photo-upload-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.photo-upload-btn span {
    font-size: 1.5rem;
    line-height: 1;
    margin-bottom: 0.25rem;
}

/* ─── Utilities ─── */
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--gray-500); }
.text-sm { font-size: 0.8125rem; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

.hidden { display: none !important; }

/* ─── Catalog Hero Search ─── */
.catalog-hero {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    padding: 2.5rem 1rem 2rem;
    text-align: center;
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    margin-bottom: 1.5rem;
}

.catalog-hero__title {
    color: var(--white);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.catalog-hero__subtitle {
    color: rgba(255,255,255,0.8);
    font-size: 0.9375rem;
    margin-bottom: 1.25rem;
}

.catalog-hero__search-wrap {
    max-width: 720px;
    margin: 0 auto;
    position: relative;
}

.catalog-hero__input {
    width: 100%;
    height: 52px;
    font-size: 1rem;
    padding: 0 3.5rem 0 1.25rem;
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    outline: none;
    font-family: var(--font-sans);
}

.catalog-hero__input:focus {
    box-shadow: 0 0 0 4px rgba(255,255,255,0.3), var(--shadow-lg);
}

.catalog-hero__search-btn {
    position: absolute;
    right: 4px;
    top: 4px;
    width: 44px;
    height: 44px;
    background: var(--primary);
    border: none;
    border-radius: var(--radius);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition);
}

.catalog-hero__search-btn:hover {
    background: var(--primary-dark);
}

.catalog-hero__stats {
    color: rgba(255,255,255,0.75);
    font-size: 0.8125rem;
    margin-top: 0.75rem;
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

/* ─── Autocomplete Dropdown ─── */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    z-index: 100;
    max-height: 420px;
    overflow-y: auto;
    border: 1px solid var(--gray-200);
    text-align: left;
}

.autocomplete-dropdown.hidden { display: none; }

.autocomplete-item {
    padding: 0.625rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid var(--gray-100);
    transition: background var(--transition);
}

.autocomplete-item:hover,
.autocomplete-item.active {
    background: var(--primary-bg);
}

.autocomplete-item:last-child { border-bottom: none; }

.autocomplete-item__photo {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
    background: var(--gray-100);
}

.autocomplete-item__info {
    flex: 1;
    min-width: 0;
}

.autocomplete-item__name {
    font-weight: 500;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--gray-800);
}

.autocomplete-item__name mark {
    background: #fef08a;
    color: inherit;
    padding: 0 1px;
    border-radius: 2px;
}

.autocomplete-item__meta {
    font-size: 0.8125rem;
    color: var(--gray-500);
    display: flex;
    gap: 0.75rem;
    margin-top: 2px;
}

.autocomplete-item__price {
    font-weight: 600;
    color: var(--gray-900);
}

.autocomplete-footer {
    padding: 0.625rem 1rem;
    text-align: center;
    font-size: 0.8125rem;
    color: var(--primary);
    cursor: pointer;
    border-top: 1px solid var(--gray-200);
    font-weight: 500;
    transition: background var(--transition);
}

.autocomplete-footer:hover {
    background: var(--primary-bg);
}

/* ─── Catalog Layout (redesigned) ─── */
.catalog-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.5rem;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 1rem 2rem;
}

.catalog-sidebar {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1.25rem;
    position: sticky;
    top: calc(var(--nav-height) + 1rem);
    max-height: calc(100vh - var(--nav-height) - 2rem);
    overflow-y: auto;
    align-self: start;
}

.catalog-sidebar h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.625rem;
    border-bottom: 2px solid var(--primary);
    color: var(--gray-800);
}

.catalog-sidebar .filter-group {
    margin-bottom: 1rem;
}

.catalog-sidebar .filter-group > label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.375rem;
    display: block;
}

.catalog-sidebar .form-select,
.catalog-sidebar .form-input {
    width: 100%;
    font-size: 0.8125rem;
    padding: 0.4rem 0.625rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    background: var(--white);
    font-family: var(--font-sans);
}

.catalog-sidebar .form-select:focus,
.catalog-sidebar .form-input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.catalog-sidebar .price-range {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0.5rem;
    align-items: center;
}

.catalog-sidebar .checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    padding: 0.2rem 0;
    cursor: pointer;
    color: var(--gray-700);
}

.sidebar-close-btn {
    display: none;
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--gray-500);
    cursor: pointer;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 99;
}

.sidebar-toggle-btn {
    display: none;
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 52px;
    height: 52px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    z-index: 50;
    font-size: 1.25rem;
    align-items: center;
    justify-content: center;
}

/* ─── Catalog Toolbar ─── */
.catalog-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.catalog-toolbar__results {
    font-size: 0.875rem;
    color: var(--gray-600);
    flex: 1;
}

.catalog-toolbar__sort select {
    font-size: 0.8125rem;
    padding: 0.35rem 0.625rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    background: var(--white);
    font-family: var(--font-sans);
    cursor: pointer;
}

.view-toggle {
    display: flex;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.view-toggle__btn {
    padding: 0.375rem 0.625rem;
    background: var(--white);
    border: none;
    cursor: pointer;
    color: var(--gray-500);
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-toggle__btn + .view-toggle__btn {
    border-left: 1px solid var(--gray-300);
}

.view-toggle__btn.active {
    background: var(--primary);
    color: var(--white);
}

.view-toggle__btn svg {
    width: 18px;
    height: 18px;
}

.auth-admin-link {
    display: block;
    text-align: center;
    font-size: 0.6875rem;
    color: var(--gray-400);
    text-decoration: none;
    margin-top: 0.75rem;
}

.auth-admin-link:hover {
    color: var(--gray-600);
    text-decoration: underline;
}

/* ─── Page Header ─── */
.page-header__actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* ─── Supplier Stock Controls ─── */
.stock-control {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.stock-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: var(--gray-50);
    color: var(--gray-700);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    padding: 0;
    line-height: 1;
}

.stock-btn:hover {
    background: var(--gray-200);
}

.stock-btn--minus:hover {
    background: var(--danger-bg);
    color: var(--danger);
}

.stock-btn--plus:hover {
    background: var(--success-bg);
    color: var(--success);
}

.stock-input {
    width: 48px;
    height: 28px;
    text-align: center;
    border: none;
    border-left: 1px solid var(--gray-200);
    border-right: 1px solid var(--gray-200);
    font-size: 0.875rem;
    font-weight: 600;
    font-family: var(--font-sans);
    -moz-appearance: textfield;
    color: var(--gray-800);
}

.stock-input::-webkit-outer-spin-button,
.stock-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

.stock-input:focus {
    outline: none;
    background: var(--primary-bg);
}

.stock-control.stock-zero {
    border-color: var(--danger);
}

.stock-control.stock-zero .stock-input {
    color: var(--danger);
    background: var(--danger-bg);
}

.stock-control.stock-low {
    border-color: var(--warning);
}

.stock-control.stock-low .stock-input {
    color: var(--warning);
}

.stock-control.stock-saving {
    opacity: 0.6;
    pointer-events: none;
}

.stock-control.stock-saved {
    border-color: var(--success);
    box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.2);
}

.row-out-of-stock {
    opacity: 0.5;
}

.row-out-of-stock:hover {
    opacity: 0.8;
}

.product-name-link {
    color: var(--primary);
    cursor: pointer;
    font-weight: 500;
}

.product-name-link:hover {
    text-decoration: underline;
}

.product-sku {
    display: block;
    font-size: 0.75rem;
    color: var(--gray-400);
    font-family: var(--font-mono);
}

.table-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.supplier-products-table td {
    vertical-align: middle;
}

/* ─── Import Page ─── */
.import-dropzone {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    background: var(--gray-50);
    margin: 1rem 0;
}

.import-dropzone.dragover,
.import-dropzone:hover {
    border-color: var(--primary);
    background: var(--primary-bg);
}

.import-dropzone__icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.import-dropzone__link {
    color: var(--primary);
    cursor: pointer;
    text-decoration: underline;
}

.import-summary {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.import-summary__item {
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius);
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    text-align: center;
}

.import-summary__item strong {
    display: block;
    font-size: 1.25rem;
}

.import-summary--create { background: var(--success-bg); border-color: var(--success); }
.import-summary--update { background: var(--info-bg); border-color: var(--info); }
.import-summary--error { background: var(--danger-bg); border-color: var(--danger); }

.import-row-create td { background: rgba(22, 163, 74, 0.05); }
.import-row-update td { background: rgba(8, 145, 178, 0.05); }
.import-row-error td { background: rgba(220, 38, 38, 0.05); }

.text-muted { color: var(--gray-500); font-size: 0.875rem; }
.text-danger { color: var(--danger); }

/* ─── Condition Tabs ─── */
.condition-tabs {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1.25rem;
}

.condition-tab {
    padding: 0.5rem 1.25rem;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 999px;
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.8);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font-sans);
}

.condition-tab:hover {
    background: rgba(255,255,255,0.2);
    color: white;
}

.condition-tab.active {
    background: white;
    color: var(--primary);
    border-color: white;
    font-weight: 600;
}

/* ─── Role Selection Cards ─── */
.role-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.role-card {
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    background: var(--white);
}

.role-card:hover {
    border-color: var(--primary-light);
    background: var(--primary-bg);
}

.role-card.active {
    border-color: var(--primary);
    background: var(--primary-bg);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.role-card__icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.role-card__title {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.role-card__desc {
    font-size: 0.8125rem;
    color: var(--gray-500);
    line-height: 1.4;
}

/* ─── Enhanced Product Cards ─── */
.product-card {
    border-radius: var(--radius-lg);
    cursor: pointer;
    position: relative;
}

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

.product-card__photo {
    height: 180px;
    overflow: hidden;
    background: var(--gray-50);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.product-card__photo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-card__body {
    padding: 0.875rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.product-card__name {
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--gray-800);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card__price {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-top: auto;
    padding-top: 0.375rem;
}

.product-card__supplier {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.product-card__city {
    font-size: 0.75rem;
    color: var(--gray-400);
}

.product-card__stock {
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.product-card__stock::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.product-card__stock.in-stock {
    color: var(--success);
}

.product-card__stock.in-stock::before {
    background: var(--success);
}

.product-card__stock.out-of-stock {
    color: var(--danger);
}

.product-card__stock.out-of-stock::before {
    background: var(--danger);
}

/* ─── Table View ─── */
.product-table-wrap {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow-x: auto;
    background: var(--white);
}

.product-table {
    width: 100%;
    border-collapse: collapse;
}

.product-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--gray-600);
    background: var(--gray-50);
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}

.product-table td {
    padding: 0.625rem 1rem;
    vertical-align: middle;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
}

.product-table tr:hover td {
    background: var(--primary-bg);
}

.product-table__name-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 250px;
}

.product-table__thumb {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
    background: var(--gray-100);
}

.product-table__name {
    font-weight: 500;
    color: var(--gray-800);
    cursor: pointer;
}

.product-table__name:hover {
    color: var(--primary);
}

.product-table__price {
    font-weight: 700;
    white-space: nowrap;
    color: var(--gray-900);
}

.product-table__stock {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8125rem;
    white-space: nowrap;
}

.product-table__stock::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.product-table__stock.in-stock { color: var(--success); }
.product-table__stock.in-stock::before { background: var(--success); }
.product-table__stock.out-of-stock { color: var(--danger); }
.product-table__stock.out-of-stock::before { background: var(--danger); }

.product-table__action-btn {
    padding: 0.25rem 0.75rem;
    font-size: 0.8125rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    white-space: nowrap;
    transition: background var(--transition);
}

.product-table__action-btn:hover {
    background: var(--primary-dark);
}

/* ─── Improved Pagination ─── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    margin-top: 1.5rem;
}

.pagination-btn {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--gray-700);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition);
}

.pagination-btn:hover {
    background: var(--primary-bg);
    border-color: var(--primary);
    color: var(--primary);
}

.pagination-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

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

.pagination-ellipsis {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    font-size: 0.875rem;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .nav-container {
        flex-wrap: wrap;
        height: auto;
        padding: 0.5rem 1rem;
        gap: 0.5rem;
    }

    .nav-left,
    .nav-right {
        flex-wrap: wrap;
    }

    .catalog-hero { padding: 1.5rem 1rem; }
    .catalog-hero__title { font-size: 1.25rem; }
    .catalog-hero__input { height: 46px; font-size: 0.9375rem; }

    .catalog-layout {
        grid-template-columns: 1fr;
    }

    .catalog-sidebar {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 300px;
        max-height: 100vh;
        z-index: 100;
        border-radius: 0;
        box-shadow: var(--shadow-xl);
        padding-top: 3rem;
    }

    .catalog-sidebar.open { display: block; }
    .sidebar-close-btn { display: block; }
    .sidebar-overlay.open { display: block; }
    .sidebar-toggle-btn { display: flex; }

    .condition-tabs { flex-wrap: wrap; }
    .condition-tab { font-size: 0.8125rem; padding: 0.375rem 1rem; }
    .role-cards { grid-template-columns: 1fr; }

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

    .product-detail {
        grid-template-columns: 1fr;
    }

    .checkout-layout {
        grid-template-columns: 1fr;
    }

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

    .layout-sidebar {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

    .filter-bar {
        flex-direction: column;
    }

    .filter-bar .form-group {
        min-width: 100%;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

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

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .auth-card {
        padding: 1.5rem;
    }

    h1 { font-size: 1.375rem; }
    h2 { font-size: 1.25rem; }
}

/* ─── Wishlist ──────────────────────────────── */
.wishlist-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--gray-400);
    transition: color 0.2s, transform 0.2s, background 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.wishlist-btn:hover {
    color: #e53e3e;
    transform: scale(1.1);
    background: #fff;
}

.wishlist-btn--active {
    color: #e53e3e;
}

.wishlist-btn--active:hover {
    color: #c53030;
}

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

.btn-wishlist-detail {
    margin-top: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.btn-wishlist-detail svg {
    flex-shrink: 0;
}

/* ─── Notifications ──────────────────────────── */
.nav-notifications {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.notification-badge {
    position: absolute;
    top: -6px;
    right: -8px;
    background: var(--danger);
    color: var(--white);
    font-size: 0.625rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
    box-shadow: 0 1px 3px rgba(220, 38, 38, 0.4);
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    padding: 1rem 1.25rem;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    transition: all var(--transition);
    cursor: pointer;
    position: relative;
}

.notification-item:hover {
    border-color: var(--gray-300);
    box-shadow: var(--shadow-sm);
}

.notification-item--unread {
    background: var(--primary-bg);
    border-color: var(--primary-light);
    border-left: 3px solid var(--primary);
}

.notification-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    color: var(--gray-600);
}

.notification-icon--order_placed {
    background: var(--success-bg);
    color: var(--success);
}

.notification-icon--order_status {
    background: var(--info-bg);
    color: var(--info);
}

.notification-icon--new_order {
    background: var(--primary-bg);
    color: var(--primary);
}

.notification-icon--supplier_verified {
    background: var(--success-bg);
    color: var(--success);
}

.notification-icon--return_request {
    background: var(--warning-bg);
    color: var(--warning);
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.notification-message {
    font-size: 0.8125rem;
    color: var(--gray-600);
    line-height: 1.4;
}

.notification-time {
    font-size: 0.75rem;
    color: var(--gray-400);
    margin-top: 0.375rem;
}

.notification-dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    margin-top: 0.375rem;
}

/* ─── Supplier Link ─── */
.supplier-link {
    color: var(--primary);
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s;
}
.supplier-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ─── Supplier Profile Page ─── */
.supplier-profile {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.supplier-profile__header {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    padding: 2rem;
    background: white;
    border-radius: var(--radius-lg, 12px);
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.1));
    margin-bottom: 1.5rem;
}

.supplier-profile__logo {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
}

.supplier-profile__logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.supplier-profile__info {
    flex: 1;
}

.supplier-profile__name {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    color: var(--gray-900, #111);
}

.supplier-profile__meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    color: var(--gray-500);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.supplier-profile__rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
}

.supplier-profile__rating-value {
    font-weight: 600;
    font-size: 1.1rem;
    margin-left: 0.25rem;
}

.star {
    font-size: 1.2rem;
    line-height: 1;
}
.star--full { color: #f59e0b; }
.star--half { color: #f59e0b; opacity: 0.6; }
.star--empty { color: var(--gray-300); }

.supplier-profile__desc {
    color: var(--gray-600);
    line-height: 1.6;
    margin: 0;
}

.supplier-profile__stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: var(--radius-lg, 12px);
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.1));
    padding: 1.25rem;
    text-align: center;
}

.stat-card__value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-card__label {
    color: var(--gray-500);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.supplier-profile__content {
    margin-bottom: 2rem;
}

.supplier-profile__reviews {
    margin-top: 2rem;
}

.supplier-profile__reviews h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.reviews-list {
    display: grid;
    gap: 1rem;
}

.review-card {
    background: white;
    border-radius: var(--radius-lg, 12px);
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.1));
    padding: 1.25rem;
}

.review-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.review-card__author {
    font-weight: 600;
    color: var(--gray-800, #1e293b);
}

.review-card__date {
    color: var(--gray-400);
    font-size: 0.85rem;
}

.review-card__rating {
    margin-bottom: 0.5rem;
}

.review-card__product {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-bottom: 0.5rem;
}

.review-card__comment {
    color: var(--gray-700, #334155);
    line-height: 1.6;
}

@media (max-width: 768px) {
    .supplier-profile__header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .supplier-profile__meta {
        justify-content: center;
    }

    .supplier-profile__rating {
        justify-content: center;
    }

    .supplier-profile__stats {
        grid-template-columns: 1fr;
    }
}

/* ─── Device Finder Wizard ──────────────────── */
.wizard-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.wizard-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 2rem;
}

.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.wizard-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    background: var(--gray-100);
    color: var(--gray-400);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.wizard-step.active {
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.wizard-step.completed {
    background: var(--success-bg);
    color: var(--success);
}

.wizard-step__num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.3);
}

.wizard-step.active .wizard-step__num {
    background: rgba(255, 255, 255, 0.3);
}

.wizard-step.completed .wizard-step__num {
    background: var(--success);
    color: var(--white);
}

.wizard-step__connector {
    width: 32px;
    height: 2px;
    background: var(--gray-200);
    flex-shrink: 0;
}

.wizard-step-content {
    position: relative;
}

.wizard-back-btn {
    margin-bottom: 1rem;
}

.wizard-step-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 1rem;
}

.wizard-breadcrumb {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-bottom: 1.25rem;
}

.wizard-fade-in {
    animation: wizardFadeIn 0.3s ease;
}

@keyframes wizardFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.wizard-brand-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.25rem 0.75rem;
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
}

.wizard-brand-card:hover {
    border-color: var(--primary);
    background: var(--primary-bg);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.wizard-brand-card__logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.wizard-brand-card__placeholder {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-bg);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
}

.wizard-brand-card__name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-700);
}

.wizard-model-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}

.wizard-model-card {
    padding: 1rem 1.25rem;
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
}

.wizard-model-card:hover {
    border-color: var(--primary);
    background: var(--primary-bg);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.wizard-model-card__name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
}

.wizard-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}

.wizard-category-card {
    padding: 1rem 1.25rem;
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
}

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

.wizard-category-card__name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
}

/* ─── Product Comparison ──────────────────────── */
.comparison-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.comparison-container h1 {
    margin-bottom: 1.5rem;
}

.comparison-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    background: var(--white);
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 500px;
}

.comparison-table th,
.comparison-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.875rem;
    vertical-align: middle;
    text-align: center;
}

.comparison-attr {
    text-align: left !important;
    font-weight: 600;
    color: var(--gray-600);
    background: var(--gray-50);
    white-space: nowrap;
    min-width: 120px;
}

.comparison-th {
    background: var(--gray-50);
    padding: 0.75rem 1rem;
}

.comparison-highlight {
    background: var(--warning-bg);
}

.comparison-photo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

.comparison-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.comparison-link:hover {
    text-decoration: underline;
}

.comparison-remove-btn {
    font-size: 1rem;
    line-height: 1;
    padding: 0.25rem 0.5rem;
}

.product-card__compare-btn {
    margin-top: 0.375rem;
    font-size: 0.75rem;
    padding: 0.25rem 0.625rem;
}

/* ─── View History ──────────────────────────── */
.history-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.history-header h1 {
    margin: 0;
}

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

.history-card__time {
    font-size: 0.75rem;
    color: var(--gray-400);
    margin-top: 0.25rem;
}

/* ─── Wizard + Comparison + History Responsive ── */
@media (max-width: 768px) {
    .wizard-steps {
        gap: 0.25rem;
    }

    .wizard-step__label {
        display: none;
    }

    .wizard-step__connector {
        width: 16px;
    }

    .wizard-brand-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }

    .wizard-model-grid,
    .wizard-category-grid {
        grid-template-columns: 1fr 1fr;
    }

    .comparison-container {
        padding: 1rem;
    }

    .history-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
}

/* ─── Contact Buttons (Product Detail) ─── */
.product-detail__contact {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
}

.product-detail__contact h3 {
    margin: 0 0 1rem;
    font-size: 1.1rem;
    color: var(--gray-800);
}

.contact-seller-info {
    margin-bottom: 1rem;
}

.contact-seller-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
}

.contact-seller-name .supplier-link {
    color: var(--primary);
    text-decoration: none;
}

.contact-seller-name .supplier-link:hover {
    text-decoration: underline;
}

.contact-seller-city {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-top: 2px;
}

.contact-seller-rating {
    font-size: 0.875rem;
    color: var(--warning);
    margin-top: 2px;
}

.contact-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius);
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
}

.contact-btn--phone {
    background: var(--primary);
    color: var(--white);
}
.contact-btn--phone:hover {
    background: var(--primary-dark);
    color: var(--white);
}

.contact-btn--whatsapp {
    background: #25d366;
    color: var(--white);
}
.contact-btn--whatsapp:hover {
    background: #1da851;
    color: var(--white);
}

.contact-btn--telegram {
    background: #0088cc;
    color: var(--white);
}
.contact-btn--telegram:hover {
    background: #006da3;
    color: var(--white);
}

.product-detail__extra-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.product-detail__badges {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.product-card__badges {
    display: flex;
    gap: 0.375rem;
    margin-bottom: 0.375rem;
}

.product-card__seller {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.product-card__seller-label {
    font-size: 0.75rem;
    color: var(--gray-400);
}

.badge--condition {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}

.badge--new {
    background: var(--success-bg);
    color: var(--success);
}

.badge--used {
    background: var(--warning-bg);
    color: var(--warning);
}

@media (max-width: 640px) {
    .contact-buttons {
        flex-direction: column;
    }
    .contact-btn {
        justify-content: center;
    }
}
