/* =====================================================================
   Kinwi: Dokan Store Search - spacing + responsive down to 260px
   ===================================================================== */

/* Desktop: add gap between input and button */
.dokan-store-search-form,
.dokan-single-store .dokan-search-form,
form.dokan-product-search-form,
.dokan-product-search .dokan-search-form,
.dokan-single-store form[role="search"],
.dokan-store-wrap form {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    align-items: stretch !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Input field: grow to fill available space */
.dokan-store-search-form input[type="text"],
.dokan-store-search-form input[type="search"],
.dokan-single-store .dokan-search-form input[type="text"],
.dokan-single-store .dokan-search-form input[type="search"],
form.dokan-product-search-form input[type="text"],
form.dokan-product-search-form input[type="search"],
.dokan-product-search input[type="text"],
.dokan-product-search input[type="search"],
.dokan-store-wrap form input[type="text"],
.dokan-store-wrap form input[type="search"] {
    flex: 1 1 120px !important;
    min-width: 80px !important;
    width: auto !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Search button: don't shrink */
.dokan-store-search-form button,
.dokan-store-search-form input[type="submit"],
.dokan-single-store .dokan-search-form button,
.dokan-single-store .dokan-search-form input[type="submit"],
form.dokan-product-search-form button,
form.dokan-product-search-form input[type="submit"],
.dokan-product-search button,
.dokan-product-search input[type="submit"],
.dokan-store-wrap form button[type="submit"],
.dokan-store-wrap form input[type="submit"] {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
}

/* Narrow screens (<=480px): stack vertically, full width each */
@media (max-width: 480px) {
    .dokan-store-search-form,
    .dokan-single-store .dokan-search-form,
    form.dokan-product-search-form,
    .dokan-product-search .dokan-search-form,
    .dokan-single-store form[role="search"],
    .dokan-store-wrap form {
        flex-direction: column !important;
        gap: 6px !important;
    }

    .dokan-store-search-form input[type="text"],
    .dokan-store-search-form input[type="search"],
    .dokan-single-store .dokan-search-form input[type="text"],
    .dokan-single-store .dokan-search-form input[type="search"],
    form.dokan-product-search-form input[type="text"],
    form.dokan-product-search-form input[type="search"],
    .dokan-product-search input[type="text"],
    .dokan-product-search input[type="search"],
    .dokan-store-wrap form input[type="text"],
    .dokan-store-wrap form input[type="search"] {
        width: 100% !important;
        min-width: 0 !important;
        flex: 1 1 auto !important;
    }

    .dokan-store-search-form button,
    .dokan-store-search-form input[type="submit"],
    .dokan-single-store .dokan-search-form button,
    .dokan-single-store .dokan-search-form input[type="submit"],
    form.dokan-product-search-form button,
    form.dokan-product-search-form input[type="submit"],
    .dokan-product-search button,
    .dokan-product-search input[type="submit"],
    .dokan-store-wrap form button[type="submit"],
    .dokan-store-wrap form input[type="submit"] {
        width: 100% !important;
        text-align: center !important;
    }
}

/* Very narrow screens (260px-360px): tighten font/padding */
@media (max-width: 360px) {
    .dokan-store-search-form input[type="text"],
    .dokan-store-search-form input[type="search"],
    .dokan-product-search input[type="text"],
    .dokan-product-search input[type="search"],
    form.dokan-product-search-form input[type="text"],
    form.dokan-product-search-form input[type="search"] {
        font-size: 13px !important;
        padding: 6px 8px !important;
    }

    .dokan-store-search-form button,
    .dokan-store-search-form input[type="submit"],
    .dokan-product-search button,
    .dokan-product-search input[type="submit"],
    form.dokan-product-search-form button,
    form.dokan-product-search-form input[type="submit"] {
        font-size: 13px !important;
        padding: 6px 10px !important;
    }
}

/* =====================================================================
   Kinwi: Dokan Store Pagination - Centered and Responsive
   ===================================================================== */
.dokan-pagination-container {
    display: flex !important;
    justify-content: center !important;
    width: 100% !important;
    margin: 20px 0 !important;
    overflow-x: auto !important;
    -ms-overflow-style: none !important;
    scrollbar-width: none !important;
}

.dokan-pagination-container::-webkit-scrollbar {
    display: none !important;
}

ul.dokan-pagination,
.dokan-pagination-container .dokan-pagination {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 0 !important;
    margin: 0 auto !important;
    list-style: none !important;
}

ul.dokan-pagination li,
.dokan-pagination-container .dokan-pagination li {
    margin: 0 !important; /* Overriding default inline-block margins */
    padding: 0 !important;
}

ul.dokan-pagination li a,
ul.dokan-pagination li span,
.dokan-pagination-container .dokan-pagination li a,
.dokan-pagination-container .dokan-pagination li span {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 36px !important;
    height: 36px !important;
    padding: 0 10px !important;
    font-size: 15px !important;
    line-height: 1 !important;
    text-align: center !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
}

/* Narrow screens (<=480px) */
@media (max-width: 480px) {
    ul.dokan-pagination,
    .dokan-pagination-container .dokan-pagination {
        gap: 4px !important;
    }
    
    ul.dokan-pagination li a,
    ul.dokan-pagination li span,
    .dokan-pagination-container .dokan-pagination li a,
    .dokan-pagination-container .dokan-pagination li span {
        min-width: 32px !important;
        height: 32px !important;
        padding: 0 8px !important;
        font-size: 14px !important;
    }
}

/* Very narrow screens (260px-360px) */
@media (max-width: 360px) {
    ul.dokan-pagination,
    .dokan-pagination-container .dokan-pagination {
        gap: 3px !important;
    }
    
    ul.dokan-pagination li a,
    ul.dokan-pagination li span,
    .dokan-pagination-container .dokan-pagination li a,
    .dokan-pagination-container .dokan-pagination li span {
        min-width: 28px !important;
        height: 28px !important;
        padding: 0 6px !important;
        font-size: 13px !important;
    }
}

/* Hide empty pager that shifts pagination right */
nav.site-navigation ul.pager {
    display: none !important;
}

/* Kinwi: My Account — Edit address link positioning
   Move the "Edit Billing/Shipping address" link so it sits
   directly below the address heading, not floated to the right. */
.woocommerce-account .woocommerce-Addresses .woocommerce-Address {
    position: relative !important;
}

.woocommerce-account .woocommerce-Addresses .woocommerce-Address-title {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 4px !important;
    margin-bottom: 12px !important;
}

.woocommerce-account .woocommerce-Addresses .woocommerce-Address-title h3 {
    margin: 0 !important;
}

.woocommerce-account .woocommerce-Addresses .woocommerce-Address-title a {
    float: none !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #111 !important;
}

.woocommerce-account .woocommerce-Addresses .woocommerce-Address-title a:hover {
    color: #00967d !important;
}

/* Kinwi: Seller Support Tickets Styling
   Make support ticket font and font-size consistent (Lora upload, 16px) and prevent blue background/text on mobile. */
.dokan-support-topic-wrapper,
.dokan-support-topic-wrapper p,
.dokan-support-topic-wrapper span,
.dokan-support-topic-wrapper a,
.dokan-support-topic-wrapper li,
.dokan-support-topic-wrapper td,
.dokan-support-topic-wrapper th,
.dokan-support-topic-wrapper div,
.dokan-support-topic-wrapper textarea,
.dokan-support-topic-wrapper input,
.dokan-support-topic-wrapper select,
.dokan-support-topic-wrapper label,
.dokan-support-topic-wrapper h3,
.dokan-support-topic-wrapper h4 {
    font-family: 'Lora upload', 'Lora', serif !important;
    font-size: 16px !important;
}

/* Ensure title and status are bold and clear */
.dokan-support-topic-wrapper .dokan-chat-title,
.dokan-support-topic-wrapper .dokan-chat-status,
.dokan-support-topic-wrapper h3,
.dokan-support-topic-wrapper h4,
.dokan-support-topic-wrapper .dokan-chat-user-box {
    font-weight: 700 !important;
}

/* Prevent chat backgrounds and text colors from turning blue on screen sizes 1000px and below */
@media only screen and (max-width: 1000px) {
    .dokan-dss-chat-box .dokan-chat-info-box .dokan-chat-text.dokan-customer-chat-text {
        background: #f6f6f6 !important;
        color: #717171 !important;
    }
    .dokan-dss-chat-box .dokan-chat-info-box .dokan-chat-text.dokan-vendor-chat-text {
        background: #5353bb25 !important;
        color: #5353bb !important;
    }
    .dokan-dss-chat-box .dokan-chat-info-box .dokan-chat-text.dokan-admin-chat-text {
        background: #f2faff !important;
        color: #1a9ed4 !important;
    }
}

/* Dokan Dashboard Fixes */

/* 1. Ensure Overview section does not scroll over header */
.elementor-location-header {
    z-index: 999999 !important;
    position: relative;
}

/* 2. Fix Visit Store link alignment to perfectly match the other links on all screen sizes */
body.dokan-dashboard .dokan-dash-sidebar #dokan-navigation ul.dokan-dashboard-menu li.dokan-common-links a:nth-of-type(2),
body.dokan-dashboard .dokan-dash-sidebar #dokan-navigation ul.dokan-dashboard-menu li.dokan-common-links a:nth-of-type(3),
body.dokan-dashboard .dokan-dash-sidebar ul.dokan-dashboard-menu li.dokan-common-links a:nth-of-type(2),
body.dokan-dashboard .dokan-dash-sidebar ul.dokan-dashboard-menu li.dokan-common-links a:nth-of-type(3) {
    display: none !important;
}

body.dokan-dashboard .dokan-dash-sidebar #dokan-navigation ul.dokan-dashboard-menu li.dokan-common-links a:nth-of-type(1),
body.dokan-dashboard .dokan-dash-sidebar ul.dokan-dashboard-menu li.dokan-common-links a:nth-of-type(1),
body.dokan-dashboard .dokan-dash-sidebar #dokan-navigation ul.dokan-dashboard-menu li a,
body.dokan-dashboard .dokan-dash-sidebar ul.dokan-dashboard-menu li a {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important; /* Force left-alignment matching standard links */
    padding: 10px 18px !important;
    box-sizing: border-box !important;
    width: 100% !important;
    min-height: 40px !important;
    text-decoration: none !important;
    border-radius: 0 !important;
    background: transparent !important;
}

body.dokan-dashboard .dokan-dash-sidebar #dokan-navigation ul.dokan-dashboard-menu li.dokan-common-links a:nth-of-type(1) i,
body.dokan-dashboard .dokan-dash-sidebar ul.dokan-dashboard-menu li.dokan-common-links a:nth-of-type(1) i,
body.dokan-dashboard .dokan-dash-sidebar #dokan-navigation ul.dokan-dashboard-menu li.dokan-common-links a:nth-of-type(1) svg,
body.dokan-dashboard .dokan-dash-sidebar ul.dokan-dashboard-menu li.dokan-common-links a:nth-of-type(1) svg,
body.dokan-dashboard .dokan-dash-sidebar #dokan-navigation ul.dokan-dashboard-menu li a i,
body.dokan-dashboard .dokan-dash-sidebar ul.dokan-dashboard-menu li a i {
    width: 20px !important;
    text-align: center !important;
    margin: 0 12px 0 0 !important; /* Spacing matching standard sidebar icons */
    padding: 0 !important;
    display: inline-block !important;
    font-size: 17px !important;
    flex-shrink: 0 !important;
}

body.dokan-dashboard .dokan-dash-sidebar #dokan-navigation ul.dokan-dashboard-menu li.dokan-common-links a:nth-of-type(1)::after,
body.dokan-dashboard .dokan-dash-sidebar ul.dokan-dashboard-menu li.dokan-common-links a:nth-of-type(1)::after {
    content: "Visit Store" !important;
    display: inline-block !important;
    color: #ffffff !important;
    font-size: 14px !important;
    font-weight: normal !important;
    white-space: nowrap !important;
    vertical-align: middle !important;
    position: static !important;
    transform: none !important;
    background: transparent !important;
    padding: 0 !important;
}

body.dokan-dashboard .dokan-dash-sidebar #dokan-navigation ul.dokan-dashboard-menu li.dokan-common-links a:nth-of-type(1)::before,
body.dokan-dashboard .dokan-dash-sidebar ul.dokan-dashboard-menu li.dokan-common-links a:nth-of-type(1)::before {
    display: none !important;
    content: none !important;
}

/* Hover & Focus state matching active green buttons */
body.dokan-dashboard .dokan-dash-sidebar #dokan-navigation ul.dokan-dashboard-menu li.dokan-common-links a:nth-of-type(1):hover,
body.dokan-dashboard .dokan-dash-sidebar ul.dokan-dashboard-menu li.dokan-common-links a:nth-of-type(1):hover,
body.dokan-dashboard .dokan-dash-sidebar #dokan-navigation ul.dokan-dashboard-menu li.dokan-common-links a:nth-of-type(1):focus-visible,
body.dokan-dashboard .dokan-dash-sidebar ul.dokan-dashboard-menu li.dokan-common-links a:nth-of-type(1):focus-visible {
    background: #00967d !important;
    color: #ffffff !important;
}

/* 3. Force full screen, left-aligned layout for modern full-bleed dashboard (no left gaps) */
body.dokan-dashboard .site-content .elementor-container,
body.dokan-dashboard main .elementor-container,
body.dokan-dashboard #content .elementor-container,
body.dokan-dashboard .elementor-section-active,
body.dokan-dashboard #content,
body.dokan-dashboard .site-content {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 0 !important;
    margin-left: 0 !important;
}

body.dokan-dashboard .elementor-section:has(.dokan-dashboard-wrap),
body.dokan-dashboard .elementor-container:has(.dokan-dashboard-wrap),
body.dokan-dashboard .elementor-section-wrap:has(.dokan-dashboard-wrap) {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 0 !important;
    margin-left: 0 !important;
}

.dokan-dashboard-wrap {
    padding-right: 30px !important;
    padding-left: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
}

/* 4. Fix chart legend buttons: full width, centered, text visible */
#dokan-analytics-app .woocommerce-chart__legend,
#dokan-analytics-app .woocommerce-legend,
body.dokan-dashboard .woocommerce-chart__legend,
body.dokan-dashboard .woocommerce-legend {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    padding: 10px 0 !important;
    margin: 0 !important;
    border: none !important;
}

#dokan-analytics-app .woocommerce-legend__list,
body.dokan-dashboard .woocommerce-legend__list {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    border: none !important;
}

#dokan-analytics-app .woocommerce-legend__item,
body.dokan-dashboard .woocommerce-legend__item {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 0 6px 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    float: none !important;
}

#dokan-analytics-app .woocommerce-legend__item button,
#dokan-analytics-app .woocommerce-legend__item .woocommerce-legend__item-button,
body.dokan-dashboard .woocommerce-legend__item button,
body.dokan-dashboard .woocommerce-legend__item .woocommerce-legend__item-button {
    display: flex !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    padding: 8px 14px !important;
    margin: 0 !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 4px !important;
    white-space: normal !important;
    overflow: visible !important;
    min-height: 0 !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    word-break: break-word !important;
    text-overflow: clip !important;
}

#dokan-analytics-app .woocommerce-legend__item button *,
#dokan-analytics-app .woocommerce-legend__item .woocommerce-legend__item-button *,
body.dokan-dashboard .woocommerce-legend__item button *,
body.dokan-dashboard .woocommerce-legend__item .woocommerce-legend__item-button * {
    white-space: normal !important;
    word-break: break-word !important;
}

#dokan-analytics-app .woocommerce-legend__item-container,
body.dokan-dashboard .woocommerce-legend__item-container {
    padding-left: 20px !important;
    width: 100% !important;
}

#dokan-analytics-app .woocommerce-legend__item-title,
body.dokan-dashboard .woocommerce-legend__item-title {
    margin-right: 8px !important;
}

#dokan-analytics-app .woocommerce-legend__item-total,
body.dokan-dashboard .woocommerce-legend__item-total {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

/* Narrow screens: slightly smaller font */
@media (max-width: 480px) {
    #dokan-analytics-app .woocommerce-legend__item button,
    #dokan-analytics-app .woocommerce-legend__item .woocommerce-legend__item-button,
    body.dokan-dashboard .woocommerce-legend__item button,
    body.dokan-dashboard .woocommerce-legend__item .woocommerce-legend__item-button {
        font-size: 12px !important;
        padding: 6px 10px !important;
        gap: 4px !important;
    }
    #dokan-analytics-app .woocommerce-legend__item button *,
    #dokan-analytics-app .woocommerce-legend__item .woocommerce-legend__item-button *,
    body.dokan-dashboard .woocommerce-legend__item button *,
    body.dokan-dashboard .woocommerce-legend__item .woocommerce-legend__item-button * {
        font-size: 12px !important;
    }
    /* Reduce dashboard page wrapper and content padding to maximize space for charts */
    body.dokan-dashboard .dokan-dashboard-wrap {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }
    body.dokan-dashboard .dokan-dashboard-content {
        padding-left: 10px !important;
        padding-right: 4px !important;
    }
    /* Reduce chart card padding on mobile to give more width to legend buttons */
    #dokan-analytics-app .components-card__body,
    #dokan-analytics-app .components-card-body,
    body.dokan-dashboard .components-card__body,
    body.dokan-dashboard .components-card-body {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
}

@media (max-width: 360px) {
    #dokan-analytics-app .woocommerce-legend__item button,
    #dokan-analytics-app .woocommerce-legend__item .woocommerce-legend__item-button,
    body.dokan-dashboard .woocommerce-legend__item button,
    body.dokan-dashboard .woocommerce-legend__item .woocommerce-legend__item-button {
        font-size: 11px !important;
        padding: 5px 8px !important;
    }
    #dokan-analytics-app .woocommerce-legend__item button *,
    #dokan-analytics-app .woocommerce-legend__item .woocommerce-legend__item-button *,
    body.dokan-dashboard .woocommerce-legend__item button *,
    body.dokan-dashboard .woocommerce-legend__item .woocommerce-legend__item-button * {
        font-size: 11px !important;
    }
}

#dokan-analytics-app .woocommerce-filters-date__content .components-menu-item__button,
body.dokan-dashboard .woocommerce-filters-date__content .components-menu-item__button {
    display: flex !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    justify-content: center !important;
    align-items: center !important;
    margin: 0 auto 8px auto !important;
}

/* Center the ellipsis dots on the analytics configure button */
#dokan-analytics-app .woocommerce-ellipsis-menu__toggle {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Hide specific options from the analytics ellipsis menu:
   9: Discounted orders, 10: Net discount amount, 11: Total tax, 
   12: Order tax, 13: Shipping tax, 16: Gross sales */
#dokan-analytics-app .woocommerce-ellipsis-menu__content > .woocommerce-ellipsis-menu__item:nth-child(9),
#dokan-analytics-app .woocommerce-ellipsis-menu__content > .woocommerce-ellipsis-menu__item:nth-child(10),
#dokan-analytics-app .woocommerce-ellipsis-menu__content > .woocommerce-ellipsis-menu__item:nth-child(11),
#dokan-analytics-app .woocommerce-ellipsis-menu__content > .woocommerce-ellipsis-menu__item:nth-child(12),
#dokan-analytics-app .woocommerce-ellipsis-menu__content > .woocommerce-ellipsis-menu__item:nth-child(13),
#dokan-analytics-app .woocommerce-ellipsis-menu__content > .woocommerce-ellipsis-menu__item:nth-child(16) {
    display: none !important;
}

/* Center other reports buttons safely */
body .dokan-reports-wrap .chart-filter,
body .dokan-report-filter-menu {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
}

body .dokan-reports-wrap .chart-filter li,
body .dokan-reports-wrap .dokan-btn,
body .dokan-report-filter-menu li {
    margin: 5px !important;
}

