/* ==========================================================================
   ShopEase — storefront & admin styles (Bootstrap 5.3 theme layer)
   ========================================================================== */

:root {
    --brand: #2952e3;
    --brand-dark: #1e3fb8;
    --brand-soft: #eef2ff;
    --ink: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --surface: #f8fafc;
    --radius: 14px;

    --bs-primary: #2952e3;
    --bs-primary-rgb: 41, 82, 227;
    --bs-link-color: #2952e3;
    --bs-link-color-rgb: 41, 82, 227;
    --bs-link-hover-color: #1e3fb8;
    --bs-link-hover-color-rgb: 30, 63, 184;
    --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --bs-body-color: #1e293b;
    --bs-border-color: #e2e8f0;
}

body {
    background: #fff;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    color: var(--ink);
    font-weight: 700;
    letter-spacing: -0.01em;
}

/* ---- Bootstrap component overrides ---- */
.btn-primary {
    --bs-btn-bg: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand-dark);
    --bs-btn-hover-border-color: var(--brand-dark);
    --bs-btn-active-bg: var(--brand-dark);
    --bs-btn-active-border-color: var(--brand-dark);
    --bs-btn-disabled-bg: var(--brand);
    --bs-btn-disabled-border-color: var(--brand);
}
.btn-outline-primary {
    --bs-btn-color: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand);
    --bs-btn-hover-border-color: var(--brand);
    --bs-btn-active-bg: var(--brand-dark);
    --bs-btn-active-border-color: var(--brand-dark);
}
.btn { font-weight: 500; border-radius: 10px; }
.btn-lg { border-radius: 12px; }
.form-control, .form-select { border-radius: 10px; border-color: var(--line); }
.form-control:focus, .form-select:focus, .form-check-input:focus {
    border-color: #9db0f5;
    box-shadow: 0 0 0 .2rem rgba(41, 82, 227, .15);
}
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-label { font-weight: 500; font-size: .9rem; color: #334155; }
.card { border-color: var(--line); border-radius: var(--radius); }
.card-header:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.pagination { --bs-pagination-active-bg: var(--brand); --bs-pagination-active-border-color: var(--brand); --bs-pagination-color: var(--ink); --bs-pagination-border-radius: 10px; }
.page-link { margin: 0 2px; border-radius: 8px !important; }
.dropdown-menu { border-radius: 12px; padding: .5rem; }
.dropdown-item { border-radius: 8px; padding: .45rem .75rem; }
.dropdown-item:active { background-color: var(--brand); }
.text-primary { color: var(--brand) !important; }
.bg-primary { background-color: var(--brand) !important; }
.text-bg-primary { background-color: var(--brand) !important; }
.table > :not(caption) > * > * { padding: .85rem .75rem; }
.table thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; background: var(--surface); }
.alert { border-radius: 12px; border: 0; }
.breadcrumb { font-size: .875rem; margin-bottom: 0; }
.breadcrumb a { text-decoration: none; }
.no-caret::after { display: none; }
.min-w-0 { min-width: 0; }

/* ---- Top bar & navigation ---- */
.topbar { background: var(--ink); color: #cbd5e1; font-size: .8rem; padding: .45rem 0; }
.topbar a { color: #cbd5e1; text-decoration: none; }
.topbar a:hover { color: #fff; }

.site-nav { padding-top: .7rem; padding-bottom: .7rem; }
.site-nav .nav-link, .site-nav .btn { white-space: nowrap; }
.site-nav .nav-link { font-weight: 500; color: #334155; padding-left: .85rem !important; padding-right: .85rem !important; }
.site-nav .nav-link:hover, .site-nav .nav-link.active { color: var(--brand); }
.brand-mark {
    width: 38px; height: 38px; border-radius: 11px;
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #2952e3, #7c3aed); color: #fff; font-size: 1.1rem;
}
.brand-name { font-weight: 800; font-size: 1.3rem; color: var(--ink); letter-spacing: -0.02em; }
.btn-icon { border: 0; width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: #334155; }
.btn-icon:hover { background: var(--surface); color: var(--brand); }
.cart-badge { font-size: .65rem; margin-top: 8px; margin-left: -8px; }
.avatar-sm { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.search-form { min-width: 260px; }
.search-form .input-group-text, .search-form .form-control { background: var(--surface); }

/* ---- Hero ---- */
.hero {
    background: radial-gradient(circle at 85% 20%, rgba(124, 58, 237, .18), transparent 45%),
                radial-gradient(circle at 10% 90%, rgba(41, 82, 227, .15), transparent 40%),
                linear-gradient(180deg, #f5f7ff 0%, #ffffff 100%);
    padding: 4.5rem 0 4rem;
}
.hero-eyebrow { display: inline-flex; align-items: center; gap: .5rem; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: .35rem .9rem; font-size: .85rem; font-weight: 500; color: #334155; }
.hero h1 { font-size: clamp(2.2rem, 4.5vw, 3.5rem); font-weight: 800; line-height: 1.1; letter-spacing: -0.03em; }
.hero .lead { color: var(--muted); max-width: 520px; }
.hero-visual { position: relative; min-height: 380px; }
.hero-card {
    position: absolute; background: #fff; border-radius: 20px; box-shadow: 0 25px 50px -12px rgba(15, 23, 42, .18);
    padding: 1.25rem; display: flex; align-items: center; gap: 1rem;
}
.hero-card .icon-circle { width: 56px; height: 56px; font-size: 1.5rem; }
.hero-card-1 { top: 10px; left: 8%; right: 18%; }
.hero-card-2 { top: 140px; left: 28%; right: 0; }
.hero-card-3 { top: 270px; left: 0; right: 30%; }
.icon-circle { width: 48px; height: 48px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; background: var(--brand-soft); color: var(--brand); font-size: 1.3rem; flex-shrink: 0; }

/* ---- Sections ---- */
.section { padding: 3.5rem 0; }
.section-title { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.02em; }
.section-subtitle { color: var(--muted); }
.page-header { background: linear-gradient(180deg, #f5f7ff, #fff); border-bottom: 1px solid var(--line); padding: 2rem 0 1.5rem; }
.page-header h1 { font-size: 1.9rem; font-weight: 800; }

.feature-strip { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fff; }
.feature-item { display: flex; gap: .9rem; align-items: center; padding: 1.4rem 0; }
.feature-item h6 { margin: 0; font-size: .95rem; }
.feature-item p { margin: 0; font-size: .85rem; color: var(--muted); }

/* ---- Category tiles ---- */
.category-tile {
    display: block; text-align: center; padding: 1.6rem 1rem; border: 1px solid var(--line); border-radius: var(--radius);
    background: #fff; text-decoration: none; color: var(--ink); transition: all .2s ease; height: 100%;
}
.category-tile:hover { border-color: #c7d2fe; box-shadow: 0 12px 30px -12px rgba(41, 82, 227, .3); transform: translateY(-3px); color: var(--ink); }
.category-tile .icon-circle { width: 64px; height: 64px; font-size: 1.7rem; border-radius: 18px; margin-bottom: .9rem; }
.category-tile h3 { font-size: 1rem; margin-bottom: .2rem; }
.category-tile span { font-size: .8rem; color: var(--muted); }

/* ---- Product card ---- */
.product-card { border: 1px solid var(--line); transition: all .2s ease; overflow: hidden; }
.product-card:hover { box-shadow: 0 18px 40px -18px rgba(15, 23, 42, .25); transform: translateY(-2px); }
.product-thumb { position: relative; display: block; aspect-ratio: 1 / 1; background: var(--surface); overflow: hidden; }
.product-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.product-card:hover .product-thumb img { transform: scale(1.04); }
.product-badges { position: absolute; top: .75rem; left: .75rem; display: flex; flex-direction: column; gap: .3rem; }
.product-category { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); text-decoration: none; font-weight: 600; }
.product-category:hover { color: var(--brand); }
.product-title { font-size: .98rem; font-weight: 600; line-height: 1.35; margin: .35rem 0 .75rem; }
.product-title a { color: var(--ink); text-decoration: none; }
.product-title a:hover { color: var(--brand); }
.price { font-weight: 700; color: var(--ink); font-size: 1.1rem; }
.price-compare { color: #94a3b8; text-decoration: line-through; font-size: .85rem; margin-left: .35rem; }
.btn-add { width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; padding: 0; }

/* ---- Shop filters ---- */
.filter-card .list-group-item { border: 0; border-radius: 10px !important; padding: .55rem .75rem; display: flex; justify-content: space-between; align-items: center; color: #334155; }
.filter-card .list-group-item:hover { background: var(--surface); }
.filter-card .list-group-item.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.filter-card .list-group-item .badge { background: var(--surface); color: var(--muted); font-weight: 500; }

/* ---- Product page ---- */
.product-gallery { border-radius: 20px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); aspect-ratio: 1 / 1; }
.product-gallery img { width: 100%; height: 100%; object-fit: cover; }
.product-price { font-size: 2rem; font-weight: 800; color: var(--ink); }
.qty-stepper { display: inline-flex; align-items: stretch; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.qty-stepper button { border: 0; background: transparent; width: 40px; color: #334155; }
.qty-stepper button:hover { background: var(--surface); }
.qty-stepper input { width: 56px; border: 0; text-align: center; font-weight: 600; -moz-appearance: textfield; }
.qty-stepper input::-webkit-outer-spin-button, .qty-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-stepper input:focus { outline: none; }
.qty-stepper.qty-sm button { width: 32px; }
.qty-stepper.qty-sm input { width: 44px; font-size: .9rem; }
.delivery-list li { display: flex; justify-content: space-between; padding: .6rem 0; border-bottom: 1px dashed var(--line); font-size: .9rem; }
.delivery-list li:last-child { border-bottom: 0; }
.nav-tabs .nav-link { color: var(--muted); font-weight: 500; border: 0; border-bottom: 2px solid transparent; }
.nav-tabs .nav-link.active { color: var(--brand); border-bottom-color: var(--brand); background: transparent; }

/* ---- Cart & checkout ---- */
.cart-thumb { width: 72px; height: 72px; border-radius: 12px; object-fit: cover; background: var(--surface); flex-shrink: 0; }
.summary-card { position: sticky; top: 100px; }
.summary-row { display: flex; justify-content: space-between; margin-bottom: .6rem; }
.summary-total { font-size: 1.25rem; font-weight: 800; color: var(--ink); }
.checkout-step { width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: .85rem; font-weight: 700; margin-right: .6rem; }
.option-card { display: block; border: 1.5px solid var(--line); border-radius: 12px; padding: 1rem 1rem 1rem 2.75rem; position: relative; cursor: pointer; transition: all .15s ease; margin-bottom: .75rem; }
.option-card:hover { border-color: #c7d2fe; }
.option-card .form-check-input { position: absolute; left: 1rem; top: 1.15rem; margin: 0; }
.option-card:has(.form-check-input:checked) { border-color: var(--brand); background: #f8faff; box-shadow: 0 0 0 3px rgba(41, 82, 227, .08); }
.summary-thumb-wrap { position: relative; }
.summary-thumb-wrap .badge { position: absolute; top: -6px; right: -6px; }

/* ---- Tracking ---- */
.tracking-steps { display: flex; justify-content: space-between; position: relative; margin: 1rem 0 .5rem; }
.tracking-steps::before { content: ""; position: absolute; top: 22px; left: 8%; right: 8%; height: 3px; background: var(--line); z-index: 0; }
.tracking-progress { position: absolute; top: 22px; left: 8%; height: 3px; background: var(--brand); z-index: 1; transition: width .4s ease; }
.tracking-step { position: relative; z-index: 2; text-align: center; flex: 1; }
.tracking-step .step-icon { width: 46px; height: 46px; border-radius: 50%; background: #fff; border: 3px solid var(--line); color: #94a3b8; display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.tracking-step.done .step-icon { background: var(--brand); border-color: var(--brand); color: #fff; }
.tracking-step.current .step-icon { box-shadow: 0 0 0 6px rgba(41, 82, 227, .18); }
.tracking-step .step-label { display: block; margin-top: .5rem; font-size: .8rem; font-weight: 600; color: var(--muted); }
.tracking-step.done .step-label { color: var(--ink); }
@media (max-width: 575.98px) {
    .tracking-step .step-icon { width: 36px; height: 36px; font-size: .9rem; }
    .tracking-steps::before, .tracking-progress { top: 17px; }
    .tracking-step .step-label { font-size: .65rem; }
}
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 17px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.timeline li { position: relative; padding-left: 52px; padding-bottom: 1.4rem; }
.timeline li:last-child { padding-bottom: 0; }
.timeline .tl-icon { position: absolute; left: 0; top: 0; width: 36px; height: 36px; border-radius: 50%; background: #fff; border: 2px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--muted); }
.timeline li:first-child .tl-icon { background: var(--brand); border-color: var(--brand); color: #fff; }
.timeline .tl-title { font-weight: 600; color: var(--ink); }
.timeline .tl-meta { font-size: .8rem; color: var(--muted); }
.info-tile { background: var(--surface); border-radius: 12px; padding: 1rem; height: 100%; }
.info-tile .label { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.info-tile .value { font-weight: 600; color: var(--ink); word-break: break-word; }

/* ---- Auth & account ---- */
.auth-wrap { min-height: calc(100vh - 300px); display: flex; align-items: center; padding: 3rem 0; }
.auth-card { max-width: 460px; margin: 0 auto; }
.account-nav .list-group-item { border: 0; border-radius: 10px !important; padding: .7rem 1rem; color: #334155; font-weight: 500; }
.account-nav .list-group-item i { display: inline-block; width: 1.75rem; }
.account-nav .list-group-item.active { background: var(--brand-soft); color: var(--brand); }
.stat-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; background: #fff; height: 100%; }
.stat-card .stat-value { font-size: 1.6rem; font-weight: 800; color: var(--ink); line-height: 1.2; }
.stat-card .stat-label { font-size: .85rem; color: var(--muted); }

.empty-state { text-align: center; padding: 4rem 1rem; }
.empty-state .icon-circle { width: 84px; height: 84px; font-size: 2.2rem; border-radius: 50%; margin-bottom: 1.25rem; }
.success-icon { width: 88px; height: 88px; border-radius: 50%; background: #dcfce7; color: #16a34a; display: inline-flex; align-items: center; justify-content: center; font-size: 2.8rem; }

/* ---- Footer ---- */
.site-footer { background: var(--ink); color: #cbd5e1; }
.footer-heading { color: #fff; font-size: .9rem; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 1rem; }
.footer-links li { margin-bottom: .55rem; font-size: .92rem; }
.footer-links a { color: #94a3b8; text-decoration: none; }
.footer-links a:hover { color: #fff; }
.social-link { width: 38px; height: 38px; border-radius: 10px; background: rgba(255, 255, 255, .08); color: #fff; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.social-link:hover { background: var(--brand); color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .08); color: #94a3b8; }
.payment-icons i { color: #94a3b8; }

/* ==========================================================================
   Admin
   ========================================================================== */
.admin-body { background: #f1f5f9; }
.admin-sidebar { width: 260px; background: var(--ink); color: #cbd5e1; position: sticky; top: 0; height: 100vh; overflow-y: auto; flex-shrink: 0; }
.admin-sidebar .brand-name, .offcanvas.admin-offcanvas .brand-name { color: #fff; }
.admin-nav .nav-link { color: #94a3b8; border-radius: 10px; padding: .65rem .9rem; display: flex; align-items: center; gap: .75rem; font-weight: 500; margin-bottom: 2px; }
.admin-nav .nav-link:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.admin-nav .nav-link.active { color: #fff; background: var(--brand); }
.admin-nav .nav-section { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #64748b; padding: 1rem .9rem .4rem; }
.admin-offcanvas { background: var(--ink) !important; width: 260px !important; }
.admin-topbar { background: #fff; border-bottom: 1px solid var(--line); padding: .8rem 1.5rem; position: sticky; top: 0; z-index: 1020; }
.admin-main { min-width: 0; }
.admin-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.admin-card .card-header { background: #fff; border-bottom: 1px solid var(--line); padding: 1rem 1.25rem; font-weight: 600; }
.kpi-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; height: 100%; display: flex; gap: 1rem; align-items: center; }
.kpi-card .kpi-value { font-size: 1.5rem; font-weight: 800; color: var(--ink); line-height: 1.15; }
.kpi-card .kpi-label { font-size: .82rem; color: var(--muted); }
.icon-circle.green { background: #dcfce7; color: #16a34a; }
.icon-circle.amber { background: #fef3c7; color: #d97706; }
.icon-circle.violet { background: #f3e8ff; color: #7c3aed; }
.icon-circle.rose { background: #ffe4e6; color: #e11d48; }
.icon-circle.sky { background: #e0f2fe; color: #0284c7; }
.admin-thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--surface); }
.status-pills .nav-link { border-radius: 999px; color: #475569; font-size: .875rem; padding: .4rem .9rem; }
.status-pills .nav-link.active { background: var(--ink); color: #fff; }
.table-hover > tbody > tr:hover > * { --bs-table-accent-bg: #f8fafc; }

/* ---- Print (invoice) ---- */
@media print {
    .no-print { display: none !important; }
    body { background: #fff !important; }
    .invoice-card { border: 0 !important; box-shadow: none !important; }
}
