/**
 * Страница магазина — вёрстка и мобильная адаптация
 */

.shop-page {
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    background: var(--gray-50);
    scroll-behavior: smooth;
}

.shop-page [id^="shop-"] {
    scroll-margin-top: 88px;
}

.shop-page > .container {
    max-width: 1320px;
}

/* Breadcrumbs */

.shop-breadcrumb {
    padding: 16px 0 0;
}

.shop-breadcrumb .breadcrumb {
    margin-bottom: 0;
    font-size: 14px;
    flex-wrap: wrap;
}

.shop-breadcrumb .breadcrumb-item a {
    color: var(--gray-600);
    text-decoration: none;
}

.shop-breadcrumb .breadcrumb-item a:hover {
    color: var(--primary-color);
}

/* Hero */

.shop-hero {
    position: relative;
    color: #fff;
    margin: 16px 0 0;
    padding: 32px 0 36px;
    background: linear-gradient(135deg, #2b2761 0%, #5b2d7a 55%, #ff6b9d 120%);
    overflow: hidden;
}

.shop-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(26, 28, 56, 0.92), rgba(20, 22, 40, 0.88));
    pointer-events: none;
}

.shop-hero.has-background {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.shop-hero.has-background::before {
    background: rgba(9, 12, 30, 0.82);
}

.shop-hero .container {
    position: relative;
    z-index: 1;
}

.shop-hero__layout {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 24px;
    align-items: start;
}

.shop-logo-large {
    width: 96px;
    height: 96px;
    border-radius: var(--border-radius-lg);
    object-fit: cover;
    background: #fff;
    box-shadow: var(--box-shadow-lg);
    flex-shrink: 0;
}

.shop-logo-large--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
}

.shop-hero__main {
    min-width: 0;
}

.shop-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.95);
    background: rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    backdrop-filter: blur(6px);
}

.shop-title {
    font-size: clamp(24px, 5vw, 36px);
    font-weight: 800;
    line-height: 1.2;
    margin: 0 0 12px;
    letter-spacing: -0.02em;
}

.shop-hero__desc {
    margin: 0 0 20px;
    font-size: 15px;
    line-height: 1.55;
    opacity: 0.95;
    max-width: 640px;
}

.shop-hero__desc a {
    color: #fff;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.shop-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.shop-stat-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.3;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    backdrop-filter: blur(4px);
}

.shop-stat-chip i {
    font-size: 16px;
    opacity: 0.9;
}

.shop-stat-chip a {
    color: inherit;
    text-decoration: none;
}

.shop-stat-chip a:hover {
    text-decoration: underline;
}

.shop-stat-chip .stars {
    display: inline-flex;
    gap: 2px;
}

.shop-hero__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.shop-chat-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    font-weight: 600;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow-md);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.shop-chat-trigger:hover {
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-lg);
}

.shop-hero__hint {
    margin: 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
}

.shop-hero__hint a {
    color: #fff;
    font-weight: 600;
}

/* Quick nav */

.shop-quick-nav {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    margin: 20px 0 8px;
    padding-bottom: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.shop-quick-nav::-webkit-scrollbar {
    display: none;
}

.shop-quick-nav a {
    flex-shrink: 0;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
    text-decoration: none;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 999px;
    transition: var(--transition);
}

.shop-quick-nav a:hover,
.shop-quick-nav a:focus {
    color: var(--primary-color);
    border-color: rgba(255, 107, 157, 0.35);
    background: rgba(255, 107, 157, 0.06);
}

/* Sections */

.shop-page__body {
    padding-bottom: 24px;
}

.shop-section {
    margin-bottom: 40px;
    padding: 28px 24px;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-xl);
    box-shadow: var(--box-shadow-sm);
}

.shop-section--alt {
    background: var(--gray-50);
}

.shop-section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px 20px;
    margin-bottom: 24px;
}

.shop-section-eyebrow {
    display: block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary-color);
    margin-bottom: 6px;
}

.shop-section-title {
    margin: 0;
    font-size: clamp(20px, 3vw, 26px);
    font-weight: 800;
    line-height: 1.25;
    color: var(--gray-900);
    letter-spacing: -0.02em;
}

.shop-section-title i {
    color: var(--primary-color);
    vertical-align: -2px;
}

.shop-section-meta {
    margin: 0;
    font-size: 14px;
    color: var(--gray-600);
}

.shop-section-head__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
    white-space: nowrap;
}

.shop-section-head__link:hover {
    color: var(--primary-hover);
}

.shop-section__footer {
    margin-top: 28px;
    text-align: center;
}

.shop-empty {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 20px;
    margin: 0;
    font-size: 15px;
    color: var(--gray-700);
    background: rgba(23, 162, 184, 0.08);
    border: 1px solid rgba(23, 162, 184, 0.2);
    border-radius: var(--border-radius-lg);
}

.shop-empty i {
    font-size: 22px;
    color: var(--bs-info);
    flex-shrink: 0;
}

/* Products grid on shop page */

.shop-page .products-grid {
    gap: 20px;
}

/* Reviews */

.shop-reviews-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.shop-page .review-card {
    height: 100%;
}

.shop-review-response {
    margin-top: 12px;
    padding: 14px 16px;
    font-size: 14px;
    line-height: 1.5;
    background: var(--gray-50);
    border-left: 3px solid var(--primary-color);
    border-radius: 0 var(--border-radius-md) var(--border-radius-md) 0;
}

.shop-review-response strong {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--gray-700);
}

/* Location */

.shop-location-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 24px;
    margin-bottom: 16px;
    padding: 16px 18px;
    background: var(--gray-50);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--gray-200);
}

.shop-location-meta__item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: var(--gray-700);
    min-width: 0;
}

.shop-location-meta__item i {
    font-size: 20px;
    color: var(--primary-color);
    flex-shrink: 0;
    margin-top: 2px;
}

.shop-location-meta__item a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
}

.shop-location-meta__item a:hover {
    text-decoration: underline;
}

#yandex-map {
    width: 100%;
    height: clamp(260px, 45vh, 450px);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
}

.shop-map-card .card-body {
    padding: 0;
}

/* Chat modal */

.shop-chat-modal .modal-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: min(520px, 70vh);
    background: var(--bs-body-bg);
}

.shop-chat-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
    min-height: 0;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: var(--border-radius-md);
    padding: 16px;
    background: var(--bs-body-bg);
    box-shadow: var(--box-shadow-sm);
}

.shop-chat-messages {
    flex: 1;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: var(--border-radius-md);
    padding: 16px;
    overflow-y: auto;
    background: var(--bs-body-bg);
    min-height: 0;
}

.shop-chat-message {
    max-width: 85%;
    margin-bottom: 16px;
    padding: 12px 16px;
    border-radius: 16px;
    background: var(--gray-100);
    color: var(--gray-900);
    box-shadow: var(--box-shadow-sm);
}

.shop-chat-message.own {
    margin-left: auto;
    background: rgba(255, 107, 157, 0.12);
}

.shop-chat-message-author {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 14px;
}

.shop-chat-message-text {
    white-space: pre-wrap;
    word-break: break-word;
}

.shop-chat-message-time {
    font-size: 12px;
    margin-top: 6px;
    color: var(--gray-500);
    text-align: right;
}

.shop-chat-empty {
    text-align: center;
    color: var(--gray-500);
    padding: 32px 0;
}

#shopChatForm .input-group {
    flex-wrap: nowrap;
}

#shopChatForm textarea {
    min-height: 44px;
    resize: none;
}

/* Mobile sticky bar */

.shop-mobile-bar {
    display: none;
}

/* —— Responsive —— */

@media (max-width: 991px) {
    .shop-hero {
        margin-top: 8px;
        border-radius: 0 0 var(--border-radius-xl) var(--border-radius-xl);
    }

    .shop-section {
        padding: 22px 18px;
    }
}

@media (max-width: 767px) {
    .shop-hero__layout {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
        gap: 16px;
    }

    .shop-logo-large {
        width: 88px;
        height: 88px;
    }

    .shop-hero__desc {
        margin-left: auto;
        margin-right: auto;
    }

    .shop-stats {
        justify-content: center;
    }

    .shop-hero__actions {
        flex-direction: column;
        width: 100%;
    }

    .shop-chat-trigger {
        width: 100%;
        justify-content: center;
    }

    .shop-reviews-grid {
        grid-template-columns: 1fr;
    }

    .shop-section-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .shop-section-head__link {
        width: 100%;
        justify-content: center;
        padding: 12px;
        border: 1px solid var(--gray-200);
        border-radius: var(--border-radius-lg);
    }

    .shop-page .products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .shop-mobile-bar {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1040;
        gap: 10px;
        padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
        background: rgba(255, 255, 255, 0.96);
        border-top: 1px solid var(--gray-200);
        box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
        backdrop-filter: blur(10px);
    }

    .shop-mobile-bar .btn {
        flex: 1;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        font-weight: 600;
        padding: 12px 16px;
        border-radius: var(--border-radius-lg);
    }

    .shop-page {
        padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    }

    #shopChatForm .input-group {
        flex-wrap: wrap;
    }

    #shopChatForm .btn {
        width: 100%;
        margin-top: 8px;
        border-radius: var(--border-radius-lg) !important;
    }
}

@media (max-width: 575px) {
    .shop-breadcrumb {
        padding-top: 12px;
    }

    .shop-stat-chip {
        font-size: 12px;
        padding: 7px 12px;
    }

    .shop-chat-modal .modal-dialog {
        margin: 0;
        max-width: 100%;
        min-height: 100%;
        align-items: stretch;
    }

    .shop-chat-modal .modal-content {
        min-height: 100dvh;
        border-radius: 0;
    }

    .shop-chat-modal .modal-body {
        height: calc(100dvh - 56px);
        max-height: none;
    }
}

@media (min-width: 768px) {
    .shop-hero {
        margin: 20px 0 0;
        border-radius: var(--border-radius-xl);
    }

    .shop-logo-large {
        width: 120px;
        height: 120px;
    }
}
