/* =============================================
   SHOP ARCHIVE STYLES
   File: /wp-content/plugins/spirit-collective/includes/shop/shop.css
   ============================================= */

:root {
    --subnav-mobile-header-height: 44px;
}

/* #region Shop Layout                      */
/* ======================================== */
#content {padding: 0; }
#content #primary { max-width: 100%; padding: 0; }
#content > .container { max-width: unset; }
.woocommerce-breadcrumb { display: none; }

#shop-filters {
    z-index: 613;
}

.sc-shop-container {
    max-width: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 0;
    min-height: 500px;
}

/* Shop header */
.sc-shop-header {
    padding: var(--sc-space-60) var(--sc-space-30);
    background: var(--sc-color-bg-section);
    text-align: center;
    border-bottom: 1px solid var(--sc-color-border);
}

/* #region Category Cards                  */
/* ======================================== */

/* Header background image */
.sc-shop-header {
    position: relative;
    overflow: hidden;
}

.sc-header-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    opacity: 0.15;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: opacity 0.5s ease;
}

.sc-header-content {
    position: relative;
    z-index: 1;
}

/* Category cards wrapper */
.sc-category-cards-wrapper {
    padding: 0 var(--sc-space-30);
    margin-bottom: var(--sc-space-30);
}

.sc-category-cards-inner {
    max-width: 1200px;
    margin: 0 auto;
}

/* Category card */
.sc-category-card {
    cursor: pointer;
    transition: all var(--sc-transition);
}

.sc-category-card-inner {
    text-align: center;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all var(--sc-transition);
}

/* Card image */
.sc-category-card-image {
    width: 150px;
    height: 150px;
    border-radius: var(--sc-radius-6);
    overflow: hidden;
    margin-bottom: var(--sc-space-12);
    background: var(--sc-color-bg-section);
}
.sc-category-card:hover .sc-category-card-title {
    color: var(--sc-color-primary);
}

.sc-category-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--sc-transition);
}

.sc-category-card:hover .sc-category-card-image img {
    transform: scale(1.1);
}

/* Card content */
.sc-category-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.sc-category-card-title {
    font-family: var(--sc-font-heading);
    font-size: 15px;
    color: var(--sc-color-text);
    margin: 0 0 var(--sc-space-5);
    line-height: 1.3;
}

.sc-category-card-count {
    font-size: 12px;
    color: var(--sc-color-text-light);
}

/* Parent category cards (slightly larger) */
.sc-parent-category-card .sc-category-card-image {
    width: 150px;
    height: 150px;
}

.sc-parent-category-card .sc-category-card-title {
    font-size: 17px;
}

/* Grid centering for parent categories */
.sc-grid-3.sc-category-cards-grid {
    max-width: 600px;
    margin: 0 auto;
}

/* #endregion Category Cards */

/* Main content area. Shop main area takes remaining space after sidebar */
.sc-shop-main {
    width: calc(100% - var(--sidebar-width, 250px));
    max-width: none;
    flex: 1;
    padding: var(--sc-space-30);
    transition: opacity var(--sc-transition);
}

/* Inner padding using SC utilities */
.sc-shop-inner {
    width: 100%;
    max-width: none;
}

/* Product grid - full width with responsive columns */
#sc-products-grid {
    width: 100%;
    max-width: none;
}

/* Override WooCommerce default product widths */
#sc-products-grid .product {
    width: 100%;
    margin: 0;
}

.sc-shop-main.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* #endregion Shop Layout */

/* #region Filters Sidebar                  */
/* ======================================== */

/* Mobile toggle for Filters Modal */
#sc-filters-toggle {
    align-items: center;
    gap: var(--sc-space-8);
    box-shadow: var(--sc-shadow);
    width: 100%;
    position: fixed;
    border-radius: 0;
    min-height: var(--subnav-mobile-header-height);
    z-index: 617;
    border-left: none;
    border-right: none;
}

.sc-shop-filters {
    width: 250px;
    background: var(--sc-color-bg-base);
    border-right: 1px solid var(--sc-color-border);
    position: fixed;
    top: 60px;
    height: calc(100vh - 60px);
    overflow-y: auto;
    transition: all var(--sc-transition);
    left: var(--buddypanel-width);
}

/* Shadow effect */
#shop-filters:before {
    content: "";
    position: absolute;
    top: 0;
    left: -13px;
    bottom: 0;
    width: 13px;
    box-shadow: var(--sc-shadow-subnav);
    pointer-events: none;
}

/* BuddyPanel search z-index fix */
body.bp-search aside.buddypanel {
    z-index: 614;
    box-shadow: none;
}

/* Admin bar adjustment */
.admin-bar .sc-shop-filters {
    top: 92px;
    height: calc(100vh - 92px);
}

/* Filters container */
.sc-filters-container {
    padding: var(--sc-space-20);
}

/* Filter sections */
.sc-filter-section {
    margin-bottom: var(--sc-space-30);
    padding-bottom: var(--sc-space-20);
    border-bottom: 1px solid var(--sc-color-border);
}

.sc-filter-section:last-child {
    border-bottom: none;
}

/* Filter titles */
.sc-filter-title {
    font-family: var(--sc-font-heading);
    font-size: 14px;
    font-weight: 500;
    color: var(--sc-color-text);
    margin-bottom: var(--sc-space-15);
    display: flex;
    align-items: center;
    gap: var(--sc-space-5);
    line-height: 1;
}

.sc-filter-title i {
    font-size: 22px;
    color: var(--sc-color-primary);
}

/* Helper text */
.sc-location-helper {
    margin: var(--sc-space-10) 0;
    font-size: 12px;
    color: var(--sc-color-text-light);
    line-height: 1.5;
}

/* Filter controls */
.sc-filter-checkbox-group,
.sc-filter-radio-group {
    display: flex;
    flex-direction: column;
    gap: var(--sc-space-10);
}

.sc-filter-checkbox,
.sc-filter-radio {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: var(--sc-color-text);
    transition: color var(--sc-transition);
    text-transform: capitalize;
}

.sc-filter-checkbox:hover,
.sc-filter-radio:hover {
    color: var(--sc-color-primary);
}

/* Fix radio/checkbox sizing */
.sc-filter-checkbox input[type="checkbox"],
.sc-filter-radio input[type="radio"] {
    margin-right: var(--sc-space-8);
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
    cursor: pointer;
}

.sc-filter-checkbox input[type="checkbox"]:checked,
.sc-filter-radio input[type="radio"]:checked {
    border-color: transparent;
    background-color: var(--sc-color-primary);
}

/* Price filter */
.sc-price-filter {
    display: flex;
    flex-direction: column;
    gap: var(--sc-space-15);
}

.sc-price-inputs {
    display: flex;
    align-items: center;
    gap: var(--sc-space-10);
}

.sc-price-input {
    flex: 1;
    padding: var(--sc-space-8) var(--sc-space-10);
    border: 1px solid var(--sc-color-border);
    border-radius: var(--sc-radius-5);
    font-size: 14px;
    background: var(--sc-color-bg-card);
    color: var(--sc-color-text);
}

.sc-price-separator {
    color: var(--sc-color-text-light);
    font-size: 14px;
}

#sc-price-slider {
    position: relative;
    height: 24px;
    margin: var(--sc-space-15) 0;
}

/* Track - positioned behind everything */
.sc-price-track {
    position: absolute;
    top: 50%;
    left: 10px;  /* Inset to align with thumb centers */
    right: 10px; /* Inset to align with thumb centers */
    height: 4px;
    background: var(--sc-color-bg-section);
    border-radius: 2px;
    transform: translateY(-50%);
    z-index: 1; /* Behind the sliders */
}

/* Active range highlight */
.sc-price-range {
    position: absolute;
    top: 50%;
    height: 4px;
    background: var(--sc-color-primary);
    border-radius: 2px;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 2; /* Above track, below sliders */
}

/* Range input sliders */
.sc-price-range-min,
.sc-price-range-max {
    position: absolute;
    width: 100%;
    top: 50%;
    transform: translateY(-50%);
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    pointer-events: none;
    z-index: 3; /* Above everything else */
}

/* Slider thumbs - these receive pointer events */
.sc-price-range-min::-webkit-slider-thumb,
.sc-price-range-max::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--sc-color-primary);
    border: 3px solid var(--sc-color-bg-card);
    box-shadow: var(--sc-shadow);
    border-radius: 50%;
    cursor: pointer;
    pointer-events: all;
    position: relative;
    z-index: 10;
}

.sc-price-range-min::-moz-range-thumb,
.sc-price-range-max::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--sc-color-primary);
    border: 3px solid var(--sc-color-bg-card);
    box-shadow: var(--sc-shadow);
    border-radius: 50%;
    cursor: pointer;
    pointer-events: all;
    position: relative;
    z-index: 10;
}

/* Hover states */
.sc-price-range-min::-webkit-slider-thumb:hover,
.sc-price-range-max::-webkit-slider-thumb:hover {
    background: var(--sc-color-primary-hover);
    transform: scale(1.1);
    transition: all var(--sc-transition);
}

.sc-price-range-min::-moz-range-thumb:hover,
.sc-price-range-max::-moz-range-thumb:hover {
    background: var(--sc-color-primary-hover);
    transform: scale(1.1);
    transition: all var(--sc-transition);
}

/* Focus states for accessibility */
.sc-price-range-min:focus::-webkit-slider-thumb,
.sc-price-range-max:focus::-webkit-slider-thumb {
    box-shadow: var(--sc-shadow-input-focus);
}

.sc-price-range-min:focus::-moz-range-thumb,
.sc-price-range-max:focus::-moz-range-thumb {
    box-shadow: var(--sc-shadow-input-focus);
}

[data-theme="dark"] {
    .sc-price-range-min, .sc-price-range-max {
        background: transparent;
    }
}

/* Clear filters button */
.sc-filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--sc-space-20);
    padding-bottom: var(--sc-space-15);
    border-bottom: 2px solid var(--sc-color-border);
}

.sc-clear-filters {
    font-size: 12px;
    color: var(--sc-color-primary);
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: underline;
}

/* #endregion Filters Sidebar */

/* #region Dokan Location Filter Styles     */
/* ======================================== */

.sc-dokan-location-wrapper .dokan-geolocation-location-filters {
    width: 100%;
    margin-bottom: 0;
}

.sc-dokan-location-wrapper .dokan-row {
    display: flex;
    flex-direction: column;
    gap: var(--sc-space-10);
}

.sc-dokan-location-wrapper .dokan-geo-filters-column {
    width: 100% !important;
    max-width: none !important;
}

.sc-dokan-location-wrapper .dokan-form-control,
.sc-dokan-location-wrapper .location-address input,
.sc-dokan-location-wrapper .woocommerce-tree-select-control__control-input {
    background: var(--sc-color-bg-card);
    border: 1px solid var(--sc-color-border);
    color: var(--sc-color-text);
    border-radius: var(--sc-radius-5);
    padding: var(--sc-space-8) var(--sc-space-10);
    font-size: 14px;
    width: 100%;
}

.sc-dokan-location-wrapper .dokan-btn {
    background: var(--sc-color-btn-primary);
    color: var(--sc-color-text);
    border: 1px solid var(--sc-color-border);
    border-radius: var(--sc-radius-full);
    padding: var(--sc-space-8) var(--sc-space-20);
    font-size: 14px;
    width: 100%;
    cursor: pointer;
    transition: all var(--sc-transition);
}

.sc-dokan-location-wrapper .dokan-btn:hover {
    background: var(--sc-color-primary);
    color: var(--sc-color-white);
    border-color: var(--sc-color-primary);
}

.sc-dokan-location-wrapper .dokan-geo-input-group-btn {
    background: var(--sc-color-bg-section);
    border: 1px solid var(--sc-color-border);
    color: var(--sc-color-text);
    padding: var(--sc-space-5) var(--sc-space-10);
    border-radius: var(--sc-radius-5);
    cursor: pointer;
    font-size: 14px;
}

.sc-dokan-location-wrapper .dokan-geo-dropdown-menu {
    background: var(--sc-color-bg-card);
    border: 1px solid var(--sc-color-border);
    box-shadow: var(--sc-shadow);
}

.sc-dokan-location-wrapper .dokan-geo-dropdown-menu a {
    color: var(--sc-color-text);
    padding: var(--sc-space-8) var(--sc-space-15);
    display: block;
}

.sc-dokan-location-wrapper .dokan-geo-dropdown-menu a:hover {
    background: var(--sc-color-bg-accent);
    color: var(--sc-color-primary);
}

/* #endregion Dokan Location Filter */

/* #region Products Grid                    */
/* ======================================== */

/* Dokan Map */
#dokan-geolocation-locations-map {
    margin-bottom: var(--sc-space-30);
    border-radius: var(--sc-radius-10);
    overflow: hidden;
}

/* WooCommerce product elements dark mode */
.sc-products-grid .product {
    background: var(--sc-color-bg-card);
    border-radius: var(--sc-radius-10);
    padding: var(--sc-space-15);
    border: 1px solid var(--sc-color-border);
}

.sc-products-grid .woocommerce-loop-product__title {
    color: var(--sc-color-text);
}

.sc-products-grid .price {
    color: var(--sc-color-primary);
}

.sc-products-grid .button {
    background: var(--sc-color-btn-primary);
    color: var(--sc-color-text);
    border: 1px solid var(--sc-color-border);
    border-radius: var(--sc-radius-full);
}

.sc-products-grid .button:hover {
    background: var(--sc-color-primary);
    color: var(--sc-color-white);
    border-color: var(--sc-color-primary);
}

/* Toolbar */
.sc-shop-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--sc-space-15) 0;
    border-bottom: 1px solid var(--sc-color-border);
}

.sc-product-count {
    font-size: 14px;
    color: var(--sc-color-text-light);
}

/* WooCommerce ordering select */
.woocommerce-ordering select {
    background: var(--sc-color-bg-card);
    color: var(--sc-color-text);
    border: 1px solid var(--sc-color-border);
    border-radius: var(--sc-radius-5);
    padding: var(--sc-space-8) var(--sc-space-10);
}

/* Active filters display */
.sc-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sc-space-10);
    margin: var(--sc-space-20) 0;
    min-height: 32px;
}

.sc-active-filters:empty {
    display: none;
    margin: 0;
}

.sc-active-filter {
    display: inline-flex;
    align-items: center;
    gap: var(--sc-space-8);
    padding: var(--sc-space-8) var(--sc-space-12);
    background: var(--sc-color-bg-accent);
    border: 1px solid var(--sc-color-primary);
    border-radius: var(--sc-radius-full);
    font-size: 13px;
    color: var(--sc-color-text);
    font-family: var(--sc-font-body);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.sc-active-filter-remove {
    cursor: pointer;
    color: var(--sc-color-primary);
    font-weight: bold;
    font-size: 18px;
    line-height: 1;
    transition: transform var(--sc-transition);
}

.sc-active-filter-remove:hover {
    transform: scale(1.2);
    color: var(--sc-color-primary-hover);
}

/* Dark mode adjustments */
[data-theme="dark"] .sc-active-filter {
    background: var(--sc-color-bg-section-alt);
    border-color: var(--sc-color-primary);
}

/* Pagination */
.sc-shop-pagination {
    margin-top: var(--sc-space-40);
}

.sc-shop-pagination .page-numbers {
    background: var(--sc-color-bg-card);
    color: var(--sc-color-text);
    border: 1px solid var(--sc-color-border);
    padding: var(--sc-space-8) var(--sc-space-15);
    border-radius: var(--sc-radius-5);
    margin: 0 var(--sc-space-5);
    text-decoration: none;
    display: inline-block;
}

.sc-shop-pagination .page-numbers.current,
.sc-shop-pagination .page-numbers:hover {
    background: var(--sc-color-primary);
    color: var(--sc-color-white);
    border-color: var(--sc-color-primary);
}

/* Loading overlay */
.sc-shop-loading {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(var(--sc-color-bg-page-rgb), 0.9);
    z-index: 100;
    justify-content: center;
    align-items: center;
}

.sc-shop-loading.active {
    display: flex;
}

.sc-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--sc-color-border);
    border-top-color: var(--sc-color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* #endregion Products Grid */

/* #region Responsive - Content Width Based */
/* ======================================== */
@media screen and (min-width: 1301px) {
    /* Mobile toggle button (hidden on desktop) */
    #sc-filters-toggle {
        display: none;
    }

    #sc-page-content {
        margin-top: var(--sc-header-height);
    }
}

/* Desktop: Default state with buddypanel collapsed (68px) */
@media screen and (min-width: 1051px) {
    body:has(#shop-filters) {
        --sidebar-width: 250px;
    }

    body:not(.buddypanel-open) .sc-shop-filters {
        left: 68px;
    }
    
    body.buddypanel-open .sc-shop-filters {
        left: 230px;
    }

    /* Mobile toggle button (hidden on desktop) */
    #sc-filters-toggle {
        display: none;
    }
    
    #content {
        padding-left: var(--sidebar-width);
    }
}

/* Tablet range: 800-1050px */
@media screen and (min-width: 800px) and (max-width: 1050px) {
    body:has(#shop-filters) {
        --sidebar-width: 0;
    }

    body:not(.buddypanel-open) .sc-shop-filters {
        left: 68px;
    }
    
    body.buddypanel-open .sc-shop-filters {
        left: 230px;
    }
    
    /* Adjust grid for medium screens */
    .sc-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

/* Mobile: Below 800px - BuddyPanel is hidden */
@media screen and (max-width: 799px) {
    body:has(#shop-filters) {
        --sidebar-width: 0;
    }

    #shop-filters:not(.modal-open) { 
        transform: translateX(-100%);
    }
    
    #shop-filters.modal-open {
        transform: translateX(0);
        z-index: 620;
        left: 0;
    }
    
    /* Show mobile toggle */
    #sc-filters-toggle {
        display: flex;
    }
    
    /* Adjust grid for mobile */
    .sc-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: var(--sc-space-20);
    }

    #sc-page-content {
        padding-top: var(--subnav-mobile-header-height);
    }
}

/* Content-width based breakpoint for filters collapse */
/* When content area is narrow (considering buddypanel state) */
@media screen and (min-width: 1051px) and (max-width: 1300px) {
    body.buddypanel-open:has(#shop-filters) {
        --sidebar-width: 0;
    }
    body:not(.buddypanel-open):has(#shop-filters) {
        --sidebar-width: 250px;
    }
    
    body.buddypanel-open #shop-filters {
        transform: translateX(-100%);
    }
    body:not(.buddypanel-open) #shop-filters {
        transform: translateX(0);
    }

    #shop-filters.modal-open { 
        z-index: 620;
        transform: translateX(0);
        width: 100%;
        left: 0;
    }

    body.buddypanel-open #sc-filters-toggle {
        display: flex;
        margin-top: var(--sc-header-height);
    }

    body.buddypanel-open #sc-page-content {
        padding-top: calc(var(--sc-header-height) + var(--subnav-mobile-header-height));
    }

    body:not(.buddypanel-open) #sc-page-content {
        padding-top: var(--sc-header-height);
    }
    
}

/* When content area is narrow (considering buddypanel state) */
@media screen and (min-width: 800px) and (max-width: 1050px) {
    body:has(#shop-filters) {
        --sidebar-width: 0;
    }

    #shop-filters.modal-open {
        transform: translateX(0);
        width: 100%;
        left: 0;
        z-index: 620;
    }

    #shop-filters:not(.modal-open) {
        transform: translateX(-100%);
    }

    #sc-filters-toggle {
        display: flex;
        margin-top: var(--sc-header-height);
    }

    #sc-page-content {
        padding-top: calc(var(--sc-header-height) + var(--subnav-mobile-header-height));
    }

}

/* Modal state for filters */
.sc-shop-filters.modal-open {
    position: fixed;
    top: 0;
    left: 0 !important;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background: transparent;
    transform: translateX(0) !important;
}

.sc-shop-filters.modal-open .sc-filters-container {
    height: 100vh;
    overflow-y: auto;
    padding-top: var(--sc-space-60);
    position: relative;
    z-index: 9999;
    background: var(--sc-color-bg-base);
    max-width: min(300px, 90%);
}

/* Filter count badge */
.sc-filter-count[data-count="0"] {
    display: none;
}

.sc-filter-count {
    background: var(--sc-color-primary);
    color: var(--sc-color-white);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 12px;
    min-width: 20px;
    text-align: center;
}

/* Show mobile-only elements */
.sc-show-mobile {
    display: none !important;
}

@media screen and (max-width: 799px) {
    .sc-show-mobile {
        display: block !important;
    }
}

@media screen and (min-width: 800px) and (max-width: 1300px) {
    body.buddypanel-open .sc-show-mobile {
        display: block !important;
    }
}

/* Modal overlay */
.sc-filters-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
}

.sc-filters-overlay.active {
    display: block;
}

/* #endregion Responsive */

/* #region Dokan Location Filter Integration */
/* ======================================== */

/* Hide only duplicate elements, keep location functionality */
.sc-dokan-location-wrapper .dokan-geo-filters-column:first-child,
.sc-dokan-location-wrapper .dokan-geo-product-categories {
    display: none;
}

.sc-dokan-location-wrapper .dokan-row {
    display: flex;
    flex-direction: column;
    gap: var(--sc-space-12);
    margin: 0;
}

#content .sc-dokan-location-wrapper .dokan-geo-filters-column {
    width: 100%;
    max-width: none;
    padding: 0;
}

/* Style location input to match SC theme */
.sc-dokan-location-wrapper .location-address input {
    width: 100%;
    padding: var(--sc-space-8) var(--sc-space-40) var(--sc-space-8) var(--sc-space-10);
    background: var(--sc-color-bg-card);
    border: 1px solid var(--sc-color-border);
    border-radius: var(--sc-radius-5);
    color: var(--sc-color-text);
    font-size: 14px;
    font-family: var(--sc-font-body);
}

.sc-dokan-location-wrapper .locate-icon {
    opacity: 0.6;
    transition: opacity var(--sc-transition);
}

/* Style the geolocation icon */
.sc-dokan-location-wrapper .locate-icon:hover {
    opacity: 1;
}

html[data-theme="dark"] .sc-dokan-location-wrapper .locate-icon {
    -webkit-filter: invert(1);
    filter: invert(1);
}

/* Map styling */
#dokan-geolocation-locations-map {
    margin-bottom: var(--sc-space-30);
    border-radius: var(--sc-radius-10);
    border: 1px solid var(--sc-color-border);
}

/* #endregion Dokan Location Filter Integration */

/* #region Dokan Location Filter Fixes       */
/* ======================================== */

/* Style the distance slider */
#content .sc-dokan-location-wrapper .range-slider-container {
    margin: 0 !important;
    padding: var(--sc-space-15);
    background: var(--sc-color-bg-section);
    border-radius: var(--sc-radius-5);
}

#content .sc-dokan-location-wrapper .dokan-range-slider {
    width: 100% !important;
    -webkit-appearance: none;
    appearance: none;
    background: var(--sc-color-bg-card);
    border-radius: 2px;
}

.sc-dokan-location-wrapper .dokan-range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--sc-color-primary);
    border-radius: 50%;
    cursor: pointer;
}

.sc-dokan-location-wrapper .dokan-range-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--sc-color-primary);
    border-radius: 50%;
    cursor: pointer;
}

.sc-dokan-location-wrapper .dokan-range-slider-value {
    font-size: 14px;
    color: var(--sc-color-text);
    margin-bottom: var(--sc-space-8);
    display: block;
    line-height: 1;
}

/* Style the search button */
.sc-dokan-location-wrapper .dokan-geo-filters-search-btn {
    padding: var(--sc-space-5) var(--sc-space-20);
    font-size: 14px;
    width: fit-content;
}

.sc-dokan-location-wrapper .dokan-geo-filters-search-btn:hover {
    background: var(--sc-color-primary);
    color: var(--sc-color-white);
    border-color: var(--sc-color-primary);
}

/* #endregion Dokan Location Filter Fixes */


/* #region Product Card Styling            */
/* ======================================== */

/* Remove WooCommerce default margins */
#sc-products-grid .sc-product-item {
    margin: 0;
    padding: 0;
}

/* Product card structure */
#content .sc-product-card-inner {
    height: 100%;
    transition: all var(--sc-transition);
    transform: none;
}

/* Product image container */
.sc-product-image {
    position: relative;
    padding-bottom: 100%; /* 1:1 aspect ratio */
    background: var(--sc-color-bg-section);
    overflow: hidden;
}

.sc-product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.sc-product-card-inner:hover .sc-product-image img {
    transform: scale(1.05);
}

/* Product badges - now below title in content */
.sc-product-content .sc-product-badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sc-space-5);
}

.sc-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--sc-radius-full);
    font-size: 10px;
    font-weight: 600;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.sc-badge-sale {
    background: var(--sc-color-error);
    color: var(--sc-color-white);
}

.sc-badge-out-of-stock {
    background: var(--sc-color-text-light);
    color: var(--sc-color-white);
}

.sc-badge-low-stock {
    background: var(--sc-color-warning);
    color: var(--sc-color-white);
}

.sc-badge-type, .sc-badge-category {
    background: var(--sc-color-info);
    color: var(--sc-color-white);
}

/* Product content area */
.sc-product-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Product title */
.sc-product-title {
    line-height: 1.3;
}

.sc-product-title a {
    color: var(--sc-color-text);
    text-decoration: none;
    transition: color var(--sc-transition);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sc-product-title a:hover {
    color: var(--sc-color-primary);
}

/* Vendor info */
.sc-vendor-info {
    border-top: 1px solid var(--sc-color-border);
    padding-top: var(--sc-space-10);
}

.sc-vendor-avatar {
    display: block;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    overflow: hidden;
    line-height: 1;
    flex-shrink: 0;
}

.sc-vendor-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sc-vendor-name {
    flex: 1;
    line-height: 1.3;
}

.sc-vendor-name a {
    color: var(--sc-color-text);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--sc-transition);
}

.sc-vendor-name a:hover {
    color: var(--sc-color-primary);
}

/* Shipping info */
.sc-shipping-info {
    display: flex;
    align-items: center;
}

/* Price styling */
.sc-product-price {
    font-family: var(--sc-font-heading);
    color: var(--sc-color-success);
    font-weight: 600;
}

.sc-product-price del {
    color: var(--sc-color-text-light);
    margin-right: var(--sc-space-5);
    font-size: 0.9em;
}

.sc-product-price ins {
    text-decoration: none;
}

/* Product actions - auto width, natural positioning */
.sc-product-actions {
    margin-top: var(--sc-space-12);
}

.sc-product-actions .button,
.sc-product-actions .sc-btn-view-product {
    display: inline-block;
    width: auto;
    background: var(--sc-color-btn-primary);
    color: var(--sc-color-text);
    border: 1px solid var(--sc-color-border);
    border-radius: var(--sc-radius-full);
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: all var(--sc-transition);
    cursor: pointer;
}

.sc-product-actions .button:hover,
.sc-product-actions .sc-btn-view-product:hover {
    background: var(--sc-color-primary);
    color: var(--sc-color-white);
    border-color: var(--sc-color-primary);
    transform: translateY(-2px);
}

/* Out of stock notice */
.sc-out-of-stock-notice {
    display: block;
    font-style: italic;
}

/* Loading state for AJAX add to cart */
.sc-product-actions .button.loading {
    opacity: 0.6;
    cursor: wait;
}

/* Mobile optimization */
@media (max-width: 600px) {
    .sc-badge {
        font-size: 9px;
        padding: 3px 8px;
    }
    
    .sc-vendor-avatar {
        width: 20px;
        height: 20px;
    }
    
    .sc-product-actions .button,
    .sc-product-actions .sc-btn-view-product {
        font-size: 12px;
        padding: 7px 16px;
    }
}

/* #endregion Product Card Styling */