:root {
  --nfmp-wp-primary: #2171B1;
  --nfmp-white: #fff;
  --nfmp-black: #000;
  --nfmp-titles: #1d2327;
  --nfmp-text: #3c434a;
  --nfmp-borders: rgab(0, 0, 0, .1);
}

html {
  @media screen and (min-width: 782px) {
    overflow: -moz-scrollbars-vertical;
    overflow-y: scroll;
  }
}

body.toplevel_page_web {
  a {
    color: var(--nfmp-wp-primary);
  }

  @media screen and (max-width:782px) {
    .wp-responsive-open #wpbody {
      right: -190px; // only when mobile admin menu open
    }
  }

  #wpwrap {
    background-color: var(--nfmp-white);
  }

  #wpcontent {
    padding-left: 0 !important;
  }

  #wpadminbar .ab-top-menu {
    li {
      transition: opacity .33s ease;
    }

    .hideme {
      max-height: 32px;
      opacity: 0;
      overflow: hidden;
      pointer-events: none;
      width: 0;
    }
  }

  #wpbody-content .notice,
  #wpbody-content #dolly,
  #wpbody-content .update-nag {
    display: none;
  }

  #wpbody-content .newfold-notifications-wrapper .notice {
    display: block;
  }
}

.wppw {
  color: var(--nfmp-text);

  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    font-weight: 500;
    margin: 0;
    color: var(--nfmp-titles);
  }

  .wppw-nav a {
    color: var(--nfmp-wp-primary);
  }

  p,
  div {
    color: var(--nfmp-text);
    font-size: 14px;
    font-weight: 400;
  }

  .components-button {
    font-size: 14px;
    font-weight: 400;
    transition: all 0.25s ease;
    white-space: nowrap;
    border: 1px solid var(--nfmp-wp-primary);
    border-radius: 3px;
    padding: 3px 12px;

    .dashicons,
    .dashicons-before:before {
      transition: all .25s ease;
    }

    &:focus:not(:disabled) {
      box-shadow: var(--nfmp-borders);
    }

    &.is-primary,
    &[variant="primary"] {
      background-color: var(--nfmp-wp-primary);
      color: var(--nfmp-white);
    }

    &.is-secondary,
    &[variant="secondary"] {
      box-shadow: var(--nfmp-borders);
      color: var(--nfmp-wp-primary);
      background-color: transparent;
    }

    &.has-icon {
      padding-right: 1rem;

      .dashicon {
        margin-right: 10px;
        /* <= WP 5.6 */
      }
    }
  }

  a:focus {
    box-shadow: var(--nfmp-borders);
    outline: 0;
  }

  .components-base-control__help,
  .components-radio-control__option label span span {
    color: var(--nfmp-text);
    margin-top: 0.25rem;
  }
}

.wppw,
.wppw * {
  box-sizing: border-box;
}

.wppw-app-body {
  padding: 18px 24px 0;

  &-inner {
    max-width: 1290px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
  }
}

.grid {
  display: grid;
  gap: clamp(0.5rem, calc(1rem + 1vw), 2rem);
  padding: 0.5rem;

  &.col2,
  &.col3,
  &.col4 {
    @media screen and (min-width: 768px) {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  }

  &.col3,
  &.col4 {
    @media screen and (min-width: 800px) {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }
  }

  &.col4 {
    @media screen and (min-width: 1020px) {
      grid-template-columns: repeat(4, minmax(0, 1fr));
    }
  }
}

.wppw {
  .components-card {

    &.short {
      margin-bottom: auto;
    }

    &.disabled {
      opacity: .5;
    }
  }

  .components-card-body,
  .components-card__body {

    &.disabled {
      opacity: .5;
    }
  }
}

.newfold-marketplace-tabs {
  display: flex;

  @media screen and (max-width: 600px) {
    flex-direction: column;
  }

  .components-tab-panel__tabs {
    display: flex;
    /* <= WP 5.4 */
    flex-direction: column;
    /* <= WP 5.6 */
    gap: 1.7rem;
    min-width: 175px;
    max-width: max-content;
    height: fit-content;
    margin-top: .5rem;
    margin-right: 2rem;
    padding: .8rem .8rem .8rem 0;
    background-color: var(--nfmp-white);
    border-radius: 1px;
    box-shadow: 0px 0px 0px 1px rgba(0, 0, 0, .1);

    @media screen and (max-width: 600px) {
      min-width: initial;
      flex-direction: row;
      gap: 1.9rem;
      overflow-y: scroll;
      margin-top: 0;
      margin: 0 .5rem 1rem .5rem;
      padding: .8rem .8rem 0 .8rem;
    }
  }

  .components-tab-panel__tabs-item {
    background: none;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
    border: none;
    border-radius: 1px;
    padding: 1px 3px;
    transition: none;
    height: auto;
    padding: 7px 0px 7px 20px;
    display: inline-flex;

    &:last-child {
      padding-right: 3px;
    }

    &:hover {
      color: var(--nfmp-wp-primary);
    }

    &.current-tab {
      color: var(--nfmp-wp-primary);
      border-left: 2.5px solid;
      border-color: var(--nfmp-wp-primary);
    }

    @media screen and (max-width: 600px) {
      padding: 7px 3px 13px 3px;

      &.current-tab {
        border-left: none;
        border-bottom: 2.5px solid;
      }
    }
  }

  .marketplace-item div:first-child {
    display: flex;
    flex-direction: column;

    .components-card__media {
      position: relative;
      background-color: #DDDBDD;

      img {
        aspect-ratio: 16 / 9;

        &::after {
          position: absolute;
          top: 0;
          right: 0;
          bottom: 0;
          left: 0;
          transform: translateX(-100%);
          background-image: linear-gradient(90deg,
              rgba(#fff, 0) 0,
              rgba(#fff, 0.2) 20%,
              rgba(#fff, 0.5) 60%,
              rgba(#fff, 0));
          animation: marketplace-skeleton 2s infinite;
          content: '';
        }

        @keyframes marketplace-skeleton {
          100% {
            transform: translateX(100%);
          }
        }

      }
    }

    .components-card__header {
      position: relative;
      border-bottom: none;
      flex-wrap: wrap;
      gap: 1rem;

      h3 {
        font-size: 16px;
        min-width: min-content;
        line-height: 1.4;
      }

      .price {
        margin: 0;
        background-color: rgba(33, 113, 177, 0.13);
        border-radius: 50px;
        color: #04253f;
        font-size: 16px;
        margin-left: 0;
        padding: 4px 12px;
        min-width: max-content;
      }
    }

    .components-card__body {
      flex-grow: 1;
      padding-top: 4px;
      padding-bottom: 22px;
      line-height: 1.6;
    }

  }
}