/* =============================================================
   Proto Theme — Product Detail Page
   Plain CSS loaded via catalog_product_view.xml.
   Overrides layout rules from _extend.less (styles-l.css).
   CSS variables --pt-* defined in :root via styles-l.css.
   ============================================================= */

/* =============================================================
   TWO-COLUMN GRID — 460px image + 440px buy panel
   ============================================================= */
.catalog-product-view .column.main {
    display:               grid !important;
    grid-template-columns: 460px 500px !important;
    gap:                   40px !important;
    justify-content:       center !important;
    align-items:           start;
    padding:               24px 0 60px;
}

/* Pre-JS column placement */
.catalog-product-view .column.main > .product.media {
    grid-column: 1;
    grid-row:    1;
    width:       100% !important;
    float:       none !important;
    margin:      0;
    align-self:  start;
}
.catalog-product-view .column.main > .product-info-main {
    grid-column: 2;
    grid-row:    1;
    width:       100% !important;
    float:       none !important;
}

/* Post-JS wrapper — same 460px + 440px columns */
.catalog-product-view .proto-pdp-2col {
    grid-column:           1 / -1;
    grid-row:              1;
    display:               grid !important;
    grid-template-columns: 460px 500px !important;
    gap:                   40px !important;
    justify-content:       center !important;
    align-items:           start;
    width:                 100%;
}
.catalog-product-view .proto-pdp-2col > .product.media {
    grid-column: 1;
    grid-row:    1;
    width:       100% !important;
    float:       none !important;
    margin:      0;
    align-self:  start;
    position:    sticky;
    top:         calc(var(--pt-utility-h) + var(--pt-header-h) + 16px);
}
.catalog-product-view .proto-pdp-2col > .product-info-main {
    grid-column: 2;
    grid-row:    1;
    width:       100% !important;
    float:       none !important;
}
.catalog-product-view .proto-pdp-2col > .pdp-trust-strip {
    grid-column: 2;
    grid-row:    2;
    align-self:  start;
}

/* =============================================================
   IMAGE GALLERY — 460px × 460px
   Fotorama sets inline width/height via JS; !important overrides.
   ============================================================= */
.catalog-product-view .product.media {
    padding:    0 !important;
    background: #ffffff;
    border:     1px solid #efefef;
    overflow:   hidden;
}

.catalog-product-view .gallery-placeholder {
    width:      100%;
    background: transparent;
    border:     none;
    box-shadow: none;
    overflow:   visible;
}

/* Fotorama stage — :not() scope prevents this height from applying in fullscreen.
   In fullscreen, fotorama's own JS resize() sets height = viewport - navHeight via
   inline style so the thumbs strip is visible. If we apply height:460px !important
   there, our CSS beats the inline style and the thumbs get pushed off-screen.
   Fotorama sets stage dimensions via inline styles — !important required to override
   in normal mode. Height matches view.xml product_page_image_medium (460px). */
.catalog-product-view .fotorama:not(.fotorama--fullscreen) .fotorama__stage {
    max-height: 460px !important;
    height:     460px !important;
}
.catalog-product-view .fotorama__stage__frame {
    width:  100% !important;
    height: 100% !important;
}
.catalog-product-view .fotorama__img {
    width:            100% !important;
    height:           100% !important;
    object-fit:       contain !important;
    object-position:  center center !important;
}

.catalog-product-view .gallery-placeholder__image {
    width:            100% !important;
    height:           460px !important;
    object-fit:       contain !important;
    object-position:  center center !important;
}

/* Thumbs strip */
.catalog-product-view .fotorama__nav-wrap {
    margin-top: 10px;
    background: transparent;
    border:     none;
    box-shadow: none;
}

/* =============================================================
   MOBILE — stack everything
   ============================================================= */
@media (max-width: 959px) {
    .catalog-product-view .column.main,
    .catalog-product-view .proto-pdp-2col {
        display:               block !important;
        grid-template-columns: none !important;
    }
    .catalog-product-view .proto-pdp-2col > .product.media {
        position: static;
    }
    .catalog-product-view .product-info-main {
        margin-top: 20px;
    }
    .catalog-product-view .fotorama:not(.fotorama--fullscreen) .fotorama__stage,
    .catalog-product-view .gallery-placeholder__image {
        height:     300px !important;
        max-height: 300px !important;
    }
}

/* =============================================================
   FULLSCREEN — fotorama JS owns the stage height.
   No height override here: fotorama resize() sets
   height = viewport - navHeight via inline style so the
   thumbs strip stays visible. Gallery.css controls img--full
   sizing via higher-specificity rules already.
   ============================================================= */
.fotorama--fullscreen .fotorama__img--full {
    max-width:  100%;
    max-height: 100vh;
}

/* =============================================================
   B2B SECONDARY ACTIONS — compact side-by-side ghost buttons
   Save to List + Add to RFQ in a single flex row.
   ============================================================= */
.rwc-b2b-actions {
    display: flex;
    gap: 8px;
    margin: 8px 0 0;
}

/* Each block fills half the row */
.rwc-b2b-actions .rwc-savedlist,
.rwc-b2b-actions #rwc-rfqcart-add-wrap {
    flex: 1;
    min-width: 0;
}

/* Hide vendor chip section — single vendor (Supply Solution) is implicit */
.rwc-b2b-actions #rwc-rfqcart-vendor-wrap {
    display: none;
}

/* Compact ghost — Save to List */
.rwc-b2b-actions .rwc-savedlist__btn {
    width: 100%;
    height: 32px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.03em;
    text-transform: none;
    color: #6b7280;
    background: transparent;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0 10px;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
    box-shadow: none;
}
.rwc-b2b-actions .rwc-savedlist__btn:hover {
    border-color: #9ca3af;
    color: #374151;
    background: transparent;
}
.rwc-b2b-actions .rwc-savedlist__btn svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

/* Compact ghost — Add to RFQ */
.rwc-b2b-actions #rwc-rfqcart-add-btn {
    width: 100%;
    height: 32px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.03em;
    color: #92400e;
    background: transparent;
    border: 1px solid #d97706;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0 10px;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    box-shadow: none;
}
.rwc-b2b-actions #rwc-rfqcart-add-btn:hover {
    background: #fffbeb;
    border-color: #b45309;
}
.rwc-b2b-actions #rwc-rfqcart-add-btn svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}
