/* Always-loaded shop card styles.
   Do not rely on Blade @once/@push — AJAX filters and empty first paint skip those. */

/* ----- Media ----- */
.buyers-shop-card__media {
    position: relative;
    width: 100%;
    height: var(--shop-card-media-height, 230px);
    min-height: 0;
    border-radius: 16px;
    overflow: hidden;
}

.buyers-shop-card__media-splide,
.buyers-shop-card__media-splide .splide__track,
.buyers-shop-card__media-splide .splide__list,
.buyers-shop-card__media-splide .splide__slide {
    width: 100%;
    height: 100%;
}

.buyers-shop-card__media-splide .splide__slide img,
.buyers-shop-card__media > img,
.buyers-shop-card__image {
    display: block;
    width: 100%;
    height: var(--shop-card-media-height, 230px);
    max-width: none;
    max-height: 100%;
    object-fit: cover;
    border-radius: 16px;
}

.shop-card-box .buyers-shop-card__media,
.shop-card-box .buyers-shop-card__media-splide .splide__slide img,
.shop-card-box .buyers-shop-card__media > img {
    border-radius: 10px;
}

/* ----- Desktop grid card ----- */
.buyers-shop-card--desktop:not(.buyers-shop-card--list) {
    background-color: var(--buyers-shop-card-bg, #ffffff) !important;
    border: var(--buyers-shop-card-border, 1px solid transparent) !important;
    border-radius: 20px !important;
    padding: 10px !important;
    display: grid !important;
    grid-template-rows: 230px minmax(0, 1fr);
    height: 100%;
    min-height: 100%;
}

.buyers-shop-card__name {
    color: rgba(45, 45, 45, 1);
    font-size: 20px;
    line-height: 160%;
    font-weight: 700;
}

.buyers-shop-card__name-text {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
}

.buyers-shop-card_button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: transparent !important;
    padding: 16px 30px;
    border-radius: 10px;
    border: 1px solid rgba(52, 94, 191, 1);
    width: 100%;
    color: rgba(52, 94, 191, 1);
    text-decoration: none;
    line-height: 1.2;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.buyers-shop-card_button:hover {
    background: rgba(52, 94, 191, 0.1) !important;
    color: rgba(52, 94, 191, 1);
    text-decoration: none;
}

.buyers-shop-card_is_online {
    background-color: rgba(56, 174, 228, 1);
    color: #fff;
    padding: 8px 12px;
    font-size: 12px;
    border-radius: 100px;
}

.buyers-shop-card_is_offline {
    background-color: rgba(52, 94, 191, 1);
    color: #fff;
    padding: 8px 12px;
    font-size: 12px;
    border-radius: 100px;
}

.buyers-shop-card_is_online_and_offline {
    background-color: rgba(228, 174, 56, 1);
    color: #fff;
    padding: 8px 12px;
    font-size: 12px;
    border-radius: 100px;
}

.buyers-shop-card__text {
    color: rgba(45, 45, 45, 1);
    font-size: 18px;
    font-weight: 400;
    line-height: 160%;
    min-height: calc(1.6em * 2);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.buyers-shop-card__content {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
}

.buyers-shop-card__info {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.buyers-shop-card__address,
.buyers-shop-card__phone {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    line-height: 1.4;
}

.buyers-shop-card__address-icon,
.buyers-shop-card__phone-icon {
    flex-shrink: 0;
    margin-top: 2px;
}

.buyers-shop-card__address-text,
.buyers-shop-card__phone-text {
    word-break: break-word;
}

.buyers-shop-card__actions {
    margin-top: auto;
    flex-shrink: 0;
}

.buyers-shop-card__price {
    color: rgba(45, 45, 45, 1);
    font-size: 20px;
    font-weight: 700;
    line-height: 160%;
}

#shops-grid > .col,
.buyers-shops-splide .row > .col {
    display: flex !important;
    flex-direction: column;
    align-self: stretch;
}

#shops-grid > .col > .buyers-shop-card,
.buyers-shops-splide .row > .col > .buyers-shop-card {
    flex: 1 1 auto;
    min-width: 0;
}

.buyers-shops-splide .splide__slide > .row {
    align-items: stretch;
    min-height: 100%;
}

.buyers-shops-splide .splide__list {
    align-items: stretch;
}

/* ----- Badges / city / categories ----- */
.buyers-shop-card__badges-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.buyers-shop-card__badges-row .buyers-shop-card__city {
    margin-top: 0;
}

.buyers-shop-card__city {
    margin-top: 0.5rem;
}

.buyers-shop-card__city-label {
    display: inline-flex;
    align-items: center;
    padding: 7px 12px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    background: color-mix(in srgb, var(--shop-city-label-color, #345EBF) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--shop-city-label-color, #345EBF) 22%, transparent);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    text-decoration: none;
    color: var(--shop-city-label-color, #345EBF);
}

.buyers-shop-card__city-label:hover {
    text-decoration: none;
    color: var(--shop-city-label-color, #345EBF);
}

.buyers-shop-card--list .buyers-shop-card__badges-row .buyers-shop-card__city-label {
    padding: 7px 15px;
    font-size: 0.875rem;
}

.shops-map-side-panel__status .buyers-shop-card__city-label {
    padding: 4px 9px;
    font-size: 11px;
}

.buyers-shop-card__city-label-name {
    white-space: nowrap;
}

.buyers-shop-card__categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    overflow-x: auto;
    max-width: 100%;
    overscroll-behavior: contain;
}

.buyers-shop-card__category {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 100px;
    background: linear-gradient(135deg, rgba(52, 94, 191, 0.08) 0%, rgba(56, 174, 228, 0.08) 100%);
    border: 1px solid rgba(52, 94, 191, 0.18);
    text-decoration: none;
    color: rgba(52, 94, 191, 1);
}

.buyers-shop-card__category:hover {
    text-decoration: none;
    color: rgba(52, 94, 191, 1);
}

.buyers-shop-card__category-name {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}

.shop-card-box .buyers-shop-card__categories {
    gap: 6px;
}

/* ----- List card ----- */
.buyers-shop-card--list {
    background-color: var(--buyers-shop-card-bg, #f2f2f2) !important;
    border: var(--buyers-shop-card-border, 1px solid #e0e0e0) !important;
    border-radius: 20px !important;
    padding: 12px !important;
}

.buyers-shop-card--list__grid {
    display: grid;
    grid-template-columns: minmax(120px, 196px) minmax(0, 1fr);
    gap: 12px 16px;
    align-items: start;
}

.buyers-shop-card--list__media {
    border-radius: 12px;
    overflow: hidden;
}

.buyers-shop-card--list .buyers-shop-card__media {
    --shop-card-media-height: 140px;
    height: 140px;
}

.buyers-shop-card--list .buyers-shop-card__media > img,
.buyers-shop-card--list .buyers-shop-card__media-splide .splide__slide img {
    width: 100% !important;
    height: 140px !important;
    max-width: none !important;
    object-fit: cover !important;
}

.buyers-shop-card--list__body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.buyers-shop-card--list__meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.buyers-shop-card--list__title-block {
    min-width: 0;
}

.buyers-shop-card--list__title {
    color: #2d2d2d;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
    word-break: break-word;
}

.buyers-shop-card--list__subtitle {
    margin-top: 4px;
    color: #7b7b7b;
    font-size: 14px;
    line-height: 1.35;
    word-break: break-word;
}

.buyers-shop-card--list__categories {
    margin: 0 !important;
}

.buyers-shop-card--list__row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    min-width: 0;
    color: #2d2d2d;
    font-size: 15px;
    line-height: 1.4;
}

.buyers-shop-card--list__icon {
    flex-shrink: 0;
    line-height: 1;
    padding-top: 2px;
}

.buyers-shop-card--list__row-text {
    min-width: 0;
    word-break: break-word;
}

.buyers-shop-card--list__phone {
    word-break: break-all;
}

.buyers-shop-card--list__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.buyers-shop-card--list .buyers-shop-card__badges-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.buyers-shop-card--list .buyers-shop-card__city {
    margin: 0;
}

.buyers-shop-card--list .buyers-shop-card__city-label-name {
    white-space: normal;
    word-break: break-word;
}

.badge-shop-online {
    background-color: rgba(56, 174, 228, 1) !important;
}

.badge-shop-offline {
    background-color: rgba(52, 94, 191, 1) !important;
}

.btn-on-map {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid rgba(52, 94, 191, 1);
    padding: 12px 18px;
    font-size: 13px;
    font-weight: 600;
    color: rgba(52, 94, 191, 1);
    text-transform: uppercase;
    border-radius: 10px;
    text-decoration: none;
    white-space: nowrap;
}

.btn-on-map:hover {
    background: rgba(52, 94, 191, 0.1);
    color: rgba(52, 94, 191, 1);
    text-decoration: none;
}

@media (min-width: 768px) {
    .buyers-shop-card--list__grid {
        grid-template-columns: minmax(180px, 248px) minmax(0, 1fr);
    }

    .buyers-shop-card--list .buyers-shop-card__media {
        --shop-card-media-height: 180px;
        height: 180px;
    }

    .buyers-shop-card--list .buyers-shop-card__media > img,
    .buyers-shop-card--list .buyers-shop-card__media-splide .splide__slide img {
        height: 180px !important;
    }
}

@media (min-width: 1200px) {
    .buyers-shop-card--list__grid {
        grid-template-columns: 280px minmax(0, 1fr) auto;
        align-items: stretch;
    }

    .buyers-shop-card--list__body {
        display: contents;
    }

    .buyers-shop-card--list__meta {
        grid-column: 2;
        grid-row: 1;
    }

    .buyers-shop-card--list__actions {
        grid-column: 3;
        grid-row: 1;
        align-self: center;
        flex-direction: column;
        align-items: stretch;
    }

    .buyers-shop-card--list .buyers-shop-card__media {
        --shop-card-media-height: 200px;
        height: 200px;
    }

    .buyers-shop-card--list .buyers-shop-card__media > img,
    .buyers-shop-card--list .buyers-shop-card__media-splide .splide__slide img {
        height: 200px !important;
    }
}

@media (max-width: 767.98px) {
    .buyers-shop-card--desktop:not(.buyers-shop-card--list) {
        grid-template-rows: auto minmax(0, 1fr);
    }

    .buyers-shop-card--desktop:not(.buyers-shop-card--list) .buyers-shop-card__media {
        aspect-ratio: 1 / 1;
        height: auto !important;
        width: 100%;
    }

    .buyers-shop-card--desktop:not(.buyers-shop-card--list) .buyers-shop-card__media > img,
    .buyers-shop-card--desktop:not(.buyers-shop-card--list) .buyers-shop-card__media-splide .splide__slide img {
        height: 100% !important;
        width: 100%;
        object-fit: cover;
    }
}
