/**
 * Sprint 18.4.445 — Mobile search discovery (recent + buy again)
 * Full-screen panel when search is focused on mobile.
 * Desktop: no effect.
 */

@media (max-width: 767px) {
  .tf-msd {
    position: fixed;
    inset: 0;
    z-index: 120500;
    display: flex;
    flex-direction: column;
    background: #f7f8fa;
    font-family: Manrope, system-ui, -apple-system, sans-serif;
    overscroll-behavior: contain;
  }
  .tf-msd[hidden] {
    display: none !important;
  }

  .tf-msd__bar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    padding-top: calc(10px + env(safe-area-inset-top));
    background: #fff;
    border-bottom: 1px solid #eef1f5;
  }

  .tf-msd__back {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #1a2535;
    display: grid;
    place-items: center;
    cursor: pointer;
  }
  .tf-msd__back svg {
    width: 22px;
    height: 22px;
  }

  .tf-msd__field {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 12px 0 14px;
    border: 1.5px solid #c45b6e;
    border-radius: 999px;
    background: #fff;
  }
  .tf-msd__field input {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    font-size: 15px;
    font-weight: 500;
    color: #1a2535;
  }
  .tf-msd__field input::placeholder {
    color: #9aa3b2;
  }
  .tf-msd__mic {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #4a5568;
    display: grid;
    place-items: center;
    cursor: pointer;
  }
  .tf-msd__mic svg {
    width: 18px;
    height: 18px;
  }

  .tf-msd__body {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px 14px 28px;
  }

  .tf-msd__section {
    margin-bottom: 22px;
  }
  .tf-msd__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
  }
  .tf-msd__head h2 {
    margin: 0;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #1a2535;
  }
  .tf-msd__head button,
  .tf-msd__head a {
    border: 0;
    background: transparent;
    font-size: 13px;
    font-weight: 700;
    color: #8b3a4a;
    cursor: pointer;
    text-decoration: none;
    padding: 0;
  }

  .tf-msd__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .tf-msd__chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    padding: 8px 12px;
    border: 1px solid #e4e8ef;
    border-radius: 999px;
    background: #fff;
    color: #1a2535;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
  }
  .tf-msd__chip span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 160px;
  }
  .tf-msd__chip i {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #7a8799;
    font-style: normal;
    font-size: 12px;
    line-height: 1;
  }

  .tf-msd__empty {
    font-size: 13px;
    color: #7a8799;
    margin: 0;
  }

  .tf-msd__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .tf-msd__card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border-radius: 14px;
    border: 1px solid #eef1f5;
    overflow: hidden;
  }
  .tf-msd__card-img {
    position: relative;
    aspect-ratio: 1;
    background: #f3f5f8;
  }
  .tf-msd__card-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
  }
  .tf-msd__card-body {
    padding: 10px 10px 12px;
  }
  .tf-msd__card-body strong {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #1a2535;
    line-height: 1.35;
    margin-bottom: 4px;
  }
  .tf-msd__card-body small {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 12px;
    color: #5b6b7c;
    line-height: 1.35;
  }
  .tf-msd__price {
    display: block;
    margin-top: 6px;
    font-size: 14px;
    font-weight: 800;
    color: #0a2550;
  }
}

@media (min-width: 768px) {
  .tf-msd {
    display: none !important;
  }
}

/* Suggestions inside discovery body */
@media (max-width: 767px) {
  .tf-msd__suggest {
    margin-bottom: 18px;
  }
  .tf-msd__suggest-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: #fff;
    border: 1px solid #eef1f5;
    border-radius: 14px;
    overflow: hidden;
  }
  .tf-msd__suggest-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    text-decoration: none;
    color: #1a2535;
    border-bottom: 1px solid #f1f4f8;
  }
  .tf-msd__suggest-item:last-child {
    border-bottom: 0;
  }
  .tf-msd__suggest-item img,
  .tf-msd__suggest-ico {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    object-fit: cover;
    background: #f3f5f8;
    flex: 0 0 36px;
    display: grid;
    place-items: center;
    color: #6b7f96;
  }
  .tf-msd__suggest-ico svg {
    width: 18px;
    height: 18px;
  }
  .tf-msd__suggest-copy {
    min-width: 0;
    flex: 1 1 auto;
  }
  .tf-msd__suggest-copy strong {
    display: block;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
  }
  .tf-msd__suggest-copy small {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    color: #7a8799;
  }
  .tf-msd__suggest-type {
    flex: 0 0 auto;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #8b3a4a;
  }
  .tf-msd__suggest-status {
    font-size: 12px;
    color: #7a8799;
    padding: 8px 4px;
    margin: 0;
  }
}
