/* Torsis Motion Layer — additive storefront interactions */
:root {
  --torsis-motion-ease: cubic-bezier(.22,.68,0,1);
  --torsis-glass: rgba(61,16,22,.82);
}

/* Sticky, frosted header */
.torsis-header {
  position: sticky;
  top: 0;
  z-index: 1100;
  isolation: isolate;
}
body.admin-bar .torsis-header { top: 32px; }
.torsis-header .navbar {
  background: var(--torsis-glass, rgba(61,16,22,.88)) !important;
  -webkit-backdrop-filter: saturate(155%) blur(16px);
  backdrop-filter: saturate(155%) blur(16px);
  border-bottom: 1px solid rgba(242,223,173,.34) !important;
  box-shadow: 0 8px 28px rgba(28,8,11,.13);
  transition: background .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.torsis-header.is-scrolled .navbar {
  background: rgba(48,12,17,.94) !important;
  border-bottom-color: rgba(201,154,53,.58) !important;
  box-shadow: 0 10px 30px rgba(28,8,11,.2);
}
.torsis-header .navbar-brand,
.torsis-header .nav-link,
.torsis-header .header-action { transition: color .2s ease, transform .2s var(--torsis-motion-ease), background-color .2s ease, box-shadow .2s ease; }
.torsis-header .nav-link:hover,
.torsis-header .nav-link:focus-visible { transform: translateY(-2px); }

/* Animated dropdowns; preserve the Walker/Bootstrap markup */
.torsis-header .dropdown { position: relative; }
.torsis-header .dropdown-menu {
  display: block;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(9px) scale(.98);
  transform-origin: top center;
  transition: opacity .2s ease, transform .24s var(--torsis-motion-ease), visibility .2s;
  border: 1px solid rgba(201,154,53,.3);
  border-radius: 12px;
  box-shadow: 0 16px 36px rgba(30,8,12,.18);
}
.torsis-header .dropdown:hover > .dropdown-menu,
.torsis-header .dropdown:focus-within > .dropdown-menu,
.torsis-header .dropdown.show > .dropdown-menu {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}
.torsis-header .dropdown-item { transition: color .18s ease, background-color .18s ease, padding-inline .18s ease; }
.torsis-header .dropdown-item:hover,
.torsis-header .dropdown-item:focus-visible { padding-inline-start: 1.35rem; }

/* Consistent hover feedback */
.torsis-button, .torsis-details-button, .torsis-add-to-cart,
.torsis-product-card-actions .button, .torsis-footer-shop-link,
.torsis-header .header-action {
  transition: transform .22s var(--torsis-motion-ease), box-shadow .22s ease,
    background-color .2s ease, border-color .2s ease, color .2s ease;
}
.torsis-button:hover, .torsis-details-button:hover,
.torsis-add-to-cart:hover, .torsis-product-card-actions .button:hover,
.torsis-footer-shop-link:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 22px rgba(61,16,22,.16);
}
.torsis-button:active, .torsis-details-button:active,
.torsis-add-to-cart:active, .torsis-product-card-actions .button:active {
  transform: translateY(-1px) scale(.985);
}

/* Tilt is driven by CSS variables and only enabled for fine pointers */
.torsis-home-product, .torsis-product-card,
.torsis-shop-page ul.products li.product {
  transform-style: preserve-3d;
  will-change: transform;
}
.torsis-home-product.is-tilting, .torsis-product-card.is-tilting,
.torsis-shop-page ul.products li.product.is-tilting {
  transition: transform .12s ease-out, box-shadow .2s ease, border-color .2s ease;
}
@media (hover: hover) and (pointer: fine) {
  .torsis-home-product.is-tilting:hover, .torsis-product-card.is-tilting:hover,
  .torsis-shop-page ul.products li.product.is-tilting:hover {
    box-shadow: 0 18px 38px rgba(58,25,22,.14);
  }
}

/* Scroll reveal: content remains visible if JS/observer is unavailable */
.js .torsis-reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .65s ease, transform .65s var(--torsis-motion-ease);
}
.js .torsis-reveal.is-revealed { opacity: 1; transform: translateY(0); }
.js .torsis-reveal[data-reveal-delay="1"] { transition-delay: .08s; }
.js .torsis-reveal[data-reveal-delay="2"] { transition-delay: .16s; }
.js .torsis-reveal[data-reveal-delay="3"] { transition-delay: .24s; }

/* Back-to-top */
.torsis-back-to-top {
  position: fixed;
  inset-inline-end: 1.25rem;
  bottom: 1.25rem;
  z-index: 1250;
  display: inline-flex;
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(242,223,173,.65);
  border-radius: 50%;
  color: #351c0a;
  background: linear-gradient(135deg,#f2dfad,#d5ad54);
  box-shadow: 0 8px 24px rgba(35,10,12,.2);
  font-size: 1.35rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity .22s ease, visibility .22s ease, transform .22s ease, box-shadow .2s ease;
  cursor: pointer;
}
.torsis-back-to-top.is-visible { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0); }
.torsis-back-to-top:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(35,10,12,.26); }
.torsis-back-to-top:focus-visible { outline: 3px solid var(--torsis-burgundy); outline-offset: 4px; }

/* Custom cursor is intentionally subtle and desktop-only */
.torsis-cursor, .torsis-cursor-dot {
  position: fixed;
  top: 0; left: 0;
  z-index: 99998;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s ease, width .2s ease, height .2s ease, background-color .2s ease, border-color .2s ease;
}
.torsis-cursor {
  width: 30px; height: 30px;
  border: 1px solid rgba(201,154,53,.9);
  background: rgba(201,154,53,.06);
  transform: translate(-50%,-50%);
}
.torsis-cursor-dot { width: 5px; height: 5px; background: #d7ad55; transform: translate(-50%,-50%); }
.torsis-cursor.is-active, .torsis-cursor-dot.is-active { opacity: 1; }
.torsis-cursor.is-hover { width: 44px; height: 44px; background: rgba(201,154,53,.14); border-color: #e7c777; }
body.torsis-custom-cursor, body.torsis-custom-cursor a,
body.torsis-custom-cursor button, body.torsis-custom-cursor input { cursor: none !important; }

@media (max-width: 767.98px) {
  .torsis-back-to-top { inset-inline-end: .8rem; bottom: calc(5.5rem + env(safe-area-inset-bottom)); width: 44px; height: 44px; }
  .torsis-header { top: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  .js .torsis-reveal { opacity: 1; transform: none; transition: none; }
  .torsis-header *, .torsis-back-to-top, .torsis-cursor, .torsis-cursor-dot,
  .torsis-home-product, .torsis-product-card { transition: none !important; }
}
