:root {
    --sg-primary: #4f46e5;
    --sg-primary-dark: #4338ca;
    --sg-primary-light: #eef2ff;
    --sg-bg: #f4f5fa;
    --sg-text-muted: #6b7280;
    --sg-border: #e5e7eb;
    --sg-radius: 0.85rem;

    /* Accent palette for multi-color marketing sections */
    --sg-accent-1: #4f46e5; /* indigo */
    --sg-accent-2: #0d9488; /* teal */
    --sg-accent-3: #ea580c; /* orange */
    --sg-accent-4: #db2777; /* pink */
    --sg-accent-5: #ca8a04; /* gold */
    --sg-accent-6: #16a34a; /* green */
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--sg-bg);
    color: #1f2430;
    -webkit-tap-highlight-color: transparent;
    /* Blocks Chrome's own pull-to-refresh/rubber-band bounce at the top
       and bottom of the page - that bounce is one of the strongest
       "this is just a browser tab" tells on mobile. */
    overscroll-behavior-y: contain;
}

/* Faster/native-feeling taps inside the WebView wrapper - removes the
   ~300ms delayed-tap browsers use to detect double-tap-to-zoom. */
a, button, .btn, input, select, textarea {
    touch-action: manipulation;
}

/* Bootstrap's default focus ring is a fixed blue regardless of the
   site's configured theme color (admin/settings) - swap it for the
   actual brand color so form fields don't visually clash with it. */
.form-control:focus,
.form-select:focus {
    border-color: var(--sg-primary);
    box-shadow: 0 0 0 .2rem var(--sg-primary-light);
}

/* A small tap-down scale gives buttons real physical feedback instead
   of the flat, instant state-change that reads as "just a web page". */
.btn {
    transition: transform .08s ease, box-shadow .08s ease;
}
.btn:active {
    transform: scale(0.97);
}

/* Navbar (light, RCM-style: white bar, colored brand text, pill CTA buttons) */
.navbar.sg-navbar {
    background: #ffffff;
    box-shadow: 0 2px 12px rgba(16, 24, 40, 0.08);
    padding-top: 0;
    padding-bottom: 0;
}
.sg-navbar .container {
    min-height: 72px;
}
.sg-navbar .navbar-brand {
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--sg-primary-dark);
}
.sg-navbar .navbar-brand img {
    border-radius: .35rem;
}
.sg-navbar .navbar-brand i {
    margin-right: 0.4rem;
}
.sg-navbar .nav-link {
    font-weight: 500;
    color: #374151;
}
.sg-navbar .nav-link:hover {
    color: var(--sg-primary);
}
/* Many top-level items (8 pages): keep them on one line, compact, no wrap */
@media (min-width: 992px) {
    .sg-navbar .container {
        max-width: 100%;
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
    .sg-nav-main .nav-link {
        white-space: nowrap;
        padding-left: .6rem;
        padding-right: .6rem;
        font-size: .92rem;
    }
    .sg-navbar .navbar-brand {
        white-space: nowrap;
        font-size: 1.15rem;
    }
}
.sg-navbar .navbar-toggler {
    border-color: var(--sg-border);
}

/* Dark navbar variant (admin-selectable via Settings > Site Appearance) */
.sg-navbar.sg-navbar-dark {
    background: linear-gradient(90deg, var(--sg-primary) 0%, var(--sg-primary-dark) 100%);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}
.sg-navbar.sg-navbar-dark .navbar-brand {
    color: #fff;
}
.sg-navbar.sg-navbar-dark .nav-link {
    color: rgba(255, 255, 255, .85);
}
.sg-navbar.sg-navbar-dark .nav-link:hover {
    color: #fff;
}
.sg-navbar.sg-navbar-dark .text-muted {
    color: rgba(255, 255, 255, .75) !important;
}
.sg-navbar.sg-navbar-dark .btn-outline-primary {
    color: #fff;
    border-color: #fff;
}
.sg-navbar.sg-navbar-dark .btn-outline-primary:hover {
    background: #fff;
    color: var(--sg-primary-dark);
}

/* Admin Site Appearance color-preset swatches */
.sg-preset-swatch {
    display: inline-flex;
    align-items: center;
}

/* Cards */
.card {
    border: 1px solid #e2e5ea;
    border-radius: var(--sg-radius);
    box-shadow: 0 4px 12px rgba(16, 24, 40, 0.08), 0 2px 4px rgba(16, 24, 40, 0.05);
}
a.card-link-tile {
    text-decoration: none;
    color: inherit;
}
a.card-link-tile .card {
    transition: transform .15s ease, box-shadow .15s ease;
    border-top: 3px solid var(--sg-primary);
}
a.card-link-tile:hover .card {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.15);
}
a.card-link-tile .card-body {
    text-align: center;
}
a.card-link-tile i {
    font-size: 1.75rem;
    color: var(--sg-primary);
    margin-bottom: .5rem;
    display: block;
}

/* Page header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    margin-bottom: 1.75rem;
}
.page-header h3 {
    margin: 0;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: .55rem;
}
.page-header h3 i {
    color: var(--sg-primary);
}

/* Stat tiles */
.stat-tile .card-body {
    padding: 1.25rem;
}
.stat-tile .stat-label {
    text-transform: uppercase;
    font-size: .72rem;
    letter-spacing: .05em;
    color: var(--sg-text-muted);
    font-weight: 600;
}
.stat-tile .stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1f2430;
}

/* Tables */
.table thead th {
    text-transform: uppercase;
    font-size: .72rem;
    letter-spacing: .04em;
    color: var(--sg-text-muted);
    border-bottom: 2px solid var(--sg-border);
    background: #fafafe;
    font-weight: 700;
}
.table td, .table th {
    vertical-align: middle;
}
.table-hover tbody tr:hover {
    background-color: var(--sg-primary-light);
}

/* Badges */
.badge {
    font-weight: 600;
    padding: .4em .75em;
    border-radius: 50rem;
}

/* Buttons */
.btn {
    border-radius: .55rem;
    font-weight: 600;
}
.btn-primary {
    background-color: var(--sg-primary);
    border-color: var(--sg-primary);
}
.btn-primary:hover, .btn-primary:focus {
    background-color: var(--sg-primary-dark);
    border-color: var(--sg-primary-dark);
}
.btn-outline-secondary {
    border-color: var(--sg-border);
    color: #374151;
}

/* Auth / centered form cards (Login, Register, Forgot/Reset Password) */
.auth-page {
    min-height: calc(100vh - 3rem);
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top, var(--sg-primary-light) 0%, var(--sg-bg) 60%);
}
.auth-logo {
    display: block;
    height: 64px;
    width: auto;
    margin: 0 auto 1.25rem;
}
.auth-card {
    border: none;
    border-radius: 1.1rem;
    box-shadow: 0 12px 32px rgba(16, 24, 40, 0.12);
    overflow: hidden;
}
.auth-card::before {
    content: '';
    display: block;
    height: 6px;
    background: linear-gradient(90deg, var(--sg-primary) 0%, var(--sg-primary-dark) 100%);
}
.auth-card .card-title {
    font-weight: 700;
    text-align: center;
}
.auth-card .form-label {
    font-weight: 600;
    font-size: .85rem;
    color: #374151;
}
.auth-card .form-control {
    padding: .65rem .9rem;
    border-radius: .6rem;
}
.auth-card .btn-primary {
    padding: .7rem;
    border-radius: .65rem;
}

/* Hero */
.hero-panel {
    background: linear-gradient(135deg, var(--sg-primary-light) 0%, #ffffff 100%);
    border-radius: var(--sg-radius);
}

/* Hero carousel (light background, so default white Bootstrap controls
   need dark, filled circles to stay visible) */
.sg-hero-carousel .carousel-inner {
    border-radius: var(--sg-radius);
}
.sg-hero-carousel .carousel-control-prev,
.sg-hero-carousel .carousel-control-next {
    width: 4%;
    opacity: 1;
}
.sg-carousel-icon {
    background-color: var(--sg-primary);
    border-radius: 50%;
    padding: 1.1rem;
    background-size: 55%;
}
.sg-carousel-indicators button {
    background-color: var(--sg-primary) !important;
    opacity: .35;
    width: 10px !important;
    height: 10px !important;
    border-radius: 50%;
    border: none !important;
}
.sg-carousel-indicators button.active {
    opacity: 1;
}

/* Marketing feature cards (home/about) */
.sg-feature-card {
    border-top: 3px solid var(--sg-primary);
    transition: transform .15s ease, box-shadow .15s ease;
}
.sg-feature-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.15);
}
.sg-feature-card i {
    font-size: 2rem;
    color: var(--sg-primary);
    margin-bottom: .6rem;
    display: block;
}

/* "How it works" step icons */
.sg-step-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--sg-primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
}
.sg-step-icon i {
    font-size: 1.9rem;
    color: var(--sg-primary);
}

/* Large decorative icon (about page) */
.sg-hero-icon {
    font-size: 9rem;
    color: var(--sg-primary-light);
    -webkit-text-stroke: 2px var(--sg-primary);
}

/* Package showcase (homepage) */
.sg-package-card {
    border-top: 4px solid var(--sg-primary);
    text-align: center;
}
.sg-package-card .sg-package-price {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--sg-primary);
}
.sg-package-card .sg-package-gp {
    color: var(--sg-text-muted);
    font-size: .9rem;
}

/* Achievers / testimonials */
.sg-achiever-card {
    text-align: center;
}
.sg-achiever-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--sg-primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto .75rem;
}
.sg-achiever-avatar i {
    font-size: 1.7rem;
    color: var(--sg-primary);
}

/* Multi-color accents: cycle each card/icon through the accent palette
   instead of every section being the same shade of indigo. */
.sg-feature-card:nth-child(1), .sg-package-card:nth-child(1) {}
.sg-accent-1 { border-top-color: var(--sg-accent-1) !important; }
.sg-accent-2 { border-top-color: var(--sg-accent-2) !important; }
.sg-accent-3 { border-top-color: var(--sg-accent-3) !important; }
.sg-accent-4 { border-top-color: var(--sg-accent-4) !important; }
.sg-accent-5 { border-top-color: var(--sg-accent-5) !important; }
.sg-accent-6 { border-top-color: var(--sg-accent-6) !important; }

.sg-feature-card.sg-accent-1 i, .sg-package-card.sg-accent-1 .sg-package-price, .sg-step-icon.sg-accent-1, .sg-achiever-avatar.sg-accent-1 i { color: var(--sg-accent-1); }
.sg-feature-card.sg-accent-2 i, .sg-package-card.sg-accent-2 .sg-package-price, .sg-step-icon.sg-accent-2, .sg-achiever-avatar.sg-accent-2 i { color: var(--sg-accent-2); }
.sg-feature-card.sg-accent-3 i, .sg-package-card.sg-accent-3 .sg-package-price, .sg-step-icon.sg-accent-3, .sg-achiever-avatar.sg-accent-3 i { color: var(--sg-accent-3); }
.sg-feature-card.sg-accent-4 i, .sg-package-card.sg-accent-4 .sg-package-price, .sg-step-icon.sg-accent-4, .sg-achiever-avatar.sg-accent-4 i { color: var(--sg-accent-4); }
.sg-feature-card.sg-accent-5 i, .sg-package-card.sg-accent-5 .sg-package-price, .sg-step-icon.sg-accent-5, .sg-achiever-avatar.sg-accent-5 i { color: var(--sg-accent-5); }
.sg-feature-card.sg-accent-6 i, .sg-package-card.sg-accent-6 .sg-package-price, .sg-step-icon.sg-accent-6, .sg-achiever-avatar.sg-accent-6 i { color: var(--sg-accent-6); }

.sg-step-icon.sg-accent-1 { background: color-mix(in srgb, var(--sg-accent-1) 12%, white); }
.sg-step-icon.sg-accent-2 { background: color-mix(in srgb, var(--sg-accent-2) 12%, white); }
.sg-step-icon.sg-accent-3 { background: color-mix(in srgb, var(--sg-accent-3) 12%, white); }
.sg-achiever-avatar.sg-accent-1 { background: color-mix(in srgb, var(--sg-accent-1) 12%, white); }
.sg-achiever-avatar.sg-accent-2 { background: color-mix(in srgb, var(--sg-accent-2) 12%, white); }
.sg-achiever-avatar.sg-accent-3 { background: color-mix(in srgb, var(--sg-accent-3) 12%, white); }

/* Member advantage checklist (home/benefits) */
.sg-advantage-item {
    background: #fff;
    border-radius: var(--sg-radius);
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.06);
    font-weight: 500;
}

/* Admin product list thumbnails */
.sg-product-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: .4rem;
}
.sg-product-thumb-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--sg-primary-light);
    color: var(--sg-primary);
}
.sg-product-thumb-lg {
    width: 120px;
    height: 120px;
}

/* User-facing repurchase product box/cart grid - "contain" (not "cover")
   so the whole product photo is always visible instead of being cropped
   to fill the box; the light background fills the letterboxed space. */
.sg-product-card-img {
    width: 100%;
    height: 220px;
    object-fit: contain;
    background: #f8f9fa;
    padding: .75rem;
    border-radius: var(--sg-radius) var(--sg-radius) 0 0;
}
.sg-product-card-img-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--sg-primary-light);
    color: var(--sg-primary);
    font-size: 2.5rem;
}
.sg-product-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--sg-primary);
}
.sg-qty-stepper {
    display: flex;
    align-items: stretch;
    gap: .25rem;
}
.sg-qty-stepper .sg-qty-input {
    max-width: 60px;
}
/* Used to be position:sticky, pinned near the bottom of the viewport -
   fine while it was one short row, but once the payment row below had
   to stack (radios/password/button each full-width on a phone, see the
   mobile block further down), a stuck panel that tall ended up covering
   most of the screen while scrolling, burying the actual cart items
   underneath it. Plain in-flow positioning avoids that regardless of
   how tall the panel ends up being. */
.sg-cart-summary {
    /* intentionally static - see comment above */
}

/* On a phone, the cart row's flex children (thumb, info, qty stepper,
   price, remove button) - each with their own min-width - wrap into an
   ugly stack where the price/remove button often end up orphaned alone
   on their own line. Forcing a line break right after the info block
   (a zero-height spacer with flex-basis:100%) pins thumbnail+name on
   their own top row and qty/price/remove together on the row below,
   regardless of how long the product name is. */
@media (max-width: 575.98px) {
    .sg-cart-info {
        min-width: 0;
        flex-basis: calc(100% - 4.5rem);
    }
    .sg-cart-row::after {
        content: "";
        flex-basis: 100%;
        order: 2;
    }
    .sg-qty-stepper {
        order: 3;
    }
    .sg-line-total {
        order: 4;
        flex: 1 1 auto;
        min-width: 0;
        text-align: left;
    }
    .sg-cart-remove {
        order: 5;
    }
    /* The totals line (Items/Delivery/Grand Total as inline spans with
       ms-3 margins) and the payment row (radios + password + button, all
       flex-wrap) both read as a cramped, unevenly-wrapped run of text on
       a narrow screen. Stacking each as its own full-width block/line is
       far more scannable at checkout - the highest-stakes moment on the
       whole site. */
    .sg-cart-summary .d-flex.justify-content-between > div:first-child {
        display: flex;
        flex-direction: column;
        gap: .35rem;
        align-items: flex-start;
    }
    .sg-cart-summary .d-flex.justify-content-between > div:first-child > span {
        margin-left: 0 !important;
    }
    .sg-cart-summary > .d-flex.justify-content-between:last-child {
        flex-direction: column;
        align-items: stretch;
    }
    .sg-cart-summary > .d-flex.justify-content-between:last-child > * {
        width: 100%;
    }
    /* The panel's own p-4 (1.5rem all round) plus every stacked child's
       own margins was most of what made it feel like it "ate the whole
       screen" - tightening both keeps the same information but in
       noticeably less vertical space. */
    .sg-cart-summary.p-4 {
        padding: 1rem !important;
    }
    .sg-cart-summary .mb-3 {
        margin-bottom: .75rem !important;
    }
    .sg-cart-summary .d-flex.gap-3 {
        gap: .5rem !important;
    }
}

/* Store catalog page (repurchase.php) - e-commerce style search/filter/grid */
.sg-category-pill {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .4rem 1rem;
    border-radius: 2rem;
    border: 1px solid #dee2e6;
    background: #fff;
    color: var(--sg-body-color, inherit);
    text-decoration: none;
    font-size: .9rem;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}
.sg-category-pill .badge {
    background: #e9ecef;
    color: #495057;
}
.sg-category-pill:hover {
    border-color: var(--sg-primary);
    color: var(--sg-primary);
}
.sg-category-pill.active {
    background: var(--sg-primary);
    border-color: var(--sg-primary);
    color: #fff;
    font-weight: 600;
}
.sg-category-pill.active .badge {
    background: rgba(255, 255, 255, .25);
    color: #fff;
}
/* "My Profile" page (admin/store/delivery-partner/user) - a consistent
   hero header (big avatar initial, name, code/role subtitle, status
   badge) shared by all four portals rather than each reinventing its own
   layout. */
.sg-profile-hero {
    background: linear-gradient(135deg, var(--sg-admin-accent, var(--sg-primary, #4f46e5)), var(--sg-admin-accent-dark, var(--sg-primary-dark, #4338ca)));
    color: #fff;
    border-radius: var(--sg-radius);
    padding: 1.75rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}
.sg-profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .2);
    color: #fff;
    font-weight: 700;
    font-size: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 3px solid rgba(255, 255, 255, .35);
}
.sg-profile-hero-name {
    font-size: 1.35rem;
    font-weight: 700;
}
.sg-profile-hero-sub {
    opacity: .85;
    font-size: .9rem;
}
.sg-profile-stat {
    text-align: center;
    padding: 0 .75rem;
}
.sg-profile-stat-value {
    font-weight: 700;
    font-size: 1.1rem;
}
.sg-profile-stat-label {
    font-size: .72rem;
    opacity: .85;
    text-transform: uppercase;
    letter-spacing: .03em;
}

/* Delivery partner dashboard's "current delivery" card (Blinkit/Zepto-
   style) - a live embedded map preview above the store/customer details,
   no API key needed since it's the public maps.google.com embed URL. */
.sg-active-delivery-map {
    height: 200px;
    overflow: hidden;
    border-radius: var(--sg-radius) var(--sg-radius) 0 0;
}
.sg-active-delivery-map iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.sg-catalog-empty {
    padding: 3rem 1rem;
    text-align: center;
}

/* Report/list tables (orders, earnings, wallet ledger, etc.) on a phone
   screen either overflow sideways or get truncated mid-column (see the
   "My Orders" table cut off after 3 columns on a real device). Past a
   certain column count there's no width left to give - the fix isn't a
   narrower table, it's not a table at all: each row becomes its own
   stacked "label: value" card, using the header text (via data-label on
   each <td>, added per table) as the label. Opt in per-table with
   class="sg-report-table" since not every table has data-label filled
   in yet. */
@media (max-width: 767.98px) {
    .sg-report-table thead {
        display: none;
    }
    .sg-report-table, .sg-report-table tbody, .sg-report-table tr, .sg-report-table td {
        display: block;
        width: 100%;
    }
    .sg-report-table tr {
        border: 1px solid #e5e7eb;
        border-radius: .5rem;
        margin-bottom: .6rem;
        padding: 0 .75rem;
    }
    .sg-report-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: .75rem;
        text-align: right;
        padding: .35rem 0;
        border: none !important;
        border-bottom: 1px solid #f1f3f5 !important;
    }
    .sg-report-table td:last-child {
        border-bottom: none !important;
    }
    .sg-report-table td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: .8rem;
        color: #6b7280;
        text-align: left;
        flex-shrink: 0;
    }
    .sg-report-table td:not([data-label])::before {
        content: none;
    }
    /* A row with a single full-width message (e.g. "No orders yet.") isn't
       a real data row - let it stay a plain centered block instead of
       getting the label/value split treatment. */
    .sg-report-table td[colspan] {
        text-align: center;
    }
    .sg-report-table td[colspan]::before {
        content: none;
    }
    /* Summary rows (Items Subtotal / Delivery Charge / Grand Total on the
       order detail page) already spell their own label out as the
       colspan cell's text, right-aligned - so unlike a normal data row,
       the pair reads correctly as one flex row (label left, amount
       right) rather than two stacked blocks. */
    /* Grouped into one continuous summary block instead of each line
       floating as its own separate bordered card - a receipt's subtotal/
       delivery/grand-total reads as one connected total, not three
       unrelated rows. */
    .sg-report-table tfoot tr {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: .75rem;
        border: 1px solid #e5e7eb;
        border-top: none;
        border-radius: 0;
        margin-bottom: 0;
    }
    .sg-report-table tfoot tr:first-child {
        border-top: 1px solid #e5e7eb;
        border-radius: .5rem .5rem 0 0;
    }
    .sg-report-table tfoot tr:last-child {
        border-radius: 0 0 .5rem .5rem;
        margin-bottom: .75rem;
    }
    .sg-report-table tfoot td[colspan] {
        text-align: left;
        width: auto;
        flex: 0 1 auto;
    }
    .sg-report-table tfoot td:last-child {
        width: auto;
        flex-shrink: 0;
        margin-left: auto;
    }
}

/* On narrow screens, wrapping the category pills onto their own lines
   (the default flex-wrap behavior) leaves the first "All" pill looking
   oddly stretched and the rest scattered across several short, unevenly
   spaced rows. A single horizontally-scrollable row - the standard
   mobile category-chip pattern - keeps every pill the same natural size
   and lets the user swipe sideways to see the rest instead. */
@media (max-width: 767.98px) {
    #sgCategoryFilter {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: .25rem;
        scrollbar-width: none;
    }
    #sgCategoryFilter::-webkit-scrollbar {
        display: none;
    }
    #sgCategoryFilter .sg-category-pill {
        flex-shrink: 0;
        white-space: nowrap;
    }
}

/* Catalog page font-size preference (small/medium/large) - scales the
   product name/price/details text via a CSS variable rather than relying
   on inherited font-size, since Bootstrap sizes several of these
   elements (headings, .small) in rem, which doesn't cascade from a
   parent's font-size. */
#sgFontSizeControl .sg-font-size-btn.active {
    background: var(--sg-primary);
    border-color: var(--sg-primary);
    color: #fff;
}
.sg-font-small { --sg-font-scale: 0.85; }
.sg-font-medium { --sg-font-scale: 1; }
.sg-font-large { --sg-font-scale: 1.2; }

#sgCatalogWrapper .sg-category-pill,
#sgCatalogWrapper #sgProductSearch,
#sgCatalogWrapper #sgResultCount,
#sgCatalogWrapper #sgSortSelect {
    font-size: calc(0.9rem * var(--sg-font-scale));
}
#sgCatalogWrapper .card-title {
    font-size: calc(1rem * var(--sg-font-scale));
}
#sgCatalogWrapper .card-body p,
#sgCatalogWrapper .card-body .text-muted.small,
#sgCatalogWrapper .card-body .small {
    font-size: calc(0.875rem * var(--sg-font-scale));
}
#sgCatalogWrapper .sg-product-price {
    font-size: calc(1.3rem * var(--sg-font-scale));
}
.sg-gallery-thumb {
    border: 2px solid transparent;
}
.sg-gallery-thumb.active {
    border-color: var(--sg-primary);
}

/* Store photo banner on the customer catalog page (repurchase.php) */
.sg-store-banner {
    height: 160px;
    background-size: cover;
    background-position: center;
    border-radius: var(--sg-radius);
    overflow: hidden;
    position: relative;
}
.sg-store-banner-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    padding: 1rem 1.25rem;
    background: linear-gradient(to top, rgba(0,0,0,.65), rgba(0,0,0,0));
}

/* Add to Cart / Buy Now buttons - distinct roles: Add to Cart is a
   quieter secondary action, Buy Now is the urgent primary one (warm
   accent + shadow), same visual language on both the catalog grid and
   the product detail page. */
.sg-btn-cart, .sg-btn-buynow {
    padding: .55rem 1.25rem;
    font-size: .9rem;
    font-weight: 600;
    letter-spacing: .02em;
    border-radius: .6rem;
    white-space: nowrap;
    min-width: 0;
}
/* Catalog grid cards are narrow, so the compact .btn-sm pair (Add to
   Cart + Buy Now side by side) needs tighter padding/font than the
   full-size product detail page buttons, otherwise "Buy Now" overflows
   past the card edge. */
.btn-sm.sg-btn-cart, .btn-sm.sg-btn-buynow {
    padding: .4rem .6rem;
    font-size: .8rem;
    letter-spacing: 0;
}
.sg-btn-cart {
    background: #fff;
    border: 1.5px solid var(--sg-primary);
    color: var(--sg-primary);
    transition: background .15s ease, color .15s ease, box-shadow .15s ease, transform .1s ease;
}
.sg-btn-cart:hover:not(:disabled) {
    background: var(--sg-primary);
    color: #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, .12);
    transform: translateY(-1px);
}
.sg-btn-cart:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: none;
}
.sg-btn-cart:disabled {
    background: #f1f3f5;
    border-color: #dee2e6;
    color: #adb5bd;
}
.sg-btn-buynow {
    background: linear-gradient(135deg, #f97316, #ea580c);
    border: none;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 3px 10px rgba(234, 88, 12, .35);
    transition: transform .1s ease, box-shadow .15s ease, filter .15s ease;
}
.sg-btn-buynow:hover {
    color: #fff;
    box-shadow: 0 6px 16px rgba(234, 88, 12, .45);
    transform: translateY(-1px);
    filter: brightness(1.05);
}
.sg-btn-buynow:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(234, 88, 12, .35);
    filter: brightness(1);
}

/* Footer */
.sg-footer {
    background: #1f2430;
}
.sg-footer-links li {
    margin-bottom: .5rem;
    color: rgba(255, 255, 255, .65);
    font-size: .92rem;
}
.sg-footer-links a {
    color: rgba(255, 255, 255, .65);
    text-decoration: none;
}
.sg-footer-links a:hover {
    color: #fff;
}
.sg-social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .1);
    color: #fff;
    margin-right: .5rem;
    text-decoration: none;
}
.sg-social-icon:hover {
    background: var(--sg-primary);
}

/* Floating WhatsApp-style contact button */
.sg-whatsapp-fab {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #25d366;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .25);
    z-index: 1050;
    text-decoration: none;
}
.sg-whatsapp-fab:hover {
    background: #1ebd59;
    color: #fff;
}

/* Order tracking timeline (Zomato/Blinkit-style step tracker) */
.sg-tracker-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--sg-bg-muted, #e9ecef);
    color: var(--sg-text-muted, #6c757d);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    font-size: 1.1rem;
}
.sg-tracker-dot-done {
    background: var(--sg-primary);
    color: #fff;
}
.sg-order-tracker { position: relative; }

/* On a phone, 5 equal flex-fill columns with no gap leaves adjacent
   labels ("Packed"/"Pickup") touching, and two-word labels ("On the
   Way") wrap and crowd the row below. Shrinking the dot/text and adding
   a small gap between columns keeps every label readable without
   redesigning the layout. */
@media (max-width: 575.98px) {
    .sg-order-tracker {
        gap: .25rem;
    }
    .sg-order-tracker > .flex-fill {
        min-width: 0;
        padding: 0 .15rem;
    }
    .sg-order-tracker .sg-tracker-dot {
        width: 28px;
        height: 28px;
        font-size: .85rem;
    }
    .sg-order-tracker .small.fw-semibold {
        font-size: .68rem;
        line-height: 1.15;
    }
    .sg-order-tracker .small.text-muted {
        font-size: .6rem;
        line-height: 1.15;
    }
}

/* Star rating (display + clickable input) */
.sg-star-display i, .sg-star-input i {
    font-size: 1.4rem;
    margin-right: 4px;
}
.sg-star-input i {
    cursor: pointer;
}

/* Flipkart-style color swatch chip for a product's color variant options -
   shows that variant's own product photo as the thumbnail (falls back to
   a plain named-color box if no image), with a ring highlight when
   selected, rather than a plain text button like weight/size use. */
.sg-variant-swatch {
    cursor: pointer;
}
.sg-variant-swatch-box {
    display: block;
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid #dee2e6;
    box-shadow: inset 0 0 0 2px #fff;
}
.sg-variant-swatch.active .sg-variant-swatch-box {
    border-color: var(--sg-admin-accent, #16a34a);
    box-shadow: inset 0 0 0 2px #fff, 0 0 0 2px var(--sg-admin-accent, #16a34a);
}
.sg-variant-swatch.active .small {
    font-weight: 600;
    color: var(--sg-admin-accent, #16a34a) !important;
}
