/*
 * Menu v3 (inc/menu-v3.php): text dropdowns, the phone accordion and the
 * „Вид подарък" chips above the product grid. Loaded only when the option
 * emocia_menu_v3 is 1. The panel itself (.ae-dd: position, green surface,
 * open/close) is still style.css; this file only lays out what is inside it.
 */

/* ---------------------------------------------------------------- desktop */

/*
 * The panel keeps the green descent of style.css (--dd-bg), the surface the
 * menu had before v3 (Таня, 29 October: dark again). Text is light on it, and
 * the one light surface is the card, so the eye lands on it.
 */
.ae-nav--v3 .ae-dd--v3 {
  background: var(--dd-bg);
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 34px 60px rgba(34, 8, 12, 0.4);
}

/* The open item sits on a soft green pill, so it is clear which panel is open. */
.ae-nav--v3 .ae-nav-link { isolation: isolate; }
.ae-nav--v3 .ae-nav-link::before {
  content: "";
  position: absolute;
  inset: -6px -12px;
  z-index: -1;
  border-radius: 10px;
  background: var(--brand-green-pale);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.ae-nav--v3 .ae-nav-item.is-open > .ae-nav-link { color: var(--brand-green-dark); }
.ae-nav--v3 .ae-nav-item.is-open > .ae-nav-link::before { opacity: 1; }
.ae-nav--v3 .ae-nav-item.is-open > .ae-nav-link::after { transform: scaleX(0); }

.ae-dd3 {
  max-width: 1280px;
  margin: 0 auto;
  /* 56px on top clears the logo medallion's overhang. */
  padding: 44px 32px 30px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  /* Column gap = tile gap, so the fourth tile lines up under the card. */
  gap: 26px 32px;
  text-align: left;
}
.ae-dd3.has-card { grid-template-columns: minmax(0, 1fr) 340px; }
.ae-dd3-card { grid-column: 2; grid-row: 1; }

.ae-dd3-cols { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 30px 48px; }
.ae-dd3-col { flex: 1 1 190px; min-width: 180px; max-width: 300px; }
/* Long single lists (По повод, Видове продукти) flow into columns of their own. */
.ae-dd3-col--wide { flex-basis: 100%; max-width: none; }
.ae-dd3-col--wide .ae-dd3-list { columns: 3 200px; column-gap: 48px; }

.ae-dd3-title,
.ae-dd3-title:visited {
  display: block;
  margin: 0 0 12px;
  padding-bottom: 11px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  font-family: var(--font-primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--brand-green-light);
  text-decoration: none;
}
a.ae-dd3-title:hover { color: var(--brand-white, #fff); }

.ae-dd3-list { list-style: none; margin: 0; padding: 0; }
.ae-dd3-list li { margin: 0; padding: 0; break-inside: avoid; }
.ae-dd3-list a,
.ae-dd3-list a:visited {
  display: inline-block;
  padding: 6px 0;
  font-family: var(--font-primary);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--brand-white, #fff);
  text-decoration: none;
  transition: color 0.2s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
/* A red line draws itself under the word on hover. */
.ae-dd3-list a span {
  background: linear-gradient(90deg, var(--brand-green-light), var(--brand-white, #fff)) 0 100% / 0 1.5px no-repeat;
  padding-bottom: 2px;
  transition: background-size 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.ae-dd3-list a:hover { color: var(--brand-white, #fff); transform: translateX(3px); }
.ae-dd3-list a:hover span { background-size: 100% 1.5px; }

/* --- product tiles under the columns (Таня, 28 October: as on Aeterna) --- */
.ae-dd3-tiles {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}
/* With a card the last track is the card's, so tile 4 sits exactly under it. */
.ae-dd3.has-card .ae-dd3-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)) 340px; }
.ae-dd3-tile,
.ae-dd3-tile:visited { display: flex; flex-direction: column; gap: 8px; color: var(--brand-white, #fff); text-decoration: none; }
/* A fixed, low photo band: the whole panel must fit the screen with no inner
   scroll (Таня, 28 October), so the tiles stay short. */
.ae-dd3-tile-img { display: block; height: 150px; border-radius: 12px; overflow: hidden; background: rgba(255, 255, 255, 0.08); box-shadow: 0 10px 24px rgba(20, 34, 26, 0.3); }
.ae-dd3-tile-img img, .ae-dd3-tile-img video { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1); }
.ae-dd3-tile:hover .ae-dd3-tile-img img { transform: scale(1.05); }
/* Names are capped at two lines and the price sits at the bottom of every
   tile, so the three prices line up whatever the title length (Таня, 28 Oct). */
.ae-dd3-tile-name { font-family: var(--font-primary); font-size: 14.5px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ae-dd3-tile:hover .ae-dd3-tile-name { color: var(--brand-green-light); }
.ae-dd3-tile-price { display: inline-flex; align-items: center; gap: 6px; margin-top: auto; font-family: var(--font-primary); font-size: 14px; font-weight: 700; color: var(--brand-green-light); }
.ae-dd3-tile-price del { font-weight: 500; opacity: 0.55; }
.ae-dd3-tile-price ins { text-decoration: none; }
.ae-dd3-tile-price svg { transition: transform 0.25s ease; }
.ae-dd3-tile:hover .ae-dd3-tile-price svg { transform: translateX(4px); }
.ae-nav-item.is-open .ae-dd3-tiles { animation: aeUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) 0.18s both; }


.ae-dd3-all,
.ae-dd3-all:visited {
  grid-column: 1 / -1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: -6px;
  font-family: var(--font-primary);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--brand-white, #fff);
  text-decoration: none;
}
.ae-dd3-all svg { transition: transform 0.25s ease; }
.ae-dd3-all:hover { color: var(--brand-green-light); }
.ae-dd3-all:hover svg { transform: translateX(4px); }

/* --- the card --- */
.ae-dd3-card,
.ae-dd3-card:visited {
  align-self: start;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  overflow: hidden;
  background: var(--brand-white, #fff);
  color: #1f2a22;
  text-decoration: none;
  box-shadow: 0 18px 40px rgba(20, 34, 26, 0.35);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease;
}
.ae-dd3-card:hover { transform: translateY(-4px); box-shadow: 0 26px 50px rgba(20, 34, 26, 0.45); color: #1f2a22; }

.ae-dd3-card-img { display: block; height: 150px; background: var(--brand-green-pale); overflow: hidden; }
.ae-dd3-card-img img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1); }
/* Every photo fills the frame edge to edge (Таня, 27 October: no white bands). */
.ae-dd3-card:hover .ae-dd3-card-img img { transform: scale(1.05); }

.ae-dd3-card-body { display: flex; flex-direction: column; padding: 16px 20px 18px; }
.ae-dd3-card-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--brand-green-dark); }
.ae-dd3-card-title { margin: 6px 0 0; font-size: 18px; font-weight: 700; line-height: 1.25; color: #1f2a22; }
.ae-dd3-card-text { margin: 6px 0 0; font-size: 13px; line-height: 1.5; color: rgba(31, 42, 34, 0.78); }
.ae-dd3-card-cta {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 9px 16px;
  border-radius: 8px;
  background: linear-gradient(150deg, #a3222c 0%, var(--brand-red-dark) 60%, #6d0f18 100%);
  color: var(--brand-white, #fff);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.4px;
  transition: background 0.25s ease, color 0.25s ease;
}
.ae-dd3-card:hover .ae-dd3-card-cta { background: var(--brand-red-mid); color: var(--brand-white, #fff); }

/* Columns and card arrive a beat apart when the panel opens. */
.ae-nav-item.is-open .ae-dd3-col,
.ae-nav-item.is-open .ae-dd3-card { animation: aeUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) both; }
.ae-nav-item.is-open .ae-dd3-col:nth-child(2) { animation-delay: 0.05s; }
.ae-nav-item.is-open .ae-dd3-col:nth-child(3) { animation-delay: 0.1s; }
.ae-nav-item.is-open .ae-dd3-col:nth-child(n+4) { animation-delay: 0.15s; }
.ae-nav-item.is-open .ae-dd3-card { animation-delay: 0.12s; }

@media (max-width: 1240px) {
  .ae-dd3.has-card { grid-template-columns: minmax(0, 1fr) 290px; }
  .ae-dd3.has-card .ae-dd3-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)) 290px; }
  .ae-dd3-card-img { height: 140px; }
  .ae-dd3-tile-img { height: 130px; }
}

/* A short screen (small laptop) has no room for the tiles: the lists and the
   card come first, nothing is ever cut off. */
@media (max-height: 820px) {
  .ae-dd3-tiles { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .ae-nav-item.is-open .ae-dd3-col,
  .ae-nav-item.is-open .ae-dd3-card { animation: none; }
}

/* --- „Дигитални продукти" (Таня, 9 November): the one list, then three
   equal tall columns that move (the car diary's set photos taking turns,
   two card videos). --- */
.ae-dd3--online { grid-template-columns: 210px minmax(0, 1fr); }
.ae-dd3--online .ae-dd3-cols { grid-column: 1; grid-row: 1; }
.ae-dd3--online .ae-dd3-col { max-width: none; }

.ae-dd3-tiles--media,
.ae-dd3.has-card .ae-dd3-tiles--media {
  grid-column: 2;
  grid-row: 1;
  /* Portrait cards (Таня, 9 November): the whole square picture shows, with
     the title and price inside the card under it. Capped, so the panel never
     grows taller than the screen. */
  grid-template-columns: repeat(4, minmax(0, 270px));
  justify-content: start;
  gap: 28px;
  padding-top: 0;
  border-top: 0;
}
.ae-dd3-mtile,
.ae-dd3-mtile:visited {
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 14px 30px rgba(20, 34, 26, 0.35);
  color: var(--brand-white, #fff);
  text-decoration: none;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), background 0.25s ease;
}
.ae-dd3-mtile:hover { transform: translateY(-4px); background: rgba(255, 255, 255, 0.14); }
.ae-dd3-mtile-media { position: relative; display: block; aspect-ratio: 1; overflow: hidden; background: rgba(255, 255, 255, 0.08); }
.ae-dd3-mtile-media img,
.ae-dd3-mtile-media video { display: block; width: 100%; height: 100%; object-fit: cover; }
.ae-dd3-mtile-body { display: flex; flex-direction: column; gap: 5px; min-width: 0; flex: 1; padding: 14px 16px 16px; }
.ae-dd3-mtile-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; color: var(--brand-green-light); }
.ae-dd3-mtile:hover .ae-dd3-tile-name { color: var(--brand-green-light); }
.ae-dd3-mtile:hover .ae-dd3-tile-price svg { transform: translateX(4px); }
.ae-nav-item.is-open .ae-dd3-tiles--media { animation: aeUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) 0.08s both; }

/* The car diary: the sets' photos cross-fade with a slow zoom (menu-v3.js
   moves .is-on while the panel is open). One photo alone just drifts. */
.ae-dd3-mtile-media .ae-slide { position: absolute; inset: 0; opacity: 0; transform: scale(1.08); transition: opacity 0.9s ease, transform 3.4s ease-out; }
.ae-dd3-mtile-media .ae-slide.is-on { opacity: 1; transform: scale(1); }
.ae-nav-item.is-open .ae-dd3-mtile-media img.is-drift { animation: aeDrift 14s ease-in-out infinite alternate; }
@keyframes aeDrift {
  from { transform: scale(1.02) translate(0, 0); }
  to { transform: scale(1.16) translate(-4%, -3%); }
}

@media (max-width: 1240px) {
  .ae-dd3--online { grid-template-columns: 180px minmax(0, 1fr); }
  .ae-dd3-tiles--media,
  .ae-dd3.has-card .ae-dd3-tiles--media { gap: 20px; }
}

/* Short screens: the columns are the point here, so they stay, a little lower. */
@media (max-height: 820px) {
  .ae-dd3--online .ae-dd3-tiles--media { display: grid; grid-template-columns: repeat(4, minmax(0, 220px)); }
}

@media (prefers-reduced-motion: reduce) {
  .ae-nav-item.is-open .ae-dd3-mtile-media img.is-drift,
  .ae-nav-item.is-open .ae-dd3-tiles--media { animation: none; }
  .ae-dd3-mtile-media .ae-slide { transition: none; transform: none; }
}

/* ---------------------------------------------------------------- phone */

.ae-drawer .ae-acc { width: 100%; border-bottom: 1px solid rgba(255, 255, 255, 0.16); }

.ae-drawer .ae-acc-head,
.ae-drawer .ae-acc-head:hover,
.ae-drawer .ae-acc-head:focus {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 8px 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  font-family: var(--font-primary);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--brand-white, #fff) !important;
  cursor: pointer;
  text-align: left;
}
.ae-drawer .ae-acc--season .ae-acc-head { color: var(--brand-green-light, #cfe6d4) !important; }
.ae-acc-chev { display: inline-flex; transition: transform 0.3s ease; }
.ae-acc.is-open .ae-acc-chev { transform: rotate(180deg); }

.ae-acc-body { padding: 0 0 14px; display: flex; flex-direction: column; }
.ae-acc-body[hidden] { display: none; }

.ae-drawer .ae-acc-sub {
  margin: 10px 0 2px;
  padding: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  min-height: 0;
}
.ae-acc-note { margin: 10px 0 4px; font-size: 0.85rem; line-height: 1.5; color: rgba(255, 255, 255, 0.75); }
.ae-drawer .ae-acc-all { font-weight: 600; color: var(--brand-white, #fff); }

/* ------------------------------------------------- chips above the grid */

.evid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 18px;
  margin: 0 0 18px;
}

.evid-chips { display: flex; flex-wrap: wrap; gap: 8px; }

.evid-chip,
.evid-chip:visited {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border: 1px solid var(--brand-green-dark, #2f5a3a);
  border-radius: 999px;
  font-family: var(--font-primary);
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-green-dark, #2f5a3a);
  background: transparent;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}
.evid-chip:hover { background: rgba(47, 90, 58, 0.08); color: var(--brand-green-dark, #2f5a3a); }
.evid-chip.is-on,
.evid-chip.is-on:hover { background: var(--brand-green-dark, #2f5a3a); color: var(--brand-white, #fff); }

.evid-sort { display: flex; gap: 14px; font-size: 13px; }
.evid-sort-link,
.evid-sort-link:visited { color: var(--brand-black, #222); text-decoration: none; opacity: 0.7; }
.evid-sort-link:hover { opacity: 1; color: var(--brand-black, #222); }
.evid-sort-link.is-on { opacity: 1; font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }

@media (max-width: 640px) {
  .evid { justify-content: flex-start; }
  .evid-chips { flex-wrap: nowrap; overflow-x: auto; width: 100%; padding-bottom: 2px; scrollbar-width: none; }
  .evid-chips::-webkit-scrollbar { display: none; }
  .evid-chip { flex: 0 0 auto; }
}

/* Filter panel: a group's own values show once it is on. */
.eshop-opt[hidden], .eshop-group[hidden], .evid-chip[hidden] { display: none; }
.eshop-sub { display: none; margin-left: 18px; }
.eshop-opt:has(> .eshop-check input:checked) > .eshop-sub,
.eshop-opt:has(> .eshop-sub input:checked) > .eshop-sub { display: block; }

/* A row of six small portrait tiles under the columns (Таня, 10 November:
   the landscape band cut the pictures). Each tile shows the whole square
   photo (or the card's video), the name and the price under it. */
.ae-dd3 .ae-dd3-tiles.ae-dd3-tiles--row,
.ae-dd3.has-card .ae-dd3-tiles.ae-dd3-tiles--row { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 22px; }
.ae-dd3-tiles--row .ae-dd3-tile-img { height: auto; aspect-ratio: 1; background: #fff; }
.ae-dd3-tiles--row .ae-dd3-tile-name { font-size: 13.5px; }
.ae-dd3-tiles--row .ae-dd3-tile-price { font-size: 13.5px; }
@media (max-width: 1240px) {
  .ae-dd3 .ae-dd3-tiles.ae-dd3-tiles--row,
  .ae-dd3.has-card .ae-dd3-tiles.ae-dd3-tiles--row { gap: 16px; }
  .ae-dd3-tiles--row .ae-dd3-tile-img { height: auto; }
}

/* The general card shows its whole square picture (Таня, 10 November: the
   150px band cut it): picture on the left, text and button beside it. */
.ae-dd3.has-card:not(.ae-dd3--online) { grid-template-columns: minmax(0, 1fr) 420px; }
.ae-dd3:not(.ae-dd3--online) .ae-dd3-card { display: grid; grid-template-columns: 170px minmax(0, 1fr); align-items: center; align-self: start; }
.ae-dd3:not(.ae-dd3--online) .ae-dd3-card-img { width: 170px; height: 170px; aspect-ratio: 1; }
.ae-dd3:not(.ae-dd3--online) .ae-dd3-card-body { padding: 14px 18px 14px 18px; }
.ae-dd3:not(.ae-dd3--online) .ae-dd3-card-title { font-size: 17px; }
.ae-dd3:not(.ae-dd3--online) .ae-dd3-card-text { font-size: 12.5px; }
@media (max-width: 1240px) {
  .ae-dd3.has-card:not(.ae-dd3--online) { grid-template-columns: minmax(0, 1fr) 360px; }
  .ae-dd3:not(.ae-dd3--online) .ae-dd3-card { grid-template-columns: 140px minmax(0, 1fr); }
  .ae-dd3:not(.ae-dd3--online) .ae-dd3-card-img { width: 140px; height: 140px; }
}

/* „Виж всички" as a button at the right end of the links, where the general
   card was (Таня, 10 November); the tiles row stays under both. */
.ae-dd3.has-btn { grid-template-columns: minmax(0, 1fr) auto; }
.ae-dd3.has-btn > .ae-dd3-cols { grid-column: 1; grid-row: 1; }
.ae-dd3-all.ae-dd3-all--btn,
.ae-dd3-all.ae-dd3-all--btn:visited { grid-column: 2; grid-row: 1; align-self: end; justify-self: end; margin: 0; padding: 13px 22px; border-radius: 10px; background: linear-gradient(150deg, #a83341 0%, #7d141d 100%); color: #fff; font-size: 13px; letter-spacing: 1px; white-space: nowrap; box-shadow: 0 12px 26px rgba(40, 8, 12, 0.35); transition: transform 0.25s ease, box-shadow 0.25s ease; }
.ae-dd3-all.ae-dd3-all--btn:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 16px 32px rgba(40, 8, 12, 0.45); }
@media (max-width: 1024px) {
  .ae-dd3.has-btn { grid-template-columns: minmax(0, 1fr); }
  .ae-dd3-all.ae-dd3-all--btn { grid-column: 1; grid-row: auto; justify-self: start; }
}

/* „Дигитални продукти": the same red button, at the foot of the category
   list on the left, beside the tiles (Таня, 10 November). */
.ae-dd3.ae-dd3--online.has-btn { grid-template-columns: 210px minmax(0, 1fr); }
.ae-dd3--online .ae-dd3-all.ae-dd3-all--btn { grid-column: 1; grid-row: 1; align-self: end; justify-self: start; white-space: normal; max-width: 210px; line-height: 1.35; }
