/* Cart controls on the product pages. Colors come from each page's own
   theme variables (--line, --text, --card, --radius), so they match. */

.sp-buy{ margin: 4px 0 16px; display: flex; flex-direction: column; gap: 10px; }
.sp-row{ display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; }

.sp-step{
  display: inline-flex; align-items: stretch;
  border: 1px solid var(--line, #888); border-radius: var(--radius, 6px);
  overflow: hidden; background: var(--card, transparent);
}
.sp-step-btn{
  width: 46px; min-height: 46px; border: 0; margin: 0;
  background: transparent; color: var(--text, inherit);
  font: 600 22px/1 system-ui, sans-serif; cursor: pointer;
}
.sp-step-btn:hover:not(:disabled){ background: rgba(255,255,255,0.07); }
.sp-step-btn:disabled{ opacity: 0.35; cursor: default; }
.sp-step input{
  width: 52px; border: 0; margin: 0; padding: 0;
  border-left: 1px solid var(--line-soft, var(--line, #888));
  border-right: 1px solid var(--line-soft, var(--line, #888));
  background: transparent; color: var(--text, inherit);
  font: 600 17px system-ui, sans-serif; text-align: center;
  -moz-appearance: textfield; appearance: textfield;
}
.sp-step input::-webkit-inner-spin-button,
.sp-step input::-webkit-outer-spin-button{ -webkit-appearance: none; margin: 0; }
.sp-step-btn:focus-visible, .sp-step input:focus-visible, .sp-field select:focus-visible{
  outline: 2px solid var(--text, currentColor); outline-offset: -2px;
}

button.btn.sp-add{ cursor: pointer; font-family: inherit; min-height: 48px; justify-content: center; }

.sp-field{ display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-muted, inherit); max-width: 320px; }
.sp-field select{
  min-height: 46px; padding: 0 12px;
  border: 1px solid var(--line, #888); border-radius: var(--radius, 6px);
  background: var(--card, #fff); color: var(--text, inherit);
  font: 500 15px system-ui, sans-serif;
}

.sp-incart{ font-size: 13px; color: var(--text-muted, inherit); min-height: 1em; }
.sp-incart:empty{ display: none; }

.sp-sr{ position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.sp-toast{
  position: fixed; left: 50%; bottom: 20px; z-index: 50;
  transform: translate(-50%, 140%); opacity: 0;
  transition: transform .25s ease, opacity .25s ease;
  display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; justify-content: center;
  max-width: calc(100vw - 32px); padding: 14px 20px;
  background: var(--card, #222); color: var(--text, #fff);
  border: 1px solid var(--line, #555); border-radius: var(--radius, 6px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.35); font-size: 14.5px;
}
.sp-toast.show{ transform: translate(-50%, 0); opacity: 1; }
.sp-toast a{ font-weight: 600; white-space: nowrap; }

/* Cart button: its own spot in the top-right corner of every page,
   apart from the page links. Uses each page's .btn-primary accent colors. */
header:has(> .sp-cart-btn){ position: relative; }
header:has(> .sp-cart-btn) > .wrap{ padding-right: 170px; }
.sp-cart-btn{
  position: absolute; top: 20px; right: 24px; z-index: 5;
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 46px; padding: 0 16px 0 14px !important;
  border-radius: 999px !important; text-decoration: none;
  font-size: 15px; font-weight: 700; line-height: 1;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}
.sp-cart-btn .sp-count{
  display: inline-block; min-width: 24px; height: 24px; padding: 0 6px;
  border-radius: 999px; background: rgba(0,0,0,0.78); color: #fff;
  font-size: 13px; line-height: 24px; text-align: center;
}
.sp-cart-btn--home{ top: 9px; background: var(--saguaro, #4f7a56); color: #fff; box-shadow: 0 4px 14px rgba(46,34,25,0.18); }
.sp-cart-btn--home:hover{ background: #3f6546; }
.sp-cart-btn--home .sp-count{ background: #fff; color: #2e4a33; }
.sp-cart-btn:focus-visible{ outline: 3px solid var(--text, #2e2219); outline-offset: 3px; }
@media (max-width: 640px){
  .sp-cart-btn{ top: 14px; right: 14px; padding: 0 12px !important; }
  .sp-cart-btn .sp-cart-word{ position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  header:has(> .sp-cart-btn) > .wrap{ padding-right: 104px; }
}

@media (prefers-reduced-motion: reduce){ .sp-toast{ transition: none; } }

/* Page name under "Saguaro Prints" in each header: larger and bolder so it
   stands apart from the page links. Keeps each page's own font. */
.brand .brand-sub{
  display: block; font-size: 18px; font-weight: 700; line-height: 1.25;
  color: var(--text, inherit); letter-spacing: 0.01em; margin-top: 6px;
}
@media (max-width: 520px){ .brand .brand-sub{ font-size: 17px; } }

/* Cart link at the bottom of every page — a backup to the top-right button. */
.sp-foot-cart{ display: flex; justify-content: center; padding: 6px 16px 40px; }
.sp-foot-cart a{
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border-radius: 999px;
  border: 1px solid var(--line, #888); background: var(--card, transparent);
  color: var(--text, var(--ink, inherit)); text-decoration: none;
  font: 600 15px/1 system-ui, -apple-system, sans-serif;
}
.sp-foot-cart a:hover{ border-color: currentColor; }
.sp-foot-cart .sp-count{
  display: inline-block; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
  background: currentColor; text-align: center; font-size: 12.5px; line-height: 22px;
}
.sp-foot-cart .sp-count > span{ color: var(--bg, #fff); }
