/* ===================================================================
   Hamro Grocery storefront (2026 redesign): warm cream page, red and
   orange from the logo, flag-shaped deal tags, big shelf prices.
   Loaded after brand.css and layout.css by Views/Shared/_Layout.cshtml
   only, so admin and sign-in pages keep their look.
   =================================================================== */

:root {
    --hg-font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --hg-red: #c4122f;
    --hg-red-dark: #a30f27;
    --hg-red-soft: #fde8ec;
    --hg-orange: #f07f1a;
    --hg-orange-soft: #fff1e4;
    --hg-orange-line: #f6d7ba;
    --hg-ink: #2a1a14;
    --hg-muted: #6e5b52;
    --hg-bg: #fbf6f1;
    --hg-sunken: #f6eee7;
    --hg-line: #efe4db;
    --hg-footer: #2a1a14;
    --hg-radius: 12px;
    --hg-radius-lg: 20px;
    --bs-primary: var(--hg-red);
    --bs-primary-rgb: 196, 18, 47;
    --bs-body-font-family: var(--hg-font);
    --bs-body-color: var(--hg-ink);
    --bs-body-bg: var(--hg-bg);
    --bs-border-color: var(--hg-line);
}

body {
    background: var(--hg-bg);
    font-family: var(--hg-font);
    color: var(--hg-ink);
}

.container {
    max-width: 1360px;
}

h1, h2, h3, h4 {
    font-weight: 800;
    letter-spacing: -0.01em;
}

/* ---- Header ---- */

.hg-header {
    border-bottom: 1px solid var(--hg-line);
}

.hg-header-inner {
    min-height: 80px;
    gap: 20px;
}

.hg-brand span {
    font-weight: 800;
    letter-spacing: -0.02em;
}

.hg-brand img {
    border-radius: 12px;
}

.hg-brand-hamro {
    color: var(--hg-red);
}

.hg-brand-grocery {
    color: #e0700f;
}

.hg-search input {
    height: 50px;
    border-radius: 14px;
    border-color: transparent;
    background: var(--hg-sunken);
    padding-left: 46px;
    font-size: 15px;
}

.hg-search button {
    left: 6px;
    right: auto;
    top: 7px;
    color: var(--hg-muted);
}

.hg-nav {
    gap: 18px;
}

    .hg-nav > a,
    .hg-nav .hg-nav-link {
        font-weight: 600;
    }

/* Pickup / delivery chooser */
.hg-fulfil {
    position: relative;
    flex: none;
}

    .hg-fulfil > summary {
        list-style: none;
        display: flex;
        align-items: center;
        gap: 10px;
        min-height: 50px;
        padding: 6px 14px;
        border-radius: 14px;
        border: 1px solid var(--hg-orange-line);
        background: var(--hg-orange-soft);
        cursor: pointer;
        line-height: 1.25;
    }

        .hg-fulfil > summary::-webkit-details-marker {
            display: none;
        }

        .hg-fulfil > summary i {
            color: #b4560a;
            font-size: 18px;
        }

.hg-fulfil-text {
    display: flex;
    flex-direction: column;
}

    .hg-fulfil-text small {
        color: var(--hg-muted);
        font-size: 12px;
    }

    .hg-fulfil-text strong {
        font-size: 14px;
    }

.hg-fulfil-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 280px;
    padding: 12px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid var(--hg-line);
    box-shadow: 0 16px 40px rgba(42, 26, 20, 0.14);
    z-index: 1060;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

    .hg-fulfil-panel button {
        display: flex;
        align-items: center;
        gap: 12px;
        min-height: 56px;
        padding: 8px 12px;
        border-radius: 12px;
        border: 1px solid var(--hg-line);
        background: #fff;
        text-align: left;
        font: inherit;
        color: var(--hg-ink);
    }

        .hg-fulfil-panel button[aria-pressed="true"] {
            border-color: var(--hg-red);
            background: var(--hg-red-soft);
        }

        .hg-fulfil-panel button span {
            display: flex;
            flex-direction: column;
        }

        .hg-fulfil-panel button small {
            color: var(--hg-muted);
        }

/* Cart button: red, with the total */
.hg-cart-btn {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 50px;
    padding: 0 16px;
    border-radius: 14px;
    background: var(--hg-red);
    color: #fff !important;
    font-weight: 700;
    text-decoration: none !important;
}

    .hg-cart-btn:hover {
        background: var(--hg-red-dark);
    }

    .hg-cart-btn .hg-count {
        min-width: 22px;
        height: 22px;
        padding: 0 6px;
        border-radius: 999px;
        background: #fff;
        color: var(--hg-red);
        font-size: 12px;
        display: inline-grid;
        place-items: center;
    }

/* Department bar: pills, Specials first in red */
.hg-catbar-inner {
    gap: 4px;
    height: 54px;
    align-items: center;
}

    .hg-catbar-inner a {
        height: 38px;
        padding: 0 14px;
        border-radius: 10px;
        color: var(--hg-ink);
        font-weight: 600;
    }

        .hg-catbar-inner a:hover {
            background: var(--hg-sunken);
        }

        .hg-catbar-inner a.active {
            box-shadow: none;
            background: var(--hg-sunken);
            color: var(--hg-red);
        }

        .hg-catbar-inner a.hg-specials {
            background: var(--hg-red);
            color: #fff;
        }

/* ---- Product cards (Views/Shared/_ProductCard.cshtml) ---- */

.hg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

/* Home page rails: exactly five across on a wide screen */
.hg-grid.is-rail {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.hg-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px;
    background: #fff;
    border: 1px solid var(--hg-line);
    border-radius: var(--hg-radius-lg);
    height: 100%;
}

.hg-card-top {
    min-height: 26px;
    display: flex;
    align-items: flex-start;
}

.hg-tag {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.03em;
    padding: 5px 16px 5px 10px;
    clip-path: polygon(0 0, 100% 0, 88% 50%, 100% 100%, 0 100%);
    background: var(--hg-ink);
    color: #fff;
}

    .hg-tag.is-half {
        background: var(--hg-red);
    }

    .hg-tag.is-multi {
        background: var(--hg-orange);
        color: var(--hg-ink);
    }

.hg-card-image {
    display: grid;
    place-items: center;
    height: 150px;
    border-radius: 14px;
    background: var(--hg-bg);
    overflow: hidden;
}

    .hg-card-image img {
        max-width: 90%;
        max-height: 90%;
        object-fit: contain;
        mix-blend-mode: multiply;
    }

.hg-card-name {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    min-height: 40px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

    .hg-card-name a {
        color: var(--hg-ink);
    }

.hg-price {
    display: flex;
    align-items: flex-start;
    line-height: 1;
    font-weight: 800;
}

.hg-price-sign,
.hg-price-cents {
    font-size: 16px;
    margin-top: 4px;
}

.hg-price-dollars {
    font-size: 34px;
    letter-spacing: -0.02em;
}

.hg-price-unit {
    margin-left: auto;
    align-self: flex-end;
    font-size: 12px;
    font-weight: 500;
    color: var(--hg-muted);
}

.hg-was {
    font-size: 13px;
    font-weight: 700;
    color: var(--hg-red-dark);
}

.hg-offer {
    align-self: flex-start;
    font-size: 13px;
    font-weight: 800;
    padding: 5px 10px;
    border-radius: 8px;
    background: #ffe7cf;
}

.hg-add {
    margin-top: auto;
    height: 46px;
    border: 0;
    border-radius: 12px;
    background: var(--hg-red);
    color: #fff;
    font: inherit;
    font-weight: 700;
}

    .hg-add:hover:not(:disabled) {
        background: var(--hg-red-dark);
    }

    .hg-add:disabled {
        background: var(--hg-sunken);
        color: var(--hg-muted);
    }

/* ---- Home page (Views/Home/Index.cshtml) ---- */

.hg-home {
    display: flex;
    flex-direction: column;
    gap: 40px;
    padding-top: 28px;
    padding-bottom: 56px;
}

.hg-home-hero {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 20px;
}

.hg-banner {
    position: relative;
    overflow: hidden;
    min-height: 280px;
    padding: 40px;
    border-radius: 24px;
    background: var(--hg-red);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
}

    .hg-banner::before,
    .hg-banner::after {
        content: "";
        position: absolute;
        border-radius: 50%;
    }

    .hg-banner::before {
        right: -60px;
        top: -60px;
        width: 320px;
        height: 320px;
        background: #e0700f;
    }

    .hg-banner::after {
        right: 60px;
        bottom: -90px;
        width: 220px;
        height: 220px;
        background: #f6b26b;
    }

    .hg-banner > * {
        position: relative;
        z-index: 1;
        max-width: 520px;
    }

    .hg-banner h1 {
        margin: 0;
        color: #fff;
        font-size: 44px;
        line-height: 1.05;
    }

    .hg-banner p {
        margin: 0;
        font-size: 17px;
        color: #ffe3e8;
    }

.hg-pill {
    align-self: flex-start;
    padding: 6px 12px;
    border-radius: 999px;
    background: #fff;
    color: var(--hg-red);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.hg-btn-light {
    align-self: flex-start;
    padding: 14px 22px;
    border-radius: 12px;
    background: #fff;
    color: var(--hg-ink) !important;
    font-weight: 700;
    text-decoration: none !important;
}

.hg-side {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.hg-panel {
    padding: 24px;
    border-radius: 24px;
    background: #fff;
    border: 1px solid var(--hg-line);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

    .hg-panel.is-warm {
        background: var(--hg-orange-soft);
        border-color: var(--hg-orange-line);
        flex-direction: row;
        align-items: center;
        gap: 16px;
    }

.hg-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 800;
    font-size: 18px;
}

    .hg-panel-head a {
        font-size: 14px;
        font-weight: 700;
    }

.hg-points {
    font-size: 36px;
    font-weight: 800;
}

.hg-muted {
    color: var(--hg-muted);
    font-size: 14px;
}

.hg-tiles {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 16px;
}

.hg-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px 12px;
    border-radius: 20px;
    background: #fff;
    border: 1px solid var(--hg-line);
    color: var(--hg-ink) !important;
    font-weight: 700;
    text-align: center;
    text-decoration: none !important;
}

    .hg-tile:hover {
        border-color: var(--hg-red);
    }

.hg-tile-mark {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    font-size: 24px;
    background: var(--hg-sunken);
    color: var(--hg-ink);
    overflow: hidden;
}

    .hg-tile-mark img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .hg-tile-mark.is-red {
        background: var(--hg-red);
        color: #fff;
    }

    .hg-tile-mark.is-orange {
        background: #ffe7cf;
    }

.hg-rail-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

    .hg-rail-head h2 {
        margin: 0;
        font-size: 26px;
    }

    .hg-rail-head a {
        font-weight: 700;
    }

/* ---- Phone cart bar ---- */

.hg-cartbar {
    display: none;
}

.hg-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    z-index: 2000;
    padding: 12px 18px;
    border-radius: 12px;
    background: var(--hg-ink);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 12px 30px rgba(42, 26, 20, 0.25);
}

    .hg-toast.is-error {
        background: var(--hg-red-dark);
    }

/* ---- Footer ---- */

.hg-footer {
    background: var(--hg-footer);
}

/* ---- Smaller screens ---- */

@media (max-width: 1199.98px) {
    .hg-grid.is-rail {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .hg-tiles {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .hg-grid.is-rail {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .hg-home-hero {
        grid-template-columns: 1fr;
    }

    /* Row 1: logo, cart, menu. Row 2: search. Row 3: pickup / delivery. */
    .hg-header-inner {
        min-height: 0;
        height: auto;
    }

    .hg-brand {
        order: 1;
        margin-right: auto;
    }

    .hg-cart-btn {
        order: 2;
        height: 44px;
    }

    .hg-menu-toggle {
        order: 3;
    }

    .hg-search {
        order: 4;
    }

    .hg-fulfil {
        order: 5;
        flex-basis: 100%;
    }

    .hg-nav {
        order: 6;
    }

    .hg-fulfil-text small {
        display: none;
    }
}

@media (max-width: 767.98px) {
    .hg-grid,
    .hg-grid.is-rail {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .hg-card {
        padding: 10px;
        border-radius: 16px;
    }

    .hg-card-image {
        height: 110px;
    }

    .hg-price-dollars {
        font-size: 26px;
    }

    .hg-tiles {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
    }

    .hg-tile {
        padding: 14px 6px;
        font-size: 13px;
    }

    .hg-tile-mark {
        width: 52px;
        height: 52px;
    }

    .hg-banner {
        padding: 28px 22px;
        min-height: 220px;
    }

        .hg-banner h1 {
            font-size: 32px;
        }

        .hg-banner::before {
            width: 180px;
            height: 180px;
            right: -90px;
            top: -90px;
        }

        .hg-banner::after {
            display: none;
        }

    .hg-fulfil > summary {
        min-height: 44px;
        padding: 4px 10px;
    }

    .hg-fulfil-panel {
        right: auto;
        left: 0;
    }

    /* Phone: a red "View cart" bar along the bottom, like the app */
    .hg-cartbar:not([hidden]) {
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: 12px;
        z-index: 1040;
        display: flex;
        align-items: center;
        gap: 12px;
        height: 56px;
        padding: 0 16px;
        border-radius: 16px;
        background: var(--hg-red);
        color: #fff !important;
        font-weight: 700;
        text-decoration: none !important;
        box-shadow: 0 10px 30px rgba(196, 18, 47, 0.35);
    }

        .hg-cartbar .hg-count {
            min-width: 30px;
            height: 30px;
            border-radius: 10px;
            background: #fff;
            color: var(--hg-red);
            display: grid;
            place-items: center;
        }

        .hg-cartbar span:nth-child(2) {
            flex: 1;
        }

    main {
        padding-bottom: 80px;
    }

    .hg-toast {
        bottom: 84px;
    }
}
