/* ========================================================================
   ZUVA Universal 9.3 — installed-app corrections only
   These rules do not alter the public desktop or responsive website design.
   ======================================================================== */

/* Shared cart surface token reused by the app confirmation screen. */
:root {
  --zuva-cart-surface: #fdfbf6;
  --zuva-app-nav-height: 76px;
}

/* Reusable, font-independent Saudi Riyal mark for custom app amounts. */
.zuva-money {
  display: inline-flex;
  align-items: baseline;
  justify-content: inherit;
  gap: .34em;
  white-space: nowrap;
  direction: ltr;
}
.zuva-money .zuva-sar-mark,
.zuva-sar-mark {
  display: inline-block;
  flex: 0 0 .78em;
  width: .78em;
  min-width: .78em;
  height: .9em;
  color: inherit;
  background-color: currentColor;
  -webkit-mask: url("../images/saudi-riyal-symbol.svg") center / contain no-repeat;
  mask: url("../images/saudi-riyal-symbol.svg") center / contain no-repeat;
  vertical-align: -.08em;
}
.zuva-money .woocommerce-Price-amount { display: inline; }

/* Installed PWA header: ZUVA | centered menu | Hakoura. */
@media (max-width: 782px) {
  html.zuva-pwa-standalone body.zuva-universal-theme.page-template-page-app .wp-site-blocks > header.wp-block-template-part,
  html.zuva-pwa-standalone body.zuva-universal-theme.page-template-page-app .zuva-site-header,
  html.zuva-pwa-standalone body.zuva-universal-theme .wp-site-blocks > header.wp-block-template-part {
    display: block !important;
  }

  html.zuva-pwa-standalone body.zuva-universal-theme .zuva-header-inner.zuva-app-header-row-93 {
    display: grid !important;
    grid-template-columns: 56px minmax(48px, 1fr) 56px !important;
    grid-template-rows: 78px !important;
    align-items: center !important;
    width: calc(100% - 28px) !important;
    height: 78px !important;
    min-height: 78px !important;
    max-height: 78px !important;
    margin-inline: auto !important;
    padding: 0 !important;
    gap: 10px !important;
  }

  html.zuva-pwa-standalone body.zuva-universal-theme .zuva-app-logo-slot-93 {
    grid-column: 1 !important;
    justify-self: start !important;
    align-self: center !important;
    margin: 0 !important;
  }
  html.zuva-pwa-standalone body.zuva-universal-theme .zuva-app-logo-slot-93 .wp-block-site-logo img,
  html.zuva-pwa-standalone body.zuva-universal-theme .zuva-app-logo-slot-93 img {
    display: block !important;
    width: 50px !important;
    height: 50px !important;
    max-width: 50px !important;
    object-fit: contain !important;
  }

  html.zuva-pwa-standalone body.zuva-universal-theme .zuva-app-menu-slot-93 {
    grid-column: 2 !important;
    justify-self: center !important;
    align-self: center !important;
    width: 48px !important;
    min-width: 48px !important;
    margin: 0 !important;
  }
  html.zuva-pwa-standalone body.zuva-universal-theme .zuva-app-menu-slot-93 .wp-block-navigation__responsive-container-open {
    display: grid !important;
    width: 48px !important;
    height: 48px !important;
    place-items: center !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Account/Order controls remain functional in the bottom app navigation. */
  html.zuva-pwa-standalone body.zuva-universal-theme .zuva-header-actions.zuva-app-hidden-actions-93 {
    display: none !important;
  }

  html.zuva-pwa-standalone body.zuva-universal-theme .zuva-app-hakoura-slot-93 {
    grid-column: 3 !important;
    justify-self: end !important;
    align-self: center !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    width: 56px !important;
    height: 56px !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  html.zuva-pwa-standalone body.zuva-universal-theme .zuva-app-hakoura-slot-93 img {
    display: block !important;
    width: 50px !important;
    height: 50px !important;
    max-width: 50px !important;
    max-height: 50px !important;
    object-fit: contain !important;
  }

  /* Keep the live cart entirely above the fixed app navigation and device inset. */
  html.zuva-pwa-standalone body.zuva-universal-theme .zuva-cart-overlay {
    bottom: calc(var(--zuva-app-nav-height) + env(safe-area-inset-bottom, 0px)) !important;
  }
  html.zuva-pwa-standalone body.zuva-universal-theme .zuva-cart-drawer {
    bottom: calc(var(--zuva-app-nav-height) + env(safe-area-inset-bottom, 0px)) !important;
    max-height: calc(100dvh - var(--zuva-live-header-bottom, 78px) - var(--zuva-app-nav-height) - env(safe-area-inset-bottom, 0px)) !important;
  }
  html.zuva-pwa-standalone body.zuva-universal-theme .zuva-cart-summary {
    flex: 0 0 auto !important;
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px)) !important;
    background: var(--zuva-cart-surface) !important;
  }
  html.zuva-pwa-standalone body.zuva-universal-theme .zuva-cart-checkout {
    position: relative;
    z-index: 2;
    width: 100%;
    pointer-events: auto;
  }
}

/* The installed-app confirmation reuses the exact live-cart surface token. */
html.zuva-pwa-standalone body.zuva-universal-theme .zuva-order-success,
html.zuva-pwa-standalone body.zuva-universal-theme .zuva-order-success .zuva-success-summary,
html.zuva-pwa-standalone body.zuva-universal-theme .zuva-order-success .zuva-success-summary > span {
  background: var(--zuva-cart-surface) !important;
}
