#main-menu .bg-brand-royal:hover {
  background-color: #edf3fa;
  color: #17212d;
}

#mega-menu .mega-cat {
  cursor: pointer;
}

html.ptn-search-open {
  overflow: hidden;
}

@media (max-width: 1023px) {
  body.ptn-drawer-open {
    overflow: hidden;
  }

  [data-menu-toggle] {
    display: flex;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
  }

  body.ptn-drawer-open [data-menu-toggle] span {
    display: none;
  }

  body.ptn-drawer-open [data-menu-toggle]::after {
    content: "";
    width: 32px;
    height: 32px;
    background: url("../images/header/drawer-close.svg") center / contain no-repeat;
  }

  .ptn-mobile-drawer {
    position: fixed;
    z-index: 49;
    inset: 80px 0 0;
    display: flex;
    font-family: "Noto Sans Thai", sans-serif;
  }

  .ptn-mobile-drawer[hidden],
  .ptn-mobile-drawer [hidden] {
    display: none !important;
  }

  .ptn-drawer-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    background: rgb(0 0 0 / 48%);
    border: 0;
    cursor: pointer;
  }

  .ptn-drawer-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: min(400px, calc(100% - 58px));
    height: 100%;
    margin-left: auto;
    padding: 32px 16px max(16px, env(safe-area-inset-bottom));
    background: #fff;
    box-shadow: -8px 0 24px rgb(23 33 45 / 12%);
  }

  .ptn-drawer-search {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 16px;
    min-height: 48px;
    padding: 0 16px;
    border: 1px solid #718197;
    border-radius: 99px;
  }

  .ptn-drawer-search img {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
  }

  .ptn-drawer-search input {
    flex: 1;
    min-width: 0;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #17212d;
    font: inherit;
    font-size: 16px;
  }

  .ptn-drawer-search input::placeholder {
    color: #4d5c70;
    opacity: 1;
  }

  .ptn-drawer-search:focus-within {
    border-color: #1519ab;
  }

  .ptn-drawer-search input:focus,
  .ptn-drawer-search input:focus-visible {
    border: 0;
    outline: 0 !important;
    box-shadow: none !important;
  }

  .ptn-drawer-search input::-webkit-search-cancel-button {
    display: none;
  }

  .ptn-drawer-search button {
    flex: 0 0 auto;
    padding: 4px 0;
    border: 0;
    background: none;
    color: #c9001a;
    font: inherit;
    font-size: 16px;
    cursor: pointer;
  }

  .ptn-drawer-scroll {
    flex: 1;
    min-height: 0;
    overflow: auto;
    scrollbar-width: none;
  }

  .ptn-drawer-scroll::-webkit-scrollbar {
    display: none;
  }

  .ptn-drawer-categories {
    display: grid;
    gap: 8px;
  }

  .ptn-drawer-category summary {
    display: flex;
    min-height: 64px;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    color: #17212d;
    font-size: 16px;
    font-weight: 600;
    line-height: 24px;
    list-style: none;
    cursor: pointer;
  }

  .ptn-drawer-category summary::-webkit-details-marker {
    display: none;
  }

  .ptn-drawer-category summary span {
    flex: 1;
    min-width: 0;
  }

  .ptn-drawer-category-icon {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    object-fit: contain;
  }

  .ptn-drawer-chevron {
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
  }

  .ptn-drawer-category[open] summary {
    background: #1519ab;
    color: #fff;
  }

  .ptn-drawer-category[open] summary img {
    filter: brightness(0) invert(1);
  }

  .ptn-drawer-category[open] .ptn-drawer-chevron {
    transform: rotate(180deg);
  }

  .ptn-drawer-category ul {
    margin: 12px 0 0 16px;
    padding: 0;
    list-style: none;
  }

  .ptn-drawer-category li {
    border-left: 1px solid #dce4ee;
  }

  .ptn-drawer-category li a {
    display: block;
    padding: 10px 20px;
    color: #17212d;
    font-size: 14px;
    line-height: 22px;
    text-decoration: none;
  }

  .ptn-drawer-category li a:hover {
    color: #1519ab;
    background: #edf3fa;
  }

  .ptn-drawer-results {
    min-height: 100%;
  }

  .ptn-drawer-results ul {
    margin: 0;
    padding: 0;
  }

  .ptn-drawer-results li {
    border-bottom: 1px solid #dce4ee;
    list-style: none;
  }

  .ptn-drawer-results li a {
    display: flex;
    min-height: 72px;
    align-items: center;
    gap: 24px;
    color: #17212d;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
  }

  .ptn-drawer-results li img {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
  }

  .ptn-drawer-results .ptn-drawer-more {
    display: block;
    padding: 20px 8px;
    color: #254c83;
    font-weight: 600;
    text-align: center;
  }

  .ptn-drawer-results .ptn-drawer-empty {
    padding: 28px 12px;
    color: #4d5c70;
    text-align: center;
  }

  .ptn-drawer-quote {
    display: flex;
    flex: 0 0 auto;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 12px;
    background: #1519ab;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
  }

  .ptn-drawer-quote img {
    width: 18px;
    height: 18px;
  }

  .ptn-mobile-drawer :focus-visible,
  [data-menu-toggle]:focus-visible {
    outline: 2px solid #1519ab;
    outline-offset: 3px;
  }
}

@media (min-width: 1024px) {
  .ptn-mobile-drawer {
    display: none !important;
  }
}
