/* Store header card — used on the single-store page (/stores/{slug}).
 * Two-pane design: dark sidebar with logo + meta on the left, banner
 * image on the right. Falls back to a gradient when cover_image isn't
 * set. All colors come from theme tokens so the per-tenant palette
 * carries through automatically.
 */

.store-header-card {
    display: flex;
    align-items: stretch;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
    margin-top: 30px;
}

.store-header-card__sidebar {
    flex: 0 0 320px;
    max-width: 320px;
    background-color: var(--secondary-color, #2f2f2f);
    color: #fff;
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.store-header-card__logo {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: #fff;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.store-header-card__logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

.store-header-card__name {
    color: #fff;
    font-size: 1.4rem;
    font-weight: 700;
    margin: 8px 0 0;
    line-height: 1.25;
}

.store-header-card__rating {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
}

.store-header-card__rating .rating {
    position: relative;
    display: inline-block;
    color: rgba(255, 255, 255, 0.35);
    font-size: 14px;
}

.store-header-card__rating .product_rate {
    color: var(--primary-color, #fcb800);
    overflow: hidden;
    position: absolute;
    top: 0;
    left: 0;
    white-space: nowrap;
}

.store-header-card__meta {
    list-style: none;
    padding: 0;
    margin: 6px 0 0;
}

.store-header-card__meta li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.4;
}

.store-header-card__meta li i {
    color: var(--primary-color, #fcb800);
    margin-top: 3px;
    flex-shrink: 0;
}

.store-header-card__meta a {
    color: rgba(255, 255, 255, 0.85);
}

.store-header-card__meta a:hover {
    color: var(--primary-color, #fcb800);
}

.store-header-card__socials {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
    display: flex;
    gap: 10px;
}

.store-header-card__socials a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transition: background-color 0.2s ease;
}

.store-header-card__socials a:hover {
    background: var(--primary-color, #fcb800);
    color: #fff;
}

.store-header-card__banner {
    flex: 1;
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    min-height: 280px;
}

/* No cover image — present a friendly gradient instead of an empty box. */
.store-header-card--no-cover .store-header-card__banner {
    background-image: linear-gradient(
        135deg,
        var(--primary-color, #fcb800) 0%,
        var(--secondary-color, #2f2f2f) 100%
    );
    opacity: 0.85;
}

/* Stack vertically on tablet / mobile. */
@media (max-width: 768px) {
    .store-header-card {
        flex-direction: column;
    }
    .store-header-card__sidebar {
        flex: none;
        max-width: 100%;
        padding: 24px;
    }
    .store-header-card__banner {
        min-height: 180px;
    }
}

/* Description block under the header keeps the existing show-more
 * toggle interaction — class is renamed from .ps-block--store-banner
 * to .store-header-description but the toggle JS just queries by IDs
 * #store-content / #store-short-description, so no JS change needed. */
.store-header-description {
    border-radius: 10px;
}

/* --- Stores listing cards (/stores) -----------------------------------
 * Vertical card design: cover image on top, content below on a clean
 * surface. Replaces the legacy .ps-block--store-2 layout that overlaid
 * text on the cover image and left huge empty white areas when no cover
 * was set. All colors come from theme tokens.
 */

.store-grid {
    row-gap: 28px;
}

.store-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #ececec;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.store-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}

.store-card__cover {
    display: block;
    aspect-ratio: 16 / 9;
    width: 100%;
    background-color: #f4f4f4;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.store-card--no-cover .store-card__cover {
    background-image: linear-gradient(
        135deg,
        var(--primary-color, #fcb800) 0%,
        var(--secondary-color, #2f2f2f) 100%
    );
    opacity: 0.85;
}

.store-card__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px 22px 22px;
    gap: 14px;
}

.store-card__head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-top: -52px; /* overlap the cover so the logo sits on the boundary */
    position: relative;
    z-index: 1;
}

.store-card__logo {
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 2px solid #fff;
}

.store-card__logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

.store-card__heading {
    flex: 1;
    min-width: 0;
    padding-top: 56px; /* keep name baseline aligned below the cover */
}

.store-card__name {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
    color: var(--secondary-color, #222);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.store-card__name a {
    color: inherit;
}

.store-card__name a:hover {
    color: var(--primary-color, #fcb800);
}

.store-card__rating {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #777;
    margin-top: 6px;
}

.store-card__rating .rating {
    position: relative;
    display: inline-block;
    color: rgba(0, 0, 0, 0.15);
    font-size: 13px;
}

.store-card__rating .product_rate {
    color: var(--primary-color, #fcb800);
    overflow: hidden;
    position: absolute;
    top: 0;
    left: 0;
    white-space: nowrap;
}

.store-card__meta {
    list-style: none;
    padding: 0;
    margin: 0;
}

.store-card__meta li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.88rem;
    color: #555;
    line-height: 1.5;
    margin-bottom: 6px;
}

.store-card__meta li:last-child {
    margin-bottom: 0;
}

.store-card__meta li i {
    color: var(--primary-color, #fcb800);
    margin-top: 4px;
    flex-shrink: 0;
}

.store-card__meta a {
    color: #555;
}

.store-card__meta a:hover {
    color: var(--primary-color, #fcb800);
}

.store-card__socials {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 8px;
}

.store-card__socials a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #f4f4f4;
    color: var(--secondary-color, #222);
    transition: background-color 0.2s ease, color 0.2s ease;
}

.store-card__socials a:hover {
    background: var(--primary-color, #fcb800);
    color: #fff;
}

.store-card__btn {
    margin-top: auto;
    align-self: stretch;
    text-align: center;
    padding: 12px 18px;
    background-color: var(--primary-color, #fcb800) !important;
    color: var(--button-text-color, #fff) !important;
    border: none !important;
    border-radius: 8px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: none;
    transition: filter 0.18s ease;
}

.store-card__btn:hover {
    color: var(--button-text-color, #fff) !important;
    filter: brightness(0.92);
}

@media (max-width: 575px) {
    .store-card__head {
        margin-top: -42px;
    }
    .store-card__logo {
        flex-basis: 56px;
        width: 56px;
        height: 56px;
    }
    .store-card__heading {
        padding-top: 46px;
    }
}

/* Hide the legacy markup if anything still renders it (defensive). */
.ps-block--store-2 {
    display: none !important;
}

/* --- Collapsible blocks on the store page (mobile only) ---------------
 * Each .store-collapsible wraps a section (filter sidebar, email form).
 * Desktop: toggle is hidden, body is always visible.
 * Mobile (≤1199px): toggle is shown as a pill-style button. Body is
 * hidden unless the wrapper has .is-open. JS at the bottom of this
 * file toggles the class on click.
 */
.store-collapsible__toggle {
    display: none;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--secondary-color, #222);
    cursor: pointer;
    text-align: left;
    transition: background-color 0.2s ease;
}

.store-collapsible__toggle:hover {
    background-color: #fafafa;
}

.store-collapsible__toggle i {
    color: var(--primary-color, #fcb800);
}

.store-collapsible__chevron {
    transition: transform 0.2s ease;
}

.store-collapsible.is-open .store-collapsible__chevron {
    transform: rotate(180deg);
}

@media (max-width: 1199px) {
    .store-collapsible__toggle {
        display: flex;
    }
    .store-collapsible:not(.is-open) .store-collapsible__body {
        display: none;
    }
    .store-collapsible.is-open .store-collapsible__body {
        margin-top: 12px;
    }
}

/* --- Single store page (/stores/{slug}) mobile fix --------------------
 * Botble's .ps-layout__left default rules hide the left column on
 * narrow viewports and turn it into a fixed-position drawer that needs
 * a toggle button. The store page doesn't ship that toggle, so the
 * filter sidebar + email-dealer form vanish on mobile. Override for
 * .ps-page--vendor so the left column simply stacks above the products
 * grid on mobile — no drawer, no hidden content.
 */
@media (max-width: 1199px) {
    .ps-page--vendor .ps-layout--shop {
        flex-direction: column;
    }
    .ps-page--vendor .ps-layout__left,
    .ps-page--vendor .ps-layout__right {
        display: block !important;
        position: static !important;
        max-width: 100% !important;
        min-width: 0 !important;
        width: 100% !important;
        height: auto !important;
        padding-right: 0 !important;
        visibility: visible !important;
        overflow: visible !important;
        z-index: auto !important;
        transform: none !important;
    }
    .ps-page--vendor .ps-layout__left .ps-layout__left-container {
        background: transparent !important;
        max-width: 100% !important;
        overflow: visible !important;
        transform: none !important;
    }
    .ps-page--vendor .ps-layout__left .screen-darken {
        display: none !important;
    }
    /* Add a little breathing room between the stacked filter, email
     * form, and the products grid. */
    .ps-page--vendor .ps-layout__left > * {
        margin-bottom: 24px;
    }
}
