/* 1. Glavni kontejner za Bento Grid (4+1) */
.musashi-bento-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    grid-template-rows: repeat(2, 280px);
    gap: 25px;
    margin-bottom: 40px;
}

/* 2. Veliki (Featured) post - Leva strana */
.musashi-bento-grid .item-featured {
    grid-column: 1 / 2;
    grid-row: 1 / 3;
    display: flex;
    flex-direction: column;
}

/* 3. Mali (Standard) postovi - Desna strana */
.musashi-bento-grid .item-standard {
    display: flex;
    flex-direction: column;
}

/* 4. Stil kartice (Card Design) */
.musashi-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: transform 0.3s ease;
}

.musashi-card:hover {
    transform: translateY(-5px);
}

/* 5. Slike (Thumbnails) */
.musashi-thumb {
    width: 100%;
    overflow: hidden;
    border-radius: 15px;
    margin-bottom: 12px;
}

.item-featured .musashi-thumb {
    height: 100%;
}

.item-standard .musashi-thumb {
    height: 180px;
}

.musashi-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 6. Meta podaci (Kategorija i Datum) */
.musashi-meta {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #2E2A2780;
    margin-bottom: 5px;
}

.musashi-meta .cat {
    font-weight: 700;
    color: #2E2A2780;
}

/* 7. Naslovi */
.musashi-title {
    margin: 5px 0 10px 0;
    font-weight: 500;
    line-height: 1.3;
    min-height: 2.6em;
    color: #2E2A27;
}

.item-featured .musashi-title {
    font-size: 28px;
}

.item-standard .musashi-title {
    font-size: 18px;
}

/* 8. Strelica za link */
.musashi-arrow {
    margin-top: auto;
    font-size: 20px;
    color: #333;
    text-decoration: none;
    transition: margin-left 0.2s ease;
}

.musashi-card:hover .musashi-arrow {
    margin-left: 5px;
}

/* 9. Standardni Grid za Proizvode (Uniforman) */
.musashi-standard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

/* 10. RESPONSIVE - Mobilna verzija */
@media (max-width: 1024px) {
    .musashi-bento-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto;
    }

    .item-featured {
        grid-column: 1 / 3;
        grid-row: auto;
    }
}

@media (max-width: 768px) {
    .musashi-bento-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .item-featured {
        grid-column: 1 / 2;
    }

    .item-standard .musashi-thumb {
        height: 250px;
    }
}

/* Briše one tačkice iz grida */
.musashi-standard-grid,
.musashi-standard-grid ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.musashi-standard-grid li {
    list-style-type: none !important;
}

/* Osigurava da proizvodi idu jedan pored drugog bez tačaka*/
.musashi-standard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
    gap: 20px;
}

/* =========================================
   CAROUSEL WRAPPER
========================================= */
.musashi-carousel-widget-container {
    width: 100%;
    position: relative;
}

/* =========================================
   NATIVE SLIDER TRACK
========================================= */
.musashi-native-slider {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    gap: 20px;
    padding: 20px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.musashi-native-slider::-webkit-scrollbar {
    display: none;
}

/* VEOMA BITNO:
   Kad isti element ima i .musashi-standard-grid i .musashi-native-slider,
   grid mora da bude ugašen, inače flex neće raditi kako treba.
*/
.musashi-standard-grid.musashi-native-slider,
.musashi-bento-grid.musashi-native-slider {
    display: flex !important;
    grid-template-columns: none !important;
}

/* =========================================
   POST ITEMS U CAROUSELU
========================================= */
.musashi-native-slider .musashi-item {
    flex: 0 0 calc(25% - 15px);
    min-width: 280px;
    list-style: none;
}

/* Da kartica unutar slidera zauzme normalno širinu */
.musashi-native-slider .musashi-item .musashi-card {
    width: 100%;
}

/* =========================================
   WOO PRODUCT ITEMS U CAROUSELU
========================================= */
.musashi-native-slider .product {
    flex: 0 0 calc(25% - 15px) !important;
    min-width: 280px;
    width: auto !important;
    max-width: none !important;
    list-style: none !important;
    margin: 0 !important;
}

/* Ako WooCommerce ubacuje ul.products ili slične gluposti */
.musashi-native-slider.products,
.musashi-native-slider .products {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 20px;
    margin: 0;
    padding: 0;
}

/* =========================================
   STRELICE
========================================= */
.musashi-carousel-controls {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 15px;
}

.carousel-nav {
    cursor: pointer;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
    padding: 0;
}

.carousel-nav:hover {
    background: #000;
    color: #fff;
}

.carousel-nav:disabled {
    opacity: 0.3;
    pointer-events: none;
}

/* =========================================
   NASLOV SEKCIJE
========================================= */
.musashi-main-title {
    font-family: "Source Serif 4", serif;
    color: #2E2A27;
    font-weight: 500;
    margin-bottom: 42px;
}

/* =========================================
   TABLET
========================================= */
@media (max-width: 1024px) {

    .musashi-native-slider .musashi-item,
    .musashi-native-slider .product {
        flex: 0 0 calc(50% - 10px) !important;
        min-width: 260px;
    }
}

.musashi-standard-grid li.product figure {
    position: relative !important;
}

.musashi-standard-grid li.product .onsale {
    position: absolute !important;
    top: 10px !important;
    left: 10px !important;
    z-index: 20 !important;
}

.musashi-native-slider li.product figure,
.musashi-standard-grid li.product figure {
    position: relative !important;
    margin: 0 !important;
}

.musashi-native-slider li.product .onsale,
.musashi-standard-grid li.product .onsale {
    position: absolute !important;
    top: 10px !important;
    left: 10px !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
    margin: 0 !important;
    z-index: 30 !important;
}

/* =========================================
   MOBILE
========================================= */
@media (max-width: 767px) {
    .musashi-standard-grid {
        grid-template-columns: repeat(auto-fill, minmax(100%, 1fr));
    }

    .musashi-native-slider {
        gap: 16px;
    }

    .musashi-native-slider .musashi-item,
    .musashi-native-slider .product {
        flex: 0 0 85% !important;
        min-width: 85%;
    }

    .musashi-carousel-controls {
        margin-bottom: 12px;
    }
}

/* =========================================
   ZAJEDNIČKI STILOVI ZA PROIZVODE
   (Grid i Carousel)
========================================= */

/* 1. Osnovna struktura donjeg dela kartice */
.musashi-standard-grid .product-element-bottom,
.musashi-native-slider .product-element-bottom {
    display: grid !important;
    text-align: left;
}

/* 2. Kategorije (Tip produkta) */
.musashi-standard-grid .wd-product-cats,
.musashi-native-slider .wd-product-cats {
    grid-column: 1;
    grid-row: 1;
}

.musashi-standard-grid .wd-product-cats a,
.musashi-native-slider .wd-product-cats a {
    font-family: "DM Sans", sans-serif !important;
    color: #2E2A27 !important;
    text-transform: uppercase;
    font-size: 14px;
    font-weight: 700;
}

/* 3. Naslov proizvoda (Limitiran na 2 reda) */
.musashi-standard-grid .wd-entities-title,
.musashi-native-slider .wd-entities-title {
    grid-row: 2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 3.2em;
    line-height: 1.6;
    margin-bottom: 15px;
    white-space: normal;
}

.musashi-standard-grid .wd-entities-title a,
.musashi-native-slider .wd-entities-title a {
    font-family: "DM Sans", sans-serif !important;
    color: #2E2A27;
    font-size: 18px;
}

/* 4. Cena - Kontejner */
.musashi-standard-grid .price,
.musashi-native-slider .price {
    width: 250px;
    grid-row: 3;
    grid-column: 1;
    display: grid !important;
}

/* Cena - Stara cena (del) */
.musashi-standard-grid .price del,
.musashi-native-slider .price del {
    grid-column: 2;
    grid-row: 1;
    align-self: flex-end;
    margin-bottom: 2px;
}

/* Cena - Fontovi i boje */
.musashi-standard-grid .price bdi,
.musashi-native-slider .price bdi {
    font-family: "DM Sans", sans-serif !important;
    font-weight: 700;
    display: block;
}

.musashi-standard-grid .price del bdi,
.musashi-native-slider .price del bdi {
    color: #2E2A2780 !important;
    font-size: 14px;
}

.musashi-standard-grid .price ins bdi,
.musashi-native-slider .price ins bdi {
    font-size: 30px;
    color: #2E2A27 !important;
}

/* 5. Dugme za dodavanje u korpu */
.musashi-standard-grid .wd-product .product-wrapper .wd-add-btn.wd-add-btn-replace,
.musashi-native-slider .wd-product .product-wrapper .wd-add-btn.wd-add-btn-replace {
    display: flex !important;
    justify-content: flex-start !important;
}

html body .musashi-standard-grid .wd-product .product-wrapper .wd-add-btn.wd-add-btn-replace a,
html body .musashi-native-slider .wd-product .product-wrapper .wd-add-btn.wd-add-btn-replace a {
    background-color: #C35A1C !important;
    border-radius: 16px !important;
    transition: background-color 0.3s ease;
    height: 48px;
    border-radius: 100px !important;
    min-width: 188px;
}

html body .musashi-standard-grid .wd-product .product-wrapper .wd-add-btn.wd-add-btn-replace a:hover,
html body .musashi-native-slider .wd-product .product-wrapper .wd-add-btn.wd-add-btn-replace a:hover {
    background-color: #A64412 !important;
    height: 48px;
    border-radius: 100px !important;
    min-width: 188px;
}

/* 6. Labela "Na popustu" (On sale) */
.musashi-standard-grid li.product .onsale,
.musashi-native-slider li.product .onsale {
    position: absolute !important;
    top: 10px !important;
    left: 10px !important;
    background: #8B3A2E !important;
    z-index: 30 !important;
}

.musashi-card-link-wrapper {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
    width: 100%;
}
