/* PneusPro 6.1.29 - cabecalho, busca mobile e logo do carrinho.
   Este arquivo nao e carregado na skin 9.0. */

/* Limita a imagem original da loja sem comprimir titulo ou botao Fechar.
   O mesmo HTML atende ao Fast Cart React e ao fallback nativo. */
body.pneuspro-theme.fast-cart-pneuspro:not(.pp-skin-90) .fast-cart-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
body.pneuspro-theme.fast-cart-pneuspro:not(.pp-skin-90) .fast-cart-store-logo {
  display: block;
  flex: 0 1 auto;
  width: auto;
  height: auto;
  min-width: 0;
  max-width: 112px;
  max-height: 48px;
  object-fit: contain;
}
body.pneuspro-theme.fast-cart-pneuspro:not(.pp-skin-90) .fast-cart-head > div {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 3px;
  min-width: 0;
}
body.pneuspro-theme.fast-cart-pneuspro:not(.pp-skin-90) .fast-cart-head strong {
  display: block;
  max-width: 100%;
  overflow-wrap: break-word;
}
body.pneuspro-theme.fast-cart-pneuspro:not(.pp-skin-90) .fast-cart-count {
  max-width: 100%;
  padding: 2px 6px;
  font-size: 11px;
  line-height: 1.2;
}
body.pneuspro-theme.fast-cart-pneuspro:not(.pp-skin-90) .fast-cart-close {
  flex: 0 0 40px;
  margin-left: auto;
}

/* Usa os mesmos eventos de abertura, fechamento e Escape da skin 9.0. */
body.pneuspro-theme:not(.pp-skin-90) .pp-mobile-search-panel {
  display: none;
}

@media (max-width: 767px) {
  /* A busca esta dentro de pp80-actions. display:contents permite que
     ela ocupe a segunda linha do grid, com logo e carrinho na primeira. */
  body.pneuspro-theme.pp-skin-80 .pp80-header__inner {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
  }
  body.pneuspro-theme.pp-skin-80 .pp80-actions {
    display: contents;
  }
  body.pneuspro-theme.pp-skin-80 .pp80-brand {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }
  body.pneuspro-theme.pp-skin-80 .pp80-brand a {
    min-width: 0;
    max-width: 100%;
  }
  body.pneuspro-theme.pp-skin-80 .pp80-brand img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 44px;
    object-fit: contain;
  }
  body.pneuspro-theme.pp-skin-80 .pp80-cart-hover {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }
  body.pneuspro-theme.pp-skin-80 .pp80-search,
  body.pneuspro-theme.pp-skin-80 .pp80-search:hover,
  body.pneuspro-theme.pp-skin-80 .pp80-search:focus-within {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    min-width: 0;
  }
  body.pneuspro-theme.pp-skin-80 .pp80-search input[type="text"],
  body.pneuspro-theme.pp-skin-80 .pp80-search:hover input[type="text"],
  body.pneuspro-theme.pp-skin-80 .pp80-search:focus-within input[type="text"] {
    flex: 1 1 0;
    min-width: 0;
    width: 0;
  }

  body.pneuspro-theme.fast-cart-pneuspro:not(.pp-skin-90) .fast-cart-head {
    gap: 10px;
  }
  body.pneuspro-theme.fast-cart-pneuspro:not(.pp-skin-90) .fast-cart-store-logo {
    max-width: 88px;
    max-height: 40px;
  }
  body.pneuspro-theme.fast-cart-pneuspro:not(.pp-skin-90) .fast-cart-head strong {
    font-size: 18px;
  }
  body.pneuspro-theme.fast-cart-pneuspro:not(.pp-skin-90) .fast-cart-kicker {
    font-size: 8px;
  }
  body.pneuspro-theme.fast-cart-pneuspro:not(.pp-skin-90) .fast-cart-count {
    font-size: 10px;
  }
  body.pneuspro-theme.fast-cart-pneuspro:not(.pp-skin-90) .fast-cart-close {
    flex-basis: 38px;
    width: 38px;
    height: 38px;
  }

  body.pneuspro-theme:not(.pp-skin-90) .pp-mobile-search-panel {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1700;
    visibility: hidden;
    pointer-events: none;
    transition: visibility 0s linear .24s;
  }
  body.pneuspro-theme:not(.pp-skin-90) .pp-mobile-search-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: rgba(0, 0, 0, .52);
    opacity: 0;
    transition: opacity .2s ease;
  }
  body.pneuspro-theme:not(.pp-skin-90) .pp-mobile-search-sheet {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    max-height: calc(100% - 24px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 18px 16px calc(24px + env(safe-area-inset-bottom));
    border-radius: 16px 16px 0 0;
    background: #fff;
    color: var(--pp-text, #17242d);
    transform: translateY(110%);
    transition: transform .24s ease;
  }
  body.pneuspro-theme:not(.pp-skin-90) .pp-mobile-search-panel.is-open {
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
  }
  body.pneuspro-theme:not(.pp-skin-90) .pp-mobile-search-panel.is-open .pp-mobile-search-backdrop {
    opacity: 1;
  }
  body.pneuspro-theme:not(.pp-skin-90) .pp-mobile-search-panel.is-open .pp-mobile-search-sheet {
    transform: translateY(0);
  }
  body.pneuspro-theme:not(.pp-skin-90) .pp-mobile-search-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
  }
  body.pneuspro-theme:not(.pp-skin-90) .pp-mobile-search-head strong {
    font-size: 18px;
  }
  body.pneuspro-theme:not(.pp-skin-90) .pp-mobile-search-head button {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: #f2f2f2;
    color: #333;
  }
  body.pneuspro-theme:not(.pp-skin-90) .pp-mobile-search-form {
    display: grid;
    gap: 10px;
    margin: 0;
  }
  body.pneuspro-theme:not(.pp-skin-90) .pp-mobile-search-field {
    display: flex;
    align-items: center;
    height: 50px;
    margin: 0;
    padding: 0 13px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: #fff;
  }
  body.pneuspro-theme:not(.pp-skin-90) .pp-mobile-search-field .fa {
    margin-right: 9px;
    color: #777;
  }
  body.pneuspro-theme:not(.pp-skin-90) .pp-mobile-search-field input {
    flex: 1 1 0;
    width: 100%;
    min-width: 0;
    height: 100%;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #333;
    font-family: inherit;
    font-size: 16px;
  }
  body.pneuspro-theme:not(.pp-skin-90) .pp-mobile-search-form .pp-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    height: 48px;
  }
  body.pneuspro-theme:not(.pp-skin-90).pp-search-open {
    overflow: hidden;
  }
}
