.woocommerce-pagination {
    display: flex;
    width:100%;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
    flex-wrap: wrap;
}

.page-numbers {
    border: 2px solid #003366;
    padding: 5px 13px;
    border-radius: 4px;
    margin:10px 0px
}

.woocommerce-pagination .page-numbers {
    margin: 6px;
}

@media (max-width: 767px) {

    .woocommerce-pagination {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }


    .woocommerce-pagination .prev,
    .woocommerce-pagination .next {
        width: 100%;
        margin: 5px 5px;
        text-align: center;
    }
}

.woocommerce-pagination .page-numbers:hover {
    border: 2px solid #003366 !important;
    padding: 5px 13px;
    border-radius: 4px;
}

.woocommerce-pagination .page-numbers.current {
    border: 2px solid #003366;
    padding: 5px 13px;
    border-radius: 4px;
    background-color: #003366;
    color:white
}

/* URL Resolution Loading State */
.acf-related-product-thumb.resolving-url {
    opacity: 0.6;
    cursor: wait;
    position: relative;
}

.acf-related-product-thumb.resolving-url::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #ccc;
    border-radius: 50%;
    border-top-color: #003366;
    animation: spin 0.8s linear infinite;
    z-index: 10;
}

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

.filter-group label {
	 
}


.active-filters {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    border-top: 1px solid #eaeaea;
    padding-top: 10px;
}

.clear-filters {
    background-color: #212121; 
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 90px;
    cursor: pointer;
    margin-right: 10px;
    text-align: center;
}

.clear-filters:hover {
    background-color: #003366; 
}

.active-filters-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.active-filter-tag {
    background-color: #f8f8f8;
    border:1px solid #eaeaea;
    border-radius: 90px;
    padding: 5px 10px;
    margin: 5px 5px 5px 0px;
    display: flex;
    align-items: center;
}

.active-filter-tag .remove-filter {
    margin-left: 5px;
    cursor: pointer;
    color: #c2185b;
    font-weight: bold;
}

.leon-shop {
    position: relative; 
    padding: 0px; 
    margin-bottom: 0px; 
}

@media (max-width: 767px) {
    .clear-filters {
        margin-bottom:10px;
    }
    .active-filters { 
        display:inline-block;
        width:100%;
    }
}

.filter-scroll-wrapper {
    overflow-x: auto; 
    position: relative; 
    scrollbar-width: none; 
    -webkit-overflow-scrolling: touch; 
}

.filter-scroll-wrapper::-webkit-scrollbar {
    display: none;
}



.filter-container {
    display: flex;
    flex-wrap: nowrap;

    white-space: nowrap;
    gap: 10px;
    background-color: #fff;
    border-bottom: none;
    padding-top:20px;
    margin:20px 0px;
}


.filter-group {
    display: inline-block;
    position: relative;
    border: 1px solid #eee;
    border-radius: 90px;
    background-color: #f8f8f8;
    cursor: pointer;
    order: 0;
    outline: none;
}

.filter-group:focus {
    outline: none;
}

.sort-by-group {
    order: 1; 
}


@media (min-width: 768px) { 
    .sort-by-group {
        margin-left: auto;
    }
}

.filter-title {
    padding: 8px 16px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    white-space: nowrap;
}

@media (max-width: 767px) {
    .sort-by-group {
        order: -3 !important;
    }
    .sale-filter-group {
        order: -2 !important;
    }
}

.filter-title::after {
    content: "";
    display: inline-block;
    width: 12px;
    height: 12px;
    background-image: url('../images/down.svg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    margin-left: 8px;
    transition: transform 0.3s ease;
}

.sale-filter-group {
    order: -2;
    border-color: #ac1311;
}

.sale-filter-group .filter-title {
    color: #ac1311;
    width: fit-content;
    padding: 8px 24px 8px 16px;
    min-width: 130px;
}

.sale-filter-group.active {
    background-color: #ac1311;
    border-color: #ac1311;
}

.sale-filter-group.active .filter-title {
    color: white !important;
}

.sale-filter-group.active .filter-title * {
    color: white !important;
}

.sale-filter-group.active .filter-title .filter-count {
    color: white !important;
}

.sale-filter-group.active .filter-title::after {
    filter: brightness(0) invert(1);
}

.sale-filter-group .filter-title::after {
    display: none;
}

/* Tag Filter Groups */
.tag-filter-group {
    order: -2;
    outline: none;
}

.tag-filter-group:focus {
    outline: none;
    border: none;
}

.tag-filter-group .filter-title::after {
    display: none;
}

.tag-filter-group .filter-title span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Akcija Filter */
.akcija-filter {
    border-color: #ac1311;
}

.akcija-filter .filter-title {
    color: #ac1311;
    width: fit-content;
    padding: 8px 24px 8px 16px;
    min-width: 130px;
}

.akcija-filter:hover {
    background-color: #ac1311 !important;
    border-color: #ac1311 !important;
}

.akcija-filter:hover .filter-title {
    color: white !important;
}

.akcija-filter:hover .filter-title * {
    color: white !important;
}

.akcija-filter:hover .filter-title .filter-count {
    color: white !important;
}

.akcija-filter:hover .filter-icon {
    /* Keep original icon color on hover */
}

.akcija-filter.active {
    background-color: #ac1311 !important;
    border-color: #ac1311 !important;
}

.akcija-filter.active .filter-title {
    color: white !important;
}

.akcija-filter.active .filter-title * {
    color: white !important;
}

.akcija-filter.active .filter-title .filter-count {
    color: white !important;
}

.akcija-filter.active .filter-icon {
    /* Keep original icon color when active */
}

/* Outlet Filter */
.outlet-filter {
    border-color: #cb650b;
}

.outlet-filter .filter-title {
    color: #cb650b;
    width: fit-content;
    padding: 8px 24px 8px 16px;
    min-width: 130px;
}

.outlet-filter:hover {
    background-color: #cb650b !important;
    border-color: #cb650b !important;
}

.outlet-filter:hover .filter-title {
    color: white !important;
}

.outlet-filter:hover .filter-title * {
    color: white !important;
}

.outlet-filter:hover .filter-title .filter-count {
    color: white !important;
}

.outlet-filter:hover .filter-icon {
    /* Keep original icon color on hover */
}

.outlet-filter.active {
    background-color: #cb650b !important;
    border-color: #cb650b !important;
}

.outlet-filter.active .filter-title {
    color: white !important;
}

.outlet-filter.active .filter-title * {
    color: white !important;
}

.outlet-filter.active .filter-title .filter-count {
    color: white !important;
}

.outlet-filter.active .filter-icon {
    /* Keep original icon color when active */
}

/* Novo Filter */
.novo-filter {
    border-color: #0053a5;
}

.novo-filter .filter-title {
    color: #0053a5;
    width: fit-content;
    padding: 8px 24px 8px 16px;
    min-width: 130px;
}

.novo-filter:hover {
    background-color: #0053a5 !important;
    border-color: #0053a5 !important;
}

.novo-filter:hover .filter-title {
    color: white !important;
}

.novo-filter:hover .filter-title * {
    color: white !important;
}

.novo-filter:hover .filter-title .filter-count {
    color: white !important;
}

.novo-filter:hover .filter-icon {
    /* Keep original icon color on hover */
}

.novo-filter.active {
    background-color: #0053a5 !important;
    border-color: #0053a5 !important;
}

.novo-filter.active .filter-title {
    color: white !important;
}

.novo-filter.active .filter-title * {
    color: white !important;
}

.novo-filter.active .filter-title .filter-count {
    color: white !important;
}

.novo-filter.active .filter-icon {
    /* Keep original icon color when active */
}

.filter-icon {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    vertical-align: middle;
    display: inline-block;
}

.filter-link {
    outline: none;
    text-decoration: none;
    border: none;
}

.filter-link:focus {
    outline: none;
    border: none;
}

.filter-link:hover {
    outline: none;
    border: none;
}

/* Remove all outlines from filter elements but preserve on context actions */
.filter-title * {
    outline: none !important;
}

.filter-title *:focus {
    outline: none !important;
}

.filter-title *:hover {
    outline: none !important;
}

/* Ensure tag filters maintain proper state on all interactions */
.tag-filter-group:focus-within {
    outline: none;
}

.tag-filter-group:active {
    transform: none !important;
    outline: none !important;
}

/* Prevent style loss on right-click and context menu */
.tag-filter-group {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.tag-filter-group .filter-title {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* White color on hover for active filters */
.tag-filter-group.active .filter-title *:hover {
    color: white !important;
}

.sale-filter-group.active .filter-title *:hover {
    color: white !important;
}

/* Disabled state for tag filters with zero count */
.tag-filter-group.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.tag-filter-group.disabled .filter-title {
    cursor: not-allowed;
}

.tag-filter-group.disabled .filter-link {
    pointer-events: none;
    cursor: not-allowed;
}
 
.filter-title.active {
 border-radius:90px;
 background:#eaeaea;

}

.filter-title.active::after {
    background-image: url('../images/up.svg'); 
}

.filter-content {
    display: none; 
    position: absolute; 
    left: 0;
    top: calc(100% + 5px); 
    background-color: #fff; 
    border: 1px solid #dfdfdf; 
    border-radius: 12px; 
    padding: 2rem; 
    z-index: 100; 
    min-width: 300px; 
    box-shadow: 0 4px 16px #0000001a; 
    white-space: normal; 
    max-height: 400px; 
    overflow-y: auto; 
    overflow-x: hidden; 
}

.filter-title.active + .filter-content {
    display: block; 
}

.filter-count {
    font-size: 0.9em;
    color: #777;
    margin-left: 4px;
    white-space: nowrap;
}


.filter-content div { 
    display: flex;
    align-items: center;
    margin-bottom: 0.8rem; 
}


.filter-content input[type="checkbox"],
.filter-content input[type="radio"] {
    opacity: 0;
    position: absolute;
    width: 0;
    height: 0;
}


.filter-content input[type="checkbox"] + label,
.filter-content input[type="radio"] + label {
    cursor: pointer;
    display: flex;
    align-items: center;
    flex-grow: 1;
    position: relative;
    padding-left: 2.3rem; 
    line-height: 1.5rem;
    min-height: 1.5rem;
}


.filter-content input[type="checkbox"] + label::before,
.filter-content input[type="radio"] + label::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    display: inline-block;
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    border: 1px solid #929292;
    border-radius: 4px; 
    background-color: #fff;
    box-sizing: border-box;
    transition: background-color 0.2s, border-color 0.2s;
}


.filter-content input[type="checkbox"]:checked + label::before,
.filter-content input[type="radio"]:checked + label::before {
    background-color: #233142;
    border-color: #233142;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3E%3Cpath d='M12.78 4.28a.75.75 0 0 1 0 1.06l-7.5 7.5a.75.75 0 0 1-1.06 0l-3.5-3.5a.75.75 0 1 1 1.06-1.06L4.5 11.19l7.22-7.22a.75.75 0 0 1 1.06 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 70%;
}


.filter-content input[type="checkbox"]:focus + label::before,
.filter-content input[type="radio"]:focus + label::before {
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.5);
}


.filter-content label .filter-count {
    margin-left: auto; 
    padding-left: 10px;
}
.filter-content label a { 
    display: flex;
    align-items: center;
    flex-grow: 1;
    text-decoration: none;
    color: inherit;
}
.filter-content label a .filter-count {
     margin-left: auto;
     padding-left: 10px;
}



.scroll-arrow {
    position: absolute;
    top: 65%;
    transform: translateY(-65%);
    z-index: 15;
    
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ccc;
    border-radius: 50%;
    padding: 0;
    margin: 0;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    color: #555;
    line-height: 1;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: background-color 0.2s, box-shadow 0.2s, color 0.2s;
    appearance: none; 
    -webkit-appearance: none;
    text-decoration: none !important; 
    font-family: sans-serif; 
    box-sizing: border-box; 
}
.scroll-arrow:hover {
    background-color: #fff;
    color: #000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    text-decoration: none !important;
}
.scroll-arrow:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.5);
}
.scroll-arrow-left {
    left: 5px;
}
.scroll-arrow-right {
    right: 5px;
}



@media (max-width: 1024px) {
    .filter-group {
        border: 1px solid #eee; 
        background-color: #f8f8f8; 
    }
    .filter-title.active {
        background-color: #eee; 
        color: #333; 
    }
     .filter-title.active::after {
         
     }

    .filter-content {
        
        min-width: 250px; 
        padding: 1.5rem; 
    }
}


@media (max-width: 767px) {
    .filter-content-moved {
        min-width: 90vw; 
        max-width: 95vw; 
        left: 5vw !important; 
        right: 5vw;
        width: 90vw; 
        box-sizing: border-box;
    }

    .dynamic-h1 {
        font-size:24px;
    }
}

.dynamic-h1 {
    color: var(--e-global-color-primary);
    font-size: 28px;
    font-weight: 600;
    margin: 0px;
}





#wc-notify-me-popup.wc-notify-me-popup-overlay { 
    display: none; 
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); 
    z-index: 10000; 
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

#wc-notify-me-popup .wc-notify-me-popup-content { 
    background-color: #fff;
    padding: 25px 30px; 
    border-radius: 4px; 
    border: 1px solid #eaeaea; 
    box-shadow: 0 4px 16px rgba(0,0,0,0.1); 
    max-width: 450px; 
    width: 90%;
    position: relative;
    text-align: left;
}

#wc-notify-me-popup .wc-notify-me-popup-close { 
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    color: #666;
}
#wc-notify-me-popup .wc-notify-me-popup-close:hover { 
    color: #000;
}

#wc-notify-me-popup .wc-notify-me-popup-content h2 { 
    margin-top: 0;
    margin-bottom: 10px; 
    font-size: 1.4em; 
    font-weight: 600;
    text-align: center;
    color: #333;
}

#wc-notify-me-popup .wc-notify-me-popup-content p { 
    margin-bottom: 15px;
    line-height: 1.5;
    font-size: 0.95em; 
    color: #555;
}
#wc-notify-me-popup .wc-notify-me-popup-content p:first-of-type { 
    text-align: center;
    margin-bottom: 20px;
}

#wc-notify-me-popup #wc-notify-me-form label { 
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

#wc-notify-me-popup #wc-notify-me-form input[type="text"],
#wc-notify-me-popup #wc-notify-me-form input[type="email"],
#wc-notify-me-popup #wc-notify-me-form input[type="tel"] { 
    width: 100%;
    padding: 10px; 
    border: 1px solid #eaeaea; 
    border-radius: 4px;
    box-sizing: border-box;
    margin-bottom: 5px; 
}

#wc-notify-me-popup #wc-notify-me-form .required { 
    color: red;
    margin-left: 3px;
}

#wc-notify-me-popup #wc-notify-me-form button[type="submit"] {
    width: 100%;
    padding: 12px 20px;
    background-color: #233142; 
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}
#wc-notify-me-popup #wc-notify-me-form button[type="submit"]:hover {
    background-color: #3a4a5e; 
}
#wc-notify-me-popup #wc-notify-me-form button[type="submit"]:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}


#wc-notify-me-popup .wc-notify-me-popup-message { 
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 3px;
    text-align: center;
}
#wc-notify-me-popup .wc-notify-me-popup-message.success { 
    background-color: #dff0d8;
    border: 1px solid #d6e9c6;
    color: #3c763d;
}
#wc-notify-me-popup .wc-notify-me-popup-message.error { 
    background-color: #f2dede;
    border: 1px solid #ebccd1;
    color: #a94442;
}


.acf-product-group-display {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.acf-product-group-display.collapsed {
    flex-wrap: nowrap;
}

div.acf-product-group-display .acf-related-product-thumb { 
    display: block; 
    width: 75px;    
    height: 60px;   
    min-height: 0 !important;  
    line-height: 0; 
    padding:2px;
    cursor: pointer;
}

/* Collapse behavior: hide thumbnails beyond the 4th when collapsed */
.acf-product-group-display.collapsed span.acf-related-product-thumb:nth-of-type(n+5) {
    display: none;
}

/* Toggle button styling */
.acf-product-group-display .acf-related-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-left: 4px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    background: #fafafa;
    color: #333;
    font-weight: 600;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}
.acf-product-group-display .acf-related-toggle:hover {
    background: #fff;
    border-color: #d5d5d5;
}

div.acf-product-group-display .acf-related-product-thumb img { 
    
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    object-fit: cover !important; 
    border: 1px solid #eee !important; 
    border-radius: 3px !important; 
    display: block; 
}


.product-image-wrapper {
    position: relative;
    display: block; 
    overflow: hidden; 
}

.product-image-wrapper .main-product-image,
.product-image-wrapper .hover-product-image {
    display: block;
    width: 100%;
    height: auto;
    transition: opacity 0.3s ease-in-out; 
    backface-visibility: hidden; 
}

.product-image-wrapper .hover-product-image {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0; 
    z-index: 1; 
}

.product-image-wrapper:hover .hover-product-image {
    opacity: 1; 
}





.woocommerce ul.products li.product .add_to_cart_button {
    display: none !important; 
}


div.acf-product-group-display .acf-related-product-thumb:hover,
div.acf-product-group-display .acf-related-product-thumb:focus {
  border-bottom: 2px solid #212121 !important; 
  box-sizing: border-box; 
}

body.filter-open {
    overflow: hidden;
}

/* Loading overlay for filtering */
#filter-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255,255,255,0.7);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
}

#filter-loading-overlay .spinner-wrapper {
    width: 72px;
    height: 72px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* CSS fallback spinner (in case SVG fails to load) */
#filter-loading-overlay .css-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(0,0,0,0.1);
    border-top-color: #233142;
    border-radius: 50%;
    animation: cssspin 0.9s linear infinite;
}

@keyframes cssspin {
    to { transform: rotate(360deg); }
}

/* Admin Styles for SEO Rules Page */
.leon-shop-admin .page-title-action {
    background-color: #2271b1;
    border-color: #2271b1;
    color: #fff;
    text-decoration: none;
    display: inline-block;
    font-size: 13px;
    line-height: 2.15384615;
    padding: 0 10px;
    cursor: pointer;
    border-width: 1px;
    border-style: solid;
    border-radius: 3px;
    white-space: nowrap;
    box-sizing: border-box;
    margin-left: 10px;
    transition: background-color 0.2s ease;
}

.leon-shop-admin .page-title-action:hover {
    background-color: #135e96;
    border-color: #135e96;
    color: #fff;
}

.leon-shop-admin .wp-header-end {
    margin: 20px 0;
}

.leon-shop-admin .notice {
    margin: 20px 0;
}

.leon-shop-admin .form-table th {
    padding: 15px 10px;
    width: 200px;
    vertical-align: top;
}

.leon-shop-admin .form-table td {
    padding: 15px 10px;
}

.leon-shop-admin .form-table hr {
    margin: 30px 0;
    border: 0;
    border-top: 1px solid #ddd;
}

.leon-shop-admin .form-table h3 {
    margin: 0 0 10px 0;
    color: #23282d;
    font-size: 1.1em;
}

.leon-shop-admin .form-table .description {
    color: #666;
    font-style: italic;
    margin: 5px 0 0 0;
}

.leon-shop-admin .form-table .spinner {
    margin: 0 5px 0 0;
}

.leon-shop-admin .regular-text {
    width: 25em;
}

.leon-shop-admin .large-text {
    width: 100%;
    max-width: 500px;
}

.leon-shop-admin .small-text {
    width: 50px;
}

/* List table improvements */
.leon-shop-admin .wp-list-table {
    margin-top: 20px;
}

.leon-shop-admin .tablenav {
    margin: 10px 0;
}

/* Better spacing for the SEO rules page */
.leon-shop-admin .wrap h1 {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.leon-shop-admin .wrap h2 {
    margin: 30px 0 15px 0;
}

.leon-shop-admin .nav-tab-wrapper {
    margin-bottom: 20px;
}

/* Improve notice styling */
.leon-shop-admin .notice.notice-info {
    border-left-color: #72aee6;
}

.leon-shop-admin .notice.notice-info ul {
    margin: 10px 0;
    padding-left: 20px;
}

.leon-shop-admin .notice.notice-info li {
    margin-bottom: 5px;
}
