/* ---- 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: #2e7d32;
}

.bm-addons__stock--in::before {
    background: #2e7d32;
}

.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;
}

/* ---- Compact table mode ---- */

.bm-addons--table {
    padding: 0;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    overflow: hidden;
}

.bm-addons__summary {
    display: flex;
    min-height: 64px;
    padding: 14px 20px;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    list-style: none;
}

.bm-addons__summary::-webkit-details-marker {
    display: none;
}

.bm-addons--table .bm-addons__summary .bm-addons__title {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #252525;
    font-family: "Bricolage Grotesque", "Bricolage Fallback", system-ui, sans-serif;
    font-size: clamp(21px, 1.6vw, 28px);
    line-height: 1.1;
}

.bm-addons__toggle,
.bm-addons__toggle svg {
    display: block;
    width: 22px;
    min-width: 22px;
    max-width: 22px;
    height: 22px;
    min-height: 22px;
    max-height: 22px;
    flex: 0 0 22px;
}

.bm-addons__toggle {
    transition: transform .2s ease;
}

.bm-addons[open] .bm-addons__toggle {
    transform: rotate(180deg);
}

.bm-addons__content {
    border-top: 1px solid #ece9e6;
}

.bm-addons--table .bm-addons__title {
    margin: 0;
    padding: 0.75rem 0.875rem;
    border-bottom: 1px solid #e5e5e5;
    background: #f7f7f7;
}

.bm-addons__table-wrap {
    width: 100%;
}

.bm-addons__table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.bm-addons__table th {
    padding: 0.5rem 0.625rem;
    border-bottom: 1px solid #d8d8d8;
    color: #6b6b6b;
    background: #fff;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-align: left;
    text-transform: uppercase;
}

.bm-addons__table td {
    padding: 0.625rem;
    border-bottom: 1px solid #ededed;
    vertical-align: middle;
}

.bm-addons__table tbody tr:last-child td {
    border-bottom: 0;
}

.bm-addons--table .bm-addons__item {
    display: table-row;
    border: 0;
    border-radius: 0;
    overflow: visible;
    transition: none;
}

.bm-addons--table .bm-addons__item:hover {
    background: #fafafa;
    box-shadow: none;
}

.bm-addons__col-image {
    width: 68px;
}

.bm-addons__col-stock {
    width: 92px;
}

.bm-addons__col-price {
    width: 90px;
    text-align: right !important;
}

.bm-addons__col-action {
    width: 88px;
    text-align: right !important;
}

.bm-addons--table .bm-addons__image {
    width: 68px;
}

.bm-addons--table .bm-addons__image img {
    display: block;
    width: 48px;
    height: 48px;
    object-fit: contain;
    background: #fff;
}

.bm-addons--table .bm-addons__name {
    display: inline-block;
    color: #232323;
    font-size: 0.84rem;
    font-weight: 500;
    line-height: 1.35;
}

.bm-addons--table .bm-addons__stock {
    font-size: 0.72rem;
}

.bm-addons--table .bm-addons__stock::before {
    width: 6px;
    height: 6px;
}

.bm-addons--table .bm-addons__price {
    color: #232323;
    font-size: 0.84rem;
    text-align: right;
}

.bm-addons--table .bm-addons__action {
    text-align: right;
}

.bm-addons--table .bm-addons__add-to-cart {
    min-width: 66px;
    padding: 0.4rem 0.55rem;
}

.bm-addons--table .bm-addons__defer-check {
    justify-content: flex-end;
}

.bm-addons__sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 767px) {
    .bm-addons--table {
        margin: 1rem 0;
    }

    .bm-addons__table,
    .bm-addons__table tbody {
        display: block;
        width: 100%;
    }

    .bm-addons__table thead {
        display: none;
    }

    .bm-addons__table tr {
        display: grid;
        grid-template-columns: 58px minmax(0, 1fr) auto;
        column-gap: 0.625rem;
        padding: 0.625rem;
        border-bottom: 1px solid #ededed;
    }

    .bm-addons__table tbody tr:last-child {
        border-bottom: 0;
    }

    .bm-addons__table td {
        display: block;
        width: auto;
        padding: 0;
        border: 0;
    }

    .bm-addons--table .bm-addons__image {
        grid-column: 1;
        grid-row: 1 / span 2;
        width: 58px;
    }

    .bm-addons--table .bm-addons__image img {
        width: 52px;
        height: 52px;
    }

    .bm-addons--table .bm-addons__product {
        grid-column: 2;
        grid-row: 1;
    }

    .bm-addons--table .bm-addons__stock-cell {
        grid-column: 2;
        grid-row: 2;
        align-self: end;
    }

    .bm-addons--table .bm-addons__price {
        grid-column: 3;
        grid-row: 1;
        padding-left: 0.5rem;
    }

    .bm-addons--table .bm-addons__action {
        grid-column: 3;
        grid-row: 2;
        align-self: end;
    }
}
