/* ── Google Fonts: Inter ─────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,400&display=swap');

/* ── Base ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Scrollbar hide ──────────────────────────────────────── */
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }
.scrollbar-hide::-webkit-scrollbar { display: none; }

/* ── Line clamp ──────────────────────────────────────────── */
.line-clamp-1 { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.line-clamp-2 { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.line-clamp-3 { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }

/* ── Glassmorphism header ────────────────────────────────── */
.glass-header {
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
}

/* ── Product image aspect ratio trick ───────────────────── */
.img-wrap {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #f3f4f6;
}
.img-wrap::before {
    content: '';
    display: block;
    padding-top: 100%; /* 1:1 */
}
.img-wrap.img-4-3::before { padding-top: 75%; }
.img-wrap.img-3-4::before { padding-top: 133.33%; }

.img-wrap img,
.img-wrap .img-placeholder {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}
.img-wrap .img-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Product card ────────────────────────────────────────── */
.product-card {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.06);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    display: flex;
    flex-direction: column;
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.14);
}
.product-card:hover .img-wrap img {
    transform: scale(1.07);
}

/* ── Merchant card ───────────────────────────────────────── */
.merchant-card {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.merchant-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 24px rgba(0,0,0,0.12);
}

/* ── General card ────────────────────────────────────────── */
.card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 2px 8px rgba(0,0,0,0.06);
}

/* ── KPI gradient cards ──────────────────────────────────── */
.kpi-card {
    border-radius: 1rem;
    padding: 1.25rem 1.5rem;
    color: white;
    position: relative;
    overflow: hidden;
}
.kpi-card-icon {
    position: absolute;
    top: 50%;
    right: 1.25rem;
    transform: translateY(-50%);
    opacity: 0.2;
    width: 52px;
    height: 52px;
}
.kpi-green  { background: linear-gradient(135deg, #1a7f37 0%, #22c55e 100%); }
.kpi-blue   { background: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 100%); }
.kpi-amber  { background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%); }
.kpi-purple { background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%); }
.kpi-teal   { background: linear-gradient(135deg, #0e7490 0%, #06b6d4 100%); }

/* ── Btn primary animations ──────────────────────────────── */
.btn-primary {
    transition: transform 0.1s ease, box-shadow 0.15s ease, background-color 0.2s ease;
}
.btn-primary:active { transform: scale(0.97); }
.btn-primary:not(:disabled):hover { box-shadow: 0 4px 14px rgba(0,0,0,0.2); }

/* ── Input focus ring ────────────────────────────────────── */
input:focus, textarea:focus, select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(26, 127, 55, 0.2);
    border-color: #1a7f37;
}

/* ── Badge cart bounce ───────────────────────────────────── */
@keyframes badge-pop {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.4); }
    70%  { transform: scale(0.9); }
    100% { transform: scale(1); }
}
.badge-pop { animation: badge-pop 0.3s ease forwards; }

/* ── Sticky store bottom bar ─────────────────────────────── */
.store-cart-bar {
    background: white;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.12);
    padding: 0.875rem 1rem;
}

/* ── Dashboard nav icon ──────────────────────────────────── */
.nav-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0.45rem 0.875rem;
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 500;
    white-space: nowrap;
    color: #4b5563;
    transition: background-color 0.15s ease, color 0.15s ease;
    text-decoration: none;
}
.nav-item:hover { background: #f3f4f6; color: #111827; }
.nav-item.active { background: #1a7f37; color: white; font-weight: 600; }

/* ── Table hover rows ────────────────────────────────────── */
.data-table tbody tr {
    transition: background-color 0.1s ease;
}
.data-table tbody tr:hover { background: #f9fafb; }

/* ── Store header blur on scroll ─────────────────────────── */
.store-header {
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

/* ── Landing hero gradient ───────────────────────────────── */
.hero-gradient {
    background: linear-gradient(135deg, #062916 0%, #0d3b20 35%, #1a7f37 75%, #20a048 100%);
}

/* ── Category card hover ─────────────────────────────────── */
.category-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.category-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

/* ── Ticker ──────────────────────────────────────────────── */
.ticker-wrap { overflow: hidden; }
.ticker-inner { display: flex; width: max-content; animation: ticker 40s linear infinite; }
.ticker-inner:hover { animation-play-state: paused; }
@keyframes ticker {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ── Float animations ────────────────────────────────────── */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-10px); }
}
.float-anim  { animation: float 4s ease-in-out infinite; }
.float-anim2 { animation: float 4s ease-in-out infinite 2s; }

/* ── Pulse ring ──────────────────────────────────────────── */
@keyframes pulse-ring {
    0%   { transform: scale(1);   opacity: .6; }
    100% { transform: scale(1.6); opacity: 0; }
}
.pulse-ring::before {
    content: '';
    position: absolute; inset: -4px;
    border-radius: 9999px;
    border: 2px solid #22c55e;
    animation: pulse-ring 2s ease-out infinite;
}

/* ── Gradient text ───────────────────────────────────────── */
.text-gradient {
    background: linear-gradient(135deg, #4ade80, #86efac);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Star rating ─────────────────────────────────────────── */
.stars { display: inline-flex; gap: 1px; }

/* ── Shimmer loading ─────────────────────────────────────── */
@keyframes shimmer {
    0%   { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}
.shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 1000px 100%;
    animation: shimmer 1.5s infinite;
}

/* ── Fade in up ──────────────────────────────────────────── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
.fade-in-up { animation: fadeInUp 0.4s ease both; }

/* ── Status badges ───────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 9999px; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.01em; }
.badge-received         { background: #dbeafe; color: #1d4ed8; }
.badge-awaiting_payment { background: #ffedd5; color: #c2410c; }
.badge-paid             { background: #dcfce7; color: #15803d; }
.badge-preparing        { background: #fef9c3; color: #a16207; }
.badge-ready            { background: #cffafe; color: #0e7490; }
.badge-delivering       { background: #f3e8ff; color: #7c3aed; }
.badge-delivered        { background: #dcfce7; color: #15803d; }
.badge-cancelled        { background: #fee2e2; color: #dc2626; }
.badge-refunded         { background: #fce7f3; color: #be185d; }

/* ── Alpine cloak ────────────────────────────────────────── */
[x-cloak] { display: none !important; }

/* ── Category icon ───────────────────────────────────────── */
.category-icon {
    width: 56px; height: 56px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 26px;
}
