// Prevent WordPress body scroll on the shortcode builder page.
// This stops the WP sidebar from infinite scrolling when the right
// preview panel is scrolled. Only the plugin's own containers scroll.
// NOTE: Do NOT constrain intermediate WP wrappers (#wpcontent etc.) —
// that clips the plugin content. Only lock body + app-container.
// Scroll #adminmenu (not #adminmenuwrap) so folded icon column stays 36px
// and is not crushed by an inner scrollbar.
// Keep .app-container from scrolling so the plugin header cannot slide
// upward out of view — header stays put; only the view + inner panels scroll.
body.gs_bookshowcase_page_gs-books-shortcode {
    overflow: hidden;

    // The app fills the screen, so WordPress's footer space would show as a gray strip below it.
    #wpbody-content {
        padding-bottom: 0;
    }

    #wpfooter {
        display: none;
    }

    .app-container {
        overflow: hidden; // was overflow-y: auto — that let the header scroll away
        min-height: unset;
        height: calc(100vh - 32px); // 32px = WP admin bar height
        overscroll-behavior: contain;
        display: flex;
        flex-direction: column;
    }

    .app-container > .main-container,
    #gs-book-showcase-shortcode-app {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        min-height: 0;
        overflow: hidden;
    }

    .gs-book-showcase-header {
        flex-shrink: 0;
    }

    .gs-book-showcase-app-view-container {
        flex: 1 1 auto;
        min-height: 0;
        overflow-x: hidden;
        overflow-y: auto; // shortcodes list / prefs etc.; edit view panels scroll inside
        overscroll-behavior: contain;
    }

    #adminmenu {
        max-height: calc(100vh - 32px);
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: none; // Firefox — hide scrollbar, keep scroll
    }

    #adminmenu::-webkit-scrollbar {
        width: 0;
        height: 0;
        display: none; // Chrome / Safari / Edge
    }
}

@media screen and (max-width: 782px) {
    body.gs_bookshowcase_page_gs-books-shortcode {
        .app-container {
            height: calc(100vh - 46px); // taller WP admin bar on mobile
        }

        #adminmenu {
            max-height: calc(100vh - 46px);
        }
    }
}

// ── Sidebar Toggle Button in Builder Header ──────────────────────────
// Prepended inside .logo-area / .book-area next to logo image for inline placement

.logo-area, .book-area {
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
}

.gsb-sidebar-toggle {
    display: inline-flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;
    width: 32px !important;
    height: 32px !important;
    background: #ffffff !important;
    border: 1.5px solid #5E6BE5 !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    padding: 0 !important;
    margin: 0 4px 0 0 !important;
    outline: none !important;
    box-shadow: 0 1px 3px rgba(94, 107, 229, 0.15) !important;
    flex-shrink: 0 !important;
    transition: background 0.2s ease, border-color 0.2s ease !important;

    .gsb-st-bar {
        display: block !important;
        width: 15px !important;
        height: 2px !important;
        background-color: #5E6BE5 !important;
        border-radius: 2px !important;
        margin: 0 !important;
        transition: background-color 0.2s ease !important;
    }

    &:hover {
        background: #5E6BE5 !important;
        .gsb-st-bar {
            background-color: #ffffff !important;
        }
    }
}

// Expanded state
body.gs_bookshowcase_page_gs-books-shortcode:not(.folded) .gsb-sidebar-toggle {
    background: rgba(94, 107, 229, 0.1);
    border-color: #5E6BE5;

    .gsb-st-bar { background: #5E6BE5; }

    .gsb-st-bar:nth-child(2) {
        width: 9px;
    }
}


#titlediv #title {
    border-radius: 5px;
}

#gsbookshowcaseSection {
    min-width: 255px;
    border: 1px solid #e5e5e5;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
    background: #fff;
    overflow: hidden;
}

.gsb_media_uploader--wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.gsb_media_uploader {
    object-fit: contain;
    object-position: center;
	// height: auto !important;
    max-width: 100%;
    border-radius: 5px;
    box-shadow: none;
    border: 1px solid #e1e1e1;
    padding: 3px;
    display: block;
    max-width: 120px;
    max-height: 40px;
}


.book-store td:nth-child(2) {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10%;
}

.book-store td:nth-child(2) .uploaded_img {
	text-align: left !important;
    height: 50px;
    width: 100%;
}

.gs_bookshowcase-metafields .form-group {
    margin-bottom: 15px;
    overflow: hidden;
}

button.gsb_media_btn {
    width: fit-content;
    display: flex;
    justify-content: center;
    padding: 8px;
    border-color: darkgray;
    flex-shrink: 0;
    white-space: nowrap;
    border-width: thin;
}

.gs_bookshowcase-metafields label {
    width: 20%;
    padding: 6px 0px;
    float: left;
}

.gs_bookshowcase-metafields .form-control {
    border-radius: 5px;
    padding: 5px 15px;
    float: left;
    width: 50%;
    box-shadow: none;
    height: auto;
    border: 1px solid #b1b1b1;

    &::placeholder {
        color: #afb0b2;
    }
}

.form-group select {
    border-radius: 5px;
    padding: 5px 15px;
    float: left;
    width: 50%;
    box-shadow: none;
    height: 38px;
    border: 1px solid #e1e1e1;

    &::placeholder {
        color: #afb0b2;
    }

}

/* For ribbon field - Free */
.gsb-css-for-free {
    // background-color: #515365;
}

.gsb-css-for-free.gsbks-pro-only {

    .gs-input-ribbon {
        display: flex;
        flex-direction: column;
        width: 50%;
    }

}

.gs-books-ribbon-field {
    // background-color: #f50303;
    display: flex;


    .gs-input-ribbon {
        width: 50%;
    }

    .select2-container--default .select2-selection--single {
        border: 1px solid #e1e1e1;
        border-radius: 5px;
        height: 38px;
        box-shadow: none;

        .select2-selection__rendered {
            line-height: 38px;
            color: #afb0b2;
        }

        .select2-selection__arrow b {
            margin-top: 4px !important;
        }
    }
    
}

#repeatable-fieldset-one,
#repeatable-book-formats {

    thead {

        th {
            text-align: left;
            padding: 8px 12px;
            border: 1px solid #e1e1e1;
            background: #f0f0f0;  
        }
    }

    tbody {

        tr {
            background: #f8f8f8;
            margin-bottom: 6px;

            td {
                padding: 8px 12px;
                border: 1px solid #e1e1e1;

                input {
                    width: 100%;
                    border-radius: 5px;
                    padding: 5px 15px;
                    box-shadow: none;
                    height: auto;
                    border: 1px solid #e1e1e1;

                    &::placeholder {
                        color: #afb0b2;
                    }
                }
            }
        }
    }
}

#repeatable-fieldset-one {

    tbody {

        tr {

            // td:nth-child(2) {
            //     display: flex;
            //     justify-content: space-between;
            //     align-content: center;
            //     flex-wrap: wrap;
            //     gap: 10px;
            // }
        }
    }
}

#repeatable-fieldset-one td {
    overflow: hidden;
    vertical-align: middle;
}

.gs_bookshowcase-metafields h2 {
    font-weight: 600 !important;
    padding: 8px 12px 8px 0 !important;
    font-style: italic;
}

.search-filter {
    .search-fil-nbox {
        margin: 5px 0px;
    }
}

.gsp-images {
    display: flex;
    gap: 10px;

    li {
        max-height: 80px;
        max-width: 80px;
        border: 1px solid #d9d9d9;
        padding: 5px;
        border-radius: 5px;

        img {
            width: 100%;
            height: 100%;
            border-radius: 5px;
            object-fit: cover;
            object-position: center;
        }
    }
}

.gs_bookshowcase-metafields input {
    width: 300px;
    outline: none;
    margin: 4px 0;
}

#gs-bksh-image #gsbk_author_image {
    max-width: 170px !important;
}

.gs_bookshowcase_wrap .gs_bookshow_switch_label {
    margin-left: 20px;
    cursor: auto;
    font-size: 13px;
    font-style: italic;
    vertical-align: sub;
}

.gs_booksh_gallery_images .gallery-item {
    display: inline-block;
    width: 75px;
    margin: 4px;
}

.gs_booksh_gallery_images .gallery-item img {
    width: 100%;
    height: auto;
}

i.gsbookshowcase-mce-icon {
    background-image: url(gsbookshowcase.png);
}

div#gs_bookshowcase_style_settings {
    position: relative;
}

div#gs_bookshowcase_style_settings tr:first-child {
    position: absolute;
    left: 0;
    top: 35px;
    width: 100%;
    height: 100%;
    background: #f8f8f8;
    opacity: 0.6;
    z-index: 99;
    padding: 0 !important;
}

div#gs_bookshowcase_style_settings tr:first-child input {
    display: none;
}

p.gsbookshowcase_pro {
    font-size: 30px !important;
    color: #fff;
    margin-top: -90px !important;
    background: #000;
    padding: 10px;
}

.gsbookshow_pro_fea li:before {
    font-family: "FontAwesome";
    content: "\f046";
    margin: 0 5px 0 0;
    color: #f14548;
}

a.gs-pro-link {
    color: #f50303;
    font-weight: bold;
}

.gswps-admin-sidebar {
    text-align: center;
}

.gswps-admin-sidebar h3 {
    font-size: 14px;
    padding: 8px 12px;
    margin: 0;
    line-height: 1.4;
}

.gs-plugins--sort-links {

    display: flex;
    align-items: center;
    gap: 24px;
    padding: 0 30px;
    background: #fff;
    margin: 0px 0px 0 -20px;
    box-shadow: 0px 1px 10px rgba(63, 66, 87, 0.06);

    a {
        color: #515365;
        font-size: 16px;
        text-decoration: none;
        transition: color 0.3s;
        font-weight: 500;
        border-bottom: 2px solid transparent;
        line-height: 64px;
        box-shadow: none;
        outline: none;

        &.gs-sort-active {
            color: #242429;
            border-color: #5E6BE5;
        }
    }

}

.gs-book-showcase-app-view-container {

    padding: 30px 15px;
    font-size: 13px;
    color: #515365;

    .shortcodes-container {
        .gs-bookshowcase-box {
            min-height: 650px;
            min-height: 70vh;
        }
    }

    .gs-bookshowcase-box {
        padding: 30px;
        background: #fff;
        border-radius: 4px;
        box-shadow: 0px 1px 10px rgba(63, 66, 87, 0.06);
        position: relative;

        &.box-accordion {
            padding: 0;
        }
    }

    .shortcode-settings--group {
        margin-bottom: 30px;
        padding: 30px;
        background: #fff;
        border-radius: 4px;
        max-width: 800px;
        width: 100%;
        box-shadow: 0px 1px 24px rgba(152, 157, 171, 0.16);
        position: relative;
        overflow: hidden;
    }

    .shortcode-settings--left {
        margin-bottom: 24px;
    }

    .shortcode-settings--right {

        .shortcode-setting--row {
            margin-bottom: 20px;
            padding-bottom: 0px;
            border: none;
        }

    }
}

.gsbks-pro-only {
    pointer-events: none;
    opacity: .4;
}

.shortcode-setting--ribon {
    position: absolute;
    top: 18px;
    right: -37px;
    background: #345be9;
    color: #fff;
    -webkit-transform: rotate(45deg);
    -ms-transform: rotate(45deg);
    transform: rotate(45deg);
    width: 140px;
    padding: 8px 0;
    line-height: 1;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
}

.gs-book-disable--term-inner {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 999;
    display: flex;
    justify-content: center;
}

#gs-book-formats .gs-book-disable--term-inner {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 45px;
    left: 0;
    z-index: 999;
    display: flex;
    justify-content: center;
}


#gs-book-information .gs-book-disable--term-inner-info {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 455px;
    left: 0;
    z-index: 999;
    display: flex;
    justify-content: center;
}


#gs-book-stores .gs-book-disable--term-inner {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 45px;
    left: 0;
    z-index: 999;
    display: flex;
    justify-content: center;
}


.gs-book-disable--term-message {
    a {
        color: #fff;
        text-decoration: none;
        font-weight: 600;
    }

    font-size: 18px;
    background: #6472efc3;
    padding: 20px 100px;
    box-shadow: 0px 0px 50px rgba(89, 97, 109, 0.1);
    border-radius: 3px;
    color: #fff;
    letter-spacing: 1px;
    align-self: flex-start;
    margin-top: 30vh;
}

.gs-book-disable--term-message-meta-box {
    a {
        color: #fff;
        text-decoration: none;
        font-weight: 600;
    }

  font-size: 15px;
  background: #6472efc3;
  padding: 8px 20px;
  -webkit-box-shadow: 0px 0px 50px rgba(89, 97, 109, 0.1);
  box-shadow: 0px 0px 50px rgba(89, 97, 109, 0.1);
  border-radius: 3px;
  color: #fff;
  letter-spacing: 1px;
  -ms-flex-item-align: start;
  align-self: flex-start;
}

.is_pro_active {
    opacity: 0.4;
}

// One-line Pro prompt above the locked fields on the Add/Edit Book screen.
.gs-books-pro-prompt {
    position: relative;
    margin: 12px 0 14px;
    padding: 12px 36px 12px 14px;
    background: rgba(100, 114, 239, 0.08);
    border-left: 3px solid #6472ef;
    border-radius: 4px;

    p {
        margin: 0 0 8px;
        font-size: 13px;
        line-height: 1.5;
    }

    &__dismiss {
        position: absolute;
        top: 6px;
        right: 6px;
        padding: 2px;
        background: none;
        border: 0;
        color: #50575e;
        cursor: pointer;

        &:hover,
        &:focus {
            color: #1d2327;
        }
    }
}

.gs-book-disable--term-pages[hidden] {
    display: none;
}


// Sortable icons CSS
.gsbks-icon-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.gsbks-icon-preview {
    font-size: 20px;
    width: 30px;
    text-align: center;
}

.gsbks-icon-table-wrap {
    width: 45%;
}

// Icon picker (Sort Order > Book Icons)
$gsbks-accent: #6472ef;

#gsbks-icon-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    padding: 40px 16px;
    background: rgba(15, 23, 42, .55);
    backdrop-filter: blur(2px);
    overflow-y: auto;
}

.gsbks-icon-modal-inner {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 880px;
    max-height: calc(100vh - 80px);
    margin: 0 auto;
    overflow: hidden;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .25);
}

.gsbks-modal-header {
    flex: 0 0 auto;
    padding: 20px 24px 16px;
    background: #fff;
    border-bottom: 1px solid #eceef3;
}

.gsbks-header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;

    h3 {
        margin: 0;
        font-size: 18px;
        font-weight: 600;
        color: #1d2327;
    }
}

.gsbks-close-modal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    font-size: 22px;
    line-height: 1;
    color: #50575e;
    background: #f3f4f8;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease;

    &:hover,
    &:focus-visible {
        color: #1d2327;
        background: #e6e8ef;
        outline: none;
    }
}

.gsbks-search-bar {
    position: relative;

    .gsbks-search-icon {
        position: absolute;
        top: 50%;
        left: 14px;
        font-size: 14px;
        color: #8c8f94;
        transform: translateY(-50%);
        pointer-events: none;
    }

    input {
        width: 100%;
        height: 44px;
        margin: 0;
        padding: 0 14px 0 38px;
        font-size: 14px;
        color: #1d2327;
        background: #f7f8fb;
        border: 1px solid #e3e6f0;
        border-radius: 10px;
        box-shadow: none;
        transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;

        &::placeholder {
            color: #8c8f94;
        }

        &:focus {
            background: #fff;
            border-color: $gsbks-accent;
            box-shadow: 0 0 0 3px rgba(100, 114, 239, .15);
            outline: none;
        }
    }
}

.gsbks-icon-list-container {
    flex: 1 1 auto;
    padding: 8px 24px 24px;
    overflow-y: auto;
    background: #fafbfc;
}

.gsbks-icon-group {
    h4 {
        margin: 18px 0 10px;
        font-size: 11px;
        font-weight: 600;
        letter-spacing: .06em;
        text-transform: uppercase;
        color: #646970;
    }
}

.gsbks-icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
    gap: 10px;
}

.gsbks-icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 14px 8px 12px;
    text-align: center;
    background: #fff;
    border: 1px solid #e3e6f0;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;

    i {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        margin: 0;
        padding: 0;
        font-size: 20px;
        color: #1d2327;
        background: #f3f4f8;
        border: 0;
        border-radius: 10px;
        transition: background-color .15s ease, color .15s ease;
    }

    &:hover {
        border-color: $gsbks-accent;
        box-shadow: 0 4px 14px rgba(100, 114, 239, .14);

        i {
            color: $gsbks-accent;
            background: rgba(100, 114, 239, .1);
        }

        .gsbks-icon-label {
            color: #1d2327;
        }
    }

    &.is-active {
        background: rgba(100, 114, 239, .06);
        border-color: $gsbks-accent;
        box-shadow: 0 0 0 1px $gsbks-accent;

        i {
            color: #fff;
            background: $gsbks-accent;
        }

        .gsbks-icon-label {
            font-weight: 600;
            color: $gsbks-accent;
        }
    }
}

.gsbks-icon-label {
    display: block;
    max-width: 100%;
    overflow: hidden;
    font-size: 11px;
    line-height: 1.3;
    color: #646970;
    white-space: nowrap;
    text-overflow: ellipsis;
}

// The selected icon pinned above the list: one tile, not a full row.
.gsbks-active-icon-group .gsbks-icon-grid {
    grid-template-columns: repeat(auto-fill, minmax(104px, 120px));
}

.sh-disabled {
  position: relative;
  cursor: pointer;
}

.sh-disabled:before {
  content: "";
  background: rgba(255, 255, 255, 0.6);
  position: absolute;
  width: 100%;
  height: 100%;
  z-index: 10;
  top: 0;
  left: 0;
}

.sh-disabled:after {
  content: "Pro Feature";
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 20;
  background: rgba(93, 106, 227, 0.7);
  color: #fff;
  padding: 10px 30px;
  width: 100%;
  text-align: center;
  border-radius: 34px;
  white-space: nowrap;
  -webkit-transform: translateX(-50%) translateY(-50%);
      -ms-transform: translateX(-50%) translateY(-50%);
          transform: translateX(-50%) translateY(-50%);
  opacity: 0;
  -webkit-transition: all 0.25s ease;
  -o-transition: all 0.25s ease;
  transition: all 0.25s ease;
}

.sh-disabled:hover:after {
  opacity: 1;
}


.gs-book-showcase-box .gs-book-showcase-table input.shortcode-input {
    box-shadow: none !important;
    outline: none !important;
    border: none !important;
    text-align: center;
    background: #edf2f6 !important;
    border-radius: 2px !important;
    margin-right: 16px;
}
// Book Cover size note (same design as GS Team Members).
#postimagediv .gsbooks-img-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 12px 0 0;
  padding: 10px 12px;
  background: rgba(#5E6BE5, .07);
  border-left: 3px solid #5E6BE5;
  border-radius: 4px;
  color: #3c434a;
  font-size: 12.5px;
  line-height: 1.5;

  .dashicons {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin-top: 1px;
    color: #5E6BE5;
    font-size: 16px;
  }
}

#postimagediv .gsbooks-img-note--warning {
  background: #fcf9e8;
  border-left-color: #dba617;

  .dashicons {
    color: #b8860b;
  }
}

/* =========================================================================
   Add/Edit Book metaboxes (Book Information, Gallery, Stores, Formats)
   Follows the GS Logo "Additional Info" metabox.
   ========================================================================= */
$gsb-brand:        #6472ef;
$gsb-brand-soft:   rgba(100, 114, 239, 0.15);
$gsb-text:         #1d2327;
$gsb-text-muted:   #6b7280;
$gsb-border:       #dcdde6;
$gsb-border-hover: #c5c7d4;
$gsb-surface:      #ffffff;
$gsb-surface-alt:  #f7f8fb;
$gsb-danger:       #d63638;
$gsb-radius:       8px;
$gsb-radius-sm:    6px;
$gsb-shadow-sm:    0 1px 2px rgba(17, 24, 39, 0.04);
$gsb-focus-ring:   0 0 0 3px $gsb-brand-soft;

@mixin gsb-control {
    border-radius: $gsb-radius-sm;
    padding: 8px 12px;
    border: 1px solid $gsb-border;
    background: $gsb-surface;
    box-shadow: $gsb-shadow-sm;
    color: $gsb-text;
    font: inherit;
    font-size: 14px;
    line-height: 1.45;
    height: auto;
    min-height: 38px;
    margin: 0;
    transition: border-color .15s ease, box-shadow .15s ease;

    &::placeholder { color: #9ca3af; }

    &:hover:not(:focus):not([disabled]) { border-color: $gsb-border-hover; }

    &:focus {
        border-color: $gsb-brand;
        box-shadow: $gsb-focus-ring;
        outline: none;
    }
}

.gsbooks-meta-fields {
    padding: 18px 4px 4px;
    color: $gsb-text;

    .field-group {
        display: flex;
        align-items: flex-start;
        gap: 16px;
        margin-bottom: 18px;

        > label {
            flex: 0 0 22%;
            max-width: 22%;
            font-weight: 600;
            font-size: 13px;
            color: $gsb-text;
            padding-top: 9px;
            line-height: 1.4;
        }

        > .form-control,
        .field-control {
            flex: 1 1 auto;
            width: auto;
            min-width: 0;
        }

        .form-control { @include gsb-control; }

        textarea.form-control {
            line-height: 1.6;
            resize: vertical;
            min-height: 80px;
        }

        select.form-control {
            max-width: none;
            background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%236b7280' d='M6 8 0 0h12z'/></svg>");
            background-repeat: no-repeat;
            background-position: right 12px center;
            background-size: 10px;
            padding-right: 32px;
            -webkit-appearance: none;
            -moz-appearance: none;
            appearance: none;
        }
    }

    .field-control--inline {
        display: flex;
        gap: 10px;

        .form-control { flex: 1 1 auto; min-width: 0; }
    }

    .gsbooks-rating {
        padding-top: 8px;
        color: #f5b301;
    }

    .gsbooks-color {
        width: 48px;
        height: 36px;
        padding: 2px;
        border: 1px solid $gsb-border;
        border-radius: $gsb-radius-sm;
        background: $gsb-surface;
    }

    .gs-books-pro-prompt { margin: 6px 0 18px; }

    // jQuery UI datepicker input keeps a white background.
    #gsbksPublish { background: $gsb-surface; }

    @media (max-width: 782px) {
        .field-group {
            flex-direction: column;
            gap: 6px;

            > label {
                flex: 0 0 auto;
                max-width: 100%;
                padding-top: 0;
            }

            > .form-control,
            .field-control { width: 100%; }
        }
    }
}

// Shared help line above repeaters and the gallery.
.gsbooks-help {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 14px !important;
    color: $gsb-text-muted;
    font-size: 12px;

    &::before {
        content: "";
        flex: 0 0 14px;
        width: 14px;
        height: 14px;
        background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><path d='M12 16v-4'/><path d='M12 8h.01'/></svg>") no-repeat center / contain;
    }
}

// Outlined action button (Add Store, Upload Logo, Add Images...).
.gsbooks-metabox-action.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 36px;
    padding: 0 12px;
    border-radius: $gsb-radius-sm;
    font-weight: 500;
    font-size: 13px;
    line-height: 1;
    white-space: nowrap;
    color: $gsb-brand;
    background: $gsb-surface;
    border: 1px dashed $gsb-brand;
    box-shadow: none;

    &:hover,
    &:focus {
        color: #fff;
        background: $gsb-brand;
        border-style: solid;
        border-color: $gsb-brand;
    }

    &[disabled] {
        color: $gsb-brand !important;
        background: $gsb-surface !important;
        border-color: $gsb-brand !important;
    }

    .dashicons {
        position: static;
        width: 18px;
        height: 18px;
        margin: 0;
        font-size: 18px;
        line-height: 1;
        vertical-align: middle;
    }
}

// Store and format rows.
.gsbooks-repeater {
    padding: 12px 4px 6px;
    color: $gsb-text;

    &__cols--stores  { grid-template-columns: minmax(0, 1fr) 140px minmax(0, 1.4fr) 36px; }
    &__cols--formats { grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr) minmax(0, .8fr) minmax(0, 1.4fr) 36px; }

    &__head,
    &__row {
        display: grid;
        align-items: center;
        gap: 10px;
    }

    &__head {
        padding: 0 13px 6px;
        font-size: 12px;
        font-weight: 600;
        color: $gsb-text-muted;
    }

    &__row {
        margin-bottom: 14px;
        padding: 10px 12px;
        background: $gsb-surface;
        border: 1px solid $gsb-border;
        border-radius: $gsb-radius;
        box-shadow: $gsb-shadow-sm;

        .form-control {
            @include gsb-control;
            width: 100%;
            min-height: 36px;
            box-shadow: none;
        }
    }

    &__remove {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        padding: 0;
        background: transparent;
        border: 0;
        border-radius: $gsb-radius-sm;
        color: $gsb-danger;
        cursor: pointer;
    }

    @media (max-width: 1024px) {
        &__head { display: none; }
        &__row  { grid-template-columns: 1fr; }
    }
}

// Gallery placeholder.
.gsbooks-gallery {
    padding: 12px 4px 6px;

    &__empty {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
        padding: 22px 12px;
        background: $gsb-surface-alt;
        border: 1px dashed $gsb-border;
        border-radius: $gsb-radius;

        > .dashicons {
            width: 32px;
            height: 32px;
            font-size: 32px;
            color: #b6b8c2;
        }
    }
}

// Locked Pro fields with an "Upgrade to PRO" badge on top.
.gsbooks-pro-field.gsbooks-fields-disable {
    position: relative;

    > *:not(.gsbooks-pro-field__inner):not(.gs-books-pro-prompt) {
        opacity: 0.4;
        pointer-events: none;
        filter: saturate(0.6);
    }

    .gsbooks-pro-field__inner {
        position: absolute;
        inset: 0;
        z-index: 9;
        display: flex;
        align-items: center;
        justify-content: center;

        &[hidden] { display: none; }

        > a {
            padding: 8px 18px;
            border-radius: 999px;
            background: linear-gradient(135deg, #7c8bff 0%, $gsb-brand 100%);
            box-shadow: 0 10px 25px rgba(100, 114, 239, 0.35);
            color: #fff;
            font-size: 13px;
            font-weight: 600;
            letter-spacing: 0.5px;
            text-transform: uppercase;
            text-decoration: none;

            &:focus { outline: none; box-shadow: $gsb-focus-ring; }
        }
    }
}

// Long Pro section: show the badge near the top instead of mid-way down.
.gsbooks-meta-fields .gsbooks-pro-field.gsbooks-fields-disable .gsbooks-pro-field__inner {
    align-items: flex-start;
    padding-top: 60px;
}

