/* ==========================================================================
   Moodboard - Single Template
   ========================================================================== */

/* Consistent paragraph sizing across the moodboard, lightbox and inline panel. */
#single-moodboard-wrapper p,
.moodboard-lightbox p,
.moodboard-inline-product p {
    line-height: 1.5rem !important;
    font-size: 0.95rem !important;
}

.moodboard-header {
    max-width: 800px;
    margin: 0 auto 1.5rem;
    text-align: center;
}

.moodboard-title {
    color: #000;
    font-size: 3rem;
    line-height: 3.6rem;
    font-weight: 600;
    text-align: center;
    display: block;
    width: 100%;
    max-width: 970px;
    margin: 0 auto 20px;
}

.moodboard-introduction {
    font-size: 1.1rem;
    line-height: 1.7;
}

/* ==========================================================================
   Grid - Full width, image only
   ========================================================================== */

.moodboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 0;
}

.moodboard-grid__item {
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.moodboard-grid__item:hover {
    opacity: 0.85;
}

.moodboard-grid__image {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    position: relative;
}

.moodboard-grid__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* AP sequential label — hidden on grid by default; shown on grid at mobile,
   and always shown on lightbox / inline-product image. */
.moodboard-ap-label {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    background: #000;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1;
    padding: 4px 6px;
    letter-spacing: 0.5px;
    pointer-events: none;
}

.moodboard-grid__image .moodboard-ap-label {
    display: none;
}

@media (max-width: 767px) {
    .moodboard-grid__image .moodboard-ap-label {
        display: inline-block;
    }
}

/* 6 columns at 1800px+ */
@media (min-width: 1800px) {
    .moodboard-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* 4 columns default — already set above */

/* 3 columns */
@media (max-width: 991px) {
    .moodboard-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 1 column */
@media (max-width: 767px) {
    .moodboard-grid {
        grid-template-columns: 1fr;
    }

    .moodboard-title {
        font-size: 1.8rem;
    }
}

/* ==========================================================================
   Lightbox
   ========================================================================== */

.moodboard-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
}

.moodboard-lightbox[aria-hidden="false"] {
    display: flex;
}

.moodboard-lightbox__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.moodboard-lightbox__container {
    position: relative;
    z-index: 1;
    background: #fff;
    /* Width is bounded by viewport on the long edge AND by viewport-height-via-aspect-ratio,
       so the aspect-ratio-derived height never exceeds the viewport. The image (65% of width)
       is then guaranteed square: 65% of W = 13/20 of W = container height. */
    width: min(calc(100vw - 20px), 1400px, calc((100vh - 40px) * 20 / 13));
    aspect-ratio: 20 / 13;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Nav buttons */
.moodboard-lightbox__nav {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 2;
    display: flex;
    gap: 10px;
}

.moodboard-lightbox__prev,
.moodboard-lightbox__next,
.moodboard-lightbox__close {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #333;
    color: #fff;
    font-size: 0;
    line-height: 1;
    padding: 0;
    transition: background 0.2s ease;
}

.moodboard-lightbox__prev:hover,
.moodboard-lightbox__next:hover,
.moodboard-lightbox__close:hover {
    background: #555;
}

.moodboard-lightbox__prev .fa,
.moodboard-lightbox__next .fa {
    font-size: 12px;
    line-height: 1;
}

.moodboard-lightbox__close .fa {
    font-size: 13px;
    line-height: 1;
}

/* Content layout */
.moodboard-lightbox__content {
    display: flex;
    flex-direction: row;
    flex: 1;
    overflow: hidden;
}

.moodboard-lightbox__loading {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 4rem;
    font-size: 1.1rem;
    color: #999;
}

/* Product inside lightbox */
.moodboard-lightbox__content .woocommerce.single-product {
    width: 100%;
    height: 100%;
}

.moodboard-lightbox__content .product {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 100%;
}

.moodboard-lightbox__content .moodboard-lightbox__image {
    flex: none;
    width: 65%;
    height: 100%;
    overflow: hidden;
    position: relative;
}

/* "View Product" CTA shown above the cart form.
   Rendered as a capitalised dark-red underlined text link rather than a button,
   overriding the shared .moodboard-lightbox__view-product button styling. */
.moodboard-lightbox__view-product.moodboard-lightbox__view-product--above,
.moodboard-lightbox__view-product.moodboard-lightbox__view-product--above:hover,
.moodboard-inline-product .moodboard-lightbox__view-product.moodboard-lightbox__view-product--above,
.moodboard-inline-product .moodboard-lightbox__view-product.moodboard-lightbox__view-product--above:hover {
    display: inline-block;
    margin-top: 0;
    margin-bottom: 1rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: #5b201a;
    text-transform: uppercase;
    text-decoration: underline;
    font-weight: 600;
}

.moodboard-lightbox__content .plants-stock-notice,
.moodboard-inline-product .plants-stock-notice {
    display: none;
}

.moodboard-lightbox__content .moodboard-lightbox__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.moodboard-lightbox__content .moodboard-lightbox__summary {
    flex: 1;
    padding: 40px 20px;
    overflow-y: auto;
    height: 100%;
    /* Grid with `align-content: safe center` centers content when there's
       room and falls back to start-aligned (top-aligned + scrollable) when
       content overflows — handling both cases without breaking scroll. */
    display: grid;
    align-content: safe center;
}

.moodboard-lightbox__content .moodboard-lightbox__summary-inner {
    width: 100%;
}

/* WooCommerce styles inside lightbox — high specificity to override theme */
.moodboard-lightbox__content .woocommerce.single-product div.product .product_title {
    text-transform: uppercase;
    font-weight: 600;
    font-family: "Halant", serif;
    font-size: 24px;
    line-height: 1.2;
    margin: 0;
    border: none;
    padding: 0;
}

.moodboard-lightbox__content .woocommerce.single-product div.product .product_title .common-name {
    font-size: 1.2rem;
    font-weight: 500;
    display: block;
}

.moodboard-lightbox__content .woocommerce.single-product .price {
    font-size: 1.3rem;
    color: #929d66;
    margin-bottom: 0;
    display: block;
}

.moodboard-lightbox__content .woocommerce.single-product .woocommerce-product-details__short-description {
    margin: 10px 0;
    line-height: 1.6;
}

.moodboard-lightbox__content .single-product .has-case.cart-form-outter {
    margin-bottom: 20px;
    padding: 15px;
}

.moodboard-lightbox__content .single-product .has-case.cart-form-outter form.cart {
    border: none;
    padding: 0;
}

.moodboard-lightbox__content .single-product .has-case.cart-form-outter form.cart select,
.moodboard-lightbox__content .single-product .has-case.cart-form-outter .variations_form select {
    max-width: 100%;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

.moodboard-lightbox__content .single-product .has-case.cart-form-outter .variations {
    max-width: 100%;
}

.moodboard-lightbox__content .single-product .has-case.cart-form-outter .variations td,
.moodboard-lightbox__content .single-product .has-case.cart-form-outter .variations th {
    max-width: 100%;
}

.moodboard-lightbox__content .woocommerce.single-product div.qty {
    float: left;
    display: block;
    padding-right: 8px;
    line-height: 40px;
}

.moodboard-lightbox__content .single-product .has-case.cart-form-outter form.cart .quantity {
    display: block;
    float: left;
}

.moodboard-lightbox__content .single-product .has-case.cart-form-outter form.cart .quantity .input-text {
    width: 60px;
}

/* View Product button */
.moodboard-lightbox__view-product {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.6rem 1.8rem;
    border: 2px solid #333;
    background: transparent;
    color: #333;
    text-transform: uppercase;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.moodboard-lightbox__view-product:hover {
    background: #333;
    color: #fff;
    text-decoration: none;
}

/* Body scroll lock */
body.moodboard-lightbox-open {
    overflow: hidden;
}

/* ==========================================================================
   Mobile — Inline product panel (replaces lightbox)
   ========================================================================== */

.moodboard-inline-product {
    display: none;
    grid-column: 1 / -1;
    background: #fff;
    position: relative;
    padding: 1.5rem;
}

.moodboard-inline-product__close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #333;
    color: #fff;
    font-size: 0;
    padding: 0;
    line-height: 1;
}

.moodboard-inline-product__close .fa {
    font-size: 16px;
    line-height: 1;
}

.moodboard-inline-product__close:hover {
    background: #555;
}

.moodboard-inline-product__loading {
    padding: 2rem;
    text-align: center;
    color: #999;
}

.moodboard-inline-product .woocommerce.single-product {
    width: 100%;
}

.moodboard-inline-product .product {
    display: flex;
    flex-direction: column;
}

.moodboard-inline-product .moodboard-lightbox__image {
    display: none;
}

.moodboard-inline-product .moodboard-lightbox__summary {
    padding: 0;
    overflow: hidden;
    max-width: 100%;
    box-sizing: border-box;
}

.moodboard-inline-product .moodboard-lightbox__summary * {
    max-width: 100%;
    box-sizing: border-box;
}

.moodboard-inline-product .woocommerce.single-product div.product .product_title {
    text-transform: uppercase;
    font-weight: 600;
    font-family: "Halant", serif;
    font-size: 24px;
    line-height: 1.2;
    margin: 0 0 5px 0;
    border: none;
    padding: 0;
}

.moodboard-inline-product .woocommerce.single-product div.product .product_title .common-name {
    font-size: 1.2rem;
    font-weight: 500;
    display: block;
}

.moodboard-inline-product .woocommerce.single-product .price {
    font-size: 1.3rem;
    color: #929d66;
    margin-bottom: 1rem;
    display: block;
}

.moodboard-inline-product .woocommerce.single-product .woocommerce-product-details__short-description {
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.moodboard-inline-product .single-product .has-case.cart-form-outter {
    margin-bottom: 20px;
    padding: 15px;
}

.moodboard-inline-product .single-product .has-case.cart-form-outter form.cart {
    border: none;
    padding: 0;
}

.moodboard-inline-product .single-product .has-case.cart-form-outter form.cart select,
.moodboard-inline-product .single-product .has-case.cart-form-outter .variations_form select {
    max-width: 100%;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

.moodboard-inline-product .single-product .has-case.cart-form-outter .variations {
    max-width: 100%;
}

.moodboard-inline-product .single-product .has-case.cart-form-outter .variations td,
.moodboard-inline-product .single-product .has-case.cart-form-outter .variations th {
    max-width: 100%;
}

.moodboard-inline-product .woocommerce.single-product div.qty {
    float: left;
    display: block;
    padding-right: 8px;
    line-height: 40px;
}

.moodboard-inline-product .single-product .has-case.cart-form-outter form.cart .quantity {
    display: block;
    float: left;
}

.moodboard-inline-product .single-product .has-case.cart-form-outter form.cart .quantity .input-text {
    width: 60px;
}

.moodboard-inline-product .moodboard-lightbox__view-product {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.6rem 1.8rem;
    border: 2px solid #333;
    background: transparent;
    color: #333;
    text-transform: uppercase;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-decoration: none;
}

.moodboard-inline-product .moodboard-lightbox__view-product:hover {
    background: #333;
    color: #fff;
}

/* Add to cart button states */
.moodboard-lightbox__summary .single_add_to_cart_button.loading,
.moodboard-inline-product .single_add_to_cart_button.loading {
    opacity: 0.6;
    pointer-events: none;
}

.moodboard-lightbox__summary .single_add_to_cart_button.added::after,
.moodboard-inline-product .single_add_to_cart_button.added::after {
    content: ' \2713';
}

/* Hide desktop lightbox on mobile */
@media (max-width: 767px) {
    .moodboard-lightbox {
        display: none !important;
    }
}

/* ==========================================================================
   Garden Design content (lightbox + inline panel)
   ========================================================================== */

/* "Garden Design" and "Contact Us" CTAs in the Garden Design view:
   dark red by default, black on hover. */
/* Three classes are needed to outrank the theme's `.woocommerce a.button`
   rule (specificity 0,2,1) that otherwise forces these black. */
.moodboard-lightbox__view-product.moodboard-lightbox__garden-design.button,
.moodboard-lightbox__view-product.moodboard-lightbox__contact-us.button {
    background: #5b201a;
    border-color: #5b201a;
    color: #fff;
}

.moodboard-lightbox__view-product.moodboard-lightbox__garden-design.button:hover,
.moodboard-lightbox__view-product.moodboard-lightbox__contact-us.button:hover {
    background: #000;
    border-color: #000;
    color: #fff;
}

.moodboard-lightbox__content .moodboard-gd .moodboard-gd__description,
.moodboard-inline-product .moodboard-gd .moodboard-gd__description {
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* Garden Design description (not the Contact block) gets a little top spacing. */
.moodboard-lightbox__content .moodboard-gd .moodboard-gd__description:not(.moodboard-gd__contact),
.moodboard-inline-product .moodboard-gd .moodboard-gd__description:not(.moodboard-gd__contact) {
    margin-top: 20px;
}

.moodboard-lightbox__content .moodboard-gd .moodboard-gd__description p:last-child,
.moodboard-inline-product .moodboard-gd .moodboard-gd__description p:last-child {
    margin-bottom: 0;
}
