/* One button treatment across storefront and warehouse.
   Important declarations in this layer supersede legacy unlayered page overrides. */
@layer shared-buttons {
  :root {
    --button-gold:#b79a58;
    --button-glow:0 0 0 1px rgba(183,154,88,.12),0 0 14px rgba(183,154,88,.24);
    --button-glow-hover:0 0 0 1px rgba(183,154,88,.25),0 0 22px rgba(183,154,88,.42);
  }
  :is(button,.btn,[role="button"],input[type="submit"],input[type="button"],input[type="reset"],.back-link,.icon-btn,.fab-btn,.elijah-category-bar a) {
    background:#fff!important;
    color:var(--ink,#3f3932)!important;
    border:1px solid var(--button-gold)!important;
    box-shadow:var(--button-glow)!important;
    filter:none!important;
    transition:box-shadow .2s ease,border-color .2s ease,transform .15s ease!important;
  }
  :is(button,.btn,[role="button"],input[type="submit"],input[type="button"],input[type="reset"],.back-link,.icon-btn,.fab-btn,.elijah-category-bar a):is(:hover,:focus-visible,:active) {
    box-shadow:var(--button-glow-hover)!important;
  }
  :is(button,.btn,[role="button"],input[type="submit"],input[type="button"],input[type="reset"],.back-link,.icon-btn,.fab-btn,.elijah-category-bar a):focus-visible {
    outline:2px solid #8a6a29!important;outline-offset:3px!important;
  }
  /* 2026-10-21 作品頁分類列：前四個小按鈕淡底色，最後的大按鈕維持白色 */
  body.elijah-page .elijah-category-bar a:not(:last-child){background:#FFF8EC!important;}
  :is(button,.btn,[role="button"],.elijah-category-bar a):is([aria-pressed="true"],[aria-selected="true"],[aria-current="page"],[aria-current="true"],.active,[data-active="true"]) {
    box-shadow:inset 0 0 0 1px var(--button-gold),var(--button-glow-hover)!important;
    font-weight:700!important;
  }
  :is(button,.btn,[role="button"],input[type="submit"],input[type="button"],input[type="reset"]):is(:disabled,[aria-disabled="true"]) {
    box-shadow:none!important;opacity:.45!important;cursor:not-allowed!important;
  }
  /* Destructive actions keep a readable warning label on the same white surface. */
  /* Quantity is one control: the parent owns its continuous border. */
  .qty-control{background:#fff!important;border:1px solid var(--button-gold)!important;border-radius:10px!important;gap:0!important;padding:0!important;box-shadow:none!important;}
  .qty-control button{background:#fff!important;border:0!important;border-radius:0!important;box-shadow:none!important;transform:none!important;margin:0!important;flex:0 0 40px;min-height:40px;padding:0!important;}
  .qty-control input{background:#fff!important;border:0!important;border-radius:0!important;box-shadow:none!important;margin:0!important;padding:0!important;height:40px;min-width:0;align-self:stretch;}
  .qty-control button:focus-visible{outline-offset:-3px!important;}
  :is(button,.btn).danger {color:#9a3434!important;}
  /* Add-to-cart on the product page: soft gold surface and a larger label. */
  #add-cart-btn:not(:disabled){background:rgba(240,217,165,.20)!important;font-size:1.1rem!important;font-weight:600!important;letter-spacing:.06em!important;line-height:1.3!important;}
  /* Cart page actions: larger labels, same as add-to-cart. */
  #checkout-btn,.cart-continue-btn{font-size:1.1rem!important;font-weight:600!important;letter-spacing:.06em!important;line-height:1.3!important;}
  @media (max-width:640px){#checkout-btn,.cart-continue-btn{font-size:1.25rem!important;padding-top:12px!important;padding-bottom:12px!important;}#add-cart-btn:not(:disabled){font-size:1.25rem!important;}}
  @media (min-width:641px){#checkout-btn,.cart-continue-btn,#add-cart-btn:not(:disabled){padding-top:10px!important;padding-bottom:10px!important;}}
  @media (prefers-reduced-motion:reduce) {
    :is(button,.btn,[role="button"],.back-link,.icon-btn,.fab-btn,.elijah-category-bar a) {transition:none!important;}
  }
}

/* 按鈕滑過：金色流光掃過一次＋微微浮起；外圍不用霧光，改成大小不一的金粉（js/components.js 產生） */
@property --btn-sheen{syntax:'<percentage>';inherits:false;initial-value:-40%;}
@layer shared-buttons {
  :is(button,.btn,[role="button"],input[type="submit"],input[type="button"],.back-link,.icon-btn,.fab-btn,.elijah-category-bar a) {
    transition:box-shadow .3s ease,border-color .2s ease,transform .15s ease,translate .3s cubic-bezier(.2,.7,.3,1)!important;
  }
  :is(button,.btn,[role="button"],input[type="submit"],input[type="button"],.back-link,.icon-btn,.fab-btn,.elijah-category-bar a):not(:disabled):not([aria-disabled="true"]):is(:hover,:active) {
    translate:0 -1.5px;
    box-shadow:0 0 0 1px rgba(183,154,88,.28)!important;
    background-image:linear-gradient(105deg,rgba(255,255,255,0) calc(var(--btn-sheen) - 22%),rgba(232,205,140,.45) var(--btn-sheen),rgba(255,255,255,0) calc(var(--btn-sheen) + 22%))!important;
    animation:btn-sheen .9s ease-out 1 both;
  }
  .qty-control button:is(:hover,:active){translate:none;background-image:none!important;animation:none;}
  @keyframes btn-sheen{from{--btn-sheen:-40%}to{--btn-sheen:140%}}
  @media (prefers-reduced-motion:reduce) {
    :is(button,.btn,[role="button"],input[type="submit"],input[type="button"],.back-link,.icon-btn,.fab-btn,.elijah-category-bar a):is(:hover,:active){translate:none;animation:none;background-image:none!important;}
  }
}

/* 金粉顆粒：取代原本的霧光，大小不一、自然散開後淡掉 */
.btn-dust-layer{position:fixed;inset:0;pointer-events:none;z-index:99999;}
.btn-dust-layer i{position:fixed;border-radius:50%;pointer-events:none;
  background:radial-gradient(circle,#fff8e2 0 25%,#e3c27a 55%,rgba(196,154,82,0) 100%);
  transform:translate(-50%,-50%) scale(0);opacity:0;animation:btn-dust var(--dur,1.3s) ease-out forwards;}
.btn-dust-layer i.big{box-shadow:0 0 4px rgba(227,194,122,.65);}
.btn-dust-layer i.soft{filter:blur(.4px);}
@keyframes btn-dust{
  0%{transform:translate(-50%,-50%) scale(0);opacity:0}
  30%{transform:translate(calc(-50% + var(--dx) * .4),calc(-50% + var(--dy) * .4)) scale(1);opacity:var(--op,1)}
  70%{opacity:calc(var(--op,1) * .7)}
  100%{transform:translate(calc(-50% + var(--dx)),calc(-50% + var(--dy))) scale(.5);opacity:0}}
