"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MobileTitleWrapper = exports.Wrapper = void 0;
const styled_1 = require("../styled");
const constants_1 = require("./constants");
exports.Wrapper = styled_1.styled.header `
  display: grid;
  grid-column: 1 / -1;
  grid-row: 1;
  grid-template-columns: min-content 1fr auto;
  grid-template-rows: repeat(4, auto);
  order: 2;

  padding: ${({ theme }) => theme.spacing(0, 6)};

  ${({ theme }) => theme.breakpoints.down('laptop')} {
    padding: ${({ theme }) => theme.spacing(0, 4)};

    &.${constants_1.pageHeaderClassnames.hasActions} {
      grid-template-columns: min-content 1fr auto auto;
    }
  }

  ${({ theme }) => theme.breakpoints.down('sm')} {
    position: sticky;
    z-index: ${({ theme }) => theme.zIndex.fab};
    top: ${constants_1.PAGE_HEADER_HEIGHT_MOBILE};

    display: block;

    margin-bottom: ${({ theme }) => theme.spacing(4)};
    padding: unset;

    background-color: ${({ theme }) => theme.palette.background.default};
  }

  .${constants_1.pageHeaderClassnames.filters} {
    grid-column: 1 / -1;
    grid-row: 4;

    ${({ theme }) => theme.breakpoints.down('laptop')} {
      grid-column: 3;
      grid-row: 1 / -1;
    }

    ${({ theme }) => theme.breakpoints.down('sm')} {
      border-bottom: 1px solid ${({ theme }) => theme.palette.components.border.default};
    }
  }

  .${constants_1.pageHeaderClassnames.quickFilters} {
    grid-column: 1 / -1;
    grid-row: 5;

    margin-top: ${({ theme }) => theme.spacing(4)};

    ${({ theme }) => theme.breakpoints.down('laptop')} {
      margin-top: ${({ theme }) => theme.spacing(3)};
    }

    ${({ theme }) => theme.breakpoints.down('sm')} {
      display: none;
    }
  }
`;
exports.MobileTitleWrapper = styled_1.styled.div `
  display: none;

  ${({ theme }) => theme.breakpoints.down('sm')} {
    position: sticky;
    z-index: ${({ theme }) => theme.zIndex.fab};
    top: 0;
    
    align-items: center;
    order: 1;
    
    background-color: ${({ theme }) => theme.palette.background.default};

    /* Причина игнора: прогрессивное улучшение */
    /* stylelint-disable plugin/no-unsupported-browser-features */
    &:not(:has(+ .${constants_1.pageHeaderClassnames.root} :is(
      .${constants_1.pageHeaderClassnames.filters},
      .${constants_1.pageHeaderClassnames.subheader}
    ))) {
      border-bottom: 1px solid ${({ theme }) => theme.palette.components.border.default};
    }
    /* stylelint-enable plugin/no-unsupported-browser-features */

    &.${constants_1.pageHeaderClassnames.hasTitle} {
      display: flex;

      height: ${constants_1.PAGE_HEADER_HEIGHT_MOBILE};
      min-height: ${constants_1.PAGE_HEADER_HEIGHT_MOBILE};
      padding: ${({ theme }) => theme.spacing(4)};
    }

    &.${constants_1.pageHeaderClassnames.hasBackButton} {
      padding: ${({ theme }) => theme.spacing(0, 4, 0, 1)};
    }
  }
`;
