/*
Theme Name: Red Fox
Theme URI: https://solegraphics.com
Author: Sole
Author URI: https://wordpress.org
Description: A custom built FSE block theme for Red Fox.
Requires at least: 6.7
Tested up to: 6.9
Requires PHP: 8.3
Version: 1.0
Text Domain: redfox
*/
:root {
  interpolate-size: allow-keywords;
}

::selection {
  background-color: var(--wp--preset--color--red-fox);
  color: #fff;
}
::-moz-selection {
  background-color: var(--wp--preset--color--red-fox);
  color: #fff;
}

@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  @view-transition {
    navigation: none;
  }

  /* remove animation entirely */
  ::view-transition-old(*) {
    animation: none;
  }
  ::view-transition-new(*) {
    animation: none;
  }
}

body,
html {
  background-color: #fff;
  scroll-behavior: smooth;
}

.wp-site-blocks {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.wp-site-blocks > * + * {
  margin-block-start: 0 !important;
}

.wp-site-blocks > main {
  flex-grow: 1;
}

/* Typography Fixes and Enhancements */
.text-with-shadow {
  text-shadow: 0 1px 1px rgba(0, 0, 0, 1);
}
h1,
h2,
h3,
h4,
h5,
h6 {
  text-wrap: pretty;
}
p {
  text-wrap: pretty;
}

a {
  text-decoration: none;
}
a:not(.wp-block-button__link):hover,
a:not(.wp-block-button__link):focus-visible {
  text-decoration: underline;
  text-decoration-thickness: 0.125em;
  text-underline-offset: 0.25lh;
}
button {
  color: inherit;
}

/*=============================*\
|* General theme overrides     *|
\*=============================*/
@media (max-width: 781px) {
  .site-logo-wrapper {
    width: 140px;
    padding-top: 0.75rem !important;
    padding-bottom: 0.75rem !important;
  }
}

.wp-block-template-part > header nav a:hover,
.wp-block-template-part > header nav a:focus-visible {
  color: var(--wp--preset--color--red-fox) !important;
}
.wp-block-template-part > header .wp-block-redfox-popover:hover,
.wp-block-template-part > header .wp-block-redfox-popover:focus-visible {
  color: var(--wp--preset--color--red-fox) !important;
}

/*=============================*\
|* Mobile drawer transitions   *|
\*=============================*/
header .mobile-only.redfox-dialog-block dialog {
  z-index: 9999;
  transition:
    box-shadow 0.2s ease-in-out,
    transform 0.2s ease-in-out,
    display 0.2s allow-discrete;
  transform: translate(-100%);
  top: 0;
  left: 0;
  right: auto;
  bottom: 0;
  height: 100dvh;
}
header .mobile-only.redfox-dialog-block dialog[open] {
  transform: translate(0);
}
@starting-style {
  header .mobile-only.redfox-dialog-block dialog[open] {
    transform: translate(-100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  header .mobile-only.redfox-dialog-block dialog {
    transition: none !important;
  }
}

body:has(dialog[open]) {
  overflow: hidden;
}

/*=============================*\
|* Header Popover Transitions  *|
\*=============================*/
header .wp-block-redfox-popover-wrapper {
  position: relative;
}
header .wp-block-redfox-popover-wrapper [popover] {
  transition:
    scale 0.2s linear,
    opacity 0.2s linear,
    display 0.2s allow-discrete,
    overlay 0.2s allow-discrete;
  scale: 0.5;
  opacity: 0;
  transform-origin: center top;
}
header .wp-block-redfox-popover-wrapper [popover]:popover-open {
  transition:
    scale 0.6s
      linear(
        0,
        0.037 0.9%,
        0.162 2%,
        1.044 7.3%,
        1.187 8.9%,
        1.245 10.6%,
        1.242 11.6%,
        1.213 12.8%,
        0.985 18.4%,
        0.953 19.9%,
        0.94 21.5%,
        0.947 23.7%,
        1.003 29.3%,
        1.015 32.4%,
        0.996 43.3%,
        1
      ),
    opacity 0.2s linear,
    display 0.2s allow-discrete,
    overlay 0.2s allow-discrete;
  scale: 1;
  opacity: 1;
}
@starting-style {
  header .wp-block-redfox-popover-wrapper [popover]:popover-open {
    scale: 0.5;
    opacity: 0;
  }
}

/*=============================*\
|* Form Styles                 *|
\*=============================*/

/* Texty input types */
textarea,
select,
input[type="color"],
input[type="date"],
input[type="datetime"],
input[type="datetime-local"],
input[type="email"],
input[type="month"],
input[type="number"],
input[type="password"],
input[type="range"],
input[type="search"],
input[type="tel"],
input[type="text"],
input[type="time"],
input[type="url"],
input[type="week"] {
  box-sizing: border-box;
  display: block;
  background-color: var(--wp--preset--color--soft-neutral-translucent);
  width: 100%;
  min-height: 44px;
  font-family: var(--wp--preset--font-family--din-2014);
  padding: 0.5lh 1em !important;
  border: 1px solid transparent;
  font-size: 1rem !important;
}
.gfield_required {
  font-size: 1em !important;
  font-family: var(--wp--preset--font-family--din-2014) !important;
}
.gfield input,
.gfield select,
.gfield textarea {
  border-color: transparent !important;
}

label,
legend {
  font-family: var(--wp--preset--font-family--handoek) !important;
  text-transform: uppercase !important;
  font-weight: bold;
}
.gform-field-label--type-sub {
  font-family: var(--wp--preset--font-family--din-2014) !important;
  text-transform: none !important;
}

input[type="submit"] {
  font-family: var(--wp--preset--font-family--handoek) !important;
  text-transform: uppercase !important;
  font-weight: bold;
}

/*=============================*\
|* POSaBIT menu customizations *|
\*=============================*/
#posabit-app {
  position: relative;

  /* Colors */
  --pb-menu--color-primary: var(--wp--preset--color--soft-neutral);
  --pb-menu--color-primary-dark: var(--wp--preset--color--soft-neutral);
  --pb-menu--color-secondary: var(--wp--preset--color--red-fox);
  --pb-menu--primary-color: var(--wp--preset--color--red-fox);
  --pb-menu--color-secondary-dark: var(--wp--preset--color--faded-black);
  --pb-menu--color-accent: var(--wp--preset--color--red-fox);
  --pb-menu--color-accent-dark: var(--wp--preset--color--red-fox);

  /* Type Colors */
  --pb-menu--color-base-text: var(--wp--preset--color--faded-black);
  --pb-menu--color-muted-text: var(--wp--preset--color--muted-gray);
  --pb-menu--color-heading-text: var(--pb-menu--color-base-text);
  --pb-menu--color-sale-text: var(--wp--preset--color--red-fox);

  /* Typography */
  --pb-menu--font-heading: var(--wp--preset--font-family--handoek);
  --pb-menu--font-body: var(--wp--preset--font-family--din-2014);

  font-family: var(--pb-menu--font-body);
}
#posabit-app .loading-spinner .spinner {
  border-color: var(--pb-menu--color-secondary);
  border-right-color: transparent;
}
.product-card .product-card__image img {
  max-width: 100%;
  object-fit: cover;
}

.pb-sticky-cart-button {
  position: fixed;
  bottom: 5vh;
  right: 10vw;
  z-index: 10;
}
.pb-sticky-cart-button .wp-block-button__link {
  box-shadow: 0 4px 4px #21232299;
}
#posabit-app .menu-categories {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

#posabit-app .menu-category-card .card__media::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: #21232233;
}
#posabit-app .menu-category-card .card__title {
  background-color: transparent;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  font-size: 35px;
  color: #fff;
  text-align: center;
}
#posabit-app .menu-category-card a:hover .card__media::before,
#posabit-app .menu-category-card a:focus-visible .card__media::before {
  background-color: #b4221bcc;
}
#posabit-app .menu-category-card a .card__media {
  transition: scale 1.3s
    linear(
      0,
      0.037 0.9%,
      0.162 2%,
      1.044 7.3%,
      1.187 8.9%,
      1.245 10.6%,
      1.242 11.6%,
      1.213 12.8%,
      0.985 18.4%,
      0.953 19.9%,
      0.94 21.5%,
      0.947 23.7%,
      1.003 29.3%,
      1.015 32.4%,
      0.996 43.3%,
      1
    );
}
#posabit-app .menu-category-card a:hover .card__media,
#posabit-app .menu-category-card a:focus-visible .card__media {
  scale: 1.05;
}
@media (prefers-reduced-motion: reduce) {
  #posabit-app .menu-category-card a .card__media {
    transition: none !important;
  }
}
#posabit-app a {
  text-decoration: none;
}

#posabit-app .cart-item__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#posabit-app .menu-category-card,
#posabit-app .product-card__media,
#posabit-app .product__image,
#posabit-app .cart-item__media,
#posabit-app .product-card .product-card__image-wrapper,
#posabit-app .product-card .product-card__image img {
  aspect-ratio: 277/341;
}
#posabit-app .product-card .product-card__image--vendor {
  aspect-ratio: 1 / 1;
  height: auto;
  border-radius: 100vw;
  overflow: clip;
}
#posabit-app .cart-item__media,
#posabit-app .menu-category-card,
#posabit-app .product-card__media,
#posabit-app .product__image {
  border-radius: 50% / 20%;
  overflow: clip;
  mask-image: url("./assets/images/oblong-mask-shape.svg");
  mask-size: cover;
  mask-repeat: no-repeat;
}
#posabit-app .price {
  font-family: var(--wp--preset--font-family--handoek);
}
#posabit-app .app-button.app-button--primary {
  background-color: var(--wp--preset--color--red-fox);
  color: #fff;
}
#posabit-app .app-button {
  border-width: 2px;
}
#posabit-app .app-button.app-button--primary:hover,
#posabit-app .app-button.app-button--primary:focus-visible {
  background-color: #fff;
  color: var(--wp--preset--color--red-fox);
}

#posabit-app .app-button.app-button--secondary {
  color: var(--wp--preset--color--faded-black);
  background-color: #fff;
}
#posabit-app .app-button.app-button--secondary:hover,
#posabit-app .app-button.app-button--secondary:focus-visible {
  color: #fff;
  background-color: var(--wp--preset--color--faded-black);
}
#posabit-app .product-card__title,
#posabit-app .product__title {
  font-family: var(--wp--preset--font-family--din-2014);
  text-transform: none;
}

#posabit-app .search-input {
  background-color: var(--wp--preset--color--red-fox);
  color: #fff;
}

#posabit-app .select-group-searchable .search-input {
  background-color: var(--wp--preset--color--soft-neutral);
}
#posabit-app .select-group-searchable .search-input input {
  background-color: transparent;
}
#posabit-app .search-input input::placeholder {
  color: #fff !important;
}
#posabit-app .search-button {
  background-color: transparent;
  color: #fff;
}
#posabit-app .category-info-button {
  background-color: transparent;
}
#posabit-app .category-info-button svg {
  background-color: transparent;
}
#posabit-app .category-selection {
  background-color: var(--wp--preset--color--soft-neutral);
  fill: var(--wp--preset--color--faded-black) !important;
}
#posabit-app .category-selection .category-selection-input svg {
  fill: var(--wp--preset--color--faded-black) !important;
}
#posabit-app .category-selection .category-selection-input select {
  color: var(--wp--preset--color--faded-black) !important;
}
#posabit-app .app-button--blank,
#posabit-app .app-button--plain {
  background-color: transparent;
}
#posabit-app .clear-all {
  color: var(--wp--preset--color--red-fox);
}
#posabit-app .chip__dismiss {
  background-color: transparent;
}
#posabit-app .chip {
  background-color: var(--wp--preset--color--soft-neutral);
  color: var(--wp--preset--color--faded-black);
}
#posabit-app .app-accordion__summary button {
  text-transform: inherit;
}

@media (min-width: 800px) {
  #posabit-app .app-actions {
    grid-template-columns: 40px min-content 1fr min-content 220px;
  }
}

/*===============================*\
|* Responsive Visibility Helpers *|
\*===============================*/
@media (max-width: 781px) {
  .desktop-only {
    display: none !important;
  }
}
@media (min-width: 781px) {
  .mobile-only {
    display: none !important;
  }
}
