/* ============================================================
   Bharat Hosiery — Shared Design System
   ============================================================ */
:root {
    --navy: #0f2942;
    --navy-700: #16395c;
    --navy-600: #1d4a76;
    --gold: #d4a017;
    --gold-600: #b8860b;
    --gold-soft: #f6e8c3;
    --ink: #1c2733;
    --muted: #6b7a8d;
    --line: #e6ebf1;
    --bg: #f5f7fa;
    --surface: #ffffff;
    --success: #1e9e6a;
    --danger: #d64550;
    --warning: #e0a106;
    --info: #2f80ed;
    --radius: 14px;
    --radius-sm: 9px;
    --shadow-sm: 0 1px 3px rgba(15, 41, 66, .06), 0 1px 2px rgba(15, 41, 66, .04);
    --shadow: 0 6px 24px rgba(15, 41, 66, .08);
    --shadow-lg: 0 18px 48px rgba(15, 41, 66, .14);
    --font: 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
    font-family: var(--font);
    color: var(--ink);
    background: var(--bg);
    margin: 0;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--navy-600); text-decoration: none; }
a:hover { color: var(--gold-600); }

.text-muted-soft { color: var(--muted); }
.fw-700 { font-weight: 700; }

/* ---------------------------------------------------- Brand */
.brand {
    display: inline-flex; align-items: center; gap: .55rem;
    font-weight: 800; letter-spacing: .2px; color: var(--navy);
}
.brand .brand-mark {
    width: 34px; height: 34px; border-radius: 9px;
    background: linear-gradient(135deg, var(--navy), var(--navy-600));
    color: var(--gold); display: grid; place-items: center;
    font-weight: 900; box-shadow: var(--shadow-sm);
}
.brand .brand-sub { font-size: .68rem; color: var(--muted); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }

/* ---------------------------------------------------- Buttons */
.btn-gold {
    background: linear-gradient(135deg, var(--gold), var(--gold-600));
    border: none; color: #fff; font-weight: 600;
    box-shadow: 0 4px 14px rgba(184, 134, 11, .3);
}
.btn-gold:hover { color: #fff; filter: brightness(1.04); }
.btn-navy { background: var(--navy); border: none; color: #fff; font-weight: 600; }
.btn-navy:hover { background: var(--navy-700); color: #fff; }
.btn-outline-navy { border: 1.5px solid var(--navy-600); color: var(--navy-600); font-weight: 600; }
.btn-outline-navy:hover { background: var(--navy-600); color: #fff; }

/* ---------------------------------------------------- Cards */
.card-soft {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.section-title { font-weight: 800; color: var(--navy); letter-spacing: -.2px; }
.eyebrow { color: var(--gold-600); font-weight: 700; text-transform: uppercase; letter-spacing: .14em; font-size: .76rem; }

/* ---------------------------------------------------- Badges */
.badge-status { font-weight: 600; padding: .38em .7em; border-radius: 999px; font-size: .74rem; }
.badge-active   { background: #e4f6ee; color: var(--success); }
.badge-inactive { background: #f1f3f6; color: var(--muted); }
.badge-pending    { background: #fdf3d8; color: #9a7400; }
.badge-processing { background: #e3eefc; color: var(--info); }
.badge-completed  { background: #e4f6ee; color: var(--success); }
.badge-cancelled  { background: #fbe4e6; color: var(--danger); }

/* ---------------------------------------------------- Tables */
.table-modern { width: 100%; border-collapse: separate; border-spacing: 0; }
.table-modern thead th {
    background: #fbfcfe; color: var(--muted); font-weight: 700; font-size: .74rem;
    text-transform: uppercase; letter-spacing: .06em; padding: .85rem 1rem;
    border-bottom: 1px solid var(--line); white-space: nowrap; cursor: pointer; user-select: none;
}
.table-modern thead th.no-sort { cursor: default; }
.table-modern tbody td { padding: .85rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table-modern tbody tr:hover { background: #fafbfd; }
.table-modern .sort-ind { opacity: .45; font-size: .7rem; }
.table-wrap { overflow-x: auto; }

.thumb { width: 46px; height: 46px; border-radius: 9px; object-fit: cover; background: #eef1f5; border: 1px solid var(--line); }

/* ---------------------------------------------------- Loader */
.loader-overlay {
    position: fixed; inset: 0; background: rgba(255, 255, 255, .6);
    backdrop-filter: blur(2px); display: none; place-items: center; z-index: 1080;
}
.loader-overlay.show { display: grid; }
.spinner-ring {
    width: 46px; height: 46px; border-radius: 50%;
    border: 4px solid var(--gold-soft); border-top-color: var(--gold);
    animation: spin .8s linear infinite;
}
.btn-spinner {
    display: inline-block; width: 1rem; height: 1rem; vertical-align: -2px;
    border: 2px solid rgba(255,255,255,.5); border-top-color: #fff; border-radius: 50%;
    animation: spin .7s linear infinite; margin-right: .4rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------- Toast */
.toast-stack { position: fixed; top: 1rem; right: 1rem; z-index: 1090; display: flex; flex-direction: column; gap: .6rem; max-width: 360px; }
.toast-card {
    background: #fff; border-left: 4px solid var(--info); border-radius: 10px;
    box-shadow: var(--shadow); padding: .8rem 1rem; display: flex; gap: .6rem; align-items: flex-start;
    animation: toastIn .25s ease;
}
.toast-card.success { border-left-color: var(--success); }
.toast-card.error   { border-left-color: var(--danger); }
.toast-card.warning { border-left-color: var(--warning); }
.toast-card .t-title { font-weight: 700; font-size: .9rem; }
.toast-card .t-msg { font-size: .84rem; color: var(--muted); }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } }

/* ---------------------------------------------------- Empty state */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty-state .es-icon { font-size: 2.4rem; opacity: .5; margin-bottom: .5rem; }

/* ---------------------------------------------------- Image upload */
.uploader {
    border: 2px dashed var(--line); border-radius: var(--radius); padding: 1.5rem;
    text-align: center; background: #fbfcfe; cursor: pointer; transition: .15s;
}
.uploader.dragover { border-color: var(--gold); background: var(--gold-soft); }
.uploader .up-icon { font-size: 1.8rem; color: var(--gold-600); }
.thumb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .7rem; margin-top: 1rem; }
.thumb-item { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); aspect-ratio: 1; background: #eef1f5; }
.thumb-item img { width: 100%; height: 100%; object-fit: cover; }
.thumb-item .thumb-x {
    position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%;
    background: rgba(214, 69, 80, .92); color: #fff; border: none; font-size: .8rem; line-height: 1;
    display: grid; place-items: center; cursor: pointer;
}
.thumb-item .thumb-tag { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(15,41,66,.7); color: #fff; font-size: .62rem; text-align: center; padding: 2px; }

/* ---------------------------------------------------- Image cards (admin uploader) */
.img-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: .5rem;
}
.img-card {
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    padding: .75rem; background: #fff;
    box-shadow: var(--shadow-sm);
}
.img-card-photo { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: #eef1f5; }
.img-card-photo img { width: 100%; height: 100%; object-fit: cover; }
.img-card-photo .thumb-x {
    position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%;
    background: rgba(214, 69, 80, .92); color: #fff; border: none; font-size: .8rem; line-height: 1;
    display: grid; place-items: center; cursor: pointer;
}
.img-card-uuid { font-size: .68rem; color: var(--muted); margin-top: .4rem; word-break: break-all; }
.img-card-view { display: flex; gap: .75rem; align-items: flex-start; }
.img-empty-hint {
    text-align: center; padding: 2rem 1rem; color: var(--muted);
    border: 2px dashed var(--line); border-radius: var(--radius); background: #fafbfd;
}
.img-empty-icon { font-size: 2rem; opacity: .6; margin-bottom: .5rem; }
.product-images-section { background: #fafbfd; border-radius: var(--radius); padding: 1.25rem; border: 1px solid var(--line); }

/* ---------------------------------------------------- Admin stat cards */
.stat-card-link { text-decoration: none; display: block; height: 100%; }
.stat-card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 1.25rem 1.5rem; height: 100%; transition: box-shadow .2s, border-color .2s, transform .15s;
}
.stat-card-link:hover .stat-card {
    box-shadow: var(--shadow); border-color: var(--gold-soft); transform: translateY(-2px);
}
.stat-card-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.stat-card-value { font-size: 2rem; font-weight: 800; color: var(--navy); margin: .35rem 0; line-height: 1.1; }
.stat-card-value.stat-gold { color: var(--gold-600); }
.stat-card-hint { font-size: .78rem; color: var(--muted); }

/* ---------------------------------------------------- Storefront catalog (image-wise) */
body.storefront { background: #fafbfc; }
body.storefront main { min-height: 60vh; }

.catalog-hero {
    padding: 2.75rem 0 1.75rem; text-align: center;
    background: linear-gradient(180deg, #fff 0%, #fafbfc 100%);
}
.catalog-hero-sm { padding: 2rem 0 1.25rem; }
.catalog-hero-title {
    font-weight: 300; font-size: clamp(1.85rem, 4.5vw, 2.75rem);
    color: #111; letter-spacing: -.03em; margin: 0;
    font-family: Georgia, 'Times New Roman', serif;
}
.catalog-hero-sub { color: var(--muted); margin: .6rem auto 0; font-size: .95rem; max-width: 480px; }

.catalog-section { padding: 1.5rem 0 3.5rem; }
.catalog-toolbar {
    display: flex; justify-content: center; align-items: center;
    flex-wrap: wrap; gap: 0.75rem; margin-bottom: 2.25rem;
}
.catalog-search {
    flex: 1 1 220px; max-width: 400px; width: 100%;
    border-radius: 999px; padding: .7rem 1.35rem;
    border: 1px solid #e8ecf0; background: #fff;
    box-shadow: 0 2px 12px rgba(15, 41, 66, .05);
}
.catalog-cat-filter {
    flex: 0 1 180px; min-width: 150px;
    border-radius: 999px; padding: .7rem 1.1rem;
    border: 1px solid #e8ecf0; background: #fff;
    box-shadow: 0 2px 12px rgba(15, 41, 66, .05);
}
.catalog-btn-viewall {
    flex: 0 0 auto;
    border-radius: 999px; padding: .7rem 1.35rem;
    border: 1px solid var(--navy, #0f2942);
    background: var(--navy, #0f2942); color: #fff;
    font-size: .9rem; font-weight: 500;
    text-decoration: none; white-space: nowrap;
    transition: background .2s ease, opacity .2s ease;
}
.catalog-btn-viewall:hover { opacity: .9; color: #fff; }

/* --- Product card */
.catalog-card {
    display: flex; flex-direction: column;
    background: #fff;
    border-radius: 14px;
    border: 1px solid #eef1f5;
    box-shadow: 0 4px 20px rgba(15, 41, 66, .06);
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease;
    height: 100%;
}
.catalog-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(15, 41, 66, .12);
}

.catalog-card-media {
    position: relative; overflow: hidden;
    background: linear-gradient(145deg, #f3f5f8, #e9edf2);
    aspect-ratio: 3 / 4;
}
.catalog-card-media img {
    width: 100%; height: 100%; object-fit: cover; display: block;
    transition: transform .5s cubic-bezier(.25, .46, .45, .94);
}
.catalog-card:hover .catalog-card-media img { transform: scale(1.06); }
.catalog-card-shine {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,.04) 100%);
    pointer-events: none;
}

.catalog-card-body {
    padding: 1rem 1rem 1.1rem;
    flex: 1; display: flex; flex-direction: column; gap: .2rem;
}
.catalog-card-cat {
    display: inline-block; align-self: flex-start;
    font-size: .65rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .1em; color: var(--gold-600);
    background: var(--gold-soft); padding: .2rem .55rem;
    border-radius: 999px; margin-bottom: .35rem;
}
.catalog-card-title {
    font-size: .95rem; font-weight: 700; color: #111;
    margin: 0; line-height: 1.35;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.catalog-card-sub {
    font-size: .78rem; color: var(--muted); margin: 0;
    line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.catalog-card-desc {
    font-size: .78rem; color: #5a6578; margin: .15rem 0 0;
    line-height: 1.5; font-style: italic;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.catalog-card-set {
    font-size: .78rem; font-weight: 600; color: var(--navy);
    margin: .2rem 0 0; line-height: 1.4;
}
.catalog-order-hint {
    font-size: .72rem; color: var(--muted); margin-top: .25rem;
}

.catalog-card-footer {
    margin-top: auto; padding-top: .85rem;
    display: flex; flex-direction: column; gap: .65rem;
}
.catalog-card-price {
    font-size: 1rem; font-weight: 700; color: var(--navy);
    letter-spacing: -.01em;
}

.catalog-btn-order,
.catalog-btn-login {
    display: block; width: 100%; text-align: center;
    padding: .58rem 1rem; border-radius: 8px;
    font-weight: 600; font-size: .82rem;
    cursor: pointer; text-decoration: none;
    transition: all .2s ease;
}
.catalog-btn-order {
    border: 1.5px solid var(--navy); background: #fff; color: var(--navy);
}
.catalog-btn-order:hover, .catalog-btn-order.is-active {
    background: var(--navy); color: #fff; border-color: var(--navy);
}
.catalog-btn-login {
    border: none;
    background: linear-gradient(135deg, var(--gold), var(--gold-600));
    color: #fff; box-shadow: 0 4px 14px rgba(184, 134, 11, .25);
}
.catalog-btn-login:hover { color: #fff; filter: brightness(1.05); transform: translateY(-1px); }

.catalog-order-panel {
    display: none; padding: .85rem;
    background: #f8fafc; border-radius: 10px;
    border: 1px solid #eef1f5;
}
.catalog-order-panel.is-open { display: block; }
.catalog-order-field { margin-bottom: .65rem; }
.catalog-order-field:last-of-type { margin-bottom: .75rem; }
.catalog-order-field label {
    font-size: .68rem; font-weight: 700; color: var(--muted);
    text-transform: uppercase; letter-spacing: .06em;
    margin-bottom: .25rem; display: block;
}
.catalog-order-field .form-control {
    font-size: .88rem; border-radius: 8px; border-color: #dde3ea;
}
.catalog-btn-save {
    width: 100%; padding: .55rem; border: none; border-radius: 8px;
    background: var(--navy); color: #fff;
    font-weight: 600; font-size: .82rem; cursor: pointer;
    transition: background .15s;
}
.catalog-btn-save:hover { background: var(--navy-700); }

.catalog-empty { text-align: center; padding: 4rem 1rem; color: var(--muted); }
.catalog-empty-icon { font-size: 3rem; opacity: .35; margin-bottom: .75rem; }

.catalog-about { background: #fff; border-top: 1px solid #eef1f5; }
.about-pill {
    background: #fafbfc; border: 1px solid var(--line); border-radius: 12px;
    padding: 1.35rem; text-align: center; height: 100%;
    transition: box-shadow .2s;
}
.about-pill:hover { box-shadow: var(--shadow-sm); }
.about-pill strong { display: block; font-size: 1.6rem; color: var(--gold-600); font-weight: 800; }
.about-pill span { font-size: .8rem; color: var(--muted); }

/* .catalog-contact { background: linear-gradient(135deg, var(--navy), var(--navy-600)); } */

/* --- Cart (image-wise items) */
.cart-item-row {
    display: flex; gap: 1rem; padding: 1rem 0;
    border-bottom: 1px solid var(--line);
}
.cart-item-row:last-child { border-bottom: none; }
.cart-item-media { flex-shrink: 0; }
.cart-item-img {
    width: 100px; height: 120px; object-fit: cover;
    border-radius: 10px; border: 1px solid var(--line);
    background: #f3f5f8;
}
.cart-item-placeholder {
    display: grid; place-items: center; font-size: 1.8rem;
}
.cart-item-cat {
    font-size: .62rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .08em; color: var(--gold-600);
}
.cart-item-name { font-weight: 700; font-size: .95rem; margin-top: .15rem; }
.cart-item-sub { font-size: .82rem; color: var(--muted); margin-top: .15rem; }
.cart-item-desc {
    font-size: .8rem; color: #5a6578; font-style: italic;
    margin-top: .25rem; line-height: 1.4;
}
.cart-item-set {
    font-size: .8rem; font-weight: 600; color: var(--navy);
    margin-top: .25rem; line-height: 1.4;
}
.cart-item-price { font-weight: 600; color: var(--navy); margin-top: .35rem; font-size: .9rem; }
.cart-item-actions { width: 90px; flex-shrink: 0; text-align: right; }
.cart-mobile-badge {
    background: #f8fafc; border: 1px solid #eef1f5;
    border-radius: 8px; padding: .65rem .85rem;
}
.cart-summary { border-radius: var(--radius); }

.catalog-btn-goto-cart {
    display: block; text-align: center; margin-top: .5rem;
    font-size: .78rem; font-weight: 600; color: var(--navy-600);
    text-decoration: none;
}
.catalog-btn-goto-cart:hover { color: var(--gold-600); }

/* --- My orders */
.my-order-card { border-radius: var(--radius); }
.my-order-items { display: flex; flex-direction: column; gap: .75rem; }
.my-order-item {
    display: flex; gap: .75rem; align-items: flex-start;
    padding: .65rem; background: #fafbfc; border-radius: 10px;
    border: 1px solid #eef1f5;
}
.my-order-thumb {
    width: 64px; height: 76px; object-fit: cover;
    border-radius: 8px; flex-shrink: 0; border: 1px solid var(--line);
}
.my-order-thumb-ph {
    display: grid; place-items: center; background: #eef1f5; font-size: 1.2rem;
}
.my-order-item-desc { font-size: .78rem; color: #5a6578; font-style: italic; margin-top: .15rem; }

#order-tabs .nav-link {
    border-radius: 999px; font-size: .82rem; font-weight: 600;
    color: var(--muted); padding: .4rem .9rem;
}
#order-tabs .nav-link.active { background: var(--navy); color: #fff; }

@media (max-width: 575.98px) {
    .cart-item-row { flex-wrap: wrap; }
    .cart-item-img { width: 80px; height: 96px; }
    .cart-item-actions { width: 100%; display: flex; align-items: center; gap: .5rem; }
    .cart-item-actions .qty-inp { width: 80px; }
    .catalog-card-body { padding: .75rem .7rem .85rem; }
    .catalog-card-title { font-size: .88rem; }
    .catalog-card-price { font-size: .92rem; }
    .catalog-card-media { aspect-ratio: 4 / 5; }
}

@media (min-width: 992px) {
    .catalog-grid { --bs-gutter-x: 1.75rem; --bs-gutter-y: 1.75rem; }
}

/* ---------------------------------------------------- Pagination */
.pager { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.pager button {
    min-width: 36px; height: 36px; border: 1px solid var(--line); background: #fff;
    border-radius: 8px; font-weight: 600; color: var(--ink); cursor: pointer;
}
.pager button:hover:not(:disabled) { border-color: var(--gold); color: var(--gold-600); }
.pager button.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.pager button:disabled { opacity: .45; cursor: not-allowed; }

/* ---------------------------------------------------- Forms */
.form-label { font-weight: 600; font-size: .85rem; color: var(--navy-700); margin-bottom: .3rem; }
.form-control, .form-select { border-radius: var(--radius-sm); border-color: var(--line); padding: .55rem .8rem; }
.form-control:focus, .form-select:focus { border-color: var(--gold); box-shadow: 0 0 0 .2rem rgba(212,160,23,.15); }
.field-error { color: var(--danger); font-size: .78rem; margin-top: .25rem; }

.modal-content { border: none; border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.modal-header { border-bottom: 1px solid var(--line); }
.modal-title { font-weight: 800; color: var(--navy); }

/* Utility */
.cursor-pointer { cursor: pointer; }
.divider { height: 1px; background: var(--line); margin: 1rem 0; }
