/* Search controls use the existing header and WooCommerce search route. */
.ppd-product-search input[type=search] {
  min-inline-size: 0; min-height: 48px; padding: 8px 53px 8px 14px;
  padding-inline: 14px 53px; font-size: 1rem; color: var(--pp-navy);
}
.ppd-product-search input::placeholder { color: #53637b; }
.ppd-product-search button {
  display: grid; place-items: center; position: absolute; inset-inline-end: 3px;
  width: 44px; height: 44px; border-radius: 50%; border: 0;
  color: #fff; background: var(--pp-red);
}
.ppd-product-search button:hover { background: var(--pp-red-dark); }
.ppd-mobile-shop .pp-header__search-panel { margin-block-start: 8px; }
.ppd-mobile-shop .pp-header__nav:not(.is-open) { visibility: hidden; }
.ppd-mobile-shop .pp-header__nav.is-open { visibility: visible; }

@media (max-width: 760px) {
  .ppd-mobile-shop .pp-header { padding-block: 6px; }
  .ppd-mobile-shop .pp-header__bar { border-radius: 18px; padding: 4px 8px 4px 12px; padding-inline: 12px 8px; gap: 4px; }
  .ppd-mobile-shop .pp-header__brand { min-width: 0; max-width: 126px; }
  .ppd-mobile-shop .pp-header__brand img { max-height: 34px; object-fit: contain; }
  .ppd-mobile-shop .pp-header__tools { gap: 0; }
  .ppd-mobile-shop .pp-header__tools > .pp-icon-btn { width: 44px; height: 44px; }
  .ppd-mobile-shop .pp-header__tools > .pp-langs { display: none; }
  .ppd-mobile-shop .pp-header__nav .pp-langs--drawer { display:flex; flex-direction:row; align-items:center; gap:4px; padding-block-start:8px; margin-block:0 16px; border-block-start:0; }
  .ppd-mobile-shop .pp-header__nav .pp-langs--drawer li { padding-inline:0; }
  .ppd-mobile-shop .pp-header__nav .pp-langs--drawer a { display:grid; place-items:center; min-width:44px; min-height:44px; }
  .ppd-mobile-shop .pp-header__nav { display:flex; flex-direction:column; padding:54px 16px max(16px,env(safe-area-inset-bottom)); background:#fff; }
  .ppd-mobile-shop .pp-header__nav .pp-langs--drawer { order:-1; }
  .ppd-mobile-shop .pp-header__nav .pp-drawer-cats { gap:2px; margin:0; }
  .ppd-mobile-shop .pp-drawer-cats a { display:flex; align-items:center; min-height:44px; white-space:normal; border-block-end:1px solid var(--pp-line); }
  .ppd-mobile-shop .pp-header__nav .ppd-menu-close { position:absolute; inset-block-start:6px; inset-inline-end:8px; width:44px; height:44px; }
  .admin-bar.ppd-mobile-shop .pp-header__nav { padding-block-start:96px; }
  .admin-bar.ppd-mobile-shop .pp-header__nav .ppd-menu-close { inset-block-start:48px; }

  /* Keep the search field visible on browsing screens without making two
     rows sticky. Product/cart/checkout keep the small single-row header. */
  .ppd-inline-search .pp-header { position:relative; inset-block-start:0; }
  .ppd-inline-search .pp-header__bar {
    display:grid; grid-template-columns:minmax(0,1fr) auto; column-gap:6px; row-gap:2px;
    padding-block-end:8px;
  }
  .ppd-inline-search .pp-header__search { display:block; grid-area:2/1/3/-1; max-width:none; }
  .ppd-inline-search .pp-header__tools { grid-area:1/2; }
  .ppd-inline-search .pp-search-toggle, .ppd-inline-search .pp-header__search-panel { display:none; }
  .ppd-inline-search .pp-header__bar::before { background:#fff; }
  .ppd-inline-search .pp-header__search .ppd-product-search input[type=search] { background:#f2f6fc; }

  .ppd-mobile-shop .pp-archive__body .pp-archive__banner:not(.ppd-category-banner) {
    min-height:0; padding:7px 0; margin-block-end:6px; background:none; box-shadow:none; border-radius:0;
  }
  .ppd-mobile-shop .pp-archive__banner:not(.ppd-category-banner)::before,
  .ppd-mobile-shop .pp-archive__banner:not(.ppd-category-banner) .pp-archive__banner-media,
  .ppd-mobile-shop .pp-archive__banner:not(.ppd-category-banner) .pp-archive__lead { display:none; }
  .ppd-mobile-shop .pp-archive__banner:not(.ppd-category-banner) .pp-archive__banner-copy { max-width:none; }
  .ppd-mobile-shop .pp-archive__body .pp-archive__banner:not(.ppd-category-banner) .pp-archive__title,
  .ppd-mobile-shop .ppd-search-title { font-size:clamp(21px,5.4vw,28px); }
  .ppd-mobile-shop .pp-breadcrumb { padding-block:8px 2px; font-size:.76rem; line-height:1.35; color:#53637b; }
  .ppd-mobile-shop .pp-breadcrumb a { color:#53637b; }
  .ppd-mobile-shop .pp-archive__pills { flex-wrap:nowrap; overflow:auto; scrollbar-width:thin; gap:6px; margin-block-end:7px; }
  .ppd-mobile-shop .pp-archive__pills .pp-pill { min-height:44px; }
  .ppd-mobile-shop .pp-archive__toolbar { padding:0; border:0; box-shadow:none; background:none; gap:8px; flex-wrap:wrap; }
  .ppd-mobile-shop .pp-archive__count { flex:1 0 100%; font-size:.8rem; color:#53637b; font-weight:600; }
  .ppd-mobile-shop .pp-archive__tools { flex:1; display:flex; flex-direction:row-reverse; gap:8px; }
  .ppd-mobile-shop .pp-archive__tools .woocommerce-ordering { flex:1 1 50%; min-width:0; }
  .ppd-mobile-shop .pp-archive__tools select, .ppd-mobile-shop .ppd-filter-toggle { min-height:44px; border:1px solid #d7e1ed; border-radius:12px; background-color:#fff; }
  .ppd-mobile-shop .ppd-filter-toggle { padding:5px 12px; justify-content:center; flex:1 0 auto; }
  .ppd-mobile-shop .pp-archive__tools select { width:100%; max-width:100%; font-size:.86rem; text-overflow:ellipsis; }
  .ppd-mobile-shop .ppd-active-filters .pp-pill, .ppd-mobile-shop .ppd-active-filters > a { min-height:44px; display:inline-flex; align-items:center; }
  .ppd-mobile-shop .pp-archive__body .pp-product__grid, .ppd-mobile-shop .ppd-product-recs .pp-product__grid { gap:8px; }
  .ppd-mobile-shop:not(.ppd-shopping-home) .pp-product { min-width:0; padding:8px; border-radius:13px; }
  .ppd-mobile-shop:not(.ppd-shopping-home) .pp-product__brand, .ppd-mobile-shop:not(.ppd-shopping-home) .pp-product__meta { color:#53637b; overflow-wrap:anywhere; }
  .ppd-mobile-shop:not(.ppd-shopping-home) .pp-product__title { font-size:.86rem; overflow-wrap:anywhere; }
  .ppd-mobile-shop:not(.ppd-shopping-home) .pp-product__foot { gap:4px; }
  .ppd-mobile-shop:not(.ppd-shopping-home) .pp-product__foot .pp-price { min-width:0; white-space:normal; line-height:1.2; overflow-wrap:anywhere; }
  .ppd-mobile-shop:not(.ppd-shopping-home) .pp-product__foot .woocommerce-Price-amount { white-space:nowrap; }
  .ppd-mobile-shop:not(.ppd-shopping-home) .pp-product__foot .pp-price del, .ppd-mobile-shop:not(.ppd-shopping-home) .pp-product__foot .pp-price ins { display:block; }
  .ppd-mobile-shop:not(.ppd-shopping-home) .pp-product__foot .pp-btn--round, .ppd-mobile-shop:not(.ppd-shopping-home) .pp-product__wish { width:44px; height:44px; flex:none; }
  .ppd-mobile-shop:not(.ppd-shopping-home) .pp-product__wish { background:#fffffff0; }

  .ppd-mobile-shop .pp-single__top { gap:10px; margin-block-end:20px; }
  .ppd-mobile-shop .pp-single__title { font-size:clamp(20px,5.3vw,26px); overflow-wrap:anywhere; }
  .ppd-mobile-shop .pp-single__gallery .woocommerce-product-gallery__image > a { padding:10px; }
  .woocommerce.ppd-mobile-shop div.product .pp-single__gallery .woocommerce-product-gallery__image img:not(.zoomImg) { max-height:min(36svh,226px); object-fit:contain; }
  .ppd-mobile-shop .ppd-product-price-row { margin-block-end:9px; }
  .ppd-mobile-shop .pp-single__features { margin-block-end:10px; padding-block-end:10px; }
  .ppd-mobile-shop .pp-single__buy .pp-single__wish { background:transparent; }
}

@media (prefers-reduced-motion: reduce) {
  html:has(.ppd-mobile-shop) { scroll-behavior:auto; }
}
/* The drawer close control also works on tablets. */
.ppd-mobile-shop .pp-header__nav .ppd-menu-close {
  position:absolute; inset-block-start:6px; inset-inline-end:8px; width:44px; height:44px;
}
@media (min-width:761px) and (max-width:900px) {
  .admin-bar.ppd-mobile-shop .pp-header__nav .ppd-menu-close { inset-block-start:46px; }
}

@media (max-width:760px) {
  .ppd-mobile-shop .pp-header > .pp-container { --pp-gutter:12px; }
  .ppd-mobile-shop .pp-archive__pills { overscroll-behavior-inline:contain; }
  .ppd-mobile-shop .pp-cart__head { margin-block-end:10px; }
  .ppd-mobile-shop .pp-cart__title { font-size:clamp(21px,5.8vw,29px); }
  .ppd-mobile-shop .pp-cart__layout, .ppd-mobile-shop .pp-checkout__layout { gap:12px; }
  .ppd-mobile-shop .pp-cart-row, .ppd-mobile-shop .pp-panel, .ppd-mobile-shop .pp-totals { padding:12px; }
  .ppd-mobile-shop .pp-cart-row__remove-btn { width:44px; height:44px; }
  .ppd-mobile-shop .pp-cart__coupon button, .ppd-mobile-shop .pp-cart__actions [name="update_cart"] { min-height:44px; }
  .ppd-mobile-shop .pp-cart__coupon input, .ppd-mobile-shop .pp-checkout .form-row .input-text { font-size:1rem; }
  .ppd-mobile-shop .pp-totals__actions .pp-btn--lg { white-space:normal; text-align:center; line-height:1.25; }
  .ppd-mobile-shop .pp-checkout__secure, .ppd-mobile-shop .pp-steps { margin-block-end:12px; }
  .ppd-mobile-shop .pp-checkout .pp-panel__title { font-size:1.08rem; }
}

/* A uniform photo stage for storefront product cards, including desktop.
   White-backed and transparent packshots share the same neutral surface. */
.ppd-mobile-shop .pp-product .pp-product__media {
  isolation:isolate;
  border:1px solid #e0e8f2;
  border-radius:clamp(10px,1.1vw,17px);
  background:linear-gradient(155deg,#fff 28%,#f3f6fb 100%);
}
.ppd-mobile-shop .pp-product .pp-product__media::before { content:none; }
.ppd-mobile-shop .pp-product .pp-product__media > a { inset:7%; mix-blend-mode:multiply; }
.ppd-mobile-shop .pp-product .pp-product__media img { transform:none; }
.ppd-mobile-shop .pp-product .pp-product__media > .pp-product__wish {
  inset-block-start:3px; inset-inline-end:3px;
  background:#fff;
}
.ppd-mobile-shop .pp-product .pp-product__media > .pp-product__wish:hover {
  background:var(--pp-red-soft);
}

/* Keep all rows aligned without adding dummy brand or description text.
   Explicit grid rows also reserve the space when a field is missing. */
.ppd-mobile-shop .pp-product:has(> .pp-product__title) {
  --ppd-card-brand-size: .8125rem;
  --ppd-card-title-size: 1rem;
  --ppd-card-meta-size: .875rem;
  --ppd-card-brand-row: calc(1.1rem + 4px);
  --ppd-card-title-row: calc(2.7rem + 4px);
  --ppd-card-meta-row: 1.225rem;
  --ppd-card-foot-row: 51px;
  display:grid;
  min-inline-size:0;
  grid-template-columns:minmax(0,1fr);
  grid-template-rows:auto var(--ppd-card-brand-row) var(--ppd-card-title-row)
    var(--ppd-card-meta-row) minmax(var(--ppd-card-foot-row),1fr);
  align-content:start;
}
.ppd-mobile-shop .pp-product > .pp-product__media { grid-row:1; grid-column:1; }
.ppd-mobile-shop .pp-product > .pp-product__brand {
  grid-row:2; grid-column:1; align-self:start; justify-self:start;
  max-inline-size:100%; margin:0; min-inline-size:0;
  font-size:var(--ppd-card-brand-size); line-height:1.35;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.ppd-mobile-shop .pp-product > .pp-product__title {
  grid-row:3; grid-column:1; align-self:start; min-inline-size:0; margin:0;
  font-size:var(--ppd-card-title-size); line-height:1.35; overflow-wrap:anywhere;
}
.ppd-mobile-shop .pp-product > .pp-product__meta {
  grid-row:4; grid-column:1; align-self:start; min-inline-size:0; margin:0;
  font-size:var(--ppd-card-meta-size); line-height:1.4;
}
.ppd-mobile-shop .pp-product > .pp-product__foot {
  grid-row:5; grid-column:1; align-self:end; min-inline-size:0; margin:0;
  min-block-size:var(--ppd-card-foot-row);
}
.ppd-mobile-shop .pp-product > .pp-product__foot .pp-price {
  min-inline-size:0; white-space:normal; line-height:1.2;
}
.ppd-mobile-shop .pp-product > .pp-product__foot .woocommerce-Price-amount {
  white-space:nowrap;
}
@media (max-width:760px) {
  .ppd-mobile-shop .pp-product:has(> .pp-product__title) {
    --ppd-card-brand-size: .6875rem;
    --ppd-card-title-size: .875rem;
    --ppd-card-meta-size: .75rem;
    --ppd-card-brand-row: calc(.93rem + 4px);
    --ppd-card-title-row: calc(2.365rem + 4px);
    --ppd-card-meta-row: 1.05rem;
    --ppd-card-foot-row: 49px;
  }
  .ppd-mobile-shop .pp-product > .pp-product__foot .pp-price del,
  .ppd-mobile-shop .pp-product > .pp-product__foot .pp-price ins { display:block; }
}

/* Replace decorative pink tones throughout the theme. Solid brand red
   remains reserved for prices, controls, and alerts. */
body.ppd-mobile-shop {
  --pp-red-soft:#e7f0fa;
  --pp-shadow-red:0 6px 16px #183b6226;
  background-color:#f3f7fb;
}
body.ppd-mobile-shop::before { background:none; }
.ppd-mobile-shop .pp-hero::before {
  background:radial-gradient(55% 95% at 22% 20%,#dbeafa,transparent 76%),
             linear-gradient(#f9fbff,#edf4fc);
}
[dir] .ppd-mobile-shop .pp-cat-tile {
  background:linear-gradient(145deg,#fff 32%,#eaf3fc 100%);
}
.ppd-mobile-shop .ppd-qty-notice { background:#eef4fb; }
.ppd-mobile-shop .pp-archive__banner--plain { background-image:none; }
.ppd-mobile-shop .pp-archive__banner--plain::before { background-image:none; }
[dir] .ppd-mobile-shop .pp-rx__panel,
[dir] .ppd-mobile-shop .pp-cart__notice,
.ppd-mobile-shop .pp-notice {
  background:linear-gradient(120deg,#f7fbff,#e8f2fc);
}
[dir] .ppd-mobile-shop .pp-cart__notice::before { background:none; }
.ppd-mobile-shop .woocommerce-error { border-color:#d4e2ef; }
