/* =======================================
   Základní styly pro Produktový Grid
   ======================================= */

/* Wrapper / kontejner gridu */
.ts-product-grid {
    font-family: "Inter", Sans-serif;
    width: 100%;
    margin: 0 auto;
    padding: 0!important;
    position: relative;
}

/* =======================================
   Styly pro filtr řazení produktů
   ======================================= */
.ts-product-sorting-filter {
    margin-bottom: 30px;
    padding: 20px 0;
    background: #F7F7F7;
    border-radius: 10px;
    padding: 5px;
}

.ts-sorting-buttons {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.ts-filter-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    color: #333333;
    font-family: "Inter", Sans-serif;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    min-width: 140px;
    text-align: center;
}

.ts-filter-button:hover {
    background-color: #ffd1fb;


}

.ts-filter-button.active {
    color: #FA60D1;
    border-color: #FA60D1;
}

.ts-filter-button.active:hover {
    background-color: transparent;
    transform: none;
    box-shadow: none;
}

@media (max-width: 768px) {
    .ts-sorting-buttons {
        justify-content: center;
    }
    
    .ts-filter-button {
        min-width: calc(50% - 8px);
        padding: 10px 16px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .ts-filter-button {
        min-width: 100%;
    }
}

/* Explicitní font pro všechny elementy v product gridu */
.ts-product-grid * {
    font-family: "Inter", Sans-serif;
}

/* Nadpis gridu – společný pro všechny varianty */
.product-grid-heading {
    font-family: "Inter", Sans-serif;
    font-size: 28px;
    font-weight: 900;
    color: #000;
    margin: 0 0 16px;
    text-align: left;
}

/* Grid zobrazení */
.ts-product-grid-desktop {
    margin: 0 auto;
    width: 100%;
    max-width: 1400px;
    position: relative;
}

/* Responsivní zobrazení */
@media (min-width: 769px) {
    .ts-product-grid-mobile {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .ts-product-grid-desktop {
        display: none !important;
    }
    .ts-product-grid-mobile {
        display: block !important;
    }
    .ts-product-grid-mobile .product-grid-card {
        margin: 0 5px;
    }
    
    /* Mobilní grid pro kategorie */
    .ts-product-grid-mobile-category-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
        padding: 0;
    }
}

/* Obecné styly pro karty produktu */
.product-grid-card {
    position: relative;
    text-align: center;
    background-color: #fff;
    overflow: hidden;
    flex-shrink: 0;
}

/* Obrázek produktu */
.product-grid-card-image {
    background-color: #fff;
    width: 100%;
    margin-bottom: 16px;
}
.product-grid-card-image-inner {
    position: relative;
}
.product-grid-card-image-inner img {
    border-radius: 10px !important;
    width: 100%;
    height: auto;
    display: block;
}

/* Informace o produktu */
.product-grid-card-info {
    padding: 0 0 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Název a cena produktu */
.product-grid-card-name {
    color: #313233;
    text-align: left;
    font-size: 14px;
    font-weight: 400;
    margin-top: 0;
}

.product-grid-card-name a:hover{
    color: #313233!important;
}
.product-grid-card-price {
    font-size: 14px;
    text-align: left;
    font-weight: 700;
    margin-top: 4px;
    margin-bottom: 4px;
}

/* Custom Badge – vlastní značka */
.product-grid-card .custom-product-badge {
    position: absolute;
    top: 0;
    right: 0;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    padding: 5px 10px;
    z-index: 3;
    border-radius: 0px 10px 0 10px;
}

/* Discount Ribbon – slevový proužek */
.product-grid-card .discount-ribbon {
    position: absolute;
    top: 0;
    left: 0;
    color: #fff;
    background: #E72D34;
    font-weight: 700;
    padding: 5px 10px;
    z-index: 3;
    font-size: 14px;
    border-radius: 10px 0 10px 0;
}

/* Overlay tlačítka */
.product-grid-card .product-grid-card-trans {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    z-index: 3;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

/* Tlačítko Do košíku */
.product-grid-card-trans .add-to-cart-button,
.product-grid-card-trans .view-variants-button {
    color: #fff!important;
    font-size: 14px!important;
    font-weight: 700!important;
    background-color: #EA6DC2!important;
    margin: 0;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    text-align: center;
    text-transform: capitalize;
    border-radius: 0 0 10px 10px!important;
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    border: none;
}

/* Hover efekt pouze pro tlačítka, ne pro quantity selector */
.product-grid-card:hover .product-grid-card-trans:not(:has(.quantity-selector)) {
    opacity: 1;
}

.product-grid-card:hover .add-to-cart-button,
.product-grid-card:hover .view-variants-button {
    opacity: 1;
}

.product-grid-card-trans .add-to-cart-button:hover,
.product-grid-card-trans .view-variants-button:hover {
    background: #cc5aa7;
}

/* Quantity Selector */
.product-grid-card-trans .quantity-selector {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #EA6DC2;
    margin: 0;
    border-radius: 0 0 10px 10px;
    z-index: 4;
    height: 32px;
}

/* Vždy zobrazit product-grid-card-trans když obsahuje quantity selector */
.product-grid-card .product-grid-card-trans:has(.quantity-selector) {
    opacity: 1;
}
.quantity-selector button {
    border: none;
    color: #fff;
    background: #c955a4;
    font-size: 14px;
    font-weight: 700;
    margin: 0;
    padding: 0px 12px;
    cursor: pointer;
    transition: background 0.3s ease-in-out;
    text-align: center;
    text-transform: capitalize;
    height: 32px;
}
.quantity-selector button:hover {
    background-color: #ab4189;
}
.quantity-selector .quantity-amount {
    flex: 2;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #EA6DC2;
    padding: 0;
    height: 32px;
}
.quantity-minus {
    border-radius: 0 0 0 10px;
}
.quantity-plus {
    border-radius: 0 0 10px 0;
}

/* Mobilní verze - custom carousel */
.custom-carousel-wrapper {
    position: relative;
    width: 100%;
    margin: 0;
    /* Pro desktop */
    --slides-to-show: 4;
    --space-between: 16px;
}

.custom-carousel-inner {
    display: flex;
    gap: var(--space-between);
    overflow-x: scroll;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-snap-type: x mandatory;
    padding: 0 15px !important;
    margin: 0 -15px !important;
}

.custom-carousel-inner::-webkit-scrollbar {
    display: none;
}

/* Mobilní úpravy */
@media (max-width: 768px) {
    .custom-carousel-wrapper {
        --slides-to-show: 1.5 !important;
        --space-between: 8px !important;
    }

    .custom-carousel-inner {
        scroll-snap-type: none !important;
        scroll-behavior: auto !important;
    }

    .product-grid-card {
        flex: 0 0 calc(
            (100% - (var(--slides-to-show) - 1) * var(--space-between)) 
            / var(--slides-to-show)
        ) !important;
        width: calc(
            (100% - (var(--slides-to-show) - 1) * var(--space-between)) 
            / var(--slides-to-show)
        ) !important;
        scroll-snap-align: none !important;
        user-select: none;
        -webkit-user-select: none;
        -webkit-touch-callout: none;
    }
}

/* Desktop verze - snap scrolling */
.ts-product-grid-desktop .ts-product-grid-swiper {
    width: 100%;
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 !important;
    gap: 20px;
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.ts-product-grid-desktop .ts-product-grid-swiper::-webkit-scrollbar {
    display: none;
}

.ts-product-grid-desktop .ts-product-grid-swiper .product-grid-card {
    flex: 0 0 calc((100% - (5 * 20px)) / 6);
    width: calc((100% - (5 * 20px)) / 6);
    box-sizing: border-box;
    scroll-snap-align: start;
}

/* Defaultní zobrazení navigačních šipek - pouze pro desktop */
@media (min-width: 769px) {
    .custom-swiper-button-prev,
    .custom-swiper-button-next {
        opacity: 1;
        visibility: visible;
        transform: translateY(-50%) scale(1);
        transition: opacity 0.3s ease-in-out, visibility 0s linear 0.3s;
    }

    .custom-swiper-button-prev.hidden,
    .custom-swiper-button-next.hidden {
        opacity: 0;
    }
    
    .custom-swiper-button-prev.hidden-complete,
    .custom-swiper-button-next.hidden-complete {
        visibility: hidden;
    }
    
    /* Nové třídy pro šipky, které nekolidují s theme flatsome */
    .custom-swiper-button-prev.arrow-hidden,
    .custom-swiper-button-next.arrow-hidden {
        opacity: 0;
    }
    
    .custom-swiper-button-prev.arrow-hidden-complete,
    .custom-swiper-button-next.arrow-hidden-complete {
        visibility: hidden;
    }
}

/* Skrýt navigační šipky na mobilu */
@media (max-width: 768px) {
    .custom-swiper-button-prev,
    .custom-swiper-button-next {
        display: none !important;
    }
}

/* Container pro navigační šipky */
.ts-product-grid-desktop .swiper-navigation,
.ts-product-grid-mobile .swiper-navigation {
    position: absolute;
    top: 0;
    left: -25px;
    right: -25px;
    bottom: 0;
    pointer-events: none;
    z-index: 4;
}

/* Navigační šipky */
.custom-swiper-button-prev,
.custom-swiper-button-next {
    pointer-events: auto;
    position: absolute;
    top: 35%;
    width: 50px;
    height: 50px;
    background: #F7F7F8;
    border: 1px solid white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.3s ease-in-out, background 0.2s ease-in-out;
    transform: translateY(-50%);
    z-index: 10;
}

/* Výchozí stav levé šipky - skrytá při načtení stránky */
.custom-swiper-button-prev {
    opacity: 0;
    visibility: hidden;
}

.custom-swiper-button-prev {
    left: 0;
}

.custom-swiper-button-next {
    right: 0;
}

.custom-swiper-button-prev::after,
.custom-swiper-button-next::after {
    content: '';
    display: block;
    width: 10px;
    height: 10px;
    border-top: 1px solid #1D1D1D;
    border-right: 1px solid #1D1D1D;
}

.custom-swiper-button-prev::after {
    transform: rotate(-135deg);
    margin-left: 3px;
}

.custom-swiper-button-next::after {
    transform: rotate(45deg);
    margin-right: 3px;
}

.custom-swiper-button-prev:hover,
.custom-swiper-button-next:hover {
    background: #EA6DC2;
}

.custom-swiper-button-prev:hover::after,
.custom-swiper-button-next:hover::after {
    border-top: 2px solid #fff;
    border-right: 2px solid #fff;
}

/* Loader – spinner */
.ajax-loader {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid #fff;
    border-top-color: #c955a4;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* =======================================
   Styly pro List Layout (display_type="list")
   ======================================= */

/* Kontejner seznamu produktů */
.ts-product-list-desktop,
.ts-product-list-mobile {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0;
}

/* Položka seznamu produktů */
.product-list-item {
    display: flex;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
}

.product-list-item:last-child {
    border-bottom: none;
}

/* Obrázek produktu (vlevo) */
.product-list-item-image {
    flex: 0 0 80px;
    width: 80px;
    position: relative;
    margin-right: 20px;
}

.product-list-item-img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}

/* Informace o produktu (uprostřed) */
.product-list-item-info {
    flex: 1;
    padding-right: 20px;
}

.product-list-item-name {
    font-size: 16px;
    font-weight: 500;
    margin: 0 0 8px 0;
    color: #313233;
}

.product-list-item-name a {
    color: #313233;
    text-decoration: none;
}

.product-list-item-name a:hover {
    color: #313233;
    text-decoration: underline;
}

.product-list-item-price {
    font-size: 14px;
    font-weight: 700;
    color: #313233;
}

/* Tlačítko košíku (vpravo) */
.product-list-item-action {
    flex: 0 0 100px;
    display: flex;
    align-items: center;
}

/* Styly pro tlačítko "Do košíku" v list layoutu (aby vypadalo jako čtverec s ikonou) */
.product-list-item-action .add-to-cart-button {
    width: 40px;
    height: 40px;
    background-color: #EA6DC2;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 0 !important; /* Skryje text "Do košíku" */
    padding: 0 !important;
    line-height: 0 !important;
    position: relative; /* Pro pozicování ikony */
    text-indent: -9999px; /* Další způsob skrytí textu */
    overflow: hidden; /* Skryje případný přetékající text */
}

.product-list-item-action .add-to-cart-button:hover {
    background-color: #cc5aa7;
}

/* Ikona košíku pro tlačítko v list layoutu */
.product-list-item-action .add-to-cart-button::before {
    content: '';
    display: block;
    width: 20px; /* Velikost ikony */
    height: 20px; /* Velikost ikony */
    background-color: #fff; /* Barva ikony */
    -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="9" cy="21" r="1"></circle><circle cx="20" cy="21" r="1"></circle><path d="M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"></path></svg>');
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="9" cy="21" r="1"></circle><circle cx="20" cy="21" r="1"></circle><path d="M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"></path></svg>');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Zajistíme trvalou viditelnost wrapperu tlačítka/selectoru v list layoutu */
.product-list-item .product-grid-card-trans {
    opacity: 1 !important;
    position: relative !important; /* Přepíše inline styl, pokud by byl potřeba */
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    width: 100%;
}

.product-list-item .product-grid-card-trans .add-to-cart-button{
    width: 40px!important;
}
/* Zajistíme trvalou viditelnost i samotného tlačítka uvnitř wrapperu v list layoutu */
.product-list-item .product-grid-card-trans .add-to-cart-button,
.product-list-item .product-grid-card-trans .view-variants-button {
    opacity: 1 !important;
    justify-self: end;
    width: 100%;
    border-radius: 8px;
}


/* Původní čtvercové tlačítko s ikonkou košíku (ponecháno pro případné jiné použití) */
.square-cart-button {
    width: 40px;
    height: 40px;
    background-color: #EA6DC2;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.square-cart-button:hover {
    background-color: #cc5aa7;
}

.square-cart-button svg {
    width: 20px;
    height: 20px;
    stroke: #fff;
}

/* Quantity selector v list layoutu */
.product-list-item .quantity-selector {
    display: flex;
    align-items: center;
    background: #EA6DC2;
    border-radius: 8px;
    overflow: hidden;
}

.product-list-item .quantity-selector button {
    width: 30px;
    height: 30px;
    background: #c955a4;
    color: #fff;
    border: none;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.product-list-item .quantity-selector .quantity-amount {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
}

/* Skrytí ribbonu a badge v list layoutu */
.product-list-item .discount-ribbon,
.product-list-item .custom-product-badge {
    display: none;
}

/* Responzivní design */
@media (min-width: 769px) {
    .ts-product-list-mobile {
        display: none !important;
    }
}

@media (max-width: 768px) {
    /* Tlačítko Do košíku */
.product-grid-card-trans .add-to-cart-button,
.product-grid-card-trans .view-variants-button {
    font-size: 11px;
    
}

.product-list-item .product-grid-card-trans{

    display: flex;
    align-items: center;
    justify-content: end;
}

.product-list-item .product-grid-card-trans .add-to-cart-button,
.product-list-item .product-grid-card-trans .view-variants-button {
    opacity: 1 !important;
    justify-self: end;
    width: 100%;
    border-radius: 8px;
    justify-self: unset;
    margin: 6px;
    padding: 0;
    height: 35px;
}


.product-list-item-action {
    flex: 0 0 80px;
}

    /* Ikona košíku pro tlačítko v list layoutu */
.product-list-item-action .add-to-cart-button::before {
    width: 15px; /* Velikost ikony */
    height: 15px; /* Velikost ikony */
    margin-left: -1px;
}
.product-list-item-action .add-to-cart-button{
    width: 35px; 
}
.product-list-item .product-grid-card-trans .add-to-cart-button{
    width: 35px!important;
}
    .ts-product-list-desktop {
        display: none !important;
    }
    
    .product-list-item-image {
        flex: 0 0 60px;
        width: 60px;
        margin-right: 12px;
    }
    
    .product-list-item-name {
        font-size: 14px;
        margin-bottom: 4px;
    }
    
    
    .product-list-item-price {
        font-size: 13px;
    }
    
    .square-cart-button {
        width: 36px;
        height: 36px;
    }
    
    .square-cart-button svg {
        width: 18px;
        height: 18px;
    }
}
