/* Keys Gun Shop interior pages (Brad 12/3: "make sure we have taken care of the interior pages as well per the rule"; design rule
   11/23: every interior page in the homepage's look, and a page that lists products gets its own hero art of what it sells).

   Banners: the homepage's misty sunrise fields with a weathered bench in front, and Keys' own recent best sellers on it, rendered
   from their catalog photos (tgd-cs/keys-interior-20261203: bench_b1.jpg, gen_pages.php, r_*.jpg, final/). Fixed 4:1 band inside
   the page width, the whole picture always visible; the title is the page's own H1 on the open field at the left. Phones (600 px
   and under): the product half of the picture on top, the title under it.
   Pages are found by their own markup (RAKD method): the hidden "cat" field of the in-page search, the canonical link for Deals,
   the rebates page's own header. Any other listing page (a sub category, a brand, a search) gets the bench without products.
   Also here: the menu bar, filter chips, product page Add to Cart, breadcrumbs and the Rebates header in the homepage palette
   (ink #141714, green #2E5F00, cream #f6f4ee). Store file, never released. */

/* ---------- menu bar: ink instead of slate ---------- */
html body header nav.main-nav, html body nav.main-nav { background: linear-gradient(180deg, #232a21 0%, #141714 100%) !important; }
html body nav.main-nav a:hover, html body nav.main-nav a:focus-visible { background-color: #2E5F00 !important; color: #fff !important; }

/* ---------- listing page banners ---------- */
html body section.content-page > .container > h1:first-child,
html body section.category-header > .container > h1:first-child,
html body main.rebates-page .page-header {
    --kp: url('../images/keys-pages/page-scene-2400.webp'); --kp-phone: url('../images/keys-pages/page-scene-phone.webp');
}
html body section.content-page > .container > h1:first-child,
html body section.category-header > .container > h1:first-child {
    box-sizing: border-box !important;
    aspect-ratio: 4 / 1; width: 100% !important; height: auto !important; min-height: 0 !important; margin: 4px 0 18px !important;
    display: flex !important; align-items: center !important; justify-content: flex-start !important;
    padding: 0 0 0 clamp(20px, 4vw, 56px) !important; border-radius: 10px; overflow: hidden;
    background: var(--kp) center / 100% 100% no-repeat, #6f7a5a !important;
    font-family: Oswald, 'Arial Narrow', Arial, sans-serif !important; font-weight: 700 !important;
    font-size: clamp(26px, 3.4vw, 54px) !important; line-height: 1 !important; text-align: left !important;
    text-transform: uppercase; letter-spacing: .01em !important; color: #fff !important;
    text-shadow: 0 2px 3px rgba(0,0,0,.55), 0 0 22px rgba(0,0,0,.55);
}

/* each department: its own picture (2400 px band; the phone picture is the product half) */
html body section.content-page:has(input[type="hidden"][name="cat"][value="firearms"]) > .container > h1:first-child {
    --kp: url('../images/keys-pages/page-firearms-2400.webp'); --kp-phone: url('../images/keys-pages/page-firearms-phone.webp'); }
html body section.content-page:has(input[type="hidden"][name="cat"][value="handguns"]) > .container > h1:first-child {
    --kp: url('../images/keys-pages/page-handguns-2400.webp'); --kp-phone: url('../images/keys-pages/page-handguns-phone.webp'); }
html body section.content-page:has(input[type="hidden"][name="cat"][value="rifles"]) > .container > h1:first-child {
    --kp: url('../images/keys-pages/page-rifles-2400.webp'); --kp-phone: url('../images/keys-pages/page-rifles-phone.webp'); }
html body section.content-page:has(input[type="hidden"][name="cat"][value="shotguns"]) > .container > h1:first-child {
    --kp: url('../images/keys-pages/page-shotguns-2400.webp'); --kp-phone: url('../images/keys-pages/page-shotguns-phone.webp'); }
html body section.content-page:has(input[type="hidden"][name="cat"][value="nfa"], input[type="hidden"][name="cat"][value="silencers"],
    input[type="hidden"][name="cat"][value="suppressed-firearms"]) > .container > h1:first-child {
    --kp: url('../images/keys-pages/page-nfa-2400.webp'); --kp-phone: url('../images/keys-pages/page-nfa-phone.webp'); }
html body section.content-page:has(input[type="hidden"][name="cat"][value="ammunition"]) > .container > h1:first-child {
    --kp: url('../images/keys-pages/page-ammo-2400.webp'); --kp-phone: url('../images/keys-pages/page-ammo-phone.webp'); }
html body section.content-page:has(input[type="hidden"][name="cat"][value="optics"], input[type="hidden"][name="cat"][value="scopes"],
    input[type="hidden"][name="cat"][value="red-dots-holo-sights"], input[type="hidden"][name="cat"][value="night-vision"],
    input[type="hidden"][name="cat"][value="thermal-optics"], input[type="hidden"][name="cat"][value="laser-sights"],
    input[type="hidden"][name="cat"][value="gun-sights"], input[type="hidden"][name="cat"][value="scope-rings"],
    input[type="hidden"][name="cat"][value="scope-bases"], input[type="hidden"][name="cat"][value="spotting-scopes"]) > .container > h1:first-child {
    --kp: url('../images/keys-pages/page-optics-2400.webp'); --kp-phone: url('../images/keys-pages/page-optics-phone.webp'); }
html body section.content-page:has(input[type="hidden"][name="cat"][value="parts"], input[type="hidden"][name="cat"][value="ar_parts"],
    input[type="hidden"][name="cat"][value="ak_parts"], input[type="hidden"][name="cat"][value="glock_parts"],
    input[type="hidden"][name="cat"][value="1911_parts"], input[type="hidden"][name="cat"][value="shooting_gear"]) > .container > h1:first-child {
    --kp: url('../images/keys-pages/page-parts-2400.webp'); --kp-phone: url('../images/keys-pages/page-parts-phone.webp'); }
html:has(link[rel="canonical"][href$="/deals"]) body section.content-page > .container > h1:first-child {
    --kp: url('../images/keys-pages/page-deals-2400.webp'); --kp-phone: url('../images/keys-pages/page-deals-phone.webp'); }

/* ---------- Rebates page: the bench banner instead of the slate box ---------- */
html body main.rebates-page .page-header {
    aspect-ratio: 4 / 1; display: flex !important; flex-direction: column; justify-content: center; align-items: flex-start;
    padding: 0 clamp(20px, 4vw, 56px) !important; border-radius: 10px; border: 0 !important; box-shadow: none !important;
    background: var(--kp) center / 100% 100% no-repeat, #6f7a5a !important; text-align: left !important;
}
html body main.rebates-page .page-header h1 {
    font-family: Oswald, 'Arial Narrow', Arial, sans-serif !important; font-size: clamp(26px, 3.4vw, 54px) !important; line-height: 1 !important;
    text-transform: uppercase; color: #fff !important; text-shadow: 0 2px 3px rgba(0,0,0,.55), 0 0 22px rgba(0,0,0,.55); margin: 0 0 8px !important;
}
html body main.rebates-page .page-header p { color: #fff !important; font-size: clamp(14px, 1.2vw, 17px) !important; max-width: 520px;
    text-shadow: 0 1px 2px rgba(0,0,0,.7), 0 0 14px rgba(0,0,0,.5); margin: 0 !important; }

/* ---------- phones: the products on top, the title under it ---------- */
@media (max-width: 600px) {
    html body section.content-page > .container > h1:first-child,
    html body section.category-header > .container > h1:first-child {
        aspect-ratio: auto; display: block !important; border-radius: 8px;
        padding: calc(100% / 2.32 + 12px) 2px 0 !important;
        background: var(--kp-phone) top center / 100% auto no-repeat, transparent !important;
        color: #141714 !important; text-shadow: none; font-size: 28px !important; text-align: left !important;
    }
    html body main.rebates-page .page-header {
        aspect-ratio: auto; padding: calc(100% / 2.32 + 12px) 2px 4px !important;
        background: var(--kp-phone) top center / 100% auto no-repeat, transparent !important;
    }
    html body main.rebates-page .page-header h1, html body main.rebates-page .page-header p { color: #141714 !important; text-shadow: none; }
}

/* ---------- palette on the rest of the interior ---------- */
html body .search-cat-chips .cat-chip { color: #2E5F00 !important; border-color: #cfd8c2 !important; background: #fff !important; }
html body .search-cat-chips .cat-chip:hover, html body .search-cat-chips .cat-chip.active { background: #2E5F00 !important; color: #fff !important; border-color: #2E5F00 !important; }
html body .add-to-cart-btn { background: #2E5F00 !important; border-color: #2E5F00 !important; color: #fff !important; }
html body .add-to-cart-btn:hover, html body .add-to-cart-btn:focus-visible { background: #244a00 !important; }
html body .breadcrumb a, html body nav[aria-label="Breadcrumb"] a, html body .breadcrumbs a { color: #2E5F00 !important; }

/* second pass (12/3): the platform's own chip, link and sticky bar colours win over plain selectors */
html body main .search-cat-chips a.cat-chip, html body .search-cat-chips a.cat-chip:visited { color: #2E5F00 !important; border-color: #cfd8c2 !important; }
html body main .search-cat-chips a.cat-chip:hover, html body main .search-cat-chips a.cat-chip.active { background: #2E5F00 !important; color: #fff !important; }
html body .product-breadcrumb a, html body a.shop-brand-link { color: #2E5F00 !important; }
html body a[href$="/caliber"][style] { background: #141714 !important; border-color: #141714 !important; }
html body [class*="sticky"] .add-to-cart-btn, html body [class*="sticky"] button[class*="cart"], html body [class*="mobile-cart-bar"] button { background: #2E5F00 !important; border-color: #2E5F00 !important; color: #fff !important; }
/* the platform's ".content-page a:not(.btn):not([class*=btn-])" (#ff6b35, 3 classes) out-ranks the rules above: 4 classes here */
html body section.content-page .search-cat-chips a.cat-chip.cat-chip:not(.active) { color: #2E5F00 !important; }
html body section.content-page .search-cat-chips a.cat-chip.cat-chip:hover, html body section.content-page .search-cat-chips a.cat-chip.cat-chip.active { color: #fff !important; background: #2E5F00 !important; border-color: #2E5F00 !important; }
html body .pdp-stickybar .psb-btn { background: #2E5F00 !important; border-color: #2E5F00 !important; color: #fff !important; }

/* 769 to 1179 px: the eight menu items fit on one row (REBATES used to drop to a second row at 1024; width sweep 12/3) */
@media (min-width:769px) and (max-width:1179px){ html body nav.main-nav a.nav-link, html body nav.main-nav > ul > li > a { padding-left:10px !important; padding-right:10px !important; letter-spacing:0 !important; font-size:13px !important; } }
