/* Small site-wide layout fixes (header, mobile menu, language button, checkout width). */

@media (min-width: 768px) {
    /* Header, menu bar and breadcrumb use the same 1240px width as the page content. */
    .site-header > .col-full,
    .storefront-primary-navigation > .col-full,
    .storefront-breadcrumb > .col-full {
        max-width: 1240px !important;
        margin-left: auto !important;
        margin-right: auto !important;
        box-sizing: border-box !important;
    }
    .storefront-primary-navigation > .col-full,
    .storefront-breadcrumb > .col-full {
        padding-left: 24px !important;
        padding-right: 24px !important;
    }
    /* The theme's clearfix pseudo-elements and the empty secondary menu were being
       laid out as flex items, which pushed the logo away from the left edge. */
    .site-header > .col-full::before,
    .site-header > .col-full::after { content: none !important; display: none !important; }
    .site-header > .col-full > .secondary-navigation { display: none !important; }
    .site-header > .col-full > .site-branding { margin-right: auto !important; }

    /* Mega menu: never taller than the screen. */
    #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item > ul.mega-sub-menu {
        max-height: calc(100vh - 270px);
        overflow-y: auto;
        overscroll-behavior: contain;
    }
}

@media (max-width: 767px) {
    /* One menu button on phones: keep the mega-menu toggle, hide the theme's second one. */
    .main-navigation button.menu-toggle,
    .main-navigation .handheld-navigation { display: none !important; }
    /* Cart pill stays on the top row instead of floating over the open menu. */
    .storefront-primary-navigation > .col-full { align-items: flex-start !important; }
    /* Language button sits above the bottom bar so it no longer covers the cart icon. */
    #gt_float_wrapper { bottom: 76px !important; }
}

/* Cart and checkout: wider column so the order summary is not squeezed. */
body.woocommerce-checkout .entry-content,
body.woocommerce-cart .entry-content { max-width: 1140px !important; }

/* Page title band when the page body carries the real H1. */
.entry-header p.entry-title { margin-top: 0; margin-bottom: 0; }

/* Photo credit line on catalogue listings. */
.im-photo-credit { margin: 18px 0 0; font-size: 12px; line-height: 1.5; color: #6b7c93; }
.im-photo-credit a { color: inherit; text-decoration: underline; }

/* Blog posts (buying guides): single centred reading column, stronger headings, no shop sidebar. */
body.single-post #secondary,
body.category #secondary { display: none !important; }
body.single-post #primary,
body.category #primary { width: 100% !important; float: none !important; margin: 0 !important; }
body.single-post .site-main,
body.category .site-main { max-width: 820px; margin: 0 auto; padding: 8px 0 48px; }
body.single-post .entry-header .entry-title { font-size: 34px; font-weight: 800; line-height: 1.2; color: #0d1f3c; }
body.single-post .entry-content { font-size: 16.5px; line-height: 1.75; color: #33435c; }
body.single-post .entry-content h2 {
    margin: 38px 0 14px;
    padding-left: 14px;
    border-left: 4px solid #ff7a2b;
    font-size: 25px;
    font-weight: 800;
    line-height: 1.3;
    color: #0d1f3c;
}
body.single-post .entry-content h3 { margin: 26px 0 8px; font-size: 19px; font-weight: 700; color: #0d1f3c; }
body.single-post .entry-content table { width: 100%; border: 1px solid #e2e8f3; border-collapse: collapse; font-size: 15px; }
body.single-post .entry-content th,
body.single-post .entry-content td { padding: 10px 14px; border: 1px solid #e2e8f3; text-align: left; vertical-align: top; }
body.single-post .entry-content th { background: #f3f6fb; color: #0d1f3c; }
body.category .entry-title a { font-weight: 800; color: #0d1f3c; text-decoration: none; }
.im-guide-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 40px 0 0;
    padding: 24px 26px;
    border-radius: 14px;
    background: #0d1f3c;
}
.im-guide-cta strong { display: block; font-size: 19px; color: #fff; }
.im-guide-cta span { font-size: 15px; color: #c8d4e6; }
.im-guide-cta a { display: inline-block; margin-left: 8px; padding: 12px 22px; border-radius: 8px; font-weight: 700; color: #fff !important; text-decoration: none !important; box-shadow: none !important; }
.im-guide-cta a.q { background: #ff7a2b; }
.im-guide-cta a.w { background: #25d366; }
@media (max-width: 767px) {
    body.single-post .entry-header .entry-title { font-size: 26px; }
    .im-guide-cta a { margin: 0 8px 0 0; }
}

/* Phone bottom bar: Storefront parks the closed search box just over the bar,
   where it sits on top of the account / search / cart buttons and blocks taps. */
.storefront-handheld-footer-bar ul li.search:not(.active) .site-search { visibility: hidden; }

/* Header: Storefront adds a bottom margin under the logo and the search box,
   which left about 40px of empty white space above the menu bar. */
@media (min-width: 768px) {
    .site-header > .col-full > .site-branding,
    .site-header > .col-full > .site-search { margin-bottom: 0 !important; }
}

/* Menu bar: top-level links are 40px tall with a 40px line height, but also had
   16px top/bottom padding, which pushed the text below the cart button's centre. */
@media (min-width: 768px) {
    #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item > a.mega-menu-link { padding-top: 0 !important; padding-bottom: 0 !important; }
}
