/**
 * Vitaderm Stockists - Frontend Styles
 * Version: 1.4.0
 *
 * Minimal, theme-friendly defaults for the [vitaderm_stockists] shortcode
 * output, the CPT archive, and single-stockist pages. Designed to layer
 * safely on top of Hello Elementor.
 */

/* ---------- Theme hooks ---------- */
:root {
    --vd-primary: var(--wp--preset--color--primary, #c36);
    --vd-contrast: var(--wp--preset--color--contrast, #2a2a2a);
    --vd-muted: #6b6b6b;
    --vd-surface: #ffffff;
    --vd-border: #e6e6e6;
    --vd-chip-bg: rgba(0, 0, 0, 0.06);
    --vd-radius: 14px;
}

/* ---------- Archive wrapper ---------- */
.vd-archive {
    --vd-primary: #636363;
    --vd-chip-bg: rgba(99, 99, 99, 0.12);
    max-width: min(1180px, 100%);
    margin: clamp(2rem, 6vw, 4rem) auto;
    padding: 0 clamp(1rem, 4vw, 2rem) clamp(3rem, 6vw, 5rem);
    font-family: "FuturaLT-Bold", Sans-serif;

}

.vd-archive-header {
    text-align: center;
    margin: 0 0 30px 0;
    /* font-size: clamp(1.75rem, 4vw, 2.5rem); */
    /* line-height: 1.1; */
    font-family: "FuturaLT-Bold", Sans-serif;
    font-size: 1.8em !important;
    font-weight: 600;
    line-height: 1.2em;
    color: #5B5B5B;

}

.vd-archive-title {
    margin: 0;
    /* font-size: clamp(1.75rem, 4vw, 2.5rem); */
    /* line-height: 1.1; */
    font-family: "FuturaLT-Bold", Sans-serif;
    font-size: 1.8em !important;
    font-weight: 600;
    line-height: 1.2em;
    color: #5B5B5B;
}

.vd-archive-description {
    color: var(--vd-muted);
    max-width: 680px;
    margin: 0.75rem auto 0;
    line-height: 1.6;
}

/* ---------- Filter bar ---------- */
.vd-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem 1rem;
    padding: 1rem 1.25rem;
    margin: 0 0 1.75rem;
    background: var(--vd-surface);
    border: 1px solid var(--vd-border);
    border-radius: var(--vd-radius);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.03);
}

.vd-filter-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1 1 200px;
    min-width: 180px;
}

.vd-filter-field>span {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--vd-muted);
}

.vd-filter select {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--vd-border);
    background: #fff;
    font-size: 0.95rem;
    line-height: 1.2;
}

.vd-filter-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 0 0 auto;
}

.vd-filter-reset {
    font-size: 0.85rem;
    color: var(--vd-muted);
    text-decoration: none !important;
}

.vd-filter-reset:hover {
    color: var(--vd-contrast);
}

/* ---------- Buttons ---------- */
.vd-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.1;
    text-decoration: none !important;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
    white-space: nowrap;
}

.vd-btn:hover,
.vd-btn:focus-visible {
    transform: translateY(-1px);
}

.vd-btn-primary {
    background: var(--vd-primary) !important;
    color: #fff !important;
    border-color: var(--vd-primary) !important;
}

.vd-btn-primary:hover,
.vd-btn-primary:focus-visible {
    background: var(--vd-primary) !important;
    color: #fff !important;
    border-color: var(--vd-primary) !important;
    filter: brightness(0.92);
}

.vd-btn-ghost {
    background: transparent;
    color: var(--vd-contrast) !important;
    border-color: var(--vd-border);
}

.vd-btn-ghost:hover,
.vd-btn-ghost:focus-visible {
    border-color: var(--vd-primary);
    color: var(--vd-primary) !important;
}

.vd-icon {
    flex: 0 0 auto;
    display: inline-block;
}

/* ---------- Grid ---------- */
.vd-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.vd-grid-archive {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.vd-grid.columns-1 {
    grid-template-columns: 1fr;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

.vd-grid.columns-2 {
    grid-template-columns: repeat(2, minmax(260px, 1fr));
}

.vd-grid.columns-3 {
    grid-template-columns: repeat(3, minmax(240px, 1fr));
}

@media (max-width: 900px) {
    .vd-grid.columns-3 {
        grid-template-columns: repeat(2, minmax(240px, 1fr));
    }
}

@media (max-width: 680px) {

    .vd-grid.columns-2,
    .vd-grid.columns-3,
    .vd-grid-archive {
        grid-template-columns: 1fr;
    }
}

/* ---------- Card ---------- */
.vd-card {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 1rem 1rem 1.1rem;
    background: var(--vd-surface);
    border: 1px solid var(--vd-border);
    border-radius: var(--vd-radius);
    transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.vd-card:hover {
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
    border-color: rgba(0, 0, 0, 0.1);
}

.vd-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.vd-thumb {
    margin: 0 auto 0.25rem;
    width: 100%;
    max-width: 260px;
}

.vd-thumb-img {
    width: 100%;
    height: auto;
    max-width: 260px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 12px;
    display: block;
}

.vd-card-title {
    margin: 0.25rem 0 0;
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
}

.vd-card-title a {
    color: inherit;
    text-decoration: none !important;
    transition: color 0.15s ease;
}

.vd-card-link {
    text-decoration: none !important;
}

.vd-card-title a:hover,
.vd-card-link:hover .vd-card-title,
.vd-card-link:focus-visible .vd-card-title {
    color: var(--vd-primary);
}

.vd-desc {
    font-size: 0.9375rem;
    line-height: 1.55;
    color: #3a3a3a;
    margin: 15px 0 15px 0;
}

.vd-read-more {
    color: var(--vd-primary);
    text-decoration: none !important;
    font-weight: 600;
    white-space: nowrap;
}

.vd-read-more:hover {
    text-decoration: underline !important;
}

/* ---------- Chips ---------- */
.vd-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: center;
}

.vd-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 999px;
    background: var(--vd-chip-bg);
    color: var(--vd-contrast);
    text-decoration: none !important;
    letter-spacing: 0.01em;
    line-height: 1.4;
}

.vd-chip-province {
    background: color-mix(in srgb, var(--vd-primary) 18%, transparent);
    color: var(--vd-primary);
}

.vd-chip-suburb {
    background: rgba(0, 0, 0, 0.06);
}

a.vd-chip:hover,
a.vd-chip:focus-visible {
    filter: brightness(0.92);
}

/* ---------- Meta lines ---------- */
.vd-meta-line {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--vd-contrast);
}

.vd-meta-line .vd-icon {
    margin-top: 0.18rem;
    color: var(--vd-primary);
}

.vd-meta-line a {
    color: inherit;
    text-decoration: none !important;
    border-bottom: none;
}

.vd-meta-line a:hover {
    color: var(--vd-primary);
}

.vd-meta-muted {
    color: var(--vd-muted);
    font-size: 0.85rem;
}

.vd-postal {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.05rem 0.45rem;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--vd-muted);
}

/* ---------- Card actions ---------- */
.vd-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: auto;
    padding-top: 0.25rem;
    justify-content: center;
}

.vd-card-actions .vd-btn {
    font-size: 0.82rem;
    padding: 0.4rem 0.75rem;
}

/* ---------- Single stockist ---------- */
.vd-single-stockist {
    --vd-primary: #636363;
    --vd-chip-bg: rgba(99, 99, 99, 0.12);
    max-width: min(980px, 100%);
    margin: clamp(1.5rem, 4vw, 3rem) auto;
    padding: clamp(1.75rem, 5vw, 3rem);
    background: var(--vd-surface);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: calc(var(--vd-radius) + 2px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.05);
}

.vd-single-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(1.5rem, 4vw, 2.5rem);
    align-items: start;
}

@media (min-width: 860px) {
    .vd-single-grid {
        /* grid-template-columns: minmax(260px, 320px) 1fr; */
    }
}

.vd-single-media {
    align-self: start;
}

.vd-single-img {
    width: 100%;
    max-width: 320px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: var(--vd-radius);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.08);
}

.vd-single-content .vd-chips {
    justify-content: flex-start;
    margin-bottom: 0.75rem;
}

.vd-single-content> :last-child {
    margin-bottom: 0;
}

.vd-single-meta {
    margin-top: clamp(1.25rem, 3vw, 1.75rem);
    padding-top: clamp(1.25rem, 3vw, 1.75rem);
    border-top: 1px solid var(--vd-border);
    display: grid;
    gap: 0.75rem;
}

.vd-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.single-vitaderm_stockist .entry-title {
    margin-top: 50px;
}

/* ---------- Socials ---------- */
.vd-single-socials {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
}

.vd-socials-label {
    font-weight: 600;
    color: var(--vd-muted);
}

.vd-single-socials ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0;
    padding: 0;
}

.vd-single-socials li a {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.06);
    font-size: 0.85rem;
    font-weight: 600;
    color: inherit;
    text-decoration: none !important;
    transition: background 0.15s ease, color 0.15s ease;
}

.vd-single-socials li a:hover,
.vd-single-socials li a:focus-visible {
    background: var(--vd-primary);
    color: #fff;
}

/* ---------- Empty state ---------- */
.vd-empty {
    margin: 2rem 0;
    text-align: center;
    font-style: italic;
    color: var(--vd-muted);
}

/* ---------- Pagination ---------- */
.vd-pagination {
    margin-top: 2.5rem;
    text-align: center;
}

.vd-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 0.75rem;
    margin: 0 0.15rem;
    border-radius: 999px;
    border: 1px solid var(--vd-border);
    color: var(--vd-contrast);
    text-decoration: none !important;
    font-weight: 600;
}

.vd-pagination .page-numbers.current {
    background: var(--vd-primary);
    color: #fff;
    border-color: var(--vd-primary);
}

.vd-pagination .page-numbers:hover {
    border-color: var(--vd-primary);
    color: var(--vd-primary);
}

/* ---------- Full-bleed ASL map ---------- */
.vd-asl-map-wide {
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    width: 80vw;
    max-width: 80vw;
    margin: 0 auto clamp(1.5rem, 4vw, 2.5rem);
}

@media (max-width: 782px) {
    .vd-asl-map-wide {
        width: 100vw;
        max-width: 100vw;
    }
}

body #asl-storelocator.asl-p-cont #asl-map-canv,
body #asl-storelocator.asl-cont #asl-map-canv {
    height: 650px !important
}

@media (max-width: 767px) {

    body #asl-storelocator.asl-p-cont #asl-map-canv,
    body #asl-storelocator.asl-cont #asl-map-canv {
        height: 650px !important;
    }
}

/* ---------- Search bar ---------- */
.entry-title {
    text-align: center;
    font-family: "FuturaLT-Bold", Sans-serif;
    font-size: 2.3em;
    font-weight: 600;
    line-height: 1.2em;
    color: #5B5B5B;
}

.vd-search-bar {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin: 2rem 0 1.5rem 0;
}

.vd-search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    line-height: 1.3;
    border: 1px solid var(--vd-border);
    border-radius: var(--vd-radius);
    background: var(--vd-surface);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
}

.vd-search-input:focus {
    outline: none;
    border-color: var(--vd-primary);
    box-shadow: 0 0 0 3px rgba(99, 99, 99, 0.18);
}

.vd-search-count {
    margin: 0;
    font-size: 0.85rem;
    color: var(--vd-muted);
    min-height: 1.2em;
}

/* ---------- Load more ---------- */
.vd-load-more-wrap {
    text-align: center;
    margin-top: clamp(1.5rem, 4vw, 2.25rem);
}

.vd-load-more {
    min-width: 160px;
    padding: 0.7rem 1.4rem;
    font-size: 0.95rem;
}

.vd-empty-results {
    margin: 0;
    color: var(--vd-muted);
    font-style: italic;
}

/* Cards get hidden attribute flipped by JS; make sure they collapse */
.vd-card[hidden],
.vd-load-more[hidden],
.vd-empty-results[hidden] {
    display: none !important;
}

/* Collapse the wrap when both the button and empty message are hidden */
.vd-load-more-wrap:not(:has(> :not([hidden]))) {
    display: none;
}

/* ---------- Single-stockist description (from excerpt) ---------- */
.vd-single-desc {
    font-size: 1rem;
    line-height: 1.65;
    color: var(--vd-contrast);
    margin: 0 0 1rem;
}

.vd-single-desc p {
    margin: 0 0 0.75rem;
}

.vd-single-desc p:last-child {
    margin-bottom: 0;
}

/* ---------- Back link (single stockist) ---------- */
.vd-single-back {
    margin: 0 0 1rem;
}

.vd-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem 0.35rem 0.6rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--vd-contrast) !important;
    background: var(--vd-chip-bg);
    border: 1px solid var(--vd-border);
    border-radius: 999px;
    text-decoration: none !important;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.vd-back-link:hover,
.vd-back-link:focus-visible {
    background: var(--vd-surface);
    border-color: var(--vd-primary);
    transform: translateX(-2px);
}