/*
 * Main menu: subcategory panel with images (inc/mega-menu.php, js/mega-menu.js).
 *
 * Desktop (>= 1025px): a panel under the item, opened by hover (with a delay, set by the
 * script), keyboard focus or touch. Without the script it still opens on hover and focus.
 * Mobile: no panel; the mobile menu keeps plain links (see inc/mega-menu.php).
 */

/* Panel */
@media only screen and (min-width: 1025px) {
  /* Top-level items keep the theme's highlight color on hover; an item whose panel is open
     (by touch or keyboard) shows it too. */
  .site-header .main-navigation ul li.ryanne-has-mega.is-open > a,
  .site-header .main-navigation ul li.ryanne-has-mega:focus-within > a {
    color: var(--secondary-color); }

  /* The panel is as wide as the header content, not as the (short) list of items. */
  .site-header .header-main-wrapper {
    position: relative; }

  .site-header .main-navigation ul li.ryanne-has-mega {
    position: static; }

  /* The theme draws its chevron on the <li>, which no longer positions it: use the link. */
  .site-header .main-navigation ul li.ryanne-has-mega::after {
    content: none; }

  .site-header .main-navigation ul li.ryanne-has-mega > a::before {
    content: "";
    position: absolute;
    right: -14px;
    top: 50%;
    width: 10px;
    height: 10px;
    margin-top: -5px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6l6 -6'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6l6 -6'/%3E%3C/svg%3E") center / contain no-repeat;
    transition: transform 0.18s ease; }

  .site-header .main-navigation ul li.ryanne-has-mega.is-open > a::before,
  .site-header .main-navigation ul li.ryanne-has-mega:focus-within > a::before {
    transform: rotate(180deg); }

  .site-header .main-navigation ul li.ryanne-has-mega > ul.sub-menu {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    gap: 22px 18px;
    align-content: start;
    left: 0;
    top: 100%;
    width: min(980px, 100%);
    padding: 26px 28px 20px;
    border-top: 2px solid var(--primary-color);
    border-radius: 0 0 14px 14px;
    background: var(--white-color);
    box-shadow: 0 22px 44px rgba(10, 35, 43, 0.16);
    clip: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s; }

  /* Open: keyboard focus always; hover only until the script takes over the timing. */
  .site-header .main-navigation ul li.ryanne-has-mega.is-open > ul.sub-menu,
  .site-header .main-navigation ul li.ryanne-has-mega:focus-within > ul.sub-menu,
  html:not(.ryanne-mega-js) .site-header .main-navigation ul li.ryanne-has-mega:hover > ul.sub-menu {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition-delay: 0s; }

  /* The theme's own hover rule would show the panel at once: only the script decides. */
  html.ryanne-mega-js .site-header .main-navigation ul li.ryanne-has-mega:not(.is-open):not(:focus-within):hover > ul.sub-menu {
    opacity: 0;
    visibility: hidden; }

  .site-header .main-navigation ul li.ryanne-has-mega > ul.sub-menu > li {
    display: block;
    font-size: 1em; }

  /* The theme paints a hovered or current submenu link white on lime: not in this panel. */
  .site-header .main-navigation ul li.ryanne-has-mega > ul.sub-menu li:hover > a,
  .site-header .main-navigation ul li.ryanne-has-mega > ul.sub-menu li:focus-within > a,
  .site-header .main-navigation ul li.ryanne-has-mega > ul.sub-menu li.current-menu-item > a {
    background: none;
    color: inherit; }

  /* Subcategory card */
  .site-header .main-navigation ul li.ryanne-has-mega > ul.sub-menu .ryanne-mega-item > a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 0;
    text-align: center;
    text-transform: none; }

  /* Sub-subcategories under the card name */
  .site-header .main-navigation ul li.ryanne-has-mega > ul.sub-menu .ryanne-mega-item > ul.sub-menu {
    position: static;
    display: block;
    width: auto;
    margin: 8px 0 0;
    padding: 0;
    background: none;
    box-shadow: none;
    border: 0;
    clip: auto;
    opacity: 1;
    visibility: visible;
    transform: none; }

  .site-header .main-navigation ul li.ryanne-has-mega > ul.sub-menu .ryanne-mega-subitem {
    display: block;
    font-size: 0.75rem; }

  .site-header .main-navigation ul li.ryanne-has-mega > ul.sub-menu .ryanne-mega-subitem > a {
    display: block;
    margin: 0;
    padding: 3px 0;
    text-align: center;
    text-transform: none;
    font-weight: 400;
    color: var(--ry-color-light-gray, #5d707a);
    transition: color 0.18s ease; }

  .site-header .main-navigation ul li.ryanne-has-mega > ul.sub-menu .ryanne-mega-subitem > a:hover {
    color: var(--light-black, #383838); }

  /* "See all in ..." */
  .site-header .main-navigation ul li.ryanne-has-mega > ul.sub-menu > .ryanne-mega-all {
    grid-column: 1 / -1;
    padding-top: 14px;
    border-top: 1px solid rgba(10, 35, 43, 0.08);
    text-align: right; }

  .site-header .main-navigation ul li.ryanne-has-mega > ul.sub-menu .ryanne-mega-all > a {
    display: inline-block;
    margin: 0;
    padding: 4px 0;
    text-transform: none;
    font-weight: 600;
    color: var(--ry-color-light-gray, #5d707a);
    transition: color 0.18s ease; }

  .site-header .main-navigation ul li.ryanne-has-mega > ul.sub-menu .ryanne-mega-all > a:hover {
    color: var(--light-black, #383838); } }

/* Card parts (both layouts) */
.ryanne-mega-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--ry-color-bg, #f5f5f5);
  transition: box-shadow 0.18s ease; }

.ryanne-mega-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply; }

.ryanne-mega-thumb.is-empty {
  color: var(--ry-color-light-gray, #5d707a);
  opacity: 0.55; }

.ryanne-mega-thumb .ryanne-icon {
  width: 38%;
  height: 38%; }

.ryanne-mega-name {
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ry-color-light-gray, #5d707a);
  transition: color 0.18s ease; }

@media only screen and (min-width: 1025px) {
  .ryanne-mega-item .ryanne-mega-thumb {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 12px; }

  .ryanne-mega-item .ryanne-mega-thumb img {
    padding: 10px; }

  .ryanne-mega-item.current-menu-item > a .ryanne-mega-thumb,
  .ryanne-mega-item > a:hover .ryanne-mega-thumb,
  .ryanne-mega-item > a:focus-visible .ryanne-mega-thumb {
    box-shadow: 0 0 0 2px var(--ry-color-light-gray, #5d707a); }

  .ryanne-mega-item > a:hover .ryanne-mega-name,
  .ryanne-mega-item > a:focus-visible .ryanne-mega-name {
    color: var(--light-black, #383838); } }
