/* Menu lateral — mobile */

@media (min-width: 761px) {
  .head__menu-btn,
  .mobile-drawer {
    display: none !important;
  }
}

@media (max-width: 760px) {
  .head__menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 10px;
    background: #f0ebe3;
    color: var(--fg);
    cursor: pointer;
    flex-shrink: 0;
  }

  .head__menu-btn svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
  }

  .head__menu-btn:active {
    transform: scale(0.96);
  }

  .has-minimal-header .head__menu-btn {
    display: none !important;
  }

  .head .head__row {
    grid-template-columns: auto 1fr auto !important;
    grid-template-areas:
      "menu brand actions"
      "searchrow searchrow searchrow" !important;
  }

  .head__menu-btn {
    grid-area: menu;
  }

  .head .brand {
    grid-area: brand;
    min-width: 0;
  }

  .head__actions {
    grid-area: actions;
  }

  .mobile-drawer {
    position: fixed;
    inset: 0;
    z-index: 600;
    pointer-events: none;
    visibility: hidden;
  }

  .mobile-drawer.is-open {
    pointer-events: auto;
    visibility: visible;
  }

  body.mobile-drawer-open {
    overflow: hidden;
  }

  .mobile-drawer__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(13, 12, 10, 0.45);
    opacity: 0;
    transition: opacity 0.22s ease;
  }

  .mobile-drawer.is-open .mobile-drawer__backdrop {
    opacity: 1;
  }

  .mobile-drawer__panel {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(292px, 86vw);
    max-width: 100%;
    background: #fff;
    box-shadow: 4px 0 24px rgba(13, 12, 10, 0.12);
    transform: translateX(-105%);
    transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: calc(0.65rem + env(safe-area-inset-top, 0px)) 0 calc(1rem + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
  }

  .mobile-drawer.is-open .mobile-drawer__panel {
    transform: translateX(0);
  }

  .mobile-drawer__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.35rem 0.85rem 0.65rem;
    border-bottom: 1px solid rgba(42, 37, 32, 0.08);
  }

  .mobile-drawer__head .brand__logo {
    max-height: 40px !important;
    max-width: 40px !important;
  }

  .mobile-drawer__head .brand__name {
    font-size: 0.75rem !important;
  }

  .mobile-drawer__close {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: #f0ebe3;
    color: var(--fg);
    cursor: pointer;
  }

  .mobile-drawer__close svg {
    width: 20px;
    height: 20px;
  }

  .mobile-drawer__user {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem 0.85rem;
    margin: 0 0.65rem;
    border-radius: 12px;
    background: linear-gradient(180deg, #faf8f4 0%, #f5f0e8 100%);
    border: 1px solid rgba(42, 37, 32, 0.06);
  }

  .mobile-drawer__avatar {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-family: "Oswald", sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    color: #fff;
    background: var(--gold-deep, #9a7840);
  }

  .mobile-drawer__name {
    margin: 0 0 0.1rem;
    font-size: 0.875rem;
    font-weight: 800;
    color: var(--fg);
  }

  .mobile-drawer__email {
    margin: 0;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 52vw;
  }

  .mobile-drawer__section {
    padding: 0.5rem 0.65rem 0.25rem;
  }

  .mobile-drawer__section--muted {
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(42, 37, 32, 0.08);
  }

  .mobile-drawer__label {
    margin: 0 0 0.35rem;
    padding: 0 0.2rem;
    font-size: 0.625rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
  }

  .mobile-drawer__list {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .mobile-drawer__list--inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.65rem;
  }

  .mobile-drawer__link {
    display: block;
    padding: 0.55rem 0.5rem;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--fg);
    text-decoration: none;
  }

  .mobile-drawer__link:hover,
  .mobile-drawer__link:focus-visible {
    background: #f5f0e8;
    color: var(--gold-deep);
  }

  .mobile-drawer__link.is-active {
    background: rgba(197, 160, 89, 0.16);
    color: var(--gold-deep);
  }

  .mobile-drawer__link--sm {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.35rem 0.25rem;
  }

  .mobile-drawer__foot {
    padding: 0.65rem 0.85rem 0.35rem;
  }

  .mobile-drawer__logout {
    display: block;
    text-align: center;
    padding: 0.55rem;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--muted);
    text-decoration: none;
  }

  .mobile-drawer__cta {
    width: 100%;
    min-height: 44px;
    justify-content: center;
  }

  body.page-account .account-nav {
    display: none !important;
  }

  body.page-account .account-layout {
    grid-template-columns: 1fr;
  }
}

/* Menu lateral: perfil e atalhos úteis da conta (sem categorias) */
@media (max-width: 760px) {
  .mobile-drawer__panel {
    gap: 0;
  }

  .mobile-drawer__head {
    margin-bottom: 12px;
  }

  .md-perfil {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 12px;
    padding: 14px;
    border-radius: 16px;
    background: linear-gradient(135deg, #2a2117, #14100b);
    color: #fff;
    text-decoration: none;
  }

  .md-perfil__avatar {
    flex: 0 0 44px;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e3bf4c, #a8842c);
    color: #1b150d;
    font-size: 1.05rem;
    font-weight: 800;
  }

  .md-perfil__txt {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }

  .md-perfil__txt b {
    font-size: 0.95rem;
    font-weight: 800;
  }

  .md-perfil__txt small {
    overflow: hidden;
    font-size: 0.72rem;
    color: #c9bfa9;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .md-perfil__seta {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    margin-left: auto;
    color: var(--gold, #e3bf4c);
  }

  .md-atalhos {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 12px 12px 4px;
  }

  .md-atalho {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border: 1px solid rgba(42, 37, 32, 0.08);
    border-radius: 14px;
    background: #faf7f1;
    color: var(--fg);
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
  }

  .md-atalho.is-active {
    border-color: rgba(168, 132, 44, 0.45);
    background: #f6eedb;
  }

  .md-atalho__icone {
    position: relative;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #fff;
    color: var(--gold-deep, #8a6a1f);
  }

  .md-atalho__icone svg {
    width: 19px;
    height: 19px;
  }

  .md-atalho__icone i {
    position: absolute;
    top: -6px;
    right: -8px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--gold-deep, #8a6a1f);
    color: #fff;
    font-size: 0.65rem;
    font-style: normal;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
  }

  .md-entrar {
    margin: 0 12px;
    padding: 16px;
    border-radius: 16px;
    background: linear-gradient(135deg, #2a2117, #14100b);
    color: #fff;
  }

  .md-entrar b {
    display: block;
    font-size: 1rem;
  }

  .md-entrar p {
    margin: 4px 0 14px;
    font-size: 0.8rem;
    line-height: 1.45;
    color: #c9bfa9;
  }

  .md-entrar__btn {
    width: 100%;
    min-height: 44px;
    justify-content: center;
  }

  .md-entrar__criar {
    display: block;
    margin-top: 10px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--gold, #e3bf4c);
    text-align: center;
    text-decoration: none;
  }

  .md-lista {
    display: flex;
    flex-direction: column;
    margin: 16px 12px 0;
    padding-top: 12px;
    border-top: 1px solid rgba(42, 37, 32, 0.08);
  }

  .md-lista__titulo {
    margin: 0 0 4px;
    padding: 0 4px;
    font-size: 0.625rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
  }

  .md-lista a {
    padding: 11px 4px;
    border-radius: 10px;
    color: var(--fg);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
  }

  .md-lista a.is-active,
  .md-lista a:hover {
    color: var(--gold-deep);
  }

  .md-sair {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: auto 12px 0;
    padding: 14px 4px 4px;
    border-top: 1px solid rgba(42, 37, 32, 0.08);
    color: #9b3b2e;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
  }

  .md-sair svg {
    width: 18px;
    height: 18px;
  }
}

/* Foto de perfil no menu lateral */
@media (max-width: 760px) {
  .md-perfil__avatar {
    overflow: hidden;
  }

  .md-perfil__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}

/* Cards do menu em tom claro dourado (iguais ao card do perfil) */
@media (max-width: 760px) {
  .md-perfil,
  .md-entrar {
    border: 1px solid rgba(168, 132, 44, 0.28);
    background: linear-gradient(135deg, #fdf8ec 0%, #f5e6c4 100%);
    color: var(--fg);
  }

  .md-perfil__txt small,
  .md-entrar p {
    color: var(--muted);
  }

  .md-perfil__seta {
    color: var(--gold-deep, #8a6a1f);
  }

  .md-perfil__avatar {
    border: 2px solid #fff;
  }

  .md-entrar__criar {
    color: var(--gold-deep, #8a6a1f);
  }
}
