:root {
    --bida-green: #22c55e;
    --bida-highlight: #92ff57;
    --bida-bg: #e9fcd9;
    --bida-text: #111827;
    --bida-muted: #6b7280;
    --bida-card: #ffffff;
    --bida-border: #e5e7eb;
}

.bida-mobile-browser {
    background: var(--bida-bg);
    padding: 16px;
    border-radius: 16px;
    color: var(--bida-text);
}

.bida-mobile-browser [hidden] {
    display: none !important;
}

.bida-mobile-browser[data-mode="product"] [data-vendor-section],
.bida-mobile-browser[data-mode="product"] [data-selected-vendor-row],
.bida-mobile-browser[data-mode="product"] [data-vendor-mode] {
    display: none !important;
}

.bida-mobile-browser-section {
    margin-bottom: 18px;
}

.bida-widget-toggle {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.bida-widget-toggle-btn {
    border: 1px solid var(--bida-border);
    background: #ffffff;
    color: var(--bida-text);
    font-size: 14px;
    font-weight: 700;
    border-radius: 999px;
    padding: 10px 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}

.bida-widget-toggle-icon {
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.bida-widget-toggle-icon svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    display: block;
}

.bida-widget-panel {
    position: relative;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 14px;
    padding: 42px 12px 12px;
    margin: 0 auto 16px;
    width: 100%;
    box-sizing: border-box;
}

.bida-widget-panel .bida-mobile-browser-section:last-child {
    margin-bottom: 0;
}

.bida-widget-close {
    position: absolute;
    top: 8px;
    right: 8px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: var(--bida-muted);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
    aspect-ratio: 1 / 1;
    padding: 0;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}

.bida-widget-close:hover {
    color: var(--bida-text);
    background: rgba(17, 24, 39, 0.08);
}

.bida-section-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--bida-text);
}

.bida-search-bar {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 10px;
    background: #ffffff;
    border: 1px solid var(--bida-border);
    border-radius: 16px;
    padding: 10px 12px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}

.bida-search-input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    font-size: 14px;
    background: transparent;
    color: var(--bida-text);
}

.bida-search-reset {
    border: none;
    background: var(--bida-highlight);
    color: #111827;
    font-weight: 700;
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 999px;
    cursor: pointer;
    flex-shrink: 0;
}

.bida-search-status {
    font-size: 12px;
    color: var(--bida-muted);
    margin-top: 6px;
}

.bida-filter-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: fit-content;
    margin: 0 auto;
}

.bida-filter-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--bida-text);
    white-space: nowrap;
}

.bida-mode-pill-group {
    display: inline-flex;
    gap: 8px;
    background: #ffffff;
    border: 1px solid var(--bida-border);
    border-radius: 999px;
    padding: 4px;
}

.bida-mode-pill {
    border: none;
    background: transparent;
    color: var(--bida-text);
    font-size: 12px;
    font-weight: 700;
    padding: 8px 14px;
    border-radius: 999px;
    cursor: pointer;
}

.bida-mode-pill.is-active {
    background: var(--bida-highlight);
}

.bida-vendor-controls {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    background: #ffffff;
    border: 1px solid var(--bida-border);
    border-radius: 12px;
    padding: 10px 12px;
}

.bida-location-filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--bida-text);
    cursor: pointer;
}

.bida-location-filter-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--bida-green);
}

.bida-radius-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.bida-vendor-radius-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--bida-text);
}

.bida-vendor-radius-input {
    width: 62px;
    border: 1px solid var(--bida-border);
    border-radius: 8px;
    padding: 6px 8px;
    font-size: 12px;
    font-weight: 700;
    color: var(--bida-text);
    background: #ffffff;
}

.bida-vendor-radius-apply {
    border: none;
    background: var(--bida-highlight);
    color: #111827;
    font-weight: 700;
    font-size: 12px;
    padding: 8px 12px;
    border-radius: 999px;
    cursor: pointer;
}

.bida-use-location-btn {
    border: 1px solid var(--bida-border);
    background: #ffffff;
    color: var(--bida-text);
    font-weight: 700;
    font-size: 12px;
    padding: 8px 12px;
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
    flex: 0 0 100%;
    width: fit-content;
    margin: 0 auto;
}

.bida-use-location-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.bida-vendor-status {
    font-size: 12px;
    color: var(--bida-muted);
    margin-top: 8px;
}

.bida-category-carousel,
.bida-subcategory-carousel,
.bida-vendor-carousel {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding-bottom: 6px;
    scroll-snap-type: x mandatory;
}

.bida-category-carousel::-webkit-scrollbar,
.bida-subcategory-carousel::-webkit-scrollbar,
.bida-vendor-carousel::-webkit-scrollbar {
    display: none;
}

.bida-category-item,
.bida-subcategory-item {
    border: none;
    background: transparent;
    padding: 6px 8px;
    border-radius: 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    scroll-snap-align: start;
    cursor: pointer;
}

.bida-category-thumb,
.bida-subcategory-thumb {
    background: #ffffff;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--bida-border);
    overflow: hidden;
}

.bida-category-thumb {
    width: 85px;
    height: 85px;
}

.bida-subcategory-thumb {
    width: 70px;
    height: 70px;
}

.bida-category-thumb img,
.bida-subcategory-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bida-category-label,
.bida-subcategory-label {
    font-size: 11px;
    color: var(--bida-text);
    font-weight: 600;
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bida-category-item.is-active .bida-category-thumb,
.bida-subcategory-item.is-active .bida-subcategory-thumb {
    border-color: var(--bida-highlight);
    background: var(--bida-highlight);
    box-shadow: 0 0 0 2px rgba(146, 255, 87, 0.35);
}

.bida-category-item.is-active,
.bida-subcategory-item.is-active {
    background: var(--bida-highlight);
}

.bida-carousel-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bida-carousel-arrow {
    display: none;
    border: none;
    background: #92ff57 !important;
    color: #111827;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    z-index: 2;
}

.bida-category-carousel,
.bida-subcategory-carousel,
.bida-vendor-carousel {
    width: 100%;
}

.bida-vendor-item {
    border: 1px solid var(--bida-border);
    background: #ffffff;
    padding: 8px;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 98px;
    scroll-snap-align: start;
    cursor: pointer;
}

.bida-vendor-item.is-active {
    border-color: var(--bida-highlight);
    box-shadow: 0 0 0 2px rgba(146, 255, 87, 0.35);
    background: #f8fff1;
}

.bida-vendor-thumb {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid var(--bida-border);
    display: inline-flex;
}

.bida-vendor-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bida-vendor-name {
    font-size: 11px;
    font-weight: 700;
    max-width: 84px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--bida-text);
}

.bida-vendor-distance {
    font-size: 10px;
    color: var(--bida-muted);
}

.bida-selected-vendor {
    background: #ffffff;
    border: 1px solid var(--bida-border);
    border-radius: 14px;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.bida-selected-vendor-thumb {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid var(--bida-border);
    flex-shrink: 0;
}

.bida-selected-vendor-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bida-selected-vendor-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.bida-selected-vendor-label {
    font-size: 10px;
    color: var(--bida-muted);
    line-height: 1;
}

.bida-selected-vendor-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--bida-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bida-selected-vendor-distance {
    margin-left: auto;
    font-size: 12px;
    font-weight: 700;
    color: var(--bida-green);
}

.bida-products-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.bida-product-card {
    background: var(--bida-card);
    border-radius: 16px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--bida-border);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
}

.bida-product-thumb {
    width: 100%;
    height: 110px;
    border-radius: 12px;
    overflow: hidden;
    background: #f3f4f6;
}

.bida-product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bida-product-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bida-product-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.bida-product-tag {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #111827;
}

.bida-product-tag.is-delivery {
    background: #dcfce7;
    color: #166534;
}

.bida-product-tag.is-download {
    background: #dbeafe;
    color: #1e40af;
}

.bida-product-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--bida-text);
}

.bida-product-price {
    font-size: 12px;
    color: var(--bida-green);
    font-weight: 700;
}

.bida-empty {
    font-size: 13px;
    color: var(--bida-muted);
    padding: 6px 0;
}

.bida-mobile-browser.is-loading {
    opacity: 0.6;
    pointer-events: none;
}

@media (min-width: 768px) {
    .bida-mobile-browser {
        max-width: 680px;
        margin: 0 auto;
    }

    .bida-carousel-arrow {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 767px) {
    .bida-carousel-arrow {
        display: none !important;
    }
}
