/* ═══════════════════════════════════════════════════════════════════════════
   Tijara Hub — Base Design System
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── CSS Variables ────────────────────────────────────────────────────────── */
:root {
    /* Brand Colors */
    --color-primary: #222222;
    --color-primary-light: #444444;
    --color-accent: #E1261C;
    --color-accent-dark: #C41E16;
    --color-accent-light: #FF4D47;
    --color-success: #27AE60;
    --color-warning: #F39C12;
    --color-info: #3498DB;

    /* Neutrals */
    --color-white: #FFFFFF;
    --color-bg: #FFFFFF;
    --color-bg-light: #F6F6F6;
    --color-bg-dark: #222222;
    --color-border: #E8E8E8;
    --color-border-light: #F0F0F0;
    --color-text: #222222;
    --color-text-light: #666666;
    --color-text-muted: #999999;

    /* Typography */
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-heading: 'Outfit', 'Inter', sans-serif;

    /* Sizing */
    --container-max: 1440px;
    --container-padding: 20px;
    --header-height: 60px;
    --nav-height: 44px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --shadow-xl: 0 20px 60px rgba(0,0,0,0.15);

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 50%;
}

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

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

body {
    font-family: var(--font-body);
    color: var(--color-text);
    background-color: var(--color-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

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

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    font-size: inherit;
}

ul, ol {
    list-style: none;
}

input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color var(--transition-fast);
}

input:focus, select:focus, textarea:focus {
    border-color: var(--color-primary);
}

/* ── Container ───────────────────────────────────────────────────────────── */
.container {
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--container-padding);
}

/* ── Typography ──────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.3;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.125rem; }
h4 { font-size: 1rem; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-base);
    white-space: nowrap;
}

.btn--primary {
    background-color: var(--color-primary);
    color: var(--color-white);
}
.btn--primary:hover {
    background-color: var(--color-primary-light);
    color: var(--color-white);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn--accent {
    background-color: var(--color-accent);
    color: var(--color-white);
}
.btn--accent:hover {
    background-color: var(--color-accent-dark);
    color: var(--color-white);
}

.btn--outline {
    border: 1.5px solid var(--color-primary);
    color: var(--color-primary);
    background: transparent;
}
.btn--outline:hover {
    background-color: var(--color-primary);
    color: var(--color-white);
}

.btn--sm { padding: 6px 16px; font-size: 0.8125rem; }
.btn--lg { padding: 14px 32px; font-size: 1rem; }
.btn--block { width: 100%; }

.btn--quick-add {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--color-white);
    color: var(--color-text);
    box-shadow: var(--shadow-sm);
}
.btn--quick-add:hover {
    background: var(--color-primary);
    color: var(--color-white);
}

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 2px;
}
.badge--sale {
    background-color: var(--color-accent);
    color: var(--color-white);
}
.badge--new {
    background-color: var(--color-primary);
    color: var(--color-white);
}
.badge--hot {
    background: linear-gradient(135deg, #FF6B35, #E1261C);
    color: var(--color-white);
}

/* ── Policy Bar ──────────────────────────────────────────────────────────── */
.policy-bar {
    background-color: var(--color-bg-dark);
    color: var(--color-white);
    font-size: 0.75rem;
    padding: 6px 0;
    overflow: hidden;
}
.policy-bar__inner {
    display: flex;
    justify-content: center;
    gap: 40px;
    animation: policy-scroll 20s linear infinite;
}
.policy-bar__item {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

@keyframes policy-scroll {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-10%); }
}

/* ── Messages / Alerts ───────────────────────────────────────────────────── */
.messages-container {
    position: fixed;
    top: calc(var(--header-height) + var(--nav-height) + 10px);
    inset-inline-end: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 400px;
}

.alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    box-shadow: var(--shadow-lg);
    animation: slideIn var(--transition-base) ease;
}
.alert--success { background: #E8F8EE; color: #1A7A3E; border-left: 4px solid var(--color-success); }
.alert--error { background: #FDE8E8; color: #9B1C1C; border-left: 4px solid var(--color-accent); }
.alert--warning { background: #FFF3E0; color: #915B00; border-left: 4px solid var(--color-warning); }
.alert--info { background: #E3F2FD; color: #1565C0; border-left: 4px solid var(--color-info); }
.alert__close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.6;
}
.alert__close:hover { opacity: 1; }

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

/* ── Stars ────────────────────────────────────────────────────────────────── */
.stars {
    display: inline-flex;
    gap: 1px;
    color: #FFB800;
    font-size: 0.7rem;
}

/* ── Section Header ──────────────────────────────────────────────────────── */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--color-border-light);
}
.section-header__title {
    font-family: var(--font-heading);
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--color-primary);
}
.section-header__view-all {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-text-light);
    display: flex;
    align-items: center;
    gap: 4px;
}
.section-header__view-all:hover {
    color: var(--color-accent);
}

/* ── Popup ────────────────────────────────────────────────────────────────── */
.popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
}
.popup-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    z-index: 10001;
    max-width: 500px;
    width: 90%;
    padding: 32px;
}


/* ── Smaller Product Cards ────────────────────────────────────────────────── */
.product-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr); /* More columns = smaller cards */
    gap: 16px;
    padding: 0 16px;
}

@media (max-width: 1200px) {
    .product-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 768px) {
    .product-grid { grid-template-columns: repeat(2, 1fr); padding: 0 8px; }
}

.product-card {
    /* Margin is handled by the grid gap, but we can add inner padding if needed */
    margin: 4px; /* A slight margin */
}

/* Ensure container max-width is slightly larger to fit more items gracefully */
.container {
    max-width: 1360px;
}
