/*
** ==============================
**   Moshina – Product Page Sticky Header & Footer
** ==============================
*/

:root {
  --pdp-header-height: 60px;
  --pdp-footer-height: 76px;
  --pdp-accent: #361601;
  /* olive/green from screenshot */
  --pdp-text: #111111;
  --pdp-bg: #ffffff;
  --pdp-shadow-up: 0 -2px 15px rgba(0, 0, 0, 0.06);
  --pdp-shadow-down: 0 2px 12px rgba(0, 0, 0, 0.05);
  --pdp-radius-btn: 30px;
  /* Pill shape */
  --pdp-radius-box: 8px;
  /* Square box shape */
  --pdp-qty-bg: #F4F5F7;
  /* Light gray */
  --pdp-transition: .25s cubic-bezier(.4, 0, .2, 1);
}

/* ────────────────────────────────────────────────────────
   STICKY PRODUCT HEADER
   ──────────────────────────────────────────────────────── */
.moshina-pdp-header {
  display: flex;
  /* Always display by default (pure CSS) */
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 9999;
  height: var(--pdp-header-height);
  background: var(--pdp-bg);
  box-shadow: var(--pdp-shadow-down);
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  gap: 12px;
}

/* ── Back & Share Buttons (Square with thin border) ──── */
.moshina-pdp-back-btn,
.moshina-pdp-share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--pdp-radius-box);
  border: 1px solid #EBEBEB;
  background: #ffffff;
  cursor: pointer;
  flex-shrink: 0;
  color: var(--pdp-text);
  transition: background var(--pdp-transition), border-color var(--pdp-transition);
  text-decoration: none;
}

.moshina-pdp-back-btn:hover,
.moshina-pdp-share-btn:hover {
  background: #fcfcfc;
  border-color: #d8d8d8;
}

.moshina-pdp-back-btn svg,
.moshina-pdp-share-btn svg {
  width: 20px;
  height: 20px;
  display: block;
}

/* RTL: Flip the back arrow to point right */
.moshina-pdp-back-btn svg {
  transform: scaleX(-1);
}

/* ── Product Title (center) ──────────────────────────── */
.moshina-pdp-header-title {
  flex: 1;
  font-size: 15px;
  font-weight: 700;
  color: var(--pdp-text);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 8px;
  font-family: inherit;
}

/* ── Share success flash ─────────────────────────────── */
.moshina-pdp-share-toast {
  position: fixed;
  bottom: calc(var(--pdp-footer-height) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #111111;
  color: #ffffff;
  font-size: 13px;
  padding: 10px 22px;
  border-radius: 24px;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s, transform .3s;
  white-space: nowrap;
  font-family: inherit;
}

.moshina-pdp-share-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ────────────────────────────────────────────────────────
   STICKY PRODUCT FOOTER
   ──────────────────────────────────────────────────────── */
.moshina-pdp-footer {
  position: fixed;
  bottom: 0;
  right: 0;
  left: 0;
  z-index: 9998;
  background: var(--pdp-bg);
  box-shadow: var(--pdp-shadow-up);
  padding: 12px 16px;
  padding-bottom: max(12px, env(safe-area-inset-bottom, 12px));
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: var(--pdp-footer-height);
  direction: rtl;
  /* Force RTL layout */
}

/* ── Quantity Selector (Light Gray Box) ────────────────── */
.moshina-pdp-qty {
  display: flex;
  align-items: center;
  background: var(--pdp-qty-bg);
  height: 48px;
  border-radius: 6px;
  overflow: hidden;
  padding: 0 4px;
  flex-shrink: 0;
  direction: ltr;
  /* Force LTR inside qty box so buttons show in screenshot order: + on left, - on right */
}

.moshina-pdp-qty-btn {
  background: transparent;
  border: none;
  width: 38px;
  height: 100%;
  font-size: 20px;
  font-weight: 500;
  color: #777777;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--pdp-transition), background var(--pdp-transition);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.moshina-pdp-qty-btn:hover {
  color: var(--pdp-text);
  background: rgba(0, 0, 0, 0.03);
}

.moshina-pdp-qty-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--pdp-text);
  min-width: 24px;
  text-align: center;
  display: inline-block;
  user-select: none;
}

/* ── CTA Button (Pill Green Box) ──────────────────────── */
.moshina-pdp-footer-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 48px;
  border-radius: var(--pdp-radius-btn);
  border: none;
  background: var(--pdp-accent);
  color: #ffffff;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--pdp-transition), transform var(--pdp-transition);
  padding: 0 20px;
  gap: 2px;
  -webkit-tap-highlight-color: transparent;
}

.moshina-pdp-footer-btn:hover,
.moshina-pdp-footer-btn:focus {
  background: #84a24c;
  outline: none;
}

.moshina-pdp-footer-btn:active {
  transform: scale(.98);
}

.moshina-pdp-footer-btn .cta-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}

.moshina-pdp-footer-btn .cta-price {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.9;
  line-height: 1.2;
}

/* Sync text color for price formatting inside green button */
.moshina-pdp-footer-price-val,
.moshina-pdp-footer-price-val * {
  color: #ffffff !important;
  font-size: inherit !important;
  font-weight: inherit !important;
  background: transparent !important;
  text-decoration: none !important;
}

/* ── View Cart Button ─────────────────────────────────────── */
.moshina-pdp-viewcart-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 48px;
  min-width: 56px;
  padding: 0 10px;
  border-radius: var(--pdp-radius-btn);
  border: 1.5px solid var(--pdp-accent);
  background: transparent;
  color: var(--pdp-accent);
  cursor: pointer;
  flex-shrink: 0;
  text-decoration: none;
  transition: background var(--pdp-transition), color var(--pdp-transition), transform var(--pdp-transition);
  -webkit-tap-highlight-color: transparent;
}

.moshina-pdp-viewcart-btn:hover,
.moshina-pdp-viewcart-btn:focus {
  background: var(--pdp-accent);
  color: #ffffff;
  outline: none;
}

.moshina-pdp-viewcart-btn:active {
  transform: scale(.97);
}

.moshina-pdp-viewcart-btn .viewcart-label {
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

/* ── Page offset to avoid overlap ─────────────────────── */
body.single-product.moshina-pdp-active {
  padding-top: var(--pdp-header-height) !important;
  padding-bottom: var(--pdp-footer-height) !important;
}

/* ── Hide on Desktop/Tablet landscape ─────────────────── */
@media (min-width: 1025px) {

  .moshina-pdp-header,
  .moshina-pdp-footer,
  .moshina-pdp-share-toast {
    display: none !important;
  }

  body.single-product.moshina-pdp-active {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }
}

/* ── Hide standard mobile header & bottom navbar on mobile product pages ──── */
@media (max-width: 1024px) {
  body.single-product .moshina-mobile-bottom-nav {
    display: none !important;
  }

  body.single-product .moshina-mobile-header,
  body.single-product .mobile_header {
    display: none !important;
  }
}