/* ==========================================================================
   2/3 & 1/3 Artisan Single Product Layout (CSS Grid)
   ========================================================================== */

.bms-single-product-layout {
    display: grid;
    grid-template-columns: 1fr 340px; /* Fluid left column, fixed 340px right column */
    gap: 48px;
    max-width: 1240px;
    margin: 40px auto;
    padding: 0 24px;
    box-sizing: border-box;
    align-items: start; /* Required for position: sticky to work in the right column */
}

/* Explicitly assign DOM elements to Grid Columns for Desktop */
.bms-product-header,
.bms-product-gallery,
.bms-detailed-content {
    grid-column: 1 / 2;
    min-width: 0; /* Prevents overflow blowouts in CSS Grid */
}

.bms-sidebar-column {
    grid-column: 2 / 3;
    grid-row: 1 / span 4; /* Stretches the track down so the sticky card has room to travel */
    height: 100%; /* Ensures the track takes full height of the parent grid */
}

@media (max-width: 991px) {
    .bms-single-product-layout {
        display: flex; /* Revert to flex column for mobile stacking */
        flex-direction: column;
        gap: 32px;
    }
    
    /* Reset all desktop grid assignments so elements naturally stack in DOM order */
    .bms-product-header,
    .bms-product-gallery,
    .bms-detailed-content,
    .bms-sidebar-column {
        width: 100%;
    }
}

/* Header & Typography */
.bms-product-header {
    margin-bottom: 24px;
}
.bms-discipline-kicker {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 700;
    color: #8c827a;
    margin-bottom: 8px;
}
.bms-discipline-kicker a {
    color: inherit;
    text-decoration: none;
}
.bms-product-title {
    font-size: 32px;
    line-height: 1.2;
    margin: 0 0 10px 0;
    font-weight: 600;
    color: #1a1a1a;
}
.bms-byline {
    font-size: 15px;
    color: #666;
    margin: 0;
}
.bms-byline-maker {
    color: #1a1a1a;
    font-weight: 600;
    text-decoration: underline;
}

/* Gallery & Thumbnails */
.bms-product-gallery {
    display: flex;
    flex-direction: row-reverse;
    gap: 1rem;
}
.bms-gallery-viewport {
    width: 100%;
    background: #fbfbfb;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 16px;
}
.bms-hero-image {
    width: 100%;
    height: auto;
    max-height: 560px;
    object-fit: contain;
    display: block;
    transition: opacity 0.2s ease-in-out;
}
.bms-thumbnails-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 8px;
}
.bms-thumb-btn {
    flex: 0 0 75px;
    width: 75px;
    height: 75px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 4px;
    background: #f0f0f0;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.15s ease;
}
.bms-thumb-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.bms-thumb-btn.is-active {
    border-color: #222222;
}
@media (max-width: 768px) {
    /* Stack gallery cleanly on mobile */
    .bms-product-gallery {
        flex-direction: column;
    }
    .bms-thumbnails-row {
        flex-direction: row;
        overflow-x: auto;
    }
}

/* Editorial Content */
.bms-section-title {
    font-size: 20px;
    margin: 36px 0 16px 0;
    font-weight: 600;
    color: #1a1a1a;
    border-bottom: 1px solid #eaeaea;
    padding-bottom: 8px;
}
.bms-content-entry {
    font-size: 16px;
    line-height: 1.7;
    color: #333333;
}

/* Maker Profile Card */
.bms-maker-card {
    background: #f9f8f6;
    border: 1px solid #eee8df;
    border-radius: 8px;
    padding: 24px;
    margin-top: 40px;
}
.bms-maker-card-header {
    display: flex;
    gap: 16px;
    align-items: center;
}
.bms-maker-avatar .bms-maker-thumb {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}
.bms-maker-eyebrow {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #888;
    font-weight: 700;
}
.bms-maker-name {
    margin: 2px 0 4px 0;
    font-size: 18px;
}
.bms-maker-name a {
    color: #111;
    text-decoration: none;
}
.bms-maker-tagline {
    margin: 0;
    font-size: 14px;
    color: #555;
}
.bms-maker-location {
    margin: 4px 0 0 0;
    font-size: 12px;
    color: #777;
}
.bms-maker-quote {
    margin: 16px 0;
    padding-left: 14px;
    border-left: 2px solid #c9b9a6;
    font-style: italic;
    color: #444;
}
.bms-maker-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}
.bms-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 3px;
    background: #fff;
    border: 1px solid #ddd;
}
.bms-maker-footer {
    margin-top: 16px;
}
.bms-link-forward {
    font-size: 14px;
    font-weight: 600;
    color: #222;
    text-decoration: none;
}
.bms-link-forward:hover {
    text-decoration: underline;
}

/* Related Product Cards Grid Layout */
.bms-products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 24px;
}
@media (max-width: 991px) {
    .bms-products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 640px) {
    .bms-products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Sticky Sidebar & Commerce Actions */
.bms-sticky-card {
    position: -webkit-sticky;
    position: sticky;
    top: 96px; /* 72px Header height + 24px breathing room */
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    z-index: 10;
}

.bms-price-box {
    font-size: 24px;
    font-weight: 700;
    color: #111;
    margin-bottom: 16px;
}
.bms-price-box del {
    font-weight: 400;
    color: #999;
    font-size: 18px;
    margin-right: 6px;
}

/* Fulfillment Panel in Sidebar */
.bms-fulfillment-panel {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 14px;
    margin-bottom: 20px;
}
.bms-panel-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 3px;
    margin-bottom: 8px;
}
.bms-badge-preorder { background: #e0f2fe; color: #0369a1; }
.bms-badge-threshold { background: #fef3c7; color: #92400e; }
.bms-badge-mto { background: #f3e8ff; color: #6b21a8; }
.bms-panel-date {
    margin: 0 0 6px 0;
    font-size: 13px;
    color: #333;
}
.bms-panel-notice {
    margin: 0;
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

/* Threshold Progress Bar */
.bms-progress-wrap {
    margin-top: 8px;
}
.bms-progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-bottom: 4px;
}
.bms-progress-track {
    background: #e2e8f0;
    border-radius: 4px;
    height: 8px;
    overflow: hidden;
}
.bms-progress-fill {
    background: #0284c7;
    height: 100%;
}
.bms-cap-note {
    display: block;
    font-size: 11px;
    color: #777;
    margin-top: 6px;
}

/* Native Woo Add to Cart Adjustments */
.bms-purchase-actions form.cart {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 0;
}
.bms-purchase-actions .single_add_to_cart_button {
    width: 100%;
    padding: 14px;
    font-size: 15px;
    font-weight: 600;
    background: #1a1a1a;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}
.bms-purchase-actions .single_add_to_cart_button:hover {
    background: #333333;
}

/* Custom Variant Trigger */
.bms-divider {
    border: none;
    border-top: 1px solid #eee;
    margin: 20px 0;
}
.bms-inquiry-prompt {
    font-size: 12px;
    color: #666;
    margin: 0 0 10px 0;
    line-height: 1.4;
}
.bms-button-secondary {
    width: 100%;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;
    background: #ffffff;
    color: #333333;
    border: 1px solid #cccccc;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}
.bms-button-secondary:hover {
    border-color: #222;
    color: #000;
}

.bms-product-header{
    width:100%;
    grid-column: 1 / 2;
}

.product-hero{
    display: flex;
    gap:1rem;
    justify-content: space-between;
    flex-direction: column;
}

@media (min-width: 640px) {
    flex-direction:row
}
