/**
 * BulkDevices product card - shared across homepage, sliders, and catalog lists.
 */

.bb-product-card,
.home-product-tabs__card {
    --bb-card-accent: #eb7d1e;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.bb-product-card:hover,
.home-product-tabs__card:hover {
    border-color: rgb(235 125 30 / 0.45);
    box-shadow: 0 8px 24px rgb(15 23 42 / 0.08);
}

.bb-product-card__media,
.home-product-tabs__media {
    display: block;
    position: relative;
    width: 100%;
    max-width: 100%;
    height: 0;
    padding: 0 0 100%;
    overflow: hidden;
    background: #ffffff;
    box-sizing: border-box;
    /* Padding-bottom square: reliable on iOS WebKit (Safari + Chrome). */
    aspect-ratio: auto;
}

.bb-product-card__img,
.home-product-tabs__img {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    right: auto !important;
    bottom: auto !important;
    width: auto !important;
    height: auto !important;
    max-width: calc(100% - 2rem) !important;
    max-height: calc(100% - 2rem) !important;
    margin: 0 !important;
    transform: translate(-50%, -50%);
    object-fit: contain;
    object-position: center;
    display: block;
}

.bb-product-card__body,
.home-product-tabs__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0.5rem;
    padding: 1rem 1rem 1.125rem;
}

.bb-product-card__name,
.home-product-tabs__name {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 700;
    line-height: 1.3;
}

.bb-product-card__name a,
.home-product-tabs__name a {
    color: #1f2937;
    text-decoration: none;
}

.bb-product-card__name a:hover,
.home-product-tabs__name a:hover {
    color: var(--bb-card-accent);
}

.bb-product-card__desc,
.home-product-tabs__desc {
    margin: 0;
    flex: 1;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: #6b7280;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bb-product-card__price,
.home-product-tabs__price {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.125rem;
    margin: 0;
    font-size: 1.0625rem;
    font-weight: 700;
    color: #1f2937;
    text-align: center;
    line-height: 1.25;
}

.bb-product-card__price-excl,
.home-product-tabs__price .bb-product-card__price-excl {
    display: block;
    font-size: 1.0625rem;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.25;
}

.bb-product-card__price-incl,
.home-product-tabs__price .bb-product-card__price-incl {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: #9ca3af;
    line-height: 1.3;
}

.bb-product-card__price-label,
.home-product-tabs__price-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: #9ca3af;
    margin-right: 0;
}

.bb-product-card__atc-form {
    margin: 0;
    margin-top: 0.25rem;
}

.bb-product-card__actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.bb-product-card__qty-selector {
    display: inline-flex;
    align-items: stretch;
    align-self: center;
    width: auto;
    max-width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    overflow: hidden;
    background: #ffffff;
    box-sizing: border-box;
}

.bb-product-card__qty-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 2.25rem;
    width: 2.25rem;
    min-height: 2.25rem;
    margin: 0;
    padding: 0;
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1;
    color: #1f2937;
    background: #f9fafb;
    border: none;
    cursor: pointer;
    appearance: none;
    transition: background-color 0.15s ease;
}

.bb-product-card__qty-btn--decrement {
    border-right: 1px solid #d1d5db;
}

.bb-product-card__qty-btn--increment {
    border-left: 1px solid #d1d5db;
}

.bb-product-card__qty-btn:hover:not(:disabled) {
    background: #f3f4f6;
}

.bb-product-card__qty-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.bb-product-card__qty {
    flex: 0 0 2.75rem;
    width: 2.75rem;
    min-width: 2.75rem;
    margin: 0;
    padding: 0.375rem 0.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    color: #1f2937;
    background: #ffffff;
    border: none;
    border-radius: 0;
    box-shadow: none;
    outline: none;
    box-sizing: border-box;
    appearance: textfield;
}

.bb-product-card__qty::-webkit-outer-spin-button,
.bb-product-card__qty::-webkit-inner-spin-button {
    margin: 0;
    appearance: none;
}

.bb-product-card__cta,
.home-product-tabs__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 0.25rem;
    padding: 0.625rem 0.875rem;
    min-height: 2.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    font-family: inherit;
    line-height: 1.25;
    color: #ffffff !important;
    background: var(--bb-card-accent) !important;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    box-sizing: border-box;
    appearance: none;
    transition: background-color 0.2s ease;
}

.bb-product-card__actions .bb-product-card__cta,
.bb-product-card__actions .home-product-tabs__cta {
    margin-top: 0;
}

.bb-product-card__atc-form .bb-product-card__cta,
.bb-product-card__atc-form .home-product-tabs__cta {
    margin-top: 0;
}

.bb-product-card__cta:hover,
.home-product-tabs__cta:hover {
    background: #d96d12;
    color: #ffffff;
}

.bb-product-grid__item,
.home-product-tabs__item {
    margin: 0;
    padding: 0;
    list-style: none;
}
