/**
 * Shop Page Layout CSS - Editor4
 *
 * IMPORTANT: This file is loaded OUTSIDE GrapesJS CssComposer
 * to prevent CSS accumulation/corruption during saves.
 *
 * This CSS is injected via <link> tag directly into the iframe head,
 * NOT through editor.setStyle(). This ensures:
 * - Layout CSS renders properly in canvas
 * - Layout CSS is NEVER included in editor.getCss()
 * - Layout CSS is NEVER saved to CustomStyles.css
 *
 * Token CSS (user customizations) is handled separately by shop-panel.js
 * and IS saved to CustomStyles.css.
 */

/* ===========================================
   EDITOR4 SHOP PAGE STABILITY STYLES
   Prevents DOM mutations and interactive behaviour
   inside Editor4 canvas. Hover is ENABLED on links
   (product cards, category links) for visual preview.
   =========================================== */

/* --- CRITICAL: Freeze form/button elements — EDITOR ONLY --- */
/* In editor canvas, body has class 'shop-page-active'.
   In preview, body has class 'e4-viewer' (no shop-page-active).
   This ensures forms/buttons are frozen in editor but interactive in preview. */
body.shop-page-active .so-shop-page button,
body.shop-page-active .so-shop-page select,
body.shop-page-active .so-shop-page input,
body.shop-page-active .so-shop-page form,
body.shop-page-active .so-shop-page [data-so-role="search-button"],
body.shop-page-active .so-shop-page [data-so-role="perpage-select"] {
    pointer-events: none !important;
    cursor: default !important;
    user-select: none !important;
}
/* Allow Add to Cart button hover in editor for visual preview */
body.shop-page-active .so-shop-page [data-so-role="add-to-cart-btn"] {
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* --- Prevent carousel/slide animations --- */
.so-shop-page .so-product-grid,
.so-shop-page .so-carousel-slide {
    transition: none !important;
    animation: none !important;
    transform: none !important;
}

/* --- Ensure all slides are visible (no hiding) --- */
.so-shop-page .so-carousel-slide {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* --- Suppress Bootstrap carousel specific behaviours --- */
.so-shop-page .carousel,
.so-shop-page .carousel-inner,
.so-shop-page .carousel-item {
    transition: none !important;
    animation: none !important;
}

/* --- Product card hover transition --- */
.so-shop-page [data-so-role="product-card"] {
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.so-shop-page [data-so-role="product-card-bg"] {
    transition: background-color 0.2s ease;
}

/* --- Product links: global styling --- */
.so-shop-page a[data-so-role="product-link"],
.so-shop-page a[data-so-role="product-link"]:hover,
.so-shop-page a[data-so-role="product-link"]:focus,
.so-shop-page a[data-so-role="product-link"]:active {
    text-decoration: none;
    color: inherit;
}
/* --- Product links: non-clickable cursor — EDITOR ONLY --- */
body.shop-page-active .so-shop-page a[data-so-role="product-link"] {
    cursor: default;
}

/* --- Product card hover effects (shadow + info bg) --- */
.so-shop-page [data-so-role="product-card"]:hover {
    box-shadow: var(--so-product-card-hover-shadow, 0 4px 12px rgba(0,0,0,0.15));
}
.so-shop-page [data-so-role="product-card"]:hover [data-so-role="product-card-bg"] {
    background-color: var(--so-product-card-info-hover-bg, #e8e8e8);
}

/* --- Disable focus outlines on frozen elements — EDITOR ONLY --- */
body.shop-page-active .so-shop-page a:focus,
body.shop-page-active .so-shop-page button:focus,
body.shop-page-active .so-shop-page input:focus,
body.shop-page-active .so-shop-page select:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* ===========================================
   PRODUCTS PAGE - SCOPED LAYOUT STYLES
   All styles for proper rendering.
   Scoped under .so-shop-page to prevent leakage.
   =========================================== */

/* --- Layout --- */
.so-shop-page.container {
    padding-left: 15px !important;
    padding-right: 15px !important;
    max-width: var(--so-shop-page-max-width, 1170px);
    margin-left: auto;
    margin-right: auto;
}

.so-shop-page .so-breadcrumb-row {
    padding-top: 15px;
}
.so-shop-page .so-main-content-row {
    padding-top: 20px;
}

/* --- Breadcrumbs --- */
.so-shop-page .so-breadcrumb-text {
    width: 75%;
}

/* --- Per-Page Selector --- */
.so-shop-page .so-perpage-wrapper {
    display: inline-block;
}
.so-shop-page .so-perpage-text {
    display: inline;
}
.so-shop-page .so-perpage-select {
    width: 20%;
    display: inline;
}

/* --- Search Form --- */
.so-shop-page .so-search-input {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}
.so-shop-page .so-search-append {
    padding: 0 !important;
}
body.shop-page-active .so-shop-page .so-search-icon {
    cursor: default;
}

/* --- Categories Sidebar --- */
.so-shop-page .so-categories-title {
    margin-top: 5px;
    margin-bottom: 5px;
}

/* --- Product Grid Header --- */
.so-shop-page .so-grid-title {
    margin-top: 0px;
    padding-top: 20px;
}
.so-shop-page .so-grid-count {
    margin-top: 0px;
    padding-top: 25px;
}

/* --- Product Card --- */
.so-shop-page .so-product-image-wrapper {
    width: 205px;
    margin: 0 auto;
}
.so-shop-page .so-product-image-cell {
    width: 205px;
    min-height: 180px;
    height: 180px;
    max-height: 180px;
    display: block;
    display: table-cell;
    text-align: center;
    vertical-align: middle;
}
.so-shop-page .so-product-image {
    max-height: 180px;
    max-width: 180px;
}
.so-shop-page .so-product-info-price {
    width: 100%;
}

/* --- Product Title: Fixed 2 lines (50px at 25px line-height) --- */
.so-shop-page .so-product-title {
    display: inline-block;
    height: 50px !important;
    overflow-y: hidden;
    position: relative;
    line-height: 25px;
}

/* --- Product Price Section: Fixed height for consistency --- */
/* Price area = 1 line price + 1 line was-price = ~50px */
.so-shop-page .product-display-price,
.so-shop-page [data-so-role="product-grid-price"] {
    min-height: 50px;
    line-height: 25px;
    margin-bottom: 0;
    margin-top: 5px;
}

.so-shop-page .so-product-was-price,
.so-shop-page [data-so-role="price-was"] {
    text-decoration: line-through;
    display: inline-block;
    min-height: 25px; /* Reserve space even if empty */
}

/* --- Info Section: Fixed height for card consistency --- */
/* Title (50px) + Price area (50px) + padding (20px) = ~120px */
.so-shop-page .col-item .info,
.so-shop-page [data-so-role="product-card-bg"] {
    min-height: 120px;
}

/* --- Editor Shell Placeholder Styles --- */
.so-shop-page .so-placeholder-text {
    color: #6c757d;
    font-style: italic;
}

/* --- Stock Badge Base Styles --- */
.so-shop-page .product-stock-counter {
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 11px;
    position: absolute;
    top: 5px;
    right: 5px;
    z-index: 10;
}
.so-shop-page .product-stock-counter-in {
    background-color: var(--so-stock-in-bg, #28a745);
    color: var(--so-stock-in-text, #fff);
}
.so-shop-page .product-stock-counter-out {
    background-color: var(--so-stock-out-bg, #dc3545);
    color: var(--so-stock-out-text, #fff);
}

/* --- Product Card Base Styles (matches original shopon.checkout.css) --- */
.so-shop-page .col-item,
.so-shop-page [data-so-role="product-card"] {
    position: relative;
    border: 1px solid var(--so-product-card-border, #E1E1E1);
    border-radius: 5px;
    background: var(--so-product-card-bg, #FFF);
    margin-top: 15px;
    margin-bottom: 5px;
    /* NOTE: No padding on card - padding is on .info section only */
}

/* Product card info section (title/price area) */
.so-shop-page .col-item .info,
.so-shop-page [data-so-role="product-card"] .info,
.so-shop-page [data-so-role="product-card-bg"] {
    padding: 10px;
    border-radius: 0 0 5px 5px;
    margin-top: 1px;
}

/* --- Categories Sidebar Base Styles --- */
.so-shop-page [data-so-role="categories-sidebar"] {
    border: 1px solid var(--so-categories-sidebar-border, rgba(0,0,0,0.125));
    border-radius: 4px;
    margin-bottom: 15px;
}
.so-shop-page [data-so-role="categories-header"] {
    background-color: var(--so-categories-header-bg, rgba(0,0,0,0.03));
    padding: 10px 15px;
    border-bottom: 1px solid rgba(0,0,0,0.125);
}
.so-shop-page [data-so-role="categories-title"] {
    margin: 0;
    font-size: var(--so-categories-title-font-size, 16px);
    font-weight: 500;
}
.so-shop-page [data-so-role="categories-list"] {
    background-color: var(--so-categories-list-bg, #fff);
    padding: 0;
    margin: 0;
    list-style: none;
}
.so-shop-page [data-so-role="categories-item"] {
    border-bottom: 1px solid var(--so-categories-item-border, rgba(0,0,0,0.125));
    padding: 10px 15px;
    background-color: var(--so-categories-list-bg, #fff);
}
.so-shop-page [data-so-role="categories-item"]:last-child {
    border-bottom: none;
}
.so-shop-page [data-so-role="categories-link"] {
    color: var(--so-categories-link-color, #17a2b8);
    text-decoration: none;
    font-size: var(--so-categories-link-font-size, 14px);
}
.so-shop-page [data-so-role="categories-link"]:hover {
    color: var(--so-categories-link-hover, #007bff);
    text-decoration: none;
}

/* --- Grid Divider --- */
.so-shop-page [data-so-role="grid-divider"] {
    border-color: var(--so-grid-divider-color, rgba(0,0,0,0.1));
}

/* --- Carousel Controls (legacy — kept for backwards compat) --- */
.so-shop-page [data-so-role="carousel-prev"],
.so-shop-page [data-so-role="carousel-next"] {
    background-color: var(--so-carousel-btn-bg, #28a745);
    color: var(--so-carousel-btn-text, #fff);
    border-color: var(--so-carousel-btn-bg, #28a745);
    padding: 6px 12px;
    font-size: 14px;
    line-height: 1.42857143;
    border-radius: 4px;
    text-decoration: none;
    display: inline-block;
}

/* --- Pagination Navigation --- */
.so-shop-page [data-so-role="pagination-nav"] {
    margin: 0;
    float: right;
}
.so-shop-page [data-so-role="pagination-nav"] .pagination {
    margin: 0;
}
.so-shop-page [data-so-role="pagination-nav"] .page-link {
    padding: 4px 10px;
    font-size: 13px;
    line-height: 1.5;
    border-radius: 3px;
}
.so-shop-page [data-so-role="pagination-nav"] .page-item + .page-item {
    margin-left: 2px;
}
/* Active page — token G23 (inner) controls background; white text */
/* ==========================================================================
   SHOP PAGE EDITOR CANVAS — hide editor grid borders on shell pages
   These borders are useful for editable pages but add noise on locked shop shells
   ========================================================================== */
.so-shop-page .row,
.so-shop-page .so-row,
.so-shop-page .row:first-child,
.so-shop-page .so-row:first-child {
    background: none !important;
    min-height: unset !important;
}
.so-shop-page [class*="col-"] {
    min-height: unset !important;
}
.so-shop-page .row > [class*="col-"] + [class*="col-"] {
    background: none !important;
}
.so-shop-page .so-section:empty,
.so-shop-page .so-section:not(:has(*)) {
    border: none !important;
    background: none !important;
    min-height: unset !important;
}

/* Active page — G23 background (dark) + G24 text (light) */
.so-shop-page [data-so-role="pagination-inner"] {
    background-color: var(--so-pagination-inner-color, #1B202F) !important;
    border-color: var(--so-pagination-inner-color, #1B202F) !important;
    color: var(--so-pagination-outer-color, #fff) !important;
}
/* Inactive pages — G24 background (light) + G23 text (dark) */
.so-shop-page [data-so-role="pagination-outer"] {
    color: var(--so-pagination-inner-color, #1B202F) !important;
    background-color: var(--so-pagination-outer-color, #fff) !important;
    border-color: #dee2e6 !important;
}
/* Hover on inactive — lighter shade of G23 background + G24 text */
.so-shop-page [data-so-role="pagination-outer"]:hover {
    text-decoration: none;
    color: var(--so-pagination-outer-color, #fff) !important;
    background-color: color-mix(in srgb, var(--so-pagination-inner-color, #1B202F) 70%, white) !important;
    border-color: color-mix(in srgb, var(--so-pagination-inner-color, #1B202F) 70%, white) !important;
}
/* Focus ring — derived from active/inner color */
.so-shop-page .page-link:focus,
.so-shop-page .page-link:active {
    box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--so-pagination-inner-color, #1B202F) 30%, transparent) !important;
    outline: none !important;
}
/* Disabled state (prev/next at bounds) */
.so-shop-page .page-item.disabled [data-so-role="pagination-outer"] {
    color: var(--so-pagination-inner-color, #1B202F) !important;
    opacity: 0.4;
    pointer-events: none;
}

/* --- Row Spacing (Bootstrap negative margins for gutters) --- */
.so-shop-page .row {
    margin-left: -15px !important;
    margin-right: -15px !important;
}
.so-shop-page .row.mainrow {
    margin-bottom: 0;
}

/* --- Main Content Row (Sidebar + Product Grid) --- */
.so-shop-page .so-main-content-row {
    margin-left: -15px !important;
    margin-right: -15px !important;
}

/* --- Sidebar Column Spacing --- */
.so-shop-page [data-so-role="sidebar-column"],
.so-shop-page .col-md-3 {
    padding-left: 15px !important;
    padding-right: 15px !important;
}

/* --- Product Grid Column --- */
.so-shop-page [data-so-role="product-grid-column"],
.so-shop-page .col-md-9 {
    padding-left: 15px !important;
    padding-right: 15px !important;
}

/* --- Product Column Spacing (Bootstrap gutters) --- */
.so-shop-page [data-so-role="product-card-col"],
.so-shop-page .col-sm-4 {
    padding-left: 15px !important;
    padding-right: 15px !important;
    margin-bottom: 15px;
}

/* --- Breadcrumb Row Columns --- */
.so-shop-page .so-breadcrumb-row > div {
    padding-left: 15px !important;
    padding-right: 15px !important;
}

/* ===========================================
   PRODUCT DETAIL PAGE - SCOPED LAYOUT STYLES
   All styles for proper rendering of the single
   product detail view. Scoped under
   .so-shop-page[data-so-page-type="product"]
   to prevent leakage to products listing page.
   =========================================== */

/* --- Utility: clear float --- */
.so-shop-page .clearboth {
    clear: both;
}

/* --- Fancybox Image Container — link resets (prevent browser blue borders) --- */
.so-shop-page .fancy-box-container a {
    border: none;
    outline: none;
    text-decoration: none;
    display: inline-block;
}
/* Main product image link — direct child only */
.so-shop-page .fancy-box-container > a:first-child {
    display: block;
    text-align: center;
    max-width: 100%;
    max-height: 440px;
    margin-bottom: 10px;
}
.so-shop-page .fancy-box-container > a:first-child img {
    max-width: 420px;
    max-height: 420px;
    display: inline-block;
    margin: 0;
    border: 1px solid var(--so-product-card-border, #ddd);
    padding: 10px;
}
/* Thumbnail images (all images inside nested divs, NOT the main image) */
.so-shop-page .fancy-box-container > div a img {
    width: 80px;
    height: 80px;
    max-height: none;
    max-width: none;
    border: 1px solid var(--so-product-card-border, #ddd);
    padding: 4px;
    margin: 0;
    object-fit: cover;
    cursor: pointer;
    border-radius: 4px;
}
/* Re-override for the main image (must come after thumbnail rule) */
.so-shop-page .fancy-box-container > a:first-child img.img-mag-small {
    max-width: 420px;
    max-height: 420px;
    width: auto;
    height: auto;
    display: inline-block;
    margin: 0;
    border: 1px solid var(--so-product-card-border, #ddd);
    padding: 10px;
    object-fit: contain;
}

/* --- Product Info Column --- */
.so-shop-page .inner-border {
    padding-left: 25px;
    border-left: 1px solid var(--so-product-card-border, #ddd);
}

/* --- Clearboth spacer (GrapesJS keeps the div but BS5 has no rule) --- */
.so-shop-page .clearboth {
    clear: both;
}

/* --- Vendor Name inherits PD4 colour (overrides inline #999) --- */
.so-shop-page[data-so-page-type="product"] .inner-border > h5:first-child {
    color: var(--so-pd-details-label-color, #999) !important;
    font-weight: normal;
}

/* --- SKU inherits PD4 colour — forced caps, not bold --- */
.so-shop-page [data-so-role="product-sku"] {
    margin-bottom: 20px;
    color: var(--so-pd-details-label-color, #999) !important;
    font-weight: normal;
    text-transform: uppercase;
}

/* --- Product Detail Form Groups (variant selectors, stock, shipping) ---
   Use CSS Grid to bypass BS5 flex-row layout entirely.
   BS5 .row flex + col-sm-* gutter padding causes dead space in the
   GrapesJS canvas that doesn't appear in normal preview.                    */
.so-shop-page[data-so-page-type="product"] .mb-3.row,
.so-shop-page[data-so-page-type="product"] .form-group.row {
    display: grid !important;
    grid-template-columns: 25% 75% !important;
    align-items: center !important;
    margin: 0 0 1.75rem 0 !important;   /* JC 28 Aug: airier rows, closer to the E2 product page */
    padding: 0 !important;
    min-height: 0 !important;
    gap: 0 !important;
}
/* Every element inside label rows — nuke all BS5 column behaviour */
.so-shop-page[data-so-page-type="product"] .mb-3.row *,
.so-shop-page[data-so-page-type="product"] .mb-3.row > *,
.so-shop-page[data-so-page-type="product"] .form-group.row *,
.so-shop-page[data-so-page-type="product"] .form-group.row > * {
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    flex: none !important;
    width: auto !important;
    max-width: none !important;
}
/* Product detail labels — FORCE BOLD locally (PD4 global is not bold) */
.so-shop-page[data-so-page-type="product"] .mb-3 h5,
.so-shop-page[data-so-page-type="product"] .form-group h5,
.so-shop-page[data-so-page-type="product"] [data-so-role="product-details-label"] {
    font-size: var(--so-pd-details-label-font-size, 14px);
    font-weight: bold;
    line-height: 1.4;
}
.so-shop-page[data-so-page-type="product"] .mb-3 p,
.so-shop-page[data-so-page-type="product"] .mb-3 small {
    line-height: 1.4;
}

/* Vendor name — match BS4 h5 size (BS5 default is larger) */
.so-shop-page[data-so-page-type="product"] .inner-border > h5 {
    font-size: 14px;
    line-height: 1.4;
}

/* --- Price section spacing --- */
.so-shop-page #product_price {
    display: inline;
    margin-top: 10px;
}
.so-shop-page #product_wasprice {
    text-decoration: line-through;
    display: inline-block;
    margin-top: 0;
}

/* --- Variant Selector Dropdown --- */
.so-shop-page .variantSelector {
    max-width: 200px;
    height: calc(1.5em + 0.75rem + 2px) !important;
    font-size: 14px;
    appearance: auto !important;
    -webkit-appearance: menulist !important;
    -moz-appearance: menulist !important;
    padding: 0.375rem 0.75rem !important;
    flex: none !important;
    width: auto !important;
    min-width: 120px;
}
/* Prevent col-6 on select from becoming a BS5 grid column */
.so-shop-page .mb-3 select.col-6 {
    flex: none !important;
    width: auto !important;
    max-width: 200px;
}

/* --- Product Title / Price Typography --- */
.so-shop-page .product_title_price {
    font-weight: bold;
}
/* Price Text inherits Product Title (PD1) token — non-editable shared styling */
.so-shop-page [data-so-role="product-price"] {
    font-family: var(--so-pd-title-font, inherit);
    font-size: var(--so-pd-title-font-size, 24px);
    color: var(--so-pd-title-color, #212529);
}
/* (Incl. VAT) inherits PD4 colour + PD1 font size/style */
.so-shop-page .product_details_text {
    color: var(--so-pd-details-label-color, #999) !important;
    font-family: var(--so-pd-title-font, inherit) !important;
    font-size: var(--so-pd-title-font-size, 14px) !important;
}

/* --- Product Tabs --- */
.so-shop-page .product-cat-tabs {
    margin-bottom: 0;
}
.so-shop-page .product-cat-tabs .nav-link {
    font-size: 14px;
    padding: 8px 15px;
}
.so-shop-page .product-cat-content {
    padding: 15px 0;
}

/* --- img-responsive: BS3 class used as injection hook by _shop_data.php --- */
/* BS5 equivalent of img-fluid — needed for featured product images */
.so-shop-page .img-responsive {
    max-width: 100%;
    height: auto;
    display: inline-block;
}

/* --- Featured Products ("Other Items You Might Like") --- */
.so-shop-page[data-so-page-type="product"] .photo {
    min-height: 180px;
    height: 180px;
    max-height: 180px;
    overflow: hidden;
}
.so-shop-page[data-so-page-type="product"] .photo img {
    max-height: 180px;
    max-width: 180px;
    width: auto !important;
}
.so-shop-page[data-so-page-type="product"] .product-display-title {
    display: inline-block;
    height: 50px;
    overflow-y: hidden;
    line-height: 25px;
    margin-top: 10px;
}

/* --- Add to Cart Button --- */
.so-shop-page .button_process {
    margin-top: 10px;
    margin-bottom: 10px;
}
/* JC 28 Aug: product-page right column breathes like the E2 page — more room
   under the SKU, before the price block and before Add to Cart. */
.so-shop-page[data-so-page-type="product"] [data-so-role="product-sku"] { margin-bottom: 28px !important; }
.so-shop-page[data-so-page-type="product"] #product_price { margin-top: 16px; }
.so-shop-page[data-so-page-type="product"] #product_add_cart { margin-top: 24px; }
.so-shop-page[data-so-page-type="product"] .product_details_text.product_title_price { margin-top: -6px; }   /* (Incl. VAT) sits WITH the price */

/* ===========================================
   AUTH (LOGIN/REGISTER) PAGE - SCOPED LAYOUT
   Scoped under data-so-page-type="login-register"
   to prevent leakage to other shop pages.
   =========================================== */

/* --- Auth page heading: reduce gap to cards --- */
.so-shop-page[data-so-page-type="login-register"] [data-so-role="page-title"] {
    margin-bottom: 2px !important;
}

/* --- Auth row: vertical spacing --- */
.so-shop-page[data-so-page-type="login-register"] > .row {
    padding-top: 5px;
}

/* --- Auth cards: equal-height alignment --- */
.so-shop-page[data-so-page-type="login-register"] > .row > .col-md-6 {
    display: flex;
    flex-direction: column;
    padding-left: 15px;
    padding-right: 15px;
}
.so-shop-page[data-so-page-type="login-register"] .card.panel-default {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* --- Auth card-body + form: flex layout for button alignment --- */
.so-shop-page[data-so-page-type="login-register"] .card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
}
.so-shop-page[data-so-page-type="login-register"] .card-body form {
    display: flex;
    flex-direction: column;
    flex: 1;
}
.so-shop-page[data-so-page-type="login-register"] .card-body form [data-so-role="button-primary"] {
    margin-top: auto;
    align-self: flex-start;
}
.so-shop-page[data-so-page-type="login-register"] .card-body > [data-so-role="button-primary"] {
    /* J8 parity (6 Sep 2026): the live body (system/page-bodies/auth.php) pushes BOTH
       card buttons to the card bottom with margin-top:auto !important (the template's
       inline margin-top:1px on the register button must lose) — the canvas showed the
       register button floating high. The preview is the truth; the canvas follows it. */
    margin-top: auto !important;
    align-self: flex-start;
}
.so-shop-page[data-so-page-type="login-register"] .card-body > br {
    display: none;   /* live body hides the <br> before the register button so the flex auto-margin works */
}

/* --- Collapse empty validation div (no error text in editor) --- */
.so-shop-page[data-so-page-type="login-register"] .validation {
    display: none;
}

/* --- Collapse heading column gap --- */
.so-shop-page[data-so-page-type="login-register"] > .row > .col-12 {
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    line-height: 1.2;
}
/* h1 inside heading col: collapse Bootstrap default bottom margin */
.so-shop-page[data-so-page-type="login-register"] > .row > .col-12 > [data-so-role="page-title"] {
    margin-top: 5px !important;
    margin-bottom: 25px !important;   /* J8 parity: live body uses 25px */
    padding: 0 0 0 15px !important;
}

/* --- Auth page spacing (match BS4 card + form-group rhythm) --- */
.so-shop-page[data-so-page-type="login-register"] .card {
    min-height: 350px;
}
.so-shop-page[data-so-page-type="login-register"] .card-body {
    padding: 1.25rem !important; /* BS4 default was 1.25rem, BS5 is 1rem */
}
.so-shop-page[data-so-page-type="login-register"] .card-header {
    padding: 0.75rem 1.25rem !important; /* BS4 default */
}
.so-shop-page[data-so-page-type="login-register"] [data-so-role="form-label"] {
    margin-bottom: 4px;
    margin-top: 8px;
}
.so-shop-page[data-so-page-type="login-register"] .form-control {
    margin-bottom: 1rem; /* BS4 form-group margin-bottom */
}
.so-shop-page[data-so-page-type="login-register"] [data-so-role="button-primary"] {
    margin-top: 10px;
}
.so-shop-page[data-so-page-type="login-register"] .mb-3 {
    margin-bottom: 10px;
}

/* --- "Forgot password?" link: allow hover cursor in editor --- */
body.shop-page-active .so-shop-page [data-so-role="page-link"] {
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* --- Page links: remove underline on hover (editor + preview) --- */
.so-shop-page [data-so-role="page-link"],
.so-shop-page [data-so-role="page-link"]:hover,
.so-shop-page [data-so-role="page-link"]:focus {
    text-decoration: none;
}

/* --- Button primary: allow hover in editor (override form freeze) --- */
body.shop-page-active .so-shop-page [data-so-role="button-primary"] {
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* --- Panel heading h3: allow token to override Bootstrap h3 sizing --- */
.so-shop-page [data-so-role="auth-panel-heading"] h3 {
    font-family: var(--so-auth-panel-heading-font, inherit);
    font-size: var(--so-auth-panel-heading-font-size, inherit);
    color: var(--so-auth-panel-heading-color, inherit);
}

/* --- Form inputs: allow click/focus in editor to show shadow --- */
body.shop-page-active .so-shop-page [data-so-role="form-input"] {
    pointer-events: auto !important;
    cursor: text !important;
}

/* --- Form inputs: token-driven styling (LP3) --- */
.so-shop-page [data-so-role="form-input"] {
    color: var(--so-form-input-color, #495057);
    background-color: var(--so-form-input-bg, #ffffff);
    border-color: var(--so-card-border-color, #ced4da);
}
.so-shop-page [data-so-role="form-input"]::placeholder {
    color: var(--so-form-input-color, #6c757d);
    opacity: 0.7;
}
.so-shop-page [data-so-role="form-input"]:focus {
    box-shadow: 0 0 0 0.2rem var(--so-form-input-focus-shadow, rgba(0,123,255,0.25));
    border-color: var(--so-card-border-color, #80bdff);
}

/* --- J8 parity (6 Sep 2026): the live login body's spacing rhythm, mirrored so the
       canvas renders like the preview (values identical to the inline rules in
       system/page-bodies/auth.php — no live change, one source for the canvas). --- */
.so-shop-page[data-so-page-type="login-register"] .mb-3 { margin-bottom: 10px !important; }
.so-shop-page[data-so-page-type="login-register"] h5 { margin-bottom: 8px !important; }
.so-shop-page[data-so-page-type="login-register"] .form-control { margin-bottom: 10px; }
.so-shop-page[data-so-page-type="login-register"] .checkbox.float-end { margin-top: 5px; margin-bottom: 10px; }
.so-shop-page[data-so-page-type="login-register"] [data-so-role="paragraph-text"] { line-height: 1.6; }
.so-shop-page[data-so-page-type="login-register"] .register-list { margin-top: 15px; margin-bottom: 20px; }
.so-shop-page[data-so-page-type="login-register"] .register-list li { margin-bottom: 8px; }
.so-shop-page[data-so-page-type="login-register"] .register-list li p { margin-bottom: 0; }
/* --- Register list items: inherit G6 paragraph-text token --- */
.so-shop-page [data-so-role="paragraph-text"] .register-list,
.so-shop-page [data-so-role="paragraph-text"] .register-list li,
.so-shop-page [data-so-role="paragraph-text"] .register-list li span,
.so-shop-page [data-so-role="paragraph-text"] .register-list li p {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}
