/* MYLOVELYPET mobile layout and accessible off-canvas navigation. */
.nav-backdrop,
.nav-mobile-head,
.nav-mobile-actions {
  display: none;
}

/* Prevent decorative and grid content from creating sideways phone scrolling. */
html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

.header-inner,
.header-tools,
.brand-text,
.cp-auth-card,
.cp-main,
.product-body {
  min-width: 0;
}

.cp-form .cp-check {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  column-gap: 12px;
}

.cp-form .cp-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 3px 0 0;
  accent-color: #1256b1;
}

.cp-form .cp-check span {
  min-width: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 1050px) {
  body.menu-open {
    overflow: hidden;
  }

  body.menu-open .header {
    z-index: 100;
  }

  .nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1;
    display: block;
    background: rgba(4, 17, 39, .64);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .2s ease, visibility .2s ease;
  }

  .nav-backdrop.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .main-nav {
    position: fixed;
    inset: 0 0 0 auto;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: min(340px, 88vw);
    max-width: 100vw;
    height: 100vh;
    height: 100dvh;
    margin: 0;
    padding: 0 16px max(20px, env(safe-area-inset-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #fff;
    border: 0;
    border-left: 2px solid #d4ac65;
    box-shadow: -20px 0 55px rgba(0, 12, 32, .26);
    transform: translateX(105%);
    visibility: hidden;
    pointer-events: none;
    transition: transform .22s ease, visibility .22s ease;
  }

  .main-nav.open {
    display: flex;
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }

  .nav-mobile-head {
    display: flex;
    position: sticky;
    top: 0;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 75px;
    padding: 17px 3px;
    background: #fff;
    border-bottom: 2px solid #dec18b;
    color: #0c2b61;
    font: 700 1.1rem Georgia, serif;
  }

  .nav-mobile-head button {
    display: inline-grid;
    place-items: center;
    flex: 0 0 39px;
    height: 39px;
    padding: 0;
    border: 1px solid #d6c49f;
    border-radius: 10px;
    background: #fff8e8;
    color: #092c62;
    font-size: 1.1rem;
  }

  .main-nav a {
    width: 100%;
    padding: 14px 12px;
    border-bottom: 1px solid #edf1f8;
    border-radius: 8px;
    font-size: .98rem;
    line-height: 1.25;
    white-space: normal;
  }

  .main-nav a.active {
    background: #f9f2e4;
    color: #966418;
  }

  .nav-mobile-actions {
    display: grid;
    gap: 6px;
    margin-top: auto;
    padding: 19px 2px 6px;
  }

  .nav-mobile-actions a {
    background: #f1f5fb;
    border: 1px solid #d8e1ef;
    text-align: center;
    color: #123c7f;
  }
}

@media (max-width: 700px) {
  .header-inner {
    gap: 6px;
    min-height: 66px;
  }

  .brand {
    flex: 1 1 auto;
    min-width: 0;
    gap: 6px;
    overflow: hidden;
  }

  .brand img {
    width: 39px;
    height: 39px;
    flex: 0 0 39px;
  }

  .brand-text strong {
    font-size: clamp(.92rem, 4vw, 1.15rem);
    white-space: nowrap;
  }

  .brand-text small {
    font-size: .38rem;
    letter-spacing: .05em;
    white-space: nowrap;
  }

  .header-tools {
    gap: 3px;
    flex: 0 0 auto;
    margin-left: 0;
  }

  #focusSearch {
    display: none;
  }

  .header-signin {
    padding: 7px 8px;
  }

  .shopround,
  .mobile-menu {
    width: 37px;
    height: 37px;
    min-width: 37px;
  }

  .mobile-menu {
    display: inline-grid;
    place-items: center;
    padding: 4px;
    border: 1px solid #dce4ef;
    border-radius: 10px;
    font-size: 1.25rem;
  }

  .product-body h3 {
    overflow-wrap: anywhere;
  }

  .cp-auth,
  .cp-hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 420px) {
  .ribbon-item:nth-child(3) {
    display: none;
  }

  .top-ribbon .container {
    justify-content: center;
  }

  .brand img {
    width: 35px;
    height: 35px;
    flex-basis: 35px;
  }

  .brand-text small {
    display: none;
  }
}

@media (max-width: 360px) {
  .header-signin {
    display: none;
  }

  .brand-text strong {
    font-size: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav-backdrop,
  .main-nav {
    transition: none;
  }
}
