/**
 * Dokan Vendor City Filter — Frontend styles
 * Follows WooCommerce visual conventions (colors, spacing, border-radius).
 */

/* ── Filter widget / shortcode container ──────────────────────────────────── */
.dvcf-filter {
    margin-bottom: 1.5em;
}

.dvcf-filter__title {
    font-size: 1em;
    font-weight: 700;
    margin: 0 0 .75em;
    padding: 0;
    text-transform: uppercase;
    letter-spacing: .05em;
}

/* ── Checkbox list ────────────────────────────────────────────────────────── */
.dvcf-filter__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dvcf-filter__item {
    padding: .3em 0;
    border-bottom: 1px solid #f0f0f0;
}

.dvcf-filter__item:last-child {
    border-bottom: none;
}

.dvcf-filter__item--active .dvcf-filter__city-name {
    font-weight: 700;
    color: var(--wc-color-primary, #7f54b3);
}

.dvcf-filter__label {
    display: flex;
    align-items: center;
    gap: .5em;
    cursor: pointer;
    margin: 0;
}

.dvcf-filter__checkbox {
    flex-shrink: 0;
    margin: 0;
    cursor: pointer;
}

.dvcf-filter__city-name {
    flex: 1;
}

.dvcf-filter__count {
    background: #f0f0f0;
    color: #555;
    border-radius: 2em;
    padding: .1em .5em;
    font-size: .8em;
    min-width: 1.8em;
    text-align: center;
}

/* ── Dropdown layout ──────────────────────────────────────────────────────── */
.dvcf-filter__dropdown {
    width: 100%;
    max-width: 300px;
    padding: .5em .75em;
    border: 1px solid #ccc;
    border-radius: 3px;
    margin-bottom: .5em;
}

/* ── Action row ───────────────────────────────────────────────────────────── */
.dvcf-filter__actions {
    display: flex;
    align-items: center;
    gap: .75em;
    margin-top: .75em;
}

.dvcf-filter__submit {
    /* Inherits .button from theme */
}

.dvcf-filter__clear {
    font-size: .875em;
    color: #666;
    text-decoration: underline;
}

.dvcf-filter__clear:hover {
    color: #c00;
}

/* ── Loading overlay ──────────────────────────────────────────────────────── */
.dvcf-filter__loading {
    display: flex;
    align-items: center;
    gap: .5em;
    padding: .5em 0;
    color: #666;
    font-size: .875em;
}

.dvcf-spinner {
    display: inline-block;
    width: 1em;
    height: 1em;
    border: 2px solid #ccc;
    border-top-color: #555;
    border-radius: 50%;
    animation: dvcf-spin .7s linear infinite;
}

@keyframes dvcf-spin {
    to { transform: rotate(360deg); }
}

/* ── Active filter chips (above shop loop) ────────────────────────────────── */
.dvcf-active-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5em;
    margin-bottom: 1em;
    padding: .5em .75em;
    background: #f8f8f8;
    border-radius: 4px;
    border: 1px solid #e5e5e5;
}

.dvcf-active-filter-label {
    font-size: .8125em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #555;
}

.dvcf-active-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: .35em;
    background: var(--wc-color-primary, #7f54b3);
    color: #fff;
    padding: .2em .65em;
    border-radius: 2em;
    font-size: .8125em;
}

.dvcf-remove-filter {
    color: rgba(255,255,255,.8);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1em;
    line-height: 1;
}

.dvcf-remove-filter:hover {
    color: #fff;
}

/* ── Product card city chip ───────────────────────────────────────────────── */
.dvcf-product-cities {
    display: flex;
    flex-wrap: wrap;
    gap: .35em;
    margin-top: .35em;
    margin-bottom: .35em;
}

.dvcf-city-chip {
    display: inline-flex;
    align-items: center;
    gap: .25em;
    padding: .15em .55em;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 2em;
    font-size: .75em;
    color: #333;
    text-decoration: none;
    transition: background .2s, color .2s;
}

.dvcf-city-chip:hover {
    background: var(--wc-color-primary, #7f54b3);
    border-color: var(--wc-color-primary, #7f54b3);
    color: #fff;
}

.dvcf-city-chip--plain {
    cursor: default;
}

.dvcf-city-chip__icon {
    font-size: .6em;
    color: var(--wc-color-primary, #7f54b3);
}

.dvcf-city-chip:hover .dvcf-city-chip__icon {
    color: rgba(255,255,255,.8);
}

/* ── Store page city badge (inside Dokan store-info <ul>) ─────────────────── */
.dvcf-store-city {
    display: flex;
    align-items: center;
    gap: .5em;
}

.dvcf-store-city a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dotted currentColor;
}

.dvcf-store-city a:hover {
    border-bottom-style: solid;
}

/* ── Vendor dashboard city field ──────────────────────────────────────────── */
.dvcf-vendor-city-field .dokan-control-label {
    padding-top: .4em;
}

.dvcf-vendor-city-field .help-block {
    color: #888;
    font-size: .875em;
    margin-top: .35em;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .dvcf-filter__dropdown {
        max-width: 100%;
    }

    .dvcf-active-filters {
        flex-direction: column;
        align-items: flex-start;
    }
}
