/* =========================
   GRID
========================= */
.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.shop-grid .shop-card {
    height: 100%;
}

.shop-grid .shop-image-wrap {
    position: relative;
    height: 170px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem;
    background: #fff;
    overflow: hidden;
}

.shop-grid .shop-image {
    width: 100%;
    height: 100%;
    max-width: 145px;
    max-height: 145px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    transition: filter 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
}

.shop-grid .shop-card:not(.is-out-of-stock):hover .shop-image {
    transform: scale(1.02);
}


/* =========================
   LIST
========================= */
.shop-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.shop-list-card {
    overflow: hidden;
}

.shop-list-inner {
    display: grid;
    grid-template-columns: 115px minmax(0, 1fr) 280px;
    gap: 1rem;
    align-items: center;
    padding: 0.85rem 1rem;
}

.shop-list-image-col {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 105px;
    padding: 0.2rem;
}

.shop-list-image-col img,
.shop-list-image-col .shop-image {
    max-width: 95px;
    max-height: 95px;
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    transition: filter 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
}

.shop-list-card:not(.is-out-of-stock):hover .shop-list-image-col img,
.shop-list-card:not(.is-out-of-stock):hover .shop-list-image-col .shop-image {
    transform: scale(1.02);
}

.shop-list-main {
    min-width: 0;
}

.shop-list-main .h6,
.shop-list-main h2 {
    margin-bottom: 0.35rem;
    word-break: break-word;
}

.shop-list-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    text-align: right;
    min-width: 0;
}

.shop-list-side .fw-bold {
    font-size: 1.15rem;
    line-height: 1.2;
}

.shop-list-side .d-flex {
    justify-content: flex-end;
}


/* =========================
   RESPONSIVE
========================= */
@media (max-width: 991.98px) {
    .shop-list-inner {
        grid-template-columns: 95px minmax(0, 1fr);
    }

    .shop-list-side {
        grid-column: 1 / -1;
        align-items: flex-start;
        text-align: left;
        padding-top: 0.6rem;
        border-top: 1px solid #e9ecef;
    }

    .shop-list-side .d-flex {
        justify-content: flex-start;
    }
}

@media (max-width: 767.98px) {
    .shop-grid .shop-image-wrap {
        height: 140px;
        padding: 0.25rem;
    }

    .shop-grid .shop-image {
        max-width: 115px;
        max-height: 115px;
    }

    .shop-list-inner {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        padding: 0.8rem;
    }

    .shop-list-image-col {
        justify-content: flex-start;
        min-height: 85px;
        padding: 0;
    }

    .shop-list-image-col img,
    .shop-list-image-col .shop-image {
        max-width: 80px;
        max-height: 80px;
    }

    .shop-list-side {
        border-top: 0;
        padding-top: 0;
    }
}


/* =========================
   OUT OF STOCK UX
========================= */
.shop-card.is-out-of-stock,
.shop-list-card.is-out-of-stock {
    background: #fcfcfc;
}

.shop-card.is-out-of-stock .shop-image,
.shop-list-card.is-out-of-stock .shop-image,
.shop-list-card.is-out-of-stock .shop-list-image-col img {
    filter: grayscale(100%) blur(2px);
    opacity: 0.45;
    transform: none !important;
}

.shop-card.is-out-of-stock:hover .shop-image,
.shop-list-card.is-out-of-stock:hover .shop-image,
.shop-list-card.is-out-of-stock:hover .shop-list-image-col img {
    filter: grayscale(100%) blur(2px);
    opacity: 0.45;
    transform: none !important;
}

.shop-card.is-out-of-stock .shop-title,
.shop-list-card.is-out-of-stock h2,
.shop-list-card.is-out-of-stock .h6 {
    opacity: 0.92;
}

.shop-card.is-out-of-stock .shop-price,
.shop-list-card.is-out-of-stock .fw-bold {
    opacity: 0.8;
}

.shop-price {
    line-height: 1.2;
}

.shop-card .badge {
    line-height: 1.2;
}

.shop-list-side .shop-price {
    white-space: nowrap;
}

.shop-card .js-cart-form {
    width: 100%;
}


/* =========================
   BADGE / OVERLAY
========================= */
.shop-card.is-out-of-stock .shop-image-wrap::after {
    content: "Out of stock";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(1px);
    color: #212529;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    pointer-events: none;
}

.shop-card.is-out-of-stock .shop-image-wrap::before {
    content: "Unavailable";
    position: absolute;
    top: 0.55rem;
    right: 0.55rem;
    z-index: 2;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: rgba(220, 53, 69, 0.95);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    pointer-events: none;
}

.shop-list-card.is-out-of-stock .shop-list-image-col::after {
    content: "Out of stock";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(1px);
    color: #212529;
    font-weight: 700;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    text-align: center;
    padding: 0.5rem;
    pointer-events: none;
}

.shop-list-card.is-out-of-stock .shop-list-image-col::before {
    content: "Unavailable";
    position: absolute;
    top: 0.45rem;
    right: 0.45rem;
    z-index: 2;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: rgba(220, 53, 69, 0.95);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    pointer-events: none;
}


/* =========================
   CARD POLISH
========================= */
.shop-card,
.shop-list-card {
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.shop-card:hover,
.shop-list-card:hover {
    box-shadow: 0 0.5rem 1.25rem rgba(0, 0, 0, 0.08);
}

.shop-card.is-out-of-stock:hover,
.shop-list-card.is-out-of-stock:hover {
    transform: none;
}

@media (max-width: 767.98px) {
    .shop-card.is-out-of-stock .shop-image-wrap::before,
    .shop-list-card.is-out-of-stock .shop-list-image-col::before {
        font-size: 0.62rem;
        padding: 0.3rem 0.5rem;
    }

    .shop-card.is-out-of-stock .shop-image-wrap::after,
    .shop-list-card.is-out-of-stock .shop-list-image-col::after {
        font-size: 0.72rem;
    }
}

.qty-wrapper .qty-btn {
    width: 32px;
    padding: 0;
    font-weight: 600;
}

.qty-wrapper .qty-input {
    width: 40px;
    padding: 2px 4px;
}

/* Chrome, Safari, Edge */
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Firefox */
.qty-input {
    -moz-appearance: textfield;
}


/* =========================
   FILTER BOXES
========================= */
.brand-filter-box {
    padding: 0.5rem 0.75rem 0.5rem 0.75rem;
    background: #fff;
}

.brand-checkbox-list {
    height: 250px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.25rem 0.35rem 0.25rem 0;
}

.brand-checkbox-item {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    padding: 0.22rem 0;
    line-height: 1.2;
}

.brand-checkbox-item input[type="checkbox"] {
    margin-top: 0.15rem;
    flex: 0 0 auto;
}

.brand-checkbox-item label {
    margin: 0;
    font-size: 0.95rem;
    cursor: pointer;
    user-select: none;
    word-break: break-word;
    flex: 1 1 auto;
}

.brand-checkbox-list::-webkit-scrollbar {
    width: 10px;
}

.brand-checkbox-list::-webkit-scrollbar-thumb {
    background: #c9c9c9;
    border-radius: 999px;
}

.brand-checkbox-list::-webkit-scrollbar-track {
    background: transparent;
}


/* =========================
   FILTER SEARCH INPUTS
========================= */
#brandSearch,
#categorySearch {
    font-size: 0.92rem;
    border-radius: 0.65rem;
    border: 1px solid #dee2e6;
    padding: 0.5rem 0.75rem;
    box-shadow: none;
}

#brandSearch:focus,
#categorySearch:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.18rem rgba(13, 110, 253, 0.12);
}

.brand-filter-box .mb-2 {
    margin-bottom: 0.55rem !important;
}


/* =========================
   HIDDEN FILTER ITEMS
========================= */
.brand-checkbox-item.d-none {
    display: none !important;
}

.js-filter-empty {
    padding: 0.35rem 0;
    font-size: 0.9rem;
}