/* ---- Shared ---- */

.bm-addons {
    margin: 1.5rem 0;
    padding: 1rem;
    border-top: 1px solid #e5e5e5;
    background: #fff;
    border-radius: 6px;
}

.bm-addons__item {
    background: #fff;
}

.bm-addons__title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 1rem;
}

.bm-addons__item {
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.bm-addons__item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.bm-addons__link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.bm-addons__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bm-addons__name {
    font-size: 0.875rem;
    line-height: 1.3;
    color: inherit;
    text-decoration: none;
}

.bm-addons__name:hover {
    text-decoration: underline;
}

.bm-addons__price {
    font-size: 0.9rem;
    font-weight: 700;
    color: #232323;
    white-space: nowrap;
}

.bm-addons__stock {
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
}

.bm-addons__stock::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.bm-addons__stock--in {
    color: #4caf50;
}

.bm-addons__stock--in::before {
    background: #4caf50;
}

.bm-addons__stock--out {
    color: #b71c1c;
}

.bm-addons__stock--out::before {
    background: #b71c1c;
}

.bm-addons__add-to-cart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    padding: 0.4rem 0.75rem;
    white-space: nowrap;
}

.bm-addons__add-to-cart:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.bm-addons__add-to-cart .material-icons {
    font-size: 1.1rem;
}

/* ---- Deferred mode (checkbox) ---- */

.bm-addons__defer-check {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    font-size: 0.8rem;
    user-select: none;
    white-space: nowrap;
}

.bm-addons__defer-check input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.bm-addons__defer-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: 2px solid #ccc;
    border-radius: 3px;
    flex-shrink: 0;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.bm-addons__defer-mark::after {
    content: '';
    display: block;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    opacity: 0;
    transition: opacity 0.15s ease;
}

.bm-addons__defer-check input:checked + .bm-addons__defer-mark {
    background: #2fb5d2;
    border-color: #2fb5d2;
}

.bm-addons__defer-check input:checked + .bm-addons__defer-mark::after {
    opacity: 1;
}

.bm-addons__defer-check--disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.bm-addons__defer-label {
    color: #555;
}

/* ---- Grid mode ---- */

.bm-addons--grid .bm-addons__grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.bm-addons--grid .bm-addons__item {
    flex: 0 0 calc(25% - 0.75rem);
    min-width: 140px;
}

.bm-addons--grid .bm-addons__image {
    aspect-ratio: 1;
    overflow: hidden;
    background: #f5f5f5;
}

.bm-addons--grid .bm-addons__body {
    padding: 0.5rem 0.75rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.bm-addons--grid .bm-addons__name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bm-addons--grid .bm-addons__actions {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.bm-addons--grid .bm-addons__add-to-cart {
    width: 100%;
}

@media (max-width: 767px) {
    .bm-addons--grid .bm-addons__item {
        flex: 0 0 calc(50% - 0.5rem);
    }
}

@media (max-width: 479px) {
    .bm-addons--grid .bm-addons__item {
        flex: 0 0 100%;
    }
}

/* ---- List mode ---- */

.bm-addons--list .bm-addons__grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.bm-addons--list .bm-addons__item {
    display: flex;
    align-items: stretch;
}

.bm-addons--list .bm-addons__link {
    flex-shrink: 0;
}

.bm-addons--list .bm-addons__image {
    width: 70px;
    height: 100%;
    min-height: 70px;
    overflow: hidden;
    background: #f5f5f5;
}

.bm-addons--list .bm-addons__body {
    flex: 1;
    min-width: 0;
    padding: 0.5rem 0.75rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.35rem;
}

.bm-addons--list .bm-addons__actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.bm-addons--list .bm-addons__price {
    margin-left: auto;
}

/* =====================================================================
   Slider (horizontal rail) display mode — compact, ~2.2 cards visible.
   ===================================================================== */
.bm-addons--slider .bm-addons__grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.4rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
}
.bm-addons--slider .bm-addons__grid::-webkit-scrollbar { display: none; }

/* Compact CRO rail: 3 cards visible, short tiles, low height. */
.bm-addons--slider .bm-addons__item {
    flex: 0 0 calc(33.333% - 0.27rem);
    max-width: calc(33.333% - 0.27rem);
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    border: 1px solid #ece5d8;
    border-radius: 8px;
    background: #fff;
    padding: 0.3rem;
}
.bm-addons--slider .bm-addons__item:has(input:checked) {
    border-color: #2A1F18;
    background: #faf7f1;
    box-shadow: 0 0 0 1px #2A1F18 inset;
}
.bm-addons--slider .bm-addons__link { flex-shrink: 0; }
.bm-addons--slider .bm-addons__image {
    width: 100%;
    aspect-ratio: auto;
    height: 58px;
    min-height: 0;
    overflow: hidden;
    border-radius: 5px;
    background: #f5f5f5;
}
.bm-addons--slider .bm-addons__image img { width: 100%; height: 100%; object-fit: cover; }
.bm-addons--slider .bm-addons__body {
    flex: 1;
    min-width: 0;
    padding: 0.3rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.bm-addons--slider .bm-addons__name { font-size: 0.62rem; line-height: 1.2; }
.bm-addons--slider .bm-addons__actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    margin-top: auto;
}
.bm-addons--slider .bm-addons__price { margin-left: 0; font-size: 0.74rem; }
.bm-addons--slider .bm-addons__defer-label { font-size: 0.56rem; }
.bm-addons--slider .bm-addons__defer-mark { width: 14px; height: 14px; }
.bm-addons--slider .bm-addons__stock { display: none; }
