/*
 * BM.Market — Product Detail Page (Block 1 right column + shared bits).
 * Same design language / tokens as the product card (product-card.css):
 * yellow CTA (--color-cta), red discount (--color-badge-sale), in-store
 * (--color-instock), delivery (--color-delivery), brand marine (--color-link).
 */

.bm-pdp-info { display: flex; flex-direction: column; }

/* Title (Magento_Theme title block) — large, bold, left aligned, ≤2 lines. */
.bm-pdp-info .page-title-wrapper,
.bm-pdp-info .page-title {
    margin: 0;
}
.bm-pdp-info .page-title-wrapper .page-title,
.bm-pdp-info .page-title-wrapper > div {
    font-size: 1.6rem;
    line-height: 1.25;
    font-weight: 700;
    color: #111111;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---- Article (SKU) + copy ---- */
.bm-pdp-article {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
    padding: 10px 14px;
    background: #F8FAFC;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
}
.bm-pdp-article-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #6B7280;
}
.bm-pdp-article-sku {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-link); /* brand blue, per the mockup */
    letter-spacing: .01em;
}
.bm-pdp-copy {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    color: var(--color-link);
    background: #fff;
    border: 1px solid #E5E7EB;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.bm-pdp-copy:hover { background: var(--color-link); color: #fff; border-color: var(--color-link); }

/* ---- Rating (stars + review-count link) ---- */
.bm-pdp-rating { margin-top: 14px; display: flex; align-items: center; gap: 8px; }
.bm-pdp-rating .rating-summary { margin: 0; }
.bm-pdp-review-count { font-size: 14px; color: var(--color-link); text-decoration: none; white-space: nowrap; }
.bm-pdp-review-count:hover { text-decoration: underline; }

/* ---- Availability + delivery ---- */
.bm-pdp-avail { margin-top: 14px; }
.bm-pdp-avail .bm-card-status { font-size: 15px; font-weight: 600; }
.bm-pdp-avail .bm-card-status svg { width: 20px; height: 20px; }
.bm-pdp-delivery {
    margin: 6px 0 0;
    color: #6B7280;
    font-size: 13px;
    line-height: 1.5;
}

/* ---- Quick specifications ---- */
.bm-pdp-specs {
    margin: 18px 0 0;
    border-top: 1px solid #EEEEEE;
}
.bm-pdp-spec-row {
    display: flex;
    gap: 16px;
    padding: 9px 2px;
    border-bottom: 1px solid #EEEEEE;
    font-size: 14px;
}
.bm-pdp-spec-label { flex: 0 0 42%; color: #6B7280; }
.bm-pdp-spec-value { flex: 1 1 auto; color: #111111; font-weight: 500; }

/* ---- Buy box: price + qty + CTA + secondary ---- */
.bm-pdp-buy { margin-top: 22px; }

.bm-pdp-price .price-box { margin: 0; }
/* Current price first, old price beside it, on the same baseline. */
.bm-pdp-price .price-container {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 12px;
}
.bm-pdp-price .final-price { order: 1; }
.bm-pdp-price .old-price { order: 2; }
.bm-pdp-price .final-price .price-label:empty { display: none; }
.bm-pdp-price .price { font-size: 30px; font-weight: 700; color: #111111; }
.bm-pdp-price .old-price .price {
    font-size: 20px;
    font-weight: 500;
    color: #6B7280;
    text-decoration: line-through;
}
/* Discounted current price → red (only when an old price is present). */
.bm-pdp-price .price-container:has(.old-price) .final-price .price,
.bm-pdp-price .special-price .price,
.bm-pdp-price .minimal-price .price { color: var(--color-sale); }

.bm-pdp-cart-row {
    display: flex;
    align-items: stretch;
    gap: 12px;
    margin-top: 18px;
}
/* Add-to-Cart grows to fill; qty selector keeps its natural width. */
.bm-pdp-cart-row .bm-pdp-cart-btn {
    flex: 1 1 auto;
    width: auto;
    height: 52px;
    font-size: 15px;
}
.bm-pdp-cart-row .field.qty,
.bm-pdp-cart-row .control.qty { margin: 0; }

/* Quantity stepper: − [n] + — kit .bm-qty contract: #E5E7EB hairline,
   10px radius, white 44px buttons, bordered 56px center cell, 48px height. */
.bm-qty {
    display: inline-flex;
    align-items: stretch;
    flex: 0 0 auto;
    height: 48px;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}
.bm-qty-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    color: #111;
    background: #fff;
    cursor: pointer;
    transition: color .15s ease;
}
.bm-qty-btn:hover { color: var(--color-primary); }
.bm-qty-input {
    width: 56px;
    border: 0;
    border-left: 1px solid #E5E7EB;
    border-right: 1px solid #E5E7EB;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    -moz-appearance: textfield;
    padding: 0;
}
.bm-qty-input:focus { outline: none; box-shadow: none; }
.bm-qty-input::-webkit-outer-spin-button,
.bm-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Secondary actions: Wishlist + Compare, outlined, equal width. */
.bm-pdp-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 12px;
}
.bm-pdp-secondary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 46px;
    padding: 0 14px;
    background: #fff;
    color: var(--color-fg, #374151);
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .15s ease, color .15s ease, background-color .15s ease;
}
/* Showcase .bm-btn-outline hover: marine border + primary text, no fill. */
.bm-pdp-secondary-btn:hover { border-color: var(--color-marine-300); color: var(--color-primary); background: #fff; }
.bm-pdp-secondary-btn svg { width: 20px; height: 20px; }

.bm-pdp-oos { margin-top: 14px; }

/* ESTO monthly-payment banner under the price (relocated from extrahint).
   Override ESTO's own float/fixed width so it sits full-width in the column. */
.bm-pdp-esto { margin-top: 14px; clear: both; }
.bm-pdp-esto .esto-monthly-payment {
    float: none;
    width: 100%;
    max-width: 100%;
    margin: 0;
}
/* Shrink ESTO's oversized brand logo to a reasonable inline size. */
.bm-pdp-esto .esto-logo,
.bm-pdp-esto img {
    height: auto !important;
    max-height: 30px !important;
    width: auto !important;
}

/* Mobile: stack qty + CTA, keep secondary two-up. */
@media (max-width: 480px) {
    .bm-pdp-cart-row { flex-wrap: wrap; }
    .bm-pdp-cart-row .bm-pdp-cart-btn { flex: 1 1 100%; }
}

/* ============================================================
 * Block 2 — full-width product tabs.
 * ============================================================ */
.bm-pdp-tabs { margin-top: 2.5rem; }
.bm-pdp-tabnav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    border-bottom: 1px solid #E5E7EB;
}
.bm-pdp-tab {
    position: relative;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .02em;
    text-transform: uppercase;
    color: #6B7280;
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    cursor: pointer;
    transition: color .15s ease, border-color .15s ease;
}
.bm-pdp-tab:hover { color: #111827; }
.bm-pdp-tab.is-active {
    color: var(--color-link);
    border-bottom-color: var(--color-link);
}
.bm-pdp-tabpanel {
    padding: 1.75rem 0;
}
/* Specification: grouped sections flow into multiple columns to use the full
   page width (instead of one long vertical list). Each group stays intact. */
.bm-pdp-tabpanel .bm-spec {
    column-count: 2;
    column-gap: 3rem;
    max-width: 100%;
}
@media (min-width: 1280px) {
    .bm-pdp-tabpanel .bm-spec { column-count: 3; }
}
@media (max-width: 768px) {
    .bm-pdp-tabpanel .bm-spec { column-count: 1; }
}
.bm-spec-section {
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
    margin: 0 0 1.5rem;
    display: inline-block; /* helps break-inside honoring across browsers */
    width: 100%;
}
.bm-spec-section-title {
    margin: 0 0 0.25rem;
    padding: 0.5rem;
    background: #F3F4F6;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: #374151;
}
.bm-spec-section .additional-attributes .label { width: 45%; color: #6B7280; font-weight: 400; }
.bm-spec-section .additional-attributes .data { color: #111827; }

/* "Skatīt visus parametrus" expand / collapse (only for long spec lists). */
.bm-spec-collapsible {
    position: relative;
    max-height: 360px;
    overflow: hidden;
}
.bm-spec-collapsible.is-expanded { max-height: none; }
.bm-spec-collapsible:not(.is-expanded)::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 90px;
    background: linear-gradient(rgba(255, 255, 255, 0), #ffffff);
    pointer-events: none;
}
.bm-spec-toggle-wrap { text-align: center; margin-top: 1rem; }
.bm-spec-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: none;
    border: 0;
    color: var(--color-link);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.bm-spec-toggle:hover { text-decoration: underline; }
.bm-spec-chevron { transition: transform .2s ease; }
.bm-spec-chevron.is-up { transform: rotate(180deg); }
/* The reused section HTML (description prose, grouped spec table) sits full width
   inside the panel — strip Hyvä's inner "card" chrome so tabs read as one surface. */
.bm-pdp-tabpanel > .card,
.bm-pdp-tabpanel .card {
    border: 0;
    box-shadow: none;
    padding: 0;
    background: transparent;
}

@media (max-width: 640px) {
    .bm-pdp-tab { padding: 10px 12px; font-size: 13px; }
    .bm-pdp-tabpanel { padding: 1.25rem 0; }
}

/* ============================================================
 * Block 3 — Recently Viewed slider, light polish to the BM look.
 * (Hyvä client-side slider; styling only — markup/JS unchanged.)
 * ============================================================ */
.bm-recent-heading {
    font-size: 1.5rem;
    line-height: 1.2;
    font-weight: 700;
    color: #111827;
}
/* Slider items are kit .bm-mcard now (see product-card.css); the old
   vendor-card skin rules were removed so they don't fight the kit DOM. */


/* Gallery prev/next arrows (showcase .bm-hero-arrow circular style) — revealed
   on hover of the main image; always visible on touch (no hover). */
.bm-gal-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 15; opacity: 0; transition: opacity .2s ease; }
.bm-gal-arrow.prev { left: 12px; }
.bm-gal-arrow.next { right: 12px; }
#gallery-main:hover .bm-gal-arrow,
.bm-gal-arrow:focus-visible { opacity: 1; }
@media (hover: none) { .bm-gal-arrow { opacity: 1; } }

/* ============================================================
 * Reviews tab — showcase "Reviews" component (transplanted).
 * ============================================================ */
.bm-rev { display: grid; grid-template-columns: 280px 1fr; gap: 40px; align-items: start; }
@media (max-width: 900px) { .bm-rev { grid-template-columns: 1fr; gap: 28px; } }
/* Rating summary */
.bm-rev-sum-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.bm-rev-score { font-size: 44px; font-weight: 700; line-height: 1; color: var(--color-fg); }
.bm-rev-stars { display: inline-flex; gap: 1px; color: #FBBF24; line-height: 0; }
.bm-rev-stars .bm-rev-star-off { color: #D1D5DB; }
.bm-rev-count { display: block; font-size: 13px; color: var(--color-fg-muted); margin-top: 3px; }
.bm-rev-bars { display: flex; flex-direction: column; gap: 6px; }
.bm-rev-bar { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.bm-rev-bar-lvl { width: 12px; color: var(--color-fg-secondary); }
.bm-rev-bar-star { color: #FBBF24; flex-shrink: 0; line-height: 0; }
.bm-rev-bar-track { flex: 1; height: 8px; border-radius: 999px; background: #EEF1F4; overflow: hidden; }
.bm-rev-bar-fill { display: block; height: 100%; background: #FBBF24; border-radius: 999px; }
.bm-rev-bar-num { width: 24px; text-align: right; color: var(--color-fg-muted); }
/* Review items */
/* Right column: review items then the write-a-review form, stacked full-width. */
.bm-rev-right { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.bm-rev .bm-rev-star-off { color: #D1D5DB; }
.bm-rev-items { display: flex; flex-direction: column; gap: 14px; }
/* Per-review average (stars + numeric) + sub-ratings (like the form). */
.bm-rev-avg { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.bm-rev-avg-num { font-size: 15px; font-weight: 700; color: var(--color-fg); }
.bm-rev-subs { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.bm-rev-sub { display: flex; align-items: center; gap: 12px; }
.bm-rev-sub-label { width: 78px; font-size: 13px; color: var(--color-fg-secondary); }
.bm-rev-sub-stars { display: inline-flex; gap: 2px; color: #FBBF24; line-height: 0; }
.bm-rev-item { border: 1px solid #E5E7EB; border-radius: 12px; padding: 18px 20px; }
.bm-rev-item-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.bm-rev-author { display: flex; align-items: center; gap: 10px; }
.bm-rev-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--color-marine-50); color: var(--color-marine-700); font-size: 14px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; text-transform: uppercase; }
.bm-rev-name { font-size: 14px; font-weight: 600; color: var(--color-fg); }
.bm-rev-date { font-size: 12.5px; color: var(--color-fg-muted); white-space: nowrap; }
.bm-rev-item-stars { display: inline-flex; gap: 1px; margin-bottom: 8px; color: #FBBF24; line-height: 0; }
.bm-rev-item-stars .bm-rev-star-off { color: #D1D5DB; }
.bm-rev-title { display: block; font-size: 14.5px; font-weight: 700; margin-bottom: 4px; color: var(--color-fg); }
.bm-rev-body { margin: 0; font-size: 14px; line-height: 1.6; color: var(--color-fg-secondary); }
/* Write-a-review form */
.bm-rev-form { border: 1px solid #E5E7EB; border-radius: 12px; padding: 22px 24px; max-width: none; width: 100%; }
.bm-rev-form-title { display: block; font-size: 16px; font-weight: 700; margin-bottom: 16px; color: var(--color-fg); }
.bm-rev-crit { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.bm-rev-crit-label { width: 74px; font-size: 14px; font-weight: 600; }
.bm-rev-crit-stars { display: inline-flex; gap: 3px; color: #FBBF24; }
.bm-rev-req { color: #E30613; }
.bm-rev-field-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.bm-rev-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
@media (max-width: 520px) { .bm-rev-grid2 { grid-template-columns: 1fr; } }
.bm-rev-form textarea.bm-input { height: auto; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.bm-rev-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.bm-rev-note { font-size: 12.5px; color: var(--color-fg-muted); }
/* Inline messages (after submit — not a toast) */
.bm-rev-msg { display: flex; align-items: center; gap: 10px; border-radius: 10px; padding: 12px 16px; font-size: 14px; margin-bottom: 12px; }
.bm-rev-msg svg { flex-shrink: 0; }
.bm-rev-msg.success { background: #F0FDF4; border: 1px solid #BBF7D0; color: #166534; }
.bm-rev-msg.error { background: #FEF2F2; border: 1px solid #FECACA; color: #991B1B; }
