/* =========================================================
   VZHLED KATEGORIE - UPDATE (Zarovnání vlevo + Široké karty)
   ========================================================= */

/* 1. HLAVNÍ NADPIS KATEGORIE */
.category-title {
    text-align: left !important; /* Zarovnání vlevo */
    font-size: 26px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    color: #1a1937 !important;
    margin-bottom: 25px !important;
    position: relative !important;
    padding-bottom: 15px !important;
}

/* Zlatá linka pod nadpisem (teď vlevo) */
.category-title::after {
    content: "";
    display: block;
    width: 60px;
    height: 3px;
    background-color: var(--rc-gold, #d8a06d);
    position: absolute;
    bottom: 0;
    left: 0; /* Začátek zleva */
    transform: none !important; /* Zrušit centrování */
    border-radius: 2px;
}

/* 2. POPIS KATEGORIE (Perex) */
.category-perex {
    text-align: left !important; /* Zarovnání vlevo */
    max-width: 100% !important; /* Využít šířku vedle sidebaru */
    margin: 0 0 30px 0 !important;
    font-size: 15px !important;
    line-height: 1.6 !important;
    color: #2c2c2c !important;
}

.category-perex b {
    color: var(--rc-gold, #d8a06d) !important;
}

/* 3. PODKATEGORIE (Grid 3 sloupce, Široké karty) */
ul.subcategories {
    display: grid !important;
    /* 3 sloupce o stejné šířce */
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 15px !important; /* Mezery mezi kartami */

    margin: 0 0 40px 0 !important;
    padding: 0 !important;
    border: none !important;
}

ul.subcategories li {
    /* Reset Shoptet stylů */
    width: auto !important;
    float: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    min-height: 0 !important; /* Fix pro grid */
}

/* Odkaz/Karta podkategorie - FLEXBOX (Obrázek | Text) */
ul.subcategories a {
    display: flex !important;
    flex-direction: row !important; /* VEDLE SEBE */
    align-items: center !important; /* Zarovnat svisle na střed */
    justify-content: flex-start !important;

    background: #fff !important;
    border: 1px solid #eee !important;
    border-radius: 8px !important;
    padding: 5px !important;
    height: 100% !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    text-align: left !important;
}

/* Hover efekt */
ul.subcategories a:hover {
    border-color: var(--rc-gold, #d8a06d) !important;
    background-color: #fcfcfc !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05) !important;
}

/* Obrázek v podkategorii (Vlevo) */
ul.subcategories .image {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    width: 80px !important; /* Fixní šířka pro obrázek */
    height: 50px !important;
    flex-shrink: 0 !important; /* Nesmrskávat */

    margin-right: 0px !important; /* Mezera mezi obr. a textem */
    margin-bottom: 0 !important; /* Zrušit mezeru dole */
}

ul.subcategories .image img {
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
}

/* Text podkategorie (Vpravo) */
ul.subcategories .text {
    font-size: 13px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    color: #333 !important;
    line-height: 1.3 !important;
    flex: 1 !important; /* Zabrat zbytek místa */
}

ul.subcategories a:hover .text {
    color: var(--rc-gold, #d8a06d) !important;
}


/* 4. DOLNÍ POPIS (SEO text) */
.category__secondDescription {
    text-align: left !important;
    max-width: 100% !important;
    margin: 40px 0 20px 0 !important;
    border-top: 1px solid #eee !important;
    padding-top: 30px !important;
}

.category__secondDescription h2,
.category__secondDescription h3 {
    text-align: left !important;
}


/* --- RESPONSIVITA --- */

/* Tablet (pod 992px) - Změna na 2 sloupce */
@media (max-width: 991px) {
    ul.subcategories {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Mobil (pod 576px) - Změna na 1 sloupec (pod sebou) */
@media (max-width: 576px) {
    ul.subcategories {
        grid-template-columns: 1fr !important;
    }

    /* Na mobilu trochu zvětšíme padding pro pohodlný klik */
    ul.subcategories a {
        padding: 15px !important;
    }
}

/* =========================================================
   FIX: NEJPRODÁVANĚJŠÍ (SROVNÁNÍ DO MŘÍŽKY)
   ========================================================= */

/* 1. Nastavíme kontejner jako Flex mřížku */
#productsTop {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
    margin: 0 -5px !important; /* Kompenzace okrajů */
}

/* 2. Jednotlivé produkty - Vynutíme šířku 25% (4 vedle sebe) */
#productsTop .product {
    flex: 0 0 25% !important;
    max-width: 25% !important;
    display: block !important; /* Přepíšeme případné skrytí */
    padding: 0 5px !important; /* Mezera mezi produkty */
    box-sizing: border-box !important;
    margin-bottom: 20px !important;
}

/* Pokud Shoptet používá carousel (slider), skryjeme ty neaktivní,
   ABY se nerozbilo stránkování, pokud tam nějaké je.
   POKUD chceš vidět všechny najednou (mřížku), tento blok níže SMAŽ. */
#productsTop .product.inactive {
    display: none !important;
}

/* 3. Reset výšky karty pro homepage */
/* Na úvodní straně nemusí být karty tak vysoké jako v kategorii */
#productsTop .p {
    min-height: 0 !important; /* Zrušíme tu velkou výšku z minula */
    height: 100% !important;
}

/* 4. Responsivita (Mobily a Tablety) */

/* Tablety (2 vedle sebe) */
@media (max-width: 991px) {
    #productsTop .product {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }
}

/* Mobily (1 přes celou šířku) */
@media (max-width: 480px) {
    #productsTop .product {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }
}


/* --------------------------------------------------------------------------
   2. TOP PRODUKTY KATEGORIE (Mřížka 4 sloupce + Design karet)
   -------------------------------------------------------------------------- */
/* Kontejner mřížky */
#productsTop {
    display: flex !important; flex-wrap: wrap !important; justify-content: flex-start !important;
    margin: 0 -5px !important;
}
/* Položka (4 vedle sebe) */
#productsTop .product {
    flex: 0 0 25% !important; max-width: 25% !important; display: block !important;
    padding: 0 5px !important; box-sizing: border-box !important; margin-bottom: 20px !important;
}
/* Karta produktu - Design */
#productsTop .product .p {
    padding: 15px 10px 10px 10px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    align-items: center !important;
    text-align: center !important;
    width: 100% !important;
    box-sizing: border-box !important;
}
/* Vnitřní elementy - Reset */
#productsTop .product .p-in, #productsTop .product .p-in-in, #productsTop .product .p-bottom {
    padding: 0 !important; margin: 0 !important; width: 100% !important;
}


/* Obrázek - Menší a ostrý */
#productsTop .product .image {
    width: 100% !important; margin: 0 0 10px 0 !important; padding: 0 !important;
}
#productsTop .product .image img {
    width: 45% !important; margin: 0 auto 10px auto !important;
}
/* Ceny na střed */
#productsTop .product .prices {
justify-content: center !important; }

/* =========================================================
   FIX: ZAROVNÁNÍ NA STŘED (TOP PRODUKTY KATEGORIE)
   ========================================================= */

/* 1. ZAROVNÁNÍ DOSTUPNOSTI (Skladem) */
/* Musíme zacílit i wrapper okolo, který to často drží vlevo */
#productsTop .product .ratings-wrapper {
    display: flex !important;
    justify-content: center !important;
    width: 100% !important;
}

#productsTop .product .availability {
    display: flex !important;     /* Aby fungoval justify-content */
    justify-content: center !important;
    text-align: center !important;
    margin: 5px auto !important;  /* Auto zajistí vycentrování bloku */
    width: 100% !important;
}

/* 2. ZAROVNÁNÍ CENY */
#productsTop .product .prices {
    display: flex !important;
    justify-content: center !important; /* Flexbox centr */
    text-align: center !important;
    width: 100% !important;
}

/* Pojistka pro vnitřní elementy ceny */
#productsTop .product .price-final,
#productsTop .product .price-standard-wrapper {
    text-align: center !important;
    justify-content: center !important;
}

/* ==========================================================================
   OPRAVA: 2 PRODUKTY VEDLE SEBE (Kategorie i Top Produkty)
   ========================================================================== */
@media (max-width: 767px) {

    /* 1. OBECNÉ PRODUKTY V KATEGORIÍCH */
    /* Přebíjíme pravidlo z řádku 565, které tam má width: 100% */
    :not(.product-slider-holder) > .products .product {
        width: 50% !important;
        float: left !important;
        padding: 5px !important;
        box-sizing: border-box !important;
    }

    /* 2. TOP PRODUKTY (Sekce #productsTop) */
    /* Přebíjíme pravidlo z řádku 1081 a 1223, kde je flex: 0 0 100% */
    #productsTop .product {
        flex: 0 0 50% !important;
        max-width: 50% !important;
        padding: 5px !important;
        box-sizing: border-box !important;
        display: block !important;
    }

    /* 3. ÚPRAVA VNITŘKU KARET, ABY SE VEDLE SEBE VEŠLY */
    .products .product .p,
    #productsTop .product .p {
       /* min-height: 380px !important;  Snížíme výšku, aby nebyly moc protáhlé */
        padding: 5px 5px !important;
    }

    /* Zmenšení písma názvu */
    .products .product a.name span,
    #productsTop .product a.name span {
        font-size: 13px !important;
        line-height: 1.2 !important;
        min-height: 32px !important; /* Max 2 řádky */
    }

    /* Zmenšení cen */
    .products .product .price-final strong,
    #productsTop .product .price-final strong {
        font-size: 16px !important;
    }

    /* Tlačítka musí být úzká, aby nepřetékala */
    .products .product .p-bottom .btn,
    #productsTop .product .p-bottom .btn {
        font-size: 11px !important;
        height: 34px !important;
        line-height: 32px !important;
        padding: 0 2px !important;
    }

    /* Schování popisku na mobilu (v mřížce 2x2 na něj není místo) */
    .products .product .p-desc,
    #productsTop .product .p-desc {
        display: none !important;
    }
}

@media (max-width: 767px) {

  /* 1) Na mobilu používej mobilní header (pokud šablona zobrazuje oba) */
  .p-detail-inner .p-data-wrapper .p-detail-inner-header {
    display: none !important;
  }
  .p-detail-inner .p-image-wrapper .p-detail-inner-header-mobile {
    display: block !important;
  }

  /* 2) NADPIS */
  .p-detail-inner .p-image-wrapper .p-detail-inner-header-mobile .h1 {
    margin: 20px 0 10px !important;   /* požadovaný odstup shora */
    font-weight: 600 !important;
    letter-spacing: -0.02em;
    line-height: 1.12 !important;
    text-align: center;

    /* větší písmo */
    font-size: clamp(21px, 5.4vw, 30px) !important;

    color: var(--rc-text, #1d1d1d) !important;
    overflow-wrap: anywhere;
  }

  /* 3) Jeden řádek: rating vlevo, brand vpravo */
  .p-detail-inner .p-image-wrapper .p-detail-inner-header-mobile .ratings-and-brand {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    margin: 0 0 6px !important;
  }

  /* hvězdy + "X hodnocení" držet v jednom bloku */
  .p-detail-inner .p-image-wrapper .p-detail-inner-header-mobile .stars-wrapper {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    min-width: 0;
  }

  .p-detail-inner .p-image-wrapper .p-detail-inner-header-mobile .stars-label {
    white-space: nowrap;
    font-size: 13px !important;
    line-height: 1 !important;
    opacity: 0.9;
  }

  /* 4) BRAND – skryj "Značka:" a udělej z odkazu tlačítko */
  .p-detail-inner .p-image-wrapper .p-detail-inner-header-mobile .brand-wrapper {
    font-size: 0 !important;     /* schová text node "Značka:" */
    line-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    white-space: nowrap;
  }

  .p-detail-inner .p-image-wrapper .p-detail-inner-header-mobile .brand-wrapper a {
    font-size: 12px !important;  /* vrátí text po font-size:0 */
    line-height: 1 !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    padding: 7px 11px !important;
    border-radius: 999px !important;

    font-weight: 700 !important;
    text-decoration: none !important;

    /* barvy dle zadání */
    color: #4d4d4d !important;
    background: rgba(77, 77, 77, 0.08) !important;
    border: 1px solid rgba(77, 77, 77, 0.28) !important;
  }

  .p-detail-inner .p-image-wrapper .p-detail-inner-header-mobile .brand-wrapper a:hover,
  .p-detail-inner .p-image-wrapper .p-detail-inner-header-mobile .brand-wrapper a:active,
  .p-detail-inner .p-image-wrapper .p-detail-inner-header-mobile .brand-wrapper a:focus {
    color: #c79040 !important;
    background: rgba(199, 144, 64, 0.12) !important;
    border-color: rgba(199, 144, 64, 0.48) !important;
    text-decoration: none !important;
  }

  /* 5) Extra malé displeje: když se to nevejde, ať se to zalomí hezky */
  @media (max-width: 360px) {
    .p-detail-inner .p-image-wrapper .p-detail-inner-header-mobile .ratings-and-brand {
      flex-wrap: wrap !important;
      justify-content: flex-start !important;
      gap: 6px !important;
    }
  }
}

 @media (max-width: 767px) {
#accordion-content .shp-accordion .shp-accordion-link {
    color: #1a1937;
    display: block;
    font-size: 16px;
    font-weight: 600;
    padding-right: 30px;
    position: relative;
    width: 100%;
    text-transform: uppercase;
    font-family: poppins;
    border-bottom: 1px solid #cfcfcf;
}

.extended-description p strong {
    margin-top: 20px;
    color: #1a1937 !important;
}
}