/* ==========================================================================
   WooCommerce Category Display - Jednotná výška karet s tlačítky na jedné úrovni
   ========================================================================== */

/* RESET A PŘEPSÁNÍ WOOCOMMERCE */
.woocommerce ul.products {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0 !important;
    margin-bottom: 40px !important;
    align-items: stretch !important;
}

.woocommerce ul.products li.product {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: none !important;
    float: none !important;
    width: auto !important;
    display: none !important;
}

/* SKRYTÍ STANDARDNÍCH ELEMENTŮ WOOCOMMERCE */
.woocommerce ul.products li.product > * {
    display: none !important;
}

/* HLAVNÍ KONTEJNER KATEGORIÍ */
.wc-category-container {
    max-width: 80%;
    margin: 0 auto;
    padding: 0 20px;
}

/* HLAVIČKA KATEGORIE - Nový design s breadcrumb na jedné lince */
.wc-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 0;
    margin-bottom: 0;
    position: relative;
}

.wc-category-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #0188cc 0%, #00d4ff 50%, #0188cc 100%);
    border-radius: 2px;
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

.wc-category-title {
    font-size: 36px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

/* BREADCRUMB NAVIGACE - Vpravo od názvu */
.wc-category-breadcrumb {
    font-size: 14px;
    color: #666;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.wc-category-breadcrumb a {
    color: #666;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.wc-category-breadcrumb a:hover {
    color: #0188cc;
}

.wc-category-breadcrumb a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #0188cc;
    transition: width 0.3s ease;
}

.wc-category-breadcrumb a:hover::after {
    width: 100%;
}

.path-separator {
    margin: 0 12px;
    color: #ddd;
    font-size: 18px;
    position: relative;
    display: inline-flex;
    align-items: center;
}

.path-separator::before {
    content: '›';
    display: inline-block;
    background: linear-gradient(135deg, #0188cc, #00d4ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    transform: scale(1.2);
}

/* POPIS KATEGORIE - Vylepšený moderní design */
.wc-category-description {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid rgba(1, 136, 204, 0.1);
    padding: 30px 35px;
    margin: 35px 0;
    font-size: 16px;
    line-height: 1.8;
    color: #4a5568;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(1, 136, 204, 0.05), 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.wc-category-description::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: linear-gradient(180deg, #0188cc 0%, #00d4ff 50%, #0188cc 100%);
    animation: gradientShift 4s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% {
        background: linear-gradient(180deg, #0188cc 0%, #00d4ff 50%, #0188cc 100%);
    }
    50% {
        background: linear-gradient(180deg, #00d4ff 0%, #0188cc 50%, #00d4ff 100%);
    }
}

.wc-category-description:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 12px rgba(1, 136, 204, 0.1), 0 2px 4px rgba(0, 0, 0, 0.08);
}

.wc-category-description p {
    margin: 0 0 15px 0;
    color: #4a5568;
}

.wc-category-description p:last-child {
    margin-bottom: 0;
}

.wc-category-description strong {
    color: #1a202c;
    font-weight: 600;
    background: linear-gradient(135deg, #0188cc, #00a6d6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* NÁSTROJE KATEGORIE - Počet a řazení */
.wc-category-tools {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 20px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid #e5e5e5;
}

.wc-category-tools-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

/* Počet produktů */
.wc-product-count {
    font-size: 14px;
    color: #666;
}

.woocommerce-result-count {
    margin: 0;
    font-size: 14px;
    color: #666;
}

/* Kontejner pro řazení */
.wc-sorting-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.wc-sorting-container label {
    font-size: 14px;
    color: #333;
    font-weight: 500;
    margin: 0;
}

/* Výběr řazení - stylování selectu */
.woocommerce-ordering {
    margin: 0;
}

.woocommerce-ordering select,
.orderby {
    padding: 8px 35px 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: border-color 0.3s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    min-width: 200px;
}

.woocommerce-ordering select:hover,
.orderby:hover {
    border-color: #0188cc;
}

.woocommerce-ordering select:focus,
.orderby:focus {
    outline: none;
    border-color: #0188cc;
    box-shadow: 0 0 0 2px rgba(1, 136, 204, 0.1);
}

/* GRID PRODUKTŮ */
.wc-products-grid {
    margin-top: 30px;
    margin-bottom: 30px;
}

.wc-products-grid ul.products {
    display: flex !important;
    flex-wrap: wrap !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    align-items: stretch !important;
}

/* KARTY PRODUKTŮ - zachováváme funkční design */
.catalog-outer {
    flex: 0 0 calc(25% - 20px);
    max-width: calc(25% - 20px);
    margin: 0 10px 30px 10px;
    border: 1px solid #e5e5e5;
    border-radius: 5px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 450px;
}

.catalog-outer:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transform: translateY(-5px);
}

.catalog {
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    min-height: 100%;
}

/* KONTEJNER OBRÁZKU */
.catalog .img {
    position: relative;
    overflow: hidden;
    padding-top: 75%;
    background: #f8f9fa;
    flex-shrink: 0;
}

.catalog .img img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.catalog .img .main-image {
    z-index: 1;
    transition: transform 0.5s ease;
}

.catalog .img .hover-image {
    z-index: 2;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.catalog:hover .img .hover-image {
    opacity: 1;
}

.catalog:hover .img .main-image {
    transform: scale(1.05);
}

/* VLAJKY */
.catalog-flags,
.flags {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    z-index: 5;
}

.flag {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    color: #fff;
}

.flag-red,
.flag-action {
    background-color: #e84500;
}

.flag-discount-sm {
    background-color: #d93025;
}

.flag-new {
    background-color: #28a745;
}

/* OBSAH KARTY */
.catalog-content {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: space-between;
    min-height: 0;
}

/* NADPIS PRODUKTU */
.catalog .title,
.catalog h3.title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    color: #333;
    margin: 0 0 8px 0;
    text-decoration: none;
    flex-shrink: 0;
    min-height: 44px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.catalog .title a {
    color: inherit;
    text-decoration: none;
}

.catalog .title a:hover {
    color: #0188cc;
}

/* KRÁTKÝ POPIS */
.catalog .perex {
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
    line-height: 1.4;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 57px;
}

/* CENA */
.price-container {
    margin-top: auto;
    margin-bottom: 0;
    flex-shrink: 0;
    padding-bottom: 10px;
}

.price-wrap .price {
    font-size: 18px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 28px;
}

.strike-price {
    color: #999;
    font-size: 14px;
    text-decoration: line-through;
    font-weight: normal;
}

.price strong {
    color: #e84500;
    font-weight: 700;
}

/* BLOK S TLAČÍTKEM */
.submit-block {
    padding: 15px;
    background-color: #f9f9f9;
    border-top: 1px solid #eee;
    margin-top: auto;
    flex-shrink: 0;
    min-height: 62px;
    display: flex;
    align-items: center;
}

.btn-insert,
.btn.btn-insert {
    display: block;
    width: 100%;
    background-color: #0188cc;
    color: #fff;
    border: none;
    padding: 12px 15px;
    border-radius: 4px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.3s ease;
    text-decoration: none;
    font-size: 14px;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-insert:hover,
.btn.btn-insert:hover {
    background-color: #016699;
    color: #fff;
}

/* INFORMACE O SKLADĚ */
.stock-info {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    text-align: center;
    margin: 0 10px 10px 10px;
}

.stock-info.low-stock {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.stock-info.in-stock {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* ANIMACE */
.catalog.in-view {
    opacity: 1;
    transform: translateY(0);
}

.catalog {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.catalog.animated {
    opacity: 1;
    transform: translateY(0);
}

/* TLAČÍTKO NAČÍST VÍCE */
.load-more-container {
    text-align: center;
    margin-top: 40px;
}

#load-more {
    background-color: #0188cc;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#load-more:hover {
    background-color: #016699;
}

#load-more:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.loading-spinner {
    margin-top: 20px;
    text-align: center;
    color: #666;
}

/* SKRYTÍ DUPLICITNÍCH PRVKŮ */
.storefront-sorting {
    display: none !important;
}

/* SKRYTÍ INFORMACÍ O SKLADĚ */
.stock-info {
    display: none !important;
}

/* RESPONZIVNÍ DESIGN */

/* Tablety - krajina */
@media (max-width: 1200px) {
    .catalog-outer {
        flex: 0 0 calc(33.333% - 20px);
        max-width: calc(33.333% - 20px);
        min-height: 420px;
    }

    .catalog .title {
        font-size: 15px;
    }

    .catalog .perex {
        font-size: 12px;
        -webkit-line-clamp: 2;
        min-height: 38px;
    }
}

/* Tablety - portrét */
@media (max-width: 1024px) {
    .catalog-outer {
        flex: 0 0 calc(50% - 16px);
        max-width: calc(50% - 16px);
        margin: 0 8px 24px 8px;
        min-height: 400px;
    }

    /* Hlavička na tabletech - centrování */
    .wc-category-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 15px;
    }

    .wc-category-breadcrumb {
        align-self: center;
        justify-content: center;
    }

    .wc-category-title-wrapper {
        width: 100%;
        text-align: center;
    }

    /* Karty produktů */
    .catalog .img {
        padding-top: 80%;
    }

    .catalog-content {
        padding: 12px;
    }

    .price-wrap .price {
        font-size: 16px;
    }

    .btn-insert {
        font-size: 13px;
        padding: 10px 12px;
    }
}

/* Mobilní zařízení */
@media (max-width: 768px) {
    .wc-category-container {
        padding: 10px;
        max-width: 100%;
    }

    /* Karty produktů - 1 sloupec na mobilech */
    .catalog-outer {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        margin: 0 0 20px 0 !important;
        min-height: auto;
        border-radius: 10px;
        box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    }

    .wc-category-tools-inner {
        flex-direction: column;
        align-items: center;
        gap: 12px;
        text-align: center;
    }

    .wc-sorting-container {
        width: 100%;
        justify-content: center;
    }

    .woocommerce-ordering select {
        width: 100%;
        max-width: 280px;
    }

    /* Obsah karet - vertikální layout */
    .catalog {
        flex-direction: column !important;
    }

    /* Obrázek nahoře */
    .catalog .img {
        width: 100%;
        padding-top: 75% !important;
        height: auto;
    }

    /* Obsah pod obrázkem */
    .catalog-content {
        padding: 15px;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .catalog .title {
        font-size: 16px;
        min-height: auto;
        font-weight: 600;
        margin-bottom: 10px;
        -webkit-line-clamp: 2;
        text-align: center;
        width: 100%;
    }

    .catalog .perex {
        display: block !important; /* Zobrazíme popis na mobilech */
        font-size: 14px;
        color: #666;
        line-height: 1.5;
        -webkit-line-clamp: 3;
        min-height: auto;
        margin-bottom: 12px;
        text-align: center;
        width: 100%;
    }

    /* Cena - vycentrovaná */
    .price-container {
        width: 100%;
        text-align: center;
        margin-bottom: 10px;
    }

    .price-wrap {
        display: flex;
        justify-content: center;
        width: 100%;
    }

    .price-wrap .price {
        font-size: 18px;
        font-weight: 700;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        width: 100%;
    }

    .strike-price {
        font-size: 14px;
    }

    /* Tlačítko na celou šířku */
    .submit-block {
        width: 100%;
        padding: 15px;
        min-height: auto;
        background-color: #f9f9f9;
        border-top: 1px solid #eee;
    }

    .btn-insert {
        font-size: 15px;
        padding: 12px 20px;
        min-height: 44px;
        font-weight: 600;
        width: 100%;
    }

    /* Vlajky */
    .catalog-flags {
        position: absolute;
        top: 10px;
        left: 10px;
        z-index: 10;
        gap: 5px;
    }

    .flag {
        font-size: 11px;
        padding: 3px 7px;
    }

    /* Hlavička - centrování */
    .wc-category-header {
        padding: 15px 0;
        text-align: center;
    }

    .wc-category-title {
        font-size: 26px;
        text-align: center;
    }

    .wc-category-breadcrumb {
        font-size: 12px;
        text-align: center;
        justify-content: center;
        flex-wrap: wrap;
    }

    .path-separator {
        margin: 0 6px;
    }

    .wc-category-description {
        padding: 18px 20px;
        font-size: 14px;
        margin: 20px 0;
    }

    .wc-category-description::after {
        display: none;
    }
}

/* Malé mobilní zařízení */
@media (max-width: 480px) {
    .wc-category-container {
        padding: 8px;
        max-width: 100%;
    }

    /* Karty produktů - stále 1 sloupec */
    .catalog-outer {
        margin: 0 0 15px 0 !important;
        border-radius: 8px;
    }

    /* Obrázek */
    .catalog .img {
        padding-top: 80% !important;
    }

    .catalog-content {
        padding: 12px;
    }

    .catalog .title {
        font-size: 15px;
        margin-bottom: 8px;
    }

    .catalog .perex {
        font-size: 13px;
        margin-bottom: 10px;
        -webkit-line-clamp: 2;
    }

    .price-wrap .price {
        font-size: 17px;
    }

    .strike-price {
        font-size: 13px;
    }

    .submit-block {
        padding: 12px;
    }

    .btn-insert {
        font-size: 14px;
        padding: 10px 15px;
        min-height: 40px;
    }

    /* Vlajky - menší */
    .flag {
        font-size: 10px;
        padding: 2px 6px;
    }

    /* Hlavička */
    .wc-category-header {
        padding: 12px 0;
    }

    .wc-category-title {
        font-size: 22px;
    }

    .wc-category-breadcrumb {
        font-size: 11px;
    }

    .wc-category-description {
        padding: 15px;
        font-size: 13px;
        margin: 15px 0;
    }

    /* Nástroje */
    .wc-category-tools {
        padding: 15px 0;
    }

    .wc-product-count {
        font-size: 12px;
    }

    .wc-sorting-container label {
        font-size: 12px;
    }

    .woocommerce-ordering select {
        font-size: 12px;
        padding: 6px 30px 6px 10px;
    }

    /* Tlačítko načíst více */
    #load-more {
        padding: 12px 24px;
        font-size: 14px;
    }
}

/* Velmi malé mobilní obrazovky */
@media (max-width: 360px) {
    /* Obrázek */
    .catalog .img {
        padding-top: 85% !important;
    }

    .catalog-content {
        padding: 10px;
    }

    .catalog .title {
        font-size: 14px;
    }

    .catalog .perex {
        font-size: 12px;
        -webkit-line-clamp: 2;
    }

    .price-wrap .price {
        font-size: 16px;
    }

    .strike-price {
        font-size: 12px;
    }

    .submit-block {
        padding: 10px;
    }

    .btn-insert {
        font-size: 13px;
        padding: 8px 12px;
        min-height: 38px;
    }
}

/* WOOCOMMERCE PAGINATION */
.woocommerce-pagination {
    text-align: center;
    margin-top: 30px;
}

.page-numbers {
    display: inline-flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 5px;
}

.page-numbers li {
    margin: 0;
}

.page-numbers a,
.page-numbers span {
    display: inline-block;
    padding: 8px 12px;
    border: 1px solid #ddd;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.page-numbers a:hover,
.page-numbers .current {
    background-color: #0188cc;
    color: #fff;
    border-color: #0188cc;
}