/* ==========================================================================
   Dokan — Vendor Store & Store Listing
   ========================================================================== */

/* ---------- Vendor Store Page ---------- */
.gm-vendor-store {
    padding-top: var(--gm-gap-md);
    padding-bottom: var(--gm-gap-2xl);
}

/* Banner */
.gm-store-banner {
    border-radius: var(--gm-radius-lg);
    overflow: hidden;
    border: 1px solid var(--gm-border-light);
}

.gm-store-banner-img {
    width: 100%;
    height: 240px;
    object-fit: cover;
    display: block;
}

.gm-store-banner-placeholder {
    width: 100%;
    height: 240px;
    background: linear-gradient(135deg, #0C3130 0%, #1a5b59 50%, #164544 100%);
}

/* Centered Profile */
.gm-store-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-top: -44px;
    margin-bottom: var(--gm-gap-xl);
    position: relative;
    z-index: 1;
}

.gm-store-avatar {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #fff;
    background: var(--gm-bg-light);
    margin-bottom: 12px;
}

.gm-store-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gm-store-name {
    font-size: 1.375rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.gm-store-verified {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: var(--gm-success);
    color: #fff;
    border-radius: 50%;
    flex-shrink: 0;
}

.gm-store-verified svg {
    width: 12px;
    height: 12px;
}

.gm-store-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.gm-store-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--gm-text-muted);
    background: var(--gm-bg-light);
    padding: 5px 12px;
    border-radius: var(--gm-radius-full);
    border: 1px solid var(--gm-border-light);
}

.gm-store-meta-item svg {
    opacity: 0.5;
}

.gm-store-meta-phone {
    color: var(--gm-primary);
    transition: background var(--gm-transition), border-color var(--gm-transition);
}

.gm-store-meta-phone:hover {
    background: var(--gm-bg-muted);
    border-color: var(--gm-border-hover);
    color: var(--gm-primary);
}

/* Products Section */
.gm-store-products {
    margin-top: 0;
}

.gm-store-products-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--gm-gap-md);
    padding-bottom: var(--gm-gap);
    border-bottom: 1px solid var(--gm-border-light);
    position: relative;
}

.gm-store-products-header::before {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--gm-primary);
    border-radius: 2px;
}

.gm-store-products-title {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.gm-store-products-count {
    font-size: 0.8125rem;
    color: var(--gm-text-muted);
    font-weight: 500;
}

/* Store product grid — 4 columns */
.gm-store-product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--gm-gap);
}

/* Hide WooCommerce default sorting on store pages */
.gm-vendor-store .woocommerce-ordering,
.gm-vendor-store .woocommerce-result-count,
.gm-vendor-store .woocommerce-notices-wrapper:empty {
    display: none;
}


/* ==========================================================================
   Store Listing — Filter Bar
   ========================================================================== */

/* Hide Dokan's default page title — we use .gm-page-title instead */
.gm-page-body > h2:first-child {
    display: none;
}

/* Override Dokan filter bar */
#dokan-store-listing-filter-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--gm-bg-light);
    border: 1px solid var(--gm-border-light);
    border-radius: var(--gm-radius);
    box-shadow: none;
    font-family: var(--gm-font);
    gap: var(--gm-gap);
}

#dokan-store-listing-filter-wrap .left {
    flex: 1;
    min-width: 0;
}

#dokan-store-listing-filter-wrap .left .store-count {
    font-size: 0.8125rem;
    color: var(--gm-text-muted);
    font-weight: 500;
    margin: 0;
    padding: 0;
}

#dokan-store-listing-filter-wrap .right {
    display: flex;
    align-items: center;
    gap: var(--gm-gap-sm);
}

#dokan-store-listing-filter-wrap .right .item {
    white-space: nowrap;
}

/* Filter button */
#dokan-store-listing-filter-wrap .right .item .dokan-store-list-filter-button,
#dokan-store-listing-filter-wrap .right .item button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px !important;
    font-size: 0.8125rem;
    font-weight: 600;
    font-family: var(--gm-font);
    color: var(--gm-text);
    background: #fff !important;
    border: 1px solid var(--gm-border) !important;
    border-radius: var(--gm-radius-sm);
    cursor: pointer;
    transition: all var(--gm-transition);
}

#dokan-store-listing-filter-wrap .right .item .dokan-store-list-filter-button:hover,
#dokan-store-listing-filter-wrap .right .item button:hover {
    border-color: var(--gm-border-hover) !important;
    color: var(--gm-primary);
}

/* Hide the hamburger icon lines inside button */
#dokan-store-listing-filter-wrap .right .item .dokan-icons {
    display: none;
}

/* Sort dropdown */
#dokan-store-listing-filter-wrap .right .item.sort-by {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

#dokan-store-listing-filter-wrap .right .item.sort-by label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--gm-text-muted);
    white-space: nowrap;
}

#dokan-store-listing-filter-wrap .right .item select,
#dokan-store-listing-filter-wrap .right .sort-by select {
    padding: 8px 32px 8px 12px;
    font-size: 0.8125rem;
    font-weight: 500;
    font-family: var(--gm-font);
    color: var(--gm-text);
    background: #fff;
    border: 1px solid var(--gm-border);
    border-radius: var(--gm-radius-sm);
    cursor: pointer;
    transition: border-color var(--gm-transition);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

#dokan-store-listing-filter-wrap .right .item select:hover,
#dokan-store-listing-filter-wrap .right .sort-by select:hover {
    border-color: var(--gm-border-hover);
}

#dokan-store-listing-filter-wrap .right .item select:focus,
#dokan-store-listing-filter-wrap .right .sort-by select:focus {
    outline: none;
    border-color: var(--gm-primary);
}

/* View toggle */
#dokan-store-listing-filter-wrap .right .toggle-view {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 0;
    line-height: 1;
    height: auto;
}

#dokan-store-listing-filter-wrap .right .toggle-view .dashicons {
    font-size: 18px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--gm-radius-xs);
    color: var(--gm-text-muted);
    cursor: pointer;
    transition: all var(--gm-transition);
    border: 1px solid transparent;
}

#dokan-store-listing-filter-wrap .right .toggle-view .dashicons:hover {
    color: var(--gm-text);
    background: #fff;
    border-color: var(--gm-border);
}

#dokan-store-listing-filter-wrap .right .toggle-view .dashicons.active {
    color: var(--gm-primary);
    background: #fff;
    border-color: var(--gm-border);
}

/* Expandable filter form */
#dokan-store-listing-filter-form-wrap {
    background: var(--gm-bg-light);
    border: 1px solid var(--gm-border-light);
    border-radius: var(--gm-radius);
    padding: var(--gm-gap);
    margin-top: var(--gm-gap-sm);
    box-shadow: none;
    font-family: var(--gm-font);
}

#dokan-store-listing-filter-form-wrap::before {
    display: none;
}

#dokan-store-listing-filter-form-wrap .store-search .store-search-input {
    width: 100%;
    padding: 10px 16px;
    font-size: 0.875rem;
    font-family: var(--gm-font);
    border: 1px solid var(--gm-border);
    border-radius: var(--gm-radius-sm);
    background: #fff;
    color: var(--gm-text);
    transition: border-color var(--gm-transition);
}

#dokan-store-listing-filter-form-wrap .store-search .store-search-input:focus {
    outline: none;
    border-color: var(--gm-primary);
}

#dokan-store-listing-filter-form-wrap .store-search .store-search-input::placeholder {
    color: var(--gm-text-muted);
}

#dokan-store-listing-filter-form-wrap .apply-filter {
    display: flex;
    justify-content: flex-end;
    gap: var(--gm-gap-xs);
    margin-top: var(--gm-gap-sm);
}

#dokan-store-listing-filter-form-wrap .apply-filter button {
    padding: 8px 20px;
    font-size: 0.8125rem;
    font-weight: 600;
    font-family: var(--gm-font);
    border-radius: var(--gm-radius-sm);
    cursor: pointer;
    transition: all var(--gm-transition);
}

#dokan-store-listing-filter-form-wrap .apply-filter #apply-filter-btn {
    background: var(--gm-primary) !important;
    color: #fff !important;
    border: 1px solid var(--gm-primary) !important;
}

#dokan-store-listing-filter-form-wrap .apply-filter #apply-filter-btn:hover {
    background: var(--gm-primary-hover) !important;
    border-color: var(--gm-primary-hover) !important;
}

#dokan-store-listing-filter-form-wrap .apply-filter #cancel-filter-btn {
    background: #fff !important;
    color: var(--gm-text) !important;
    border: 1px solid var(--gm-border) !important;
}

#dokan-store-listing-filter-form-wrap .apply-filter #cancel-filter-btn:hover {
    border-color: var(--gm-border-hover) !important;
}


/* ==========================================================================
   Store Listing Grid
   ========================================================================== */
.gm-stores-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--gm-gap);
    margin-top: var(--gm-gap-lg);
}

.gm-store-card {
    display: block;
    background: #fff;
    border: 1px solid var(--gm-border-light);
    border-radius: var(--gm-radius);
    overflow: hidden;
    transition: border-color var(--gm-transition);
}

.gm-store-card:hover {
    border-color: var(--gm-border-hover);
    color: var(--gm-text);
}

/* Card banner */
.gm-store-card-banner {
    height: 120px;
    overflow: hidden;
    background: var(--gm-bg-light);
}

.gm-store-card-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.gm-store-card:hover .gm-store-card-banner img {
    transform: scale(1.03);
}

.gm-store-card-banner-ph {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0C3130 0%, #164544 100%);
}

/* Card body */
.gm-store-card-body {
    padding: 16px;
    position: relative;
}

.gm-store-card-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #fff;
    margin-top: -38px;
    margin-bottom: 8px;
    background: var(--gm-bg-light);
}

.gm-store-card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gm-store-card-name {
    font-size: 0.9375rem;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: -0.01em;
}

.gm-store-card-meta {
    display: flex;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--gm-text-muted);
}


/* ==========================================================================
   Dokan Dashboard Override
   ========================================================================== */
.dokan-dashboard-wrap {
    font-family: var(--gm-font);
}

.dokan-dashboard-wrap .dokan-dash-sidebar {
    border-radius: var(--gm-radius);
    border: 1px solid var(--gm-border-light);
}

.dokan-dashboard-wrap .dokan-dash-sidebar ul.dokan-dashboard-menu li a {
    font-family: var(--gm-font);
    font-size: 0.875rem;
}

.dokan-dashboard-wrap .dokan-dashboard-content {
    font-family: var(--gm-font);
}


/* ==========================================================================
   Dokan Pagination Override
   ========================================================================== */
.dokan-pagination-container .dokan-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    list-style: none;
    margin-top: var(--gm-gap-xl);
}

.dokan-pagination-container .dokan-pagination li a,
.dokan-pagination-container .dokan-pagination li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 var(--gm-gap-sm);
    border-radius: var(--gm-radius-sm);
    font-size: 0.8125rem;
    border: 1px solid var(--gm-border-light);
    color: var(--gm-text);
    transition: all var(--gm-transition);
}

.dokan-pagination-container .dokan-pagination li a:hover {
    border-color: var(--gm-primary);
    color: var(--gm-primary);
}

.dokan-pagination-container .dokan-pagination li.active span {
    background: var(--gm-primary);
    color: #fff;
    border-color: var(--gm-primary);
}


/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1024px) {
    .gm-stores-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .gm-store-product-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .gm-store-banner-img,
    .gm-store-banner-placeholder {
        height: 200px;
    }
}

@media (max-width: 767px) {
    .gm-vendor-store {
        padding-top: var(--gm-gap);
    }

    .gm-store-banner {
        border-radius: var(--gm-radius);
    }

    .gm-store-banner-img,
    .gm-store-banner-placeholder {
        height: 150px;
    }

    .gm-store-profile {
        margin-top: -32px;
        margin-bottom: var(--gm-gap-lg);
    }

    .gm-store-avatar {
        width: 72px;
        height: 72px;
    }

    .gm-store-name {
        font-size: 1.125rem;
    }

    .gm-store-meta-item {
        font-size: 0.6875rem;
        padding: 4px 10px;
    }

    .gm-store-product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .gm-stores-grid {
        grid-template-columns: 1fr;
        gap: var(--gm-gap-sm);
    }

    .gm-store-card-banner {
        height: 100px;
    }

    .gm-store-card-body {
        padding: 14px;
    }

    .gm-store-card-avatar {
        width: 42px;
        height: 42px;
        margin-top: -32px;
    }
}

@media (max-width: 480px) {
    .gm-store-banner-img,
    .gm-store-banner-placeholder {
        height: 120px;
    }

    .gm-store-profile {
        margin-top: -28px;
    }

    .gm-store-avatar {
        width: 64px;
        height: 64px;
    }

    .gm-store-name {
        font-size: 1rem;
    }
}
