/* ==========================================================================
   Produkty: přepínač kategorií, karty (mřížka /kolekce), vlnka papíru.
   Zdroj: v2 ProductsCatalog.tsx, Products.tsx, PaperEdge.tsx.
   Karty jsou globální položky Divi Library (Blurb `es-card`).
   ========================================================================== */

/* --- Vlnka papíru do tmavé patičky / z tmavé sekce (v2 PaperEdge) --- */
.es-edge-bottom::after,
.es-edge-top::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  z-index: 1;
  height: 1.25rem; /* h-5 */
  background-color: var(--espero-bg);
  -webkit-mask: url(../img/paper-edge.svg) 0 0 / 100% 100% no-repeat;
  mask: url(../img/paper-edge.svg) 0 0 / 100% 100% no-repeat;
  pointer-events: none;
}
.es-edge-bottom::after {
  bottom: 0;
  transform: rotate(180deg);
}
.es-edge-top::before {
  top: 0;
}
@media (min-width: 768px) {
  .es-edge-bottom::after,
  .es-edge-top::before {
    height: 1.5rem; /* md:h-6 */
  }
}

/* --- Hlavička /kolekce: vodoznak ve 38 % výšky (`top-[38%] -translate-y-1/2`) --- */
.es-pagehead--mark-mid {
  background-image:
    var(--es-grain-06),
    radial-gradient(circle at center, rgba(234, 176, 131, 0.385), transparent 70%),
    radial-gradient(circle at center, rgba(248, 234, 197, 0.63), transparent 68%) !important;
  background-repeat: repeat, no-repeat, no-repeat !important;
  background-size:
    auto,
    34rem 34rem,
    36rem 36rem !important;
  background-position:
    0 0,
    right -14vw top -5rem,
    left -12vw top -8rem !important;
}
.es-pagehead--mark-mid::before {
  content: '';
  position: absolute;
  right: 3%;
  top: 38%;
  height: 520px;
  aspect-ratio: 76 / 108;
  transform: translateY(-50%);
  background-color: var(--espero-ink);
  opacity: 0.045;
  pointer-events: none;
  -webkit-mask: var(--es-mark) center / contain no-repeat;
  mask: var(--es-mark) center / contain no-repeat;
}
@media (min-width: 768px) {
  .es-pagehead--mark-mid::before {
    height: 640px;
  }
}
/* Hlavička s přepínačem má víc místa dole (`pb-12 md:pb-16`). */
.es-pagehead:has(.es-tabs) {
  padding-bottom: 3rem !important;
}
@media (min-width: 768px) {
  .es-pagehead:has(.es-tabs) {
    padding-bottom: 4rem !important;
  }
}
.es-pagehead:has(.es-tabs) .et_pb_column {
  gap: 0 !important;
}

/* --- Přepínač kategorií (tablist) --- */
.es-pagehead .es-tabs,
.es-tabs {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-end !important; /* patkami: nápisy jsou různě vysoké */
  justify-content: center !important;
  gap: 1rem !important; /* gap-4 */
  width: auto !important;
  margin: 2.25rem 0 0 !important; /* mt-9 */
}
@media (min-width: 640px) {
  .es-tabs {
    gap: 2.5rem !important; /* sm:gap-10 */
  }
}
@media (min-width: 768px) {
  .es-pagehead .es-tabs--page {
    margin-top: 2.75rem !important; /* md:mt-11 */
  }
}
.es-tab {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 0.75rem !important; /* gap-3 */
  width: auto !important;
  margin: 0 !important;
  padding: 0.5rem !important; /* p-2 */
  cursor: pointer;
  color: var(--espero-inkmuted);
  transition: color 300ms var(--espero-ease-tw);
}
.es-tab:hover {
  color: var(--espero-ink);
}
.es-tab.is-active {
  color: var(--espero-orange);
}
:where(.es-tab .et_pb_module) {
  margin: 0 !important;
  width: auto !important;
}
.es-tab-logo img {
  display: block;
  width: auto !important;
  height: 0.875rem !important; /* h-3.5 */
  opacity: 0.4;
  user-select: none;
  transition: opacity 300ms var(--espero-ease-tw);
}
@media (min-width: 768px) {
  .es-tab-logo img {
    height: 1.75rem !important; /* md:h-7 */
  }
}
.es-tab:hover .es-tab-logo img {
  opacity: 0.7;
}
.es-tab.is-active .es-tab-logo img,
html:not(.es-js) .es-tab-logo img {
  opacity: 1;
}
.es-tab-label p {
  position: relative;
  margin: 0;
  padding: 0 0 0.5rem !important; /* pb-2 */
  white-space: nowrap;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem; /* text-xl */
  line-height: 1.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: inherit;
}
.es-tab-label p::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px; /* h-0.5 */
  background-color: var(--espero-orange);
  transition: all 300ms var(--espero-ease-tw);
}
.es-tab.is-active .es-tab-label p::after {
  width: 100%;
}
/* Homepage: tenčí linka a menší odsazení (`pb-1.5`, `h-px`). */
.es-tabs--home .es-tab-label p {
  padding-bottom: 0.375rem !important;
}
.es-tabs--home .es-tab-label p::after {
  height: 1px;
}

.es-tabpanel[hidden],
.es-carousel .es-cards.es-tabpanel[hidden] {
  display: none !important;
}

/* Přepnutí kategorie: panel se prolne (0,4 s), karty postupně (0,7 s). */
@keyframes es-fade-in {
  from {
    opacity: 0;
  }
}
@keyframes es-rise-in {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
}
@media (prefers-reduced-motion: no-preference) {
  .es-tabpanel.is-entering {
    animation: es-fade-in 0.4s var(--espero-ease) both;
  }
  .es-collection .es-tabpanel.is-entering .es-card {
    animation: es-rise-in 0.7s var(--espero-ease) both;
    animation-delay: calc(0.05s + var(--i, 0) * 0.07s);
  }
}

/* ==========================================================================
   Mřížka /kolekce
   ========================================================================== */

.es-collection {
  padding: 2.5rem 0 6rem !important; /* pt-10 pb-24 */
}
@media (min-width: 768px) {
  .es-collection {
    padding: 3rem 0 8rem !important; /* md:pt-12 md:pb-32 */
  }
}
.es-collection .es-cards {
  width: 100% !important;
  max-width: 72rem !important; /* max-w-6xl */
  margin: 0 auto !important;
  padding: 0 1.5rem !important;
}
.es-collection .es-cards > .et_pb_column {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 3rem !important; /* gap-x-12 */
  row-gap: 4rem !important; /* gap-y-16 */
  width: 100% !important;
  margin: 0 !important;
}
@media (min-width: 640px) {
  .es-collection .es-cards > .et_pb_column {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (min-width: 768px) {
  .es-collection .es-cards > .et_pb_column {
    column-gap: 5rem !important; /* md:gap-x-20 */
    row-gap: 6rem !important; /* md:gap-y-24 */
  }
}

/* --- Karta produktu (Blurb) --- */
.es-card {
  width: 100% !important;
  margin: 0 !important;
  text-align: center;
}
.es-card .et_pb_blurb_content {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 0 !important; /* Divi flex dává 30 px */
  max-width: none !important;
  margin: 0 !important;
}
.es-card .et_pb_main_blurb_image {
  position: relative;
  display: flex !important;
  align-items: flex-end;
  justify-content: center;
  width: 100% !important;
  height: 240px;
  margin: 0 !important;
}
@media (min-width: 768px) {
  .es-card .et_pb_main_blurb_image {
    height: 300px;
  }
}
.es-card .et_pb_main_blurb_image > a,
.es-card .et_pb_image_wrap {
  display: flex !important;
  align-items: flex-end;
  justify-content: center;
  width: 100% !important;
  height: 100%;
  margin: 0 !important;
}
/* Teplá záře za patkou, odkryje se při najetí */
.es-card .et_pb_main_blurb_image::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 120%;
  height: 42%;
  transform: translateX(-50%);
  border-radius: 9999px;
  background: radial-gradient(ellipse at center, rgba(196, 149, 42, 0.28), rgba(196, 149, 42, 0.08) 45%, transparent 70%);
  filter: blur(18px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 700ms var(--espero-ease-tw);
}
.es-card:hover .et_pb_main_blurb_image::before {
  opacity: 1;
}
/* Výška je strop, ne příkaz: dárkové sety jsou širší než buňka. */
.es-card img {
  position: relative;
  width: auto !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: 220px;
  object-fit: contain;
  user-select: none;
  transition: transform 500ms var(--espero-ease-tw);
}
@media (min-width: 768px) {
  .es-card img {
    max-height: 280px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .es-card:hover img {
    transform: scale(1.04);
  }
}
.es-card .et_pb_blurb_container {
  display: block !important;
  width: 100%;
  padding: 0 !important;
  text-align: center !important;
}
.es-card h3 {
  margin: 1.5rem 0 0 !important; /* mt-6 */
  padding: 0 !important;
  font-family: var(--font-display) !important;
  font-weight: 700;
  font-size: 1.125rem !important; /* text-lg */
  line-height: 1.75rem !important;
  text-transform: uppercase;
  color: var(--espero-ink) !important;
  transition: color 300ms var(--espero-ease-tw);
}
.es-card h3 a {
  color: inherit !important;
}
.es-card:hover h3 {
  color: var(--espero-golddark) !important;
}
.es-card a:focus-visible {
  outline-offset: 8px;
}

/* ==========================================================================
   Detail produktu (v2 ProductDetail.tsx)
   ========================================================================== */

/* Sdílené drobnosti: popisek nad nadpisem, linka pod nadpisem, odkaz zpět. */
.es-eyebrow p {
  margin: 0;
  padding: 0 !important;
  font-size: 13px;
  line-height: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--espero-inkmuted);
}
/* Linka pod nadpisem (`h-px w-14 bg-espero-orange/60`), odstup = mezera rodiče.
   Modul je v Divi flex s vlastní mezerou, ta se tu vypíná. */
.es-rule {
  gap: 0 !important;
}
.es-rule::after {
  content: '';
  display: block;
  width: 3.5rem;
  height: 1px;
  margin-top: var(--es-rule-gap, 1.5rem);
  background-color: rgb(204 104 1 / 0.6);
}
.es-back p {
  margin: 0;
  padding: 0 !important;
}
.es-back a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 12px;
  line-height: 1.5;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--espero-inkmuted);
  transition: color 300ms var(--espero-ease-tw);
}
.es-back a::before {
  content: '←';
}
/* tap-44 */
.es-back a::after {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 100%;
  height: 2.75rem;
  transform: translateY(-50%);
}
.es-back a:hover {
  color: var(--espero-orange);
}

.es-product-head {
  padding: 8rem 0 5rem !important; /* pt-32 pb-20 */
}
@media (min-width: 768px) {
  .es-product-head {
    padding: 10rem 0 6rem !important; /* md:pt-40 md:pb-24 */
  }
}
.es-product-head .et_pb_column {
  align-items: stretch !important;
  text-align: left;
  gap: 0 !important;
}
.es-product-main {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 3rem !important; /* gap-12 */
  margin-top: 2.5rem !important; /* mt-10 */
}
@media (min-width: 768px) {
  .es-product-main {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4rem !important; /* md:gap-16 */
    margin-top: 3.5rem !important; /* md:mt-14 */
  }
}
.es-product-main > .et_pb_column {
  width: 100% !important;
  margin: 0 !important;
}
.es-product-main > .et_pb_column:first-child {
  position: relative;
  display: flex !important;
  justify-content: center;
  align-items: center !important; /* sloupec Divi je flex-column: vodorovně na střed */
}
/* Teplá záře za lahví */
.es-product-main > .et_pb_column:first-child::before {
  content: '';
  position: absolute;
  bottom: 6%;
  left: 50%;
  width: 85%;
  height: 55%;
  transform: translateX(-50%);
  border-radius: 9999px;
  background: radial-gradient(ellipse at center, rgba(234, 176, 131, 0.55), rgba(248, 234, 197, 0.25) 45%, transparent 72%);
  filter: blur(26px);
  pointer-events: none;
}
.es-product-image {
  position: relative;
  width: auto !important;
  margin: 0 !important;
}
.es-product-image img {
  display: block;
  width: auto !important;
  height: 380px !important;
  max-width: 100% !important; /* jako Tailwind preflight: na úzkém displeji se zúží */
  user-select: none;
}
@media (min-width: 640px) {
  .es-product-image img {
    height: 440px !important;
  }
}
@media (min-width: 768px) {
  .es-product-image img {
    height: 500px !important;
  }
}
@media (min-width: 1024px) {
  .es-product-image img {
    height: 560px !important;
  }
}

.es-product-head .es-product-text,
.es-product-text {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 1.5rem !important; /* gap-6 */
}
:where(.es-product-text .et_pb_module) {
  margin: 0 !important;
}
.es-product-title :is(h1, h2) {
  margin: 0;
  padding: 0 !important;
  font-family: var(--font-display) !important;
  font-weight: 700 !important;
  font-size: clamp(2.2rem, 5vw, 3.6rem) !important;
  line-height: 1.05 !important;
  text-transform: uppercase;
  color: var(--espero-ink) !important;
}
.es-product-desc p {
  max-width: 36rem;
  margin: 0;
  padding: 0 !important;
  font-size: 15px;
  line-height: 1.625;
  color: rgb(42 26 16 / 0.8);
}
@media (min-width: 768px) {
  .es-product-desc p {
    font-size: 1rem;
  }
}
/* Popisek a štítky tónů leží v jednom bloku (`gap-3`), ne `gap-6`. */
.es-product-text .es-notes {
  margin-top: -0.75rem !important;
}
.es-notes-label p {
  margin: 0;
  padding: 0 !important;
  font-size: 12px;
  line-height: 1.5;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--espero-inkmuted);
}
.es-notes ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem; /* gap-2.5 */
  margin: 0;
  padding: 0 !important;
  list-style: none !important;
}
.es-notes li {
  margin: 0;
  padding: 0.375rem 0.875rem; /* px-3.5 py-1.5 */
  border: 1px solid rgb(42 26 16 / 0.2);
  border-radius: 9999px;
  background-color: rgb(255 248 239 / 0.4);
  font-size: 12px;
  line-height: 1.5;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgb(42 26 16 / 0.85);
  list-style: none !important;
}

/* --- Další produkty --- */
.es-related {
  padding: 1rem 0 6rem !important; /* pt-4 pb-24 */
}
@media (min-width: 768px) {
  .es-related {
    padding-bottom: 8rem !important; /* md:pb-32 */
  }
}
.es-related-head .et_pb_column {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 1rem !important; /* gap-4 */
  text-align: center;
  --es-rule-gap: 1rem;
}
:where(.es-related-head .et_pb_module) {
  margin: 0 !important;
}
.es-related-title :is(h1, h2) {
  margin: 0;
  padding: 0 !important;
  font-family: var(--font-display) !important;
  font-weight: 700 !important;
  font-size: clamp(1.7rem, 3.2vw, 2.5rem) !important;
  line-height: 1.1 !important;
  text-transform: uppercase;
  color: var(--espero-ink) !important;
}
.es-related-title.es-rule::after {
  margin-left: auto;
  margin-right: auto;
}

/* ==========================================================================
   Karusel karet (v2 ProductCarousel.tsx, tón „light")
   Řádek karet `es-cards` v sekci `es-carousel`; JS přidá šipky a ukazatel.
   ========================================================================== */

.es-carousel .es-cards {
  position: relative;
  display: block !important; /* šipky a ukazatel nejsou položky flexu */
  width: 100% !important;
  max-width: 72rem !important; /* max-w-6xl */
  margin: 0.5rem auto 0 !important; /* mt-2 */
  padding: 0 !important;
}
@media (min-width: 768px) {
  .es-carousel .es-cards {
    margin-top: 1rem !important; /* md:mt-4 */
    padding: 0 4rem !important; /* md:px-16 */
  }
}
.es-carousel .es-cards > .et_pb_column {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 0 !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 1.25rem 2.5rem !important; /* px-10 py-5 */
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.es-carousel .es-cards > .et_pb_column::-webkit-scrollbar {
  display: none;
}
@media (min-width: 768px) {
  .es-carousel .es-cards > .et_pb_column {
    padding: 1.25rem 0 !important; /* md:px-0 */
  }
}
.es-carousel .es-card {
  flex: 0 0 100% !important;
  scroll-snap-align: center;
}
@media (min-width: 768px) {
  .es-carousel .es-card {
    flex-basis: 50% !important;
  }
}
@media (min-width: 1024px) {
  .es-carousel .es-card {
    flex-basis: calc(100% / 3) !important;
  }
}
/* Karta v karuselu: nižší box (232 / md 288), užší obrázek, oranžová záře.
   Box nemá šířku (v2 bez `w-full`), smrští se na obsah a `max-w-[74%]`
   obrázku se počítá z té šířky; proto i obaly Divi `display: contents`. */
.es-carousel .es-card .et_pb_main_blurb_image {
  width: auto !important;
  height: 232px;
}
/* v2 má u obrázku `sizes="(max-width: 767px) 45vw, 22vw"`: s `srcset` je to
   vlastní šířka obrázku, takže se box na mobilu a tabletu smrští na ni. */
.es-carousel .es-card .et_pb_main_blurb_image {
  max-width: 45vw;
}
@media (min-width: 768px) {
  .es-carousel .es-card .et_pb_main_blurb_image {
    max-width: 22vw;
  }
}
.es-carousel .es-card .et_pb_main_blurb_image > a,
.es-carousel .es-card .et_pb_image_wrap {
  display: contents !important;
}
@media (min-width: 768px) {
  .es-carousel .es-card .et_pb_main_blurb_image {
    height: 288px;
  }
}
.es-carousel .es-card img {
  max-height: 100%;
  max-width: 74% !important;
}
.es-carousel .es-card .et_pb_main_blurb_image::before {
  width: 130%;
  height: 45%;
  background: radial-gradient(ellipse at center, rgba(204, 104, 1, 0.28), rgba(204, 104, 1, 0.08) 45%, transparent 70%);
}
@media (prefers-reduced-motion: no-preference) {
  .es-carousel .es-card:hover img {
    transform: scale(1.03);
  }
}
.es-carousel .es-card h3 {
  margin-top: 2rem !important; /* mt-8 */
}
.es-carousel .es-card:hover h3 {
  color: var(--espero-ink) !important;
}

/* Šipky: svislý střed obrázku = odsazení dráhy 20 px + půlka boxu. */
.es-carousel-arrow {
  position: absolute;
  z-index: 10;
  top: 136px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  padding: 0;
  transform: translateY(-50%);
  border: 1px solid rgb(42 26 16 / 0.25);
  border-radius: 9999px;
  background: none;
  color: var(--espero-ink);
  transition:
    color 300ms var(--espero-ease-tw),
    border-color 300ms var(--espero-ease-tw),
    opacity 300ms var(--espero-ease-tw);
}
@media (min-width: 768px) {
  .es-carousel-arrow {
    top: 164px;
  }
}
.es-carousel-arrow:hover:not(:disabled) {
  border-color: var(--espero-orange);
  color: var(--espero-orange);
}
.es-carousel-arrow:disabled {
  opacity: 0.3;
}
.es-carousel-arrow--prev {
  left: 0.25rem;
}
.es-carousel-arrow--next {
  right: 0.25rem;
}
@media (min-width: 768px) {
  .es-carousel-arrow--prev {
    left: 0.5rem;
  }
  .es-carousel-arrow--next {
    right: 0.5rem;
  }
}
.es-carousel-arrow svg {
  width: 1.25rem;
  height: 1.25rem;
}
.es-carousel-progress {
  width: 16rem;
  max-width: 70%;
  height: 1px;
  margin: 3rem auto 0; /* mt-12 */
  background-color: rgb(42 26 16 / 0.15);
}
.es-carousel-progress > span {
  display: block;
  height: 1px;
  background-color: var(--espero-orange);
  transition: transform 150ms var(--espero-ease-tw);
}
.es-carousel-arrow[hidden],
.es-carousel-progress[hidden] {
  display: none;
}
