/* ==========================================================================
   VS Listing Plugin Styles
   ========================================================================== */

/* --- General Variables & Reset (applied scoped) --- */
.vs-shop-directory,
.vs-listing-archive,
.vs-top-block-wrapper,
.ymal-block {
    --vs-primary: #1f9b3b;
    --vs-primary-hover: #187d30;
    --vs-text-dark: #111827;
    --vs-text-muted: #6B7280;
    --vs-bg-light: #F9FAFB;
    --vs-border-color: #E5E7EB;
    --vs-star-color: #FFBC00;
}

.site-container.vs-listing-archive {
    max-width: none;
    background-color: #ffffff;
}

.vs-listing-page-h1 {
    font-size: 28px;
    font-weight: 800;
    color: #111827;
    margin: 28px 0px;
    text-align: center;
}

/* --- Category rich description block --- */
.vs-category-rich-description {
    margin-top: 32px;
    margin-bottom: 40px;
    font-size: 14px;
    line-height: 1.7;
}

.vs-shop-directory {
    margin: 30px 0;
}

/* --- Jump Navigation --- */
.vs-shop-directory .jump-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 32px;
}

.vs-shop-directory .jump-nav a {

    display: inline-block;
    padding: 2px 18px;
    border-radius: 20px;
    border: 1px solid var(--vs-border-color);
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    text-decoration: none;
    transition: all 0.15s;
}

.vs-shop-directory .jump-nav a:hover {
    background: var(--vs-primary);
    border-color: var(--vs-primary);
    color: #fff;
}

/* --- Category Section --- */
.vs-shop-directory .category-section {
    margin-bottom: 48px;
}


.vs-shop-directory .category-heading {
    font-size: 22px;
    font-weight: 700;
    color: var(--vs-text-dark);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--vs-border-color);
}

.vs-shop-directory .category-rich-description {
    font-size: 14px;
    color: #4B5563;
    line-height: 1.6;
    margin-bottom: 24px;
}

/* --- Card Grid --- */
.vs-shop-directory .card-grid {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(1, 1fr);
    width: 100%;
    max-width: 1460px;
    margin: 0;
    padding-right: 24px;
}

/* Tablet: 2 items per row */
@media (min-width: 600px) {
    .vs-shop-directory .card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Large Tablet / Small Desktop: 3 items per row */
@media (min-width: 900px) {
    .vs-shop-directory .card-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Desktop: 5 items per row */
@media (min-width: 1200px) {
    .vs-shop-directory .card-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* --- [vs_listings] optional heading row ("Section title" + "View all →") --- */
.vs-listings-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    max-width: 1400px;
    margin: 0 auto 16px;
}

.vs-listings-heading {
    font-size: 20px;
    font-weight: 700;
    color: var(--vs-text-dark);
}

.vs-listings-view-all {
    font-size: 13px;
    font-weight: 600;
    color: var(--vs-primary);
    text-decoration: none;
    white-space: nowrap;
}

.vs-listings-view-all:hover {
    text-decoration: underline;
}

/* --- [vs_listings columns="N"] forces the desktop column count instead
   of the default responsive 1/2/3/5 progression. Mobile/tablet steps
   below 1200px are unchanged. --- */
@media (min-width: 1200px) {
    .vs-shop-directory.vs-cols-2 .card-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .vs-shop-directory.vs-cols-3 .card-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .vs-shop-directory.vs-cols-4 .card-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .vs-shop-directory.vs-cols-6 .card-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* --- Shop Cards --- */
.vs-shop-directory .card {
    background: #fff;
    border: 1px solid var(--vs-border-color);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    /* reset link styles when card is an <a> */
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.vs-shop-directory a.card:hover,
.vs-shop-directory .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    text-decoration: none;
    color: inherit;
}

.vs-shop-directory .card-logo {
    background: #fff;
    border-bottom: 1px solid var(--vs-border-color);
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.vs-shop-directory .card-ribbon {
    position: absolute;
    top: 14px;
    right: -26px;
    background-color: var(--vs-primary, #1f9b3b);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    line-height: 1.2;
    padding: 4px 32px;
    transform: rotate(45deg);
    letter-spacing: 0.04em;
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    z-index: 2;
    pointer-events: none;
}

.vs-shop-directory .card-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.vs-shop-directory .card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.vs-shop-directory .card-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--vs-text-dark);
    line-height: 1.3;
}

.vs-shop-directory .card-descriptor {
    font-size: 13px;
    font-style: italic;
    color: var(--vs-text-muted);
    line-height: 1.4;
}

.vs-shop-directory .card-description {
    font-size: 13px;
    color: #374151;
    line-height: 1.5;
    margin-top: 2px;
}

.vs-shop-directory .card-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
}

.vs-shop-directory .stars,
.vs-top-block .stars,
.vs-offer-row .stars {
    --rating: 0;
    --percent: calc(var(--rating) / 5 * 100%);

    position: relative;
    display: inline-block;
    font-size: 14px;
    line-height: 1;
    letter-spacing: 1px;
}

.vs-shop-directory .stars::before,
.vs-top-block .stars::before,
.vs-offer-row .stars::before {
    content: "★★★★★";
    color: #D1D5DB;
}

.vs-shop-directory .stars::after,
.vs-top-block .stars::after,
.vs-offer-row .stars::after {
    content: "★★★★★";
    color: #FFBC00;
    position: absolute;
    left: 0;
    top: 0;
    width: var(--percent);
    overflow: hidden;
    white-space: nowrap;
}

.vs-shop-directory .rating-score,
.vs-top-block .rating-score,
.vs-offer-row .rating-score {
    font-size: 13px;
    font-weight: 700;
    color: var(--vs-text-dark);
}

.vs-shop-directory .rating-source,
.vs-top-block .rating-source,
.vs-offer-row .rating-source {
    font-size: 12px;
    color: var(--vs-text-muted);
}

.vs-shop-directory .card-spacer {
    flex: 1;
    min-height: 12px;
}

/* The card-btn is now a <span> (decorative) - style it like a button */
.vs-shop-directory .card-btn {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 6px 0;
    background: var(--vs-primary);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
    user-select: none;
}

a.card:hover .card-btn,
.card:hover .card-btn {
    background: var(--vs-primary-hover);
}

/* ==========================================================================
   VS Top Block (Listings CPT Template) - whole card is a clickable <a>
   ========================================================================== */
.vs-top-block-wrapper {
    max-width: 900px;
    margin: 0 auto 20px;
}

/* The card itself – works as both <div> and <a> */
.vs-top-block {
    max-width: 850px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid var(--vs-border-color);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
}

a.vs-top-block:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.10);
    text-decoration: none;
    color: inherit;
}

.vs-top-block .block-logo {
    flex: 0 0 200px;
    background: #fff;
    border-right: 1px solid var(--vs-border-color);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.vs-top-block .block-logo img {
    max-width: 100%;
    max-height: 160px;
    object-fit: contain;
}

.vs-top-block .block-content {
    flex: 1;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    justify-content: center;
}

.vs-top-block .block-shop-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--vs-text-dark);
    line-height: 1.2;
}

.vs-top-block .block-intro {
    font-size: 14px;
    color: #374151;
    line-height: 1.6;
}

.vs-top-block .block-rating {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.vs-top-block .block-rating .star {
    font-size: 15px;
}

.vs-top-block .block-btn {
    display: block;
    width: 100%;
    padding: 8px 0;
    background: var(--vs-primary);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}

.vs-top-block .block-btn:hover {
    background: var(--vs-primary-hover);
}

/* Affordance label shown instead of a nested button (whole card is already <a>) */
.vs-top-block .block-btn-label {
    display: inline-block;
    margin-top: 4px;
    font-size: 14px;
    font-weight: 700;
    color: var(--vs-primary);
    letter-spacing: 0.01em;
}

a.vs-top-block:hover .block-btn-label {
    text-decoration: underline;
}


.vs-block-footnote {
    font-size: 11px;
    color: var(--vs-text-muted);
    line-height: 1.5;
    margin-top: 8px;
    margin-bottom: 40px;
    text-align: center;
}

/* --- You Might Also Like (YMAL) Block --- */
.ymal-block {
    max-width: 900px;
    margin: 48px 0;
}

.ymal-heading {
    font-size: 20px;
    font-weight: 700;
    color: var(--vs-text-dark);
    margin-bottom: 20px;
}

.ymal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.ymal-card {
    background: #fff;
    border: 1px solid var(--vs-border-color);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.ymal-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.ymal-card-img {
    background: #F3F4F6;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: var(--vs-text-muted);
    border-bottom: 1px solid var(--vs-border-color);
    font-weight: 500;
    overflow: hidden;
    object-position: top;
}

.ymal-card-body {
    padding: 16px;
}

.ymal-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--vs-text-dark);
    margin-bottom: 6px;
}

.ymal-card-link {
    font-size: 13px;
    color: var(--vs-primary);
    font-weight: 600;
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    .vs-top-block {
        flex-direction: column;
    }

    .vs-top-block .block-logo {
        flex: 1;
        border-right: none;
        border-bottom: 1px solid var(--vs-border-color);
        min-height: 150px;
        padding: 16px;
    }

    .vs-top-block .block-content {
        padding: 20px;
    }
}

/* ==========================================================================
   [vs_seasonal_banner] — editorial promo banner
   ========================================================================== */
.vs-seasonal-banner {
    --vs-primary: #1f9b3b;
    --vs-primary-hover: #187d30;
    --vs-text-dark: #111827;
    --vs-text-muted: #6B7280;
    --vs-border-color: #E5E7EB;

    max-width: 1400px;
    margin: 0 auto 14px;
    background: #fff;
    border: 1px solid var(--vs-border-color);
    border-radius: 12px;
    overflow: hidden;
}

.vs-seasonal-img {
    width: 100%;
    aspect-ratio: 3 / 1;
    background: #F3F4F6;
    border-bottom: 1px solid var(--vs-border-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.vs-seasonal-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vs-seasonal-img .vs-img-placeholder svg {
    width: 44px;
    height: 44px;
}

@media (max-width: 480px) {
    .vs-seasonal-img {
        aspect-ratio: 16 / 9;
    }

    .vs-seasonal-img .vs-img-placeholder svg {
        width: 32px;
        height: 32px;
    }
}

.vs-seasonal-body {
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.vs-seasonal-copy h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--vs-text-dark);
    margin-bottom: 4px;
}

.vs-seasonal-copy p {
    font-size: 13px;
    color: var(--vs-text-muted);
}

.vs-btn-pill {
    display: inline-block;
    background-color: var(--vs-primary);
    color: #fff;
    border: none;
    padding: 10px 22px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    text-decoration: none;
    flex-shrink: 0;
    transition: background 0.2s;
}

.vs-btn-pill:hover {
    background-color: var(--vs-primary-hover);
    color: #fff;
}

/* --- Shared placeholder icon for empty image slots (banner + offers) --- */
.vs-img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #D1D5DB;
}

.vs-img-placeholder svg {
    width: 32px;
    height: 32px;
}

/* ==========================================================================
   [vs_offers] / [vs_offer] — editorial offer cards
   ========================================================================== */
.vs-offer-row {
    --vs-primary: #1f9b3b;
    --vs-primary-hover: #187d30;
    --vs-text-dark: #111827;
    --vs-text-muted: #6B7280;
    --vs-border-color: #E5E7EB;
    --vs-offer-columns: 2;

    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 14px;
    align-items: stretch;
    max-width: 1400px;
    margin: 0 auto;
}

/* Fixed 2-up as soon as there's room, regardless of the configured
   desktop count — avoids two offer cards feeling cramped on tablets
   when `columns` is set higher than 2. */
@media (min-width: 480px) {
    .vs-offer-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* From here up, honour the configured column count. */
@media (min-width: 900px) {
    .vs-offer-row {
        grid-template-columns: repeat(var(--vs-offer-columns), 1fr);
    }
}

.vs-offer-card {
    background: #fff;
    border: 1px solid var(--vs-border-color);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.vs-offer-card.is-live {
    border-color: var(--vs-primary);
}

.vs-offer-img {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #F3F4F6;
    border-bottom: 1px solid var(--vs-border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.vs-offer-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vs-offer-img .vs-img-placeholder svg {
    width: 28px;
    height: 28px;
}

.vs-offer-body {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.vs-offer-card h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--vs-text-dark);
    margin-bottom: 4px;
}

.vs-offer-card p {
    font-size: 12px;
    color: var(--vs-text-muted);
    margin-bottom: 6px;
    line-height: 1.5;
}

.vs-offer-exp {
    display: inline-flex;
    gap: 4px;
    font-size: 11px;
    color: var(--vs-text-muted);
    margin-bottom: 6px;
    line-height: 1.5;
}

.vs-offer-rating {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-bottom: 10px;
}

.vs-btn {
    display: block;
    width: 100%;
    text-align: center;
    background-color: var(--vs-primary);
    color: #fff;
    border: none;
    padding: 9px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    margin-top: auto;
    transition: background 0.2s;
}

.vs-btn:hover {
    background-color: var(--vs-primary-hover);
    color: #fff;
}

@media (max-width: 480px) {
    .vs-seasonal-body {
        flex-direction: column;
        align-items: flex-start;
    }

    .vs-btn-pill {
        width: 100%;
        text-align: center;
    }
}

/* ==========================================================================
   [vs_category_tiles] — image tiles linking into category archives
   ========================================================================== */
.vs-category-tiles {
    --vs-tile-columns: 4;
    --vs-border-color: #E5E7EB;

    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Fixed 3-up on tablets, regardless of the configured desktop count —
   avoids 4+ tiles feeling cramped before there's actually room. */
@media (min-width: 640px) {
    .vs-category-tiles {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* From here up, honour the configured column count. */
@media (min-width: 1024px) {
    .vs-category-tiles {
        grid-template-columns: repeat(var(--vs-tile-columns), 1fr);
    }
}

.vs-cat-tile {
    position: relative;
    display: block;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 16 / 7;
    background: #6B7280 center / cover no-repeat;
    border: 1px solid var(--vs-border-color);
    text-decoration: none;
}

.vs-cat-scrim {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.68) 0%, rgba(0, 0, 0, 0) 100%);
}

.vs-cat-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 9px 11px;
}

.vs-cat-label strong {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
}

.vs-cat-label span {
    display: block;
    font-size: 11px;
    color: #fff;
    opacity: 0.85;
    margin-top: 2px;
}

/* ==========================================================================
   Category archive layout — sidebar taxonomy menu + main content
   (templates/taxonomy-listing_cat.php)
   ========================================================================== */
.vs-archive-layout {
    display: flex;
    align-items: flex-start;
    gap: 32px;
}

.vs-archive-sidebar {
    flex: 0 0 220px;
    width: 220px;
    margin-top: 45px;
}

.vs-archive-main {
    flex: 1;
    min-width: 0;
    /* prevents the card grid from overflowing its column */
}

.shop-sidebar-header {
    text-align: center;
    padding: 0 0 25px;
}

.shop-sidebar-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--global-palette3, #1A202C);
}

.shop-sidebar-subtitle {
    font-size: 18px;
    font-weight: 500;
    color: var(--global-palette3, #1A202C);
}

/* Stack sidebar above content below tablet width. This intentionally
   does not style #shop_sidebar_shortcode_menu itself (link color,
   spacing, active-state, etc.) — only add rules here if that menu
   doesn't already have styling elsewhere on the site. */
@media (max-width: 900px) {
    .vs-archive-layout {
        flex-direction: column;
        gap: 20px;
    }

    .vs-archive-sidebar {
        flex: 1 1 auto;
        width: 100%;
    }
}

/* ==========================================================================
   Category Before & After Loop WYSIWYG Content
   ========================================================================== */
.vs-category-content {
    font-size: 15px;
    line-height: 1.7;
    color: var(--vs-text-dark, #374151);
    margin: 24px 0;
}

.vs-category-content p {
    margin-bottom: 16px;
}

.vs-category-content p:last-child {
    margin-bottom: 0;
}

.vs-category-content h2,
.vs-category-content h3,
.vs-category-content h4 {
    color: var(--vs-text-dark, #1f2937);
    margin-top: 28px;
    margin-bottom: 12px;
    font-weight: 700;
    line-height: 1.3;
}

.vs-category-content ul,
.vs-category-content ol {
    margin: 16px 0 16px 24px;
}

.vs-category-content li {
    margin-bottom: 6px;
}

.vs-category-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.vs-category-before-loop {
    margin-bottom: 32px;
}

.vs-category-after-loop {
    margin-top: 40px;
    margin-bottom: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--vs-border-color, #E5E7EB);
}