/* ══════════════════════════════════════════
   Infinity Digital — polish layer (motion, touch feedback, layout fixes)
   Loaded in <head> right after ids-ux.css (inc/ux.php). ids-shop-min.css is printed
   at the end of <body>, so rules that touch shop components carry an "html body"
   prefix to win on specificity instead of source order.
   See THEME-AUDIT.md for the item each block answers (A1, C2, …).
═══════════════════════════════════════════ */
:root{
  --p-ease:cubic-bezier(.22,1,.36,1);
  --p-spring:cubic-bezier(.34,1.56,.64,1);
  --p-fast:.14s;
  --p-med:.24s;
  --p-accent:#6D4AFF;
  --p-accent-ring:rgba(109,74,255,.28);
}

/* ── A7 · Touch feel ─────────────────────────────────────── */
html{-webkit-tap-highlight-color:transparent}
a,button,label,select,summary,[role=button],input[type=submit],input[type=button]{touch-action:manipulation}

html body .ids-btn,
html body .ids-action-btn,
html body .ids-menu-btn,
html body .ids-drawer__close,
html body .ids-carousel-btn,
html body .ids-cat-pill,
html body .ids-var-pill,
html body .ids-mob-sticky button,
html body .ids-currency__group button,
html body button.single_add_to_cart_button{
  transition:transform .16s var(--p-ease),filter .2s ease,background-color .2s ease,border-color .2s ease,color .2s ease,box-shadow .2s ease,opacity .2s ease;
}
html body .ids-btn:active,
html body .ids-mob-sticky button:active,
html body button.single_add_to_cart_button:active,
html body .ids-cat-pill:active,
html body .ids-var-pill:active{transform:scale(.96)}
html body .ids-action-btn:active,
html body .ids-menu-btn:active,
html body .ids-drawer__close:active,
html body .ids-carousel-btn:active,
html body .ids-currency__group button:active{transform:scale(.92)}

@media (hover:none){
  /* plain links have no hover on touch: dim them while pressed */
  .ids-footer a:active,
  .ids-nav__menu a:active,
  .ids-drawer__links a:active,
  .ids-breadcrumb a:active,
  .woocommerce-breadcrumb a:active,
  .ids-live-result:active,
  .ids-product-card__title:active{opacity:.6}
}

/* ── A1 / A2 · Cards: clean lift, no stuck hover on touch ── */
/* the old reveal class must never hide content; ids-polish.js runs the reveal instead */
html body .ids-reveal{opacity:1;transform:none}
.p-rv{opacity:0}
@media print{.p-rv{opacity:1!important}}

html body .ids-product-card{
  transition:transform .28s var(--p-ease),border-color .2s ease,box-shadow .28s var(--p-ease);
}
@media (hover:hover){
  html body .ids-product-card:hover{
    transform:translateY(-4px);
    border-color:rgba(124,115,255,.55);
    box-shadow:0 18px 40px -18px rgba(0,0,0,.7),0 10px 30px -14px var(--p-accent-ring);
  }
  html body .ids-product-card:hover .ids-product-card__img-wrap{transform:none}
}
@media (hover:none){
  html body .ids-product-card:hover{transform:none;border-color:var(--border);box-shadow:none}
  html body .ids-product-card:active{transform:scale(.985);border-color:rgba(124,115,255,.55);box-shadow:none}
  html body .ids-product-card:hover .ids-product-card__img{transform:none}
}

/* ── A13 · Image loading: shimmer placeholder, then fade in ── */
html body .ids-product-card__img,
html body .ids-gallery-main__img{transition:transform .55s cubic-bezier(.2,.8,.25,1),opacity .35s ease}
.p-loading{background-image:linear-gradient(135deg,rgba(255,255,255,.05),rgba(255,255,255,0) 60%)}
.p-loading img{opacity:0}

/* ── A3 / A4 · Endless animations ─────────────────────────── */
html body .ids-header .custom-logo,
html body .ids-footer__brand .custom-logo,
html body .ids-footer__brand .ids-logo img{animation:none!important;will-change:auto}
.p-paused,.p-paused *{animation-play-state:paused!important}

/* ── A8 · Search bar and live results ease in ─────────────── */
@keyframes pDrop{from{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:none}}
.ids-search-bar:not([hidden]){animation:pDrop .22s var(--p-ease) both}
.ids-live-results.is-active{animation:pDrop .18s var(--p-ease) both}
.ids-account-dropdown{transform-origin:top right}

/* ── A9 · Cross-fade between pages (browsers without support ignore this) ── */
@media (prefers-reduced-motion:no-preference){
  @view-transition{navigation:auto}
  ::view-transition-old(root){animation:pVtOut .12s ease both}
  ::view-transition-new(root){animation:pVtIn .2s ease both}
}
@keyframes pVtOut{to{opacity:0}}
@keyframes pVtIn{from{opacity:0}}

/* ── A10 · Toast ──────────────────────────────────────────── */
.p-toast{
  position:fixed;left:50%;bottom:calc(20px + env(safe-area-inset-bottom));z-index:2147482000;
  display:flex;align-items:center;gap:10px;
  max-width:min(92vw,420px);padding:12px 16px 12px 12px;
  background:#182235;color:#F8FAFC;border:1px solid rgba(255,255,255,.14);border-radius:14px;
  box-shadow:0 18px 44px -12px rgba(0,0,0,.7);
  font:600 14px/1.35 Inter,system-ui,sans-serif;
  transform:translate(-50%,16px);opacity:0;pointer-events:none;
  transition:transform .28s var(--p-spring),opacity .2s ease;
}
.p-toast.is-in{transform:translate(-50%,0);opacity:1}
.p-toast.is-raised{bottom:calc(92px + env(safe-area-inset-bottom))}
.p-toast__icon{flex:0 0 26px;width:26px;height:26px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:#6366F1;color:#fff}
.p-toast--success .p-toast__icon{background:#16A34A}
.p-toast--error .p-toast__icon{background:#DC2626}
.p-toast__icon svg{width:14px;height:14px}

@media (max-width:767px){
  .p-toast,.p-toast.is-raised{top:calc(68px + env(safe-area-inset-top));bottom:auto;transform:translate(-50%,-16px)}
  .p-toast.is-in{transform:translate(-50%,0)}
}

/* ── A11 · Cart icon bump when the count changes ──────────── */
@keyframes pBump{0%{transform:scale(1)}35%{transform:scale(1.18)}100%{transform:scale(1)}}
.p-bump{animation:pBump .42s var(--p-spring)}

/* ── A12 / B3 · Variation pills ───────────────────────────── */
@keyframes pPop{0%{transform:scale(.94)}100%{transform:scale(1)}}
html body .ids-var-pill.active{animation:pPop .24s var(--p-spring);box-shadow:0 0 0 3px var(--p-accent-ring)}
@keyframes pShake{0%,100%{transform:translateX(0)}20%{transform:translateX(-7px)}40%{transform:translateX(6px)}60%{transform:translateX(-4px)}80%{transform:translateX(3px)}}
.p-shake{animation:pShake .42s ease}

/* ── C2 · Product page: option labels line up with their options ── */
html body table.variations th,
html body table.variations td.label,
html body table.variations th.label,
html body table.variations .label label{text-align:left}

/* ── C3 · Quantity sits beside Add to cart instead of floating alone ── */
html body .ids-product-summary__cart-area form.variations_form.cart .woocommerce-variation-add-to-cart{
  display:grid!important;grid-template-columns:auto minmax(0,1fr)!important;gap:12px!important;align-items:stretch!important;
}
html body .ids-product-summary__cart-area form.variations_form.cart .woocommerce-variation-add-to-cart>*{grid-column:1/-1!important;margin:0!important}
html body .ids-product-summary__cart-area form.variations_form.cart .woocommerce-variation-add-to-cart>.quantity{
  grid-column:1!important;align-self:stretch!important;justify-self:start!important;margin:0!important;
}
html body .ids-product-summary__cart-area form.variations_form.cart .woocommerce-variation-add-to-cart>.single_add_to_cart_button{
  grid-column:2!important;width:100%!important;min-width:0!important;padding:0 12px!important;
}
/* the hidden "Clear" link and stacked margins left an 85px hole above the quantity row */
html body form.variations_form a.reset_variations[style*="hidden"]{display:none!important}
html body form.variations_form table.variations{margin-bottom:6px!important}
html body form.variations_form table.variations tr:last-child{margin-bottom:6px!important}
/* D4 · say why the buttons are dimmed */
html body .ids-product-summary__cart-area form.variations_form.cart .woocommerce-variation-add-to-cart-disabled::after{
  content:"Choose your options above to continue";
  grid-column:1/-1;text-align:center;font-size:13px;line-height:1.4;color:#94A3B8;
}

/* ── C4 · Variation price: no link-style underline, no duplicate ── */
html body .woocommerce-variation-price ins{text-decoration:none}
html body .woocommerce-variation-price .price{display:inline-flex;align-items:baseline;gap:10px;flex-wrap:wrap}
html body .p-dup-price .woocommerce-variation-price{display:none}

/* ── C5 / C6 · Product cards: equal tiles, footers on one line ── */
html body .ids-product-card__img-wrap{aspect-ratio:1/1}
html body .ids-product-card__img{width:100%;height:100%;object-fit:cover;display:block}
html body .ids-product-card__title{min-height:2.8em}
html body .ids-product-card__footer{margin-top:auto}

/* ── C7 · Search fields: one box, not a box inside a box ──── */
html body .ids-hero__search-inner input#ids-hero-search-input,
html body .ids-hero__search-inner input[type=search],
html body .ids-blog__search input[type=search],
html body .ids-faq__search input[type=search]{
  border:0!important;background:transparent!important;box-shadow:none!important;outline:0!important;
}

/* ── C13 · Tap targets ───────────────────────────────────── */
html body .ids-carousel-btn{width:44px;height:44px}
@media (min-width:768px){
  html body .ids-card-btns .ids-btn--sm{min-height:40px}
}

/* ── C10 · Account page: one card, full-width Google button ── */
html body .ids-auth__form{border:0!important;padding:0!important;background:transparent!important}
html body .ids-auth .nsl-container .nsl-container-buttons{display:flex;flex-direction:column;align-items:stretch;padding:0}
html body .ids-auth .nsl-container .nsl-container-buttons a{width:100%;max-width:none;margin:0;flex:1 1 auto}
html body .ids-auth .nsl-container .nsl-button{width:100%;min-height:48px;justify-content:center;border-radius:12px;box-shadow:none}
html body .ids-auth .nsl-container .nsl-button .nsl-button-label-container{flex:0 1 auto;margin:0}

/* ── C12 · 404 ────────────────────────────────────────────── */
html body .ids-404{text-align:center}
html body .ids-404 form{display:flex;gap:8px;justify-content:center;max-width:440px;margin:20px auto}
html body .ids-404 form label{flex:1 1 auto;min-width:0}
html body .ids-404 form input[type=search]{width:100%}

/* ── Phones ───────────────────────────────────────────────── */
@media (max-width:767px){
  /* C1 · category sections become one swipeable row each instead of long stacked grids */
  html body .ids-cat-products{padding:28px 0}
  html body .ids-cat-products .ids-section-header--row{
    flex-direction:row;flex-wrap:nowrap;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px;
  }
  html body .ids-cat-products .ids-section-header--row>.ids-btn{flex:0 0 auto}
  html body .ids-cat-products .ids-products-grid{
    display:grid!important;grid-auto-flow:column!important;grid-template-columns:none!important;grid-auto-columns:44%!important;gap:10px!important;
    overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch;
    scroll-snap-type:x proximity;scroll-padding-left:14px;
    margin:0 -14px;padding:4px 14px 12px;
    scrollbar-width:none;
  }
  html body .ids-cat-products .ids-products-grid::-webkit-scrollbar{display:none}
  html body .ids-cat-products .ids-product-card{scroll-snap-align:start;min-width:0}

  /* C8 · shop toolbar on one compact line */
  html body .ids-shop-toolbar{
    display:flex!important;flex-direction:row!important;flex-wrap:nowrap!important;align-items:center!important;justify-content:space-between!important;gap:10px!important;padding:10px 12px!important;
  }
  html body .ids-shop-toolbar .woocommerce-result-count{margin:0;font-size:13px}
  html body .ids-shop-toolbar .woocommerce-ordering{margin:0}
  html body .ids-shop-toolbar__left{flex:1 1 auto;min-width:0}
  html body .ids-shop-toolbar__right{flex:0 0 auto}
  html body .ids-shop-toolbar select.orderby{width:auto!important;max-width:156px!important}

  /* D1 · smallest text sizes */
  html body .product-badge{font-size:10px}
  html body .ids-price-from{font-size:10.5px}
  html body .ids-product-card__title{font-size:13px}
}
@media (max-width:480px){
  /* C9 · footer contacts stack so the email fits on one line */
  html body .ids-footer .ids-footer__contact{grid-template-columns:1fr!important}
}

/* ── A14 · Reduced motion ─────────────────────────────────── */
/* C14 · chat bubble: smaller on phones, and out of the way while scrolling */
html body .chaty .chaty-widget{transition:opacity .22s var(--p-ease),transform .22s var(--p-ease)}
@media (max-width:767px){
  html.p-chat-away body .chaty .chaty-widget:not(.chaty-open):not(.form-open){opacity:0;transform:translateX(24px);pointer-events:none}
  html.p-chat-away body .chaty .chaty-widget:not(.chaty-open):not(.form-open) *{pointer-events:none!important}
}

@media (prefers-reduced-motion:reduce){
  .p-rv{opacity:1}
  .p-toast{transition:opacity .2s ease}
  .p-bump,.p-shake,html body .ids-var-pill.active,
  .ids-search-bar:not([hidden]),.ids-live-results.is-active{animation:none}
  html body .ids-btn:active,html body .ids-var-pill:active,html body .ids-cat-pill:active,
  html body .ids-action-btn:active,html body .ids-product-card:active,html body .ids-product-card:hover{transform:none}
}
