/* Cannabis Kings legacy-capture compatibility layer.
   Captured Electro/WooCommerce markup is retained for URL/content parity;
   the retired theme bundle is not. Keep the fallback scoped to body.legacy-page
   so modern Blade pages continue to use home.css alone. */

body.legacy-page,
body.legacy-page * {
    box-sizing: border-box;
}

body.legacy-page {
    margin: 0;
    overflow-x: hidden;
    color: #222;
    background: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    line-height: 1.55;
}

body.legacy-page a {
    color: #1f6b3a;
}

body.legacy-page img,
body.legacy-page video,
body.legacy-page iframe,
body.legacy-page embed,
body.legacy-page object {
    max-width: 100%;
}

body.legacy-page img {
    display: block;
    height: auto;
}

/* The captured Electro header is retained in the source for URL/content
   parity, but its desktop + handheld copies are not a usable responsive UI.
   Give legacy pages the same compact brand/navigation entry point as the
   converted pages and leave the captured article/form content below it. */
body.legacy-page .ck-legacy-brandbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    width: 100%;
    max-width: 1200px;
    min-height: 68px;
    margin-inline: auto;
    padding: 10px 20px;
    border-bottom: 1px solid #e5e5e5;
    background: #fff;
}

body.legacy-page .ck-legacy-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #1f6b3a;
    font-size: 18px;
    font-weight: 700;
    text-decoration: none;
}

body.legacy-page .ck-legacy-brand img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

body.legacy-page .ck-legacy-brandbar nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 4px 18px;
}

body.legacy-page .ck-legacy-brandbar nav a {
    padding: 8px 0;
    color: #222;
    font-size: 14px;
    text-decoration: none;
}

body.legacy-page .ck-legacy-brandbar nav a:hover,
body.legacy-page .ck-legacy-brandbar nav a:focus-visible {
    color: #1f6b3a;
    text-decoration: underline;
}

body.legacy-page .top-bar,
body.legacy-page #masthead,
body.legacy-page .site-header,
body.legacy-page .handheld-header-wrap {
    display: none !important;
}

body.legacy-page .container,
body.legacy-page .site-content-inner,
body.legacy-page .desktop-footer,
body.legacy-page .footer-newsletter-inner,
body.legacy-page .footer-bottom-widgets-inner {
    width: 100%;
    max-width: 1200px;
    margin-inline: auto;
    padding-inline: 20px;
}

body.legacy-page .site-header,
body.legacy-page .masthead {
    position: static;
    width: 100%;
    background: #fff;
    border-bottom: 1px solid #e5e5e5;
}

body.legacy-page .masthead::before {
    content: "";
    display: block;
    width: 72px;
    height: 72px;
    margin: 16px auto 10px;
    background: url('/assets/branding/cannabis-kings-192x192.png') center / contain no-repeat;
}

body.legacy-page .header-logo-area,
body.legacy-page .electro-navbar-inner,
body.legacy-page .header-support-inner {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
}

body.legacy-page .header-logo-area {
    min-height: 86px;
    justify-content: space-between;
}

body.legacy-page .header-logo-link img,
body.legacy-page .img-header-logo {
    width: auto;
    max-width: 180px;
    max-height: 72px;
}

body.legacy-page .top-bar,
body.legacy-page .electro-navbar {
    background: #1f6b3a;
    color: #fff;
}

body.legacy-page .electro-navbar {
    min-height: 46px;
}

body.legacy-page .primary-nav-menu,
body.legacy-page .primary-nav-menu > ul,
body.legacy-page .nav-inline,
body.legacy-page .nav-inline > ul {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

body.legacy-page .primary-nav-menu a,
body.legacy-page .nav-inline a {
    display: block;
    padding: 10px 6px;
    color: inherit;
    font-size: 14px;
    text-decoration: none;
}

body.legacy-page .dropdown-menu,
body.legacy-page .off-canvas-navigation-wrapper,
body.legacy-page .off-canvas-navigation,
body.legacy-page .navbar-toggler,
body.legacy-page .handheld-header,
body.legacy-page #loftloader-wrapper,
body.legacy-page .pl-imgloading,
body.legacy-page .imgloading-container,
body.legacy-page .loader-inner,
body.legacy-page .loader-section,
body.legacy-page .loader-close-button,
body.legacy-page .pace,
body.legacy-page .pace-progress,
body.legacy-page .pswp {
    display: none !important;
}

body.legacy-page .site-content {
    display: block;
    width: 100%;
    min-width: 0;
    padding: 36px 0 56px;
}

body.legacy-page .content-area,
body.legacy-page .site-main,
body.legacy-page .entry-content,
body.legacy-page .wpb_wrapper {
    min-width: 0;
    max-width: 100%;
}

body.legacy-page h1,
body.legacy-page h2,
body.legacy-page h3,
body.legacy-page h4 {
    color: #1a1a1a;
    line-height: 1.2;
}

body.legacy-page .single-product-wrapper,
body.legacy-page .single-product .product.type-product {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 36px;
    align-items: start;
    width: 100%;
}

body.legacy-page .single-product-wrapper > *,
body.legacy-page .single-product .product.type-product > * {
    min-width: 0;
}

body.legacy-page .woocommerce-product-gallery,
body.legacy-page .product-images-wrapper,
body.legacy-page .summary,
body.legacy-page .product-actions-wrapper {
    width: 100% !important;
    max-width: 100%;
    min-width: 0;
    float: none !important;
}

/* WooCommerce wrote opacity:0 inline while its retired gallery script
   initialized. The captured JS is intentionally removed, so keep the real
   product image visible without relying on that script. */
body.legacy-page .woocommerce-product-gallery {
    opacity: 1 !important;
}

/* The capture includes the same gallery twice (Electro's replacement widget
   plus the WooCommerce gallery). The retired JS no longer coordinates them;
   keep one real hero image so products do not open with three duplicates. */
body.legacy-page .woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image:not(:first-child),
body.legacy-page .electro-wc-product-gallery {
    display: none !important;
}

body.legacy-page .woocommerce-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 8px;
}

body.legacy-page .woocommerce-breadcrumb .delimiter {
    color: #777;
}

body.legacy-page .woocommerce-breadcrumb .delimiter i {
    display: none;
}

body.legacy-page .woocommerce-breadcrumb .delimiter::before {
    content: "›";
}

body.legacy-page .woocommerce-product-gallery__image,
body.legacy-page .woocommerce-product-gallery__image img,
body.legacy-page .woocommerce-main-image img {
    width: 100%;
    max-width: 100%;
    height: auto;
}

body.legacy-page .flex-control-thumbs,
body.legacy-page .woocommerce-product-gallery ol {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    gap: 8px;
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
}

body.legacy-page ul.products,
body.legacy-page .products,
body.legacy-page .onsale-product-carousel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 20px;
    width: 100%;
    margin: 24px 0;
    padding: 0;
    list-style: none;
}

body.legacy-page .product-outer,
body.legacy-page .product-inner,
body.legacy-page .product-thumbnail,
body.legacy-page .product-loop-body,
body.legacy-page .product-loop-footer {
    min-width: 0;
    max-width: 100%;
}

body.legacy-page .price,
body.legacy-page .electro-price {
    color: #1f6b3a;
    font-weight: 700;
}

body.legacy-page input,
body.legacy-page select,
body.legacy-page textarea,
body.legacy-page button {
    max-width: 100%;
    font: inherit;
}

body.legacy-page input,
body.legacy-page select,
body.legacy-page textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cfcfcf;
    border-radius: 4px;
}

body.legacy-page .wpforms-field,
body.legacy-page .wpcf7-form p,
body.legacy-page .form-row {
    max-width: 680px;
    margin: 0 0 16px;
}

body.legacy-page table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
}

body.legacy-page .desktop-footer,
body.legacy-page .footer-widgets,
body.legacy-page .footer-bottom-widgets {
    min-width: 0;
}

body.legacy-page .footer-widgets,
body.legacy-page .footer-bottom-widgets-inner {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

body.legacy-page .footer-newsletter,
body.legacy-page .site-footer {
    width: 100%;
    background: #1a1a1a;
    color: #fff;
}

body.legacy-page .site-footer a {
    color: #b8e4c8;
}

body.legacy-page .wpb_column,
body.legacy-page .vc_column-inner,
body.legacy-page .row,
body.legacy-page .columns {
    min-width: 0;
    max-width: 100%;
}

@media (max-width: 768px) {
    body.legacy-page .ck-legacy-brandbar {
        align-items: flex-start;
        display: block;
        min-height: 0;
        padding: 10px 14px;
    }

    body.legacy-page .ck-legacy-brandbar nav {
        justify-content: flex-start;
        gap: 0 16px;
        margin-top: 6px;
    }

    body.legacy-page .ck-legacy-brandbar nav a {
        padding: 5px 0;
        font-size: 13px;
    }

    body.legacy-page .container,
    body.legacy-page .site-content-inner,
    body.legacy-page .desktop-footer,
    body.legacy-page .footer-newsletter-inner,
    body.legacy-page .footer-bottom-widgets-inner {
        padding-inline: 14px;
    }

    body.legacy-page .header-logo-area,
    body.legacy-page .electro-navbar-inner,
    body.legacy-page .header-support-inner {
        display: block;
        padding-block: 12px;
    }

    body.legacy-page .primary-nav-menu,
    body.legacy-page .primary-nav-menu > ul,
    body.legacy-page .nav-inline,
    body.legacy-page .nav-inline > ul {
        display: flex;
        flex-wrap: wrap;
        gap: 0 8px;
    }

    body.legacy-page .primary-nav-menu a,
    body.legacy-page .nav-inline a {
        padding: 7px 3px;
        font-size: 13px;
    }

    body.legacy-page .single-product-wrapper,
    body.legacy-page .single-product .product.type-product {
        display: block;
    }

    body.legacy-page .product-images-wrapper,
    body.legacy-page .summary {
        margin-bottom: 24px;
    }

    body.legacy-page ul.products,
    body.legacy-page .products,
    body.legacy-page .onsale-product-carousel,
    body.legacy-page .footer-widgets,
    body.legacy-page .footer-bottom-widgets-inner {
        grid-template-columns: 1fr;
    }

    body.legacy-page .site-content {
        padding-top: 22px;
    }

    body.legacy-page .entry-content,
    body.legacy-page .wpb_wrapper,
    body.legacy-page p,
    body.legacy-page li,
    body.legacy-page td,
    body.legacy-page th {
        overflow-wrap: anywhere;
    }
}
