/* ================================
   NF Product Slider – SCOPED (full)
   ================================ */

.nf-product-slider {
    width: 100%;
    margin: 0 auto;
}

/* Container + wrapper */
.nf-product-slider .mmpw-swiper-container {
    width: 100%;
    padding: 0;
    margin: 0 auto;
    overflow: hidden;
}
.nf-product-slider .swiper-wrapper {
    overflow: visible !important;   /* badges can overflow */
}

/* Slides */
.nf-product-slider .swiper-slide {
    flex-shrink: 0;
    width: auto !important;
    flex: 0 0 auto;
    box-sizing: border-box;
}
.nf-product-slider .swiper-slide.mmpw-product-item {
    margin: 0;
    padding: 0 2%;                 /* subtle inner padding */
    box-sizing: border-box;
}

/* === EXACT SLIDES PER VIEW (via data-slides) === */
.nf-product-slider .mmpw-swiper-container[data-slides="1"] .swiper-slide { width: 100% !important;     max-width: 100%;      flex-basis: 100%; }
.nf-product-slider .mmpw-swiper-container[data-slides="2"] .swiper-slide { width: 50% !important;      max-width: 50%;       flex-basis: 50%; }
.nf-product-slider .mmpw-swiper-container[data-slides="3"] .swiper-slide { width: 33.3333% !important; max-width: 33.3333%;  flex-basis: 33.3333%; }
.nf-product-slider .mmpw-swiper-container[data-slides="4"] .swiper-slide { width: 25% !important;      max-width: 25%;       flex-basis: 25%; }
.nf-product-slider .mmpw-swiper-container[data-slides="5"] .swiper-slide { width: 20% !important;      max-width: 20%;       flex-basis: 20%; }
.nf-product-slider .mmpw-swiper-container[data-slides="6"] .swiper-slide { width: 16.6667% !important; max-width: 16.6667%;  flex-basis: 16.6667%; }
.nf-product-slider .mmpw-swiper-container[data-slides="7"] .swiper-slide { width: 14.2857% !important; max-width: 14.2857%;  flex-basis: 14.2857%; }
.nf-product-slider .mmpw-swiper-container[data-slides="8"] .swiper-slide { width: 12.5% !important;    max-width: 12.5%;     flex-basis: 12.5%; }

/* =========================
   Product image 300×300
   ========================= */
.nf-product-slider .mmpw-product-image,
.nf-product-slider .hps-myswiper-product-image.hps-product-image {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 300px;
    height: 300px;
    margin: 0 auto;                 /* center inside slide */
    overflow: hidden;
    background: transparent;
}
.nf-product-slider .hps-myswiper-product-image.hps-product-image.mmpw-product-image {
    background: transparent;
}
.nf-product-slider .mmpw-product-image img,
.nf-product-slider .hps-myswiper-product-image.hps-product-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
    display: block;
}

/* Title */
.nf-product-slider .mmpw-product-title,
.nf-product-slider .hps-swiper-product-title {
    color: #282828;
    font-size: 16px;
    font-family: "Fira Sans", Sans-serif;
    font-weight: 600;
    margin: 10px 0 6px 0;
    text-align: center;
    line-height: 1.35;
    text-decoration: none;
}

/* Description */
.nf-product-slider .hps-swiper-product-description.hps-product-description,
.nf-product-slider .mmpw-product-description {
    color: #000;
    font-size: 16px;
    font-family: "Fira Sans", Sans-serif;
    line-height: 20px;
    font-weight: 300;
    margin: 6px 0 10px 0;
    padding: 0 8px;                  /* keep text away from edges */
    white-space: normal !important;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    word-break: break-word;
}
.nf-product-slider .hps-swiper-product-description-mobile.hps-product-description {
    display: none;
    color: #000;
    font-size: 16px;
    line-height: 18px;
    margin: 6px 0 10px 0;
    padding: 0 8px;
    font-family: "Fira Sans", Sans-serif;
    font-weight: 300;
    text-align: center;
    white-space: normal !important;
    word-break: break-word;
}

/* Rating stars */
.nf-product-slider .star-home-menu { width: 18px; }
.nf-product-slider .menu-rating-stars.home { margin: 0; }

/* Price + add-to-cart row */
.nf-product-slider .hps-price-and-cart,
.nf-product-slider .mmpw-price-and-cart {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    margin: 6px 0;
}

/* Base price color */
.nf-product-slider .hps-swiper-regular-price .price,
.nf-product-slider .hps-swiper-regular-price .price * {
    color: #000 !important;
}
.nf-product-slider .price,
.nf-product-slider .price * {
    color: inherit !important;
}

/* Price wrapper alignment */
.nf-product-slider .hps-swiper-price-wrapper,
.nf-product-slider .mmpw-price-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    white-space: nowrap;
    font-size: 16px;
    font-weight: 600;
    color: #000;
    text-align: center;
    text-decoration: none;
}

/* ===== Strong override for your price markup (no .price wrapper) ===== */
/* Sale price (INS): 24px, bold, no underline */
.nf-product-slider .hps-swiper-price-wrapper ins,
.nf-product-slider .hps-swiper-price-wrapper ins *,
.nf-product-slider .hps-swiper-price-wrapper ins .woocommerce-Price-amount,
.nf-product-slider .hps-swiper-price-wrapper ins .woocommerce-Price-amount *,
.nf-product-slider .hps-swiper-price-wrapper ins bdi,
.nf-product-slider .hps-swiper-price-wrapper ins bdi * {
    font-size: 24px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    border-bottom: 0 !important;
    background-image: none !important;
    line-height: 1.2 !important;
}

/* Regular price (DEL): 16px, weight 300, keep line-through */
.nf-product-slider .hps-swiper-price-wrapper del,
.nf-product-slider .hps-swiper-price-wrapper del *,
.nf-product-slider .hps-swiper-price-wrapper del .woocommerce-Price-amount,
.nf-product-slider .hps-swiper-price-wrapper del .woocommerce-Price-amount *,
.nf-product-slider .hps-swiper-price-wrapper del bdi,
.nf-product-slider .hps-swiper-price-wrapper del bdi * {
    font-size: 16px !important;
    font-weight: 300 !important;
    text-decoration: line-through !important;
    opacity: 1 !important;
    line-height: 1.2 !important;
}

/* Safety: neutralize underline on <ins> inside the widget */
.nf-product-slider ins,
.nf-product-slider ins * {
    text-decoration: none !important;
    border-bottom: 0 !important;
}

/* ===== Icon-only, transparent cart button ===== */
.nf-product-slider .sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0);
    white-space: nowrap; border: 0;
}
.nf-product-slider .hps-custom-add-to-cart-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
    height: auto;
    box-shadow: none !important;
    text-decoration: none;
    color: inherit;
}
.nf-product-slider .hps-custom-add-to-cart-button .nf-add-text { display: none !important; }

.nf-product-slider .nf-cart-icon,
.nf-product-slider .hps-cart-svg {
    width: 30px;
    height: 30px;
    display: inline-block;
}
.nf-product-slider .nf-icon-default { display: inline-block; }
.nf-product-slider .nf-icon-hover   { display: none; }

.nf-product-slider .hps-custom-add-to-cart-button:hover .nf-icon-default { display: none; }
.nf-product-slider .hps-custom-add-to-cart-button:hover .nf-icon-hover   { display: inline-block; }

/* Active state (our .is-active and Woo's .added) */
.nf-product-slider .hps-custom-add-to-cart-button.is-active .nf-icon-default,
.nf-product-slider .hps-custom-add-to-cart-button.is-active .nf-icon-hover,
.nf-product-slider .hps-custom-add-to-cart-button.added .nf-icon-default,
.nf-product-slider .hps-custom-add-to-cart-button.added .nf-icon-hover {
    display: none !important;
}
.nf-product-slider .hps-custom-add-to-cart-button.is-active .nf-icon-active,
.nf-product-slider .hps-custom-add-to-cart-button.added .nf-icon-active {
    display: inline-block !important;
}
.nf-product-slider .hps-custom-add-to-cart-button:not(.is-active):not(.added) .nf-icon-active {
    display: none;
}

.nf-product-slider .hps-custom-add-to-cart-button:hover,
.nf-product-slider .hps-custom-add-to-cart-button:active,
.nf-product-slider .hps-custom-add-to-cart-button:focus {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}
.nf-product-slider .hps-custom-add-to-cart-button:focus-visible {
    outline: 2px solid #1FB25A;
    outline-offset: 2px;
}

/* Hide Woo's "View cart" link */
.nf-product-slider a.added_to_cart.wc-forward { display: none !important; }

/* ===== Badges ===== */
.nf-product-slider .hps-discount-badge {
    position: absolute;
    color: #fff;
    background-color: #de1528;
    font-weight: bold;
    font-size: 20px;
    border-radius: 100px;
    right: 3%;
    top: 5%;
    padding: 12px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.nf-product-slider .hps-best-seller-badge {
    width: 70%;
    position: absolute;
    left: 0;
    top: 0;
}
.nf-product-slider .hps-best-seller-badge img {
    width: 100%;
    height: auto;
    display: block;
}

/* ===== Arrows (force exact size) ===== */
.nf-product-slider .homeproductswiperarrowleft img,
.nf-product-slider .homeproductswiperarrowright img {
    width: 45px !important;
    height: 45px !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: contain;
    display: block;
}
.nf-product-slider .mmpw-arrow-left  { left: -30px; }
.nf-product-slider .mmpw-arrow-right { right: -30px; }
.nf-product-slider .swiper-button-prev::after,
.nf-product-slider .swiper-button-next::after {
    display: none !important;
    content: none !important;
}

/* ===== Responsive ===== */
@media (max-width: 992px) {
    /* scale down image square on mobile so cards fit */
    .nf-product-slider .mmpw-product-image,
    .nf-product-slider .hps-myswiper-product-image.hps-product-image {
        width: 220px;
        height: 220px;
    }

    .nf-product-slider .hps-swiper-product-description-mobile.hps-product-description { display: block; }
    .nf-product-slider .hps-swiper-product-description.hps-product-description,
    .nf-product-slider .mmpw-product-description { display: none !important; }

    .nf-product-slider .homeproductswiperarrowleft img,
    .nf-product-slider .homeproductswiperarrowright img {
        width: 30px !important;
        height: 30px !important;
    }

    .nf-product-slider .hps-product-image img { width: 100% !important; }
    .nf-product-slider .hps-product-link { margin-left: 0 !important; }
    .nf-product-slider .hps-discount-badge { right: 0; }
}

/* ===========================
   ADD-ONLY FIXES (append only)
   =========================== */

/* 1) Keep images square with available width (no visual change otherwise) */
.nf-product-slider .mmpw-product-image,
.nf-product-slider .hps-myswiper-product-image.hps-product-image {
    aspect-ratio: 1 / 1;
    width: 100%;
    height: auto;
}

/* 2) Price spacing + single regular = 16px */
.nf-product-slider .hps-swiper-price-wrapper,
.nf-product-slider .mmpw-price-wrapper {
    display: inline-flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
}
.nf-product-slider .hps-swiper-price-wrapper > .woocommerce-Price-amount,
.nf-product-slider .mmpw-price-wrapper > .woocommerce-Price-amount {
    font-size: 16px !important;
}

/* 3) Force 1 per view on very small screens */
@media (max-width: 520px) {
    .nf-product-slider .mmpw-swiper-container .swiper-slide {
        width: 100% !important;
        flex-basis: 100% !important;
        padding: 0 !important;
    }
}

/* ================================
   GRID LAYOUT STYLES
   ================================ */

.nf-product-slider--grid .nf-product-grid {
    display: grid;
    grid-template-columns: repeat(var(--grid-columns, 4), 1fr);
    gap: 20px;
    width: 100%;
    padding: 0;
}

.nf-product-slider--grid .nf-product-grid[data-columns="1"] {
    --grid-columns: 1;
    grid-template-columns: repeat(1, 1fr);
}

.nf-product-slider--grid .nf-product-grid[data-columns="2"] {
    --grid-columns: 2;
    grid-template-columns: repeat(2, 1fr);
}

.nf-product-slider--grid .nf-product-grid[data-columns="3"] {
    --grid-columns: 3;
    grid-template-columns: repeat(3, 1fr);
}

.nf-product-slider--grid .nf-product-grid[data-columns="4"] {
    --grid-columns: 4;
    grid-template-columns: repeat(4, 1fr);
}

.nf-product-slider--grid .nf-product-grid[data-columns="5"] {
    --grid-columns: 5;
    grid-template-columns: repeat(5, 1fr);
}

.nf-product-slider--grid .nf-product-grid[data-columns="6"] {
    --grid-columns: 6;
    grid-template-columns: repeat(6, 1fr);
}

.nf-product-slider--grid .nf-product-grid[data-columns="7"] {
    --grid-columns: 7;
    grid-template-columns: repeat(7, 1fr);
}

.nf-product-slider--grid .nf-product-grid[data-columns="8"] {
    --grid-columns: 8;
    grid-template-columns: repeat(8, 1fr);
}

.nf-product-slider--grid .nf-product-grid-item {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    padding: 0;
    margin: 0;
}

.nf-product-slider--grid .nf-product-grid-item .mmpw-product-image,
.nf-product-slider--grid .nf-product-grid-item .hps-myswiper-product-image.hps-product-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    margin: 0 auto;
}

/* Responsive grid adjustments */
@media (max-width: 1200px) {
    .nf-product-slider--grid .nf-product-grid[data-columns] {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) {
    .nf-product-slider--grid .nf-product-grid[data-columns] {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .nf-product-slider--grid .nf-product-grid[data-columns] {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 520px) {
    .nf-product-slider--grid .nf-product-grid[data-columns] {
        grid-template-columns: repeat(2, 1fr);
        padding: .75rem;
    }

    ul.product-categories.kategorije {
        display: none;
    }
}

/* ================================
   PRODUCT SLIDER PAGINATION (Grid Mode Only)
   ================================ */

.nf-product-slider-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.nf-product-pagination-link {
    display: inline-block;
    padding: 8px 12px;
    text-decoration: none;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: all 0.3s ease;
    min-width: 40px;
    text-align: center;
}

.nf-product-pagination-link:hover {
    background-color: #f5f5f5;
    border-color: #999;
    color: #000;
}

.nf-product-pagination-current {
    background-color: #34ab57;
    color: #fff;
    border-color: #34ab57;
    font-weight: bold;
    cursor: default;
}

.nf-product-pagination-current:hover {
    background-color: #34ab57;
    color: #fff;
    border-color: #34ab57;
}

.nf-product-pagination-dots {
    padding: 8px 4px;
    color: #999;
}

.nf-product-pagination-prev,
.nf-product-pagination-next {
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .nf-product-slider-pagination {
        gap: 4px;
    }
    
    .nf-product-pagination-link {
        padding: 6px 10px;
        font-size: 14px;
        min-width: 36px;
    }
    
    .nf-product-pagination-dots {
        padding: 6px 2px;
    }
}