/* Salgadaria Shop — shared custom styles */

/* Material Symbols */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* Elevation / shadow system */
.shadow-soft {
  box-shadow: 0 2px 8px rgba(42, 18, 6, 0.08);
}
.card-shadow {
  box-shadow: 0 4px 20px rgba(42, 18, 6, 0.08);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.card-shadow:hover {
  box-shadow: 0 12px 32px rgba(42, 18, 6, 0.18);
}
.cta-shadow {
  box-shadow: 0 10px 20px -5px rgba(204, 34, 24, 0.35);
}
.combo-card-shadow {
  box-shadow: 0 10px 0 0 rgba(42, 18, 6, 0.1);
}
.combo-card-shadow-dark {
  box-shadow: 0 10px 0 0 rgba(42, 18, 6, 0.15);
}
.combo-card-shadow-gold {
  box-shadow: 0 10px 0 0 rgba(116, 91, 0, 0.1);
}
.combo-card-shadow-gold-dark {
  box-shadow: 0 10px 0 0 rgba(116, 91, 0, 0.15);
}

/* Dot-grid background pattern used on combos page */
.bg-pattern {
  background-image: radial-gradient(rgba(166, 0, 3, 0.05) 2px, transparent 2px);
  background-size: 24px 24px;
}

/* ─── Entrance animation ────────────────────────────────────────── */
@keyframes blurSlideUp {
  from { opacity: 0; filter: blur(4px); transform: translateY(48px); }
  to   { opacity: 1; filter: blur(0px); transform: translateY(0);    }
}
@keyframes blurSlideUpImage {
  from { opacity: 0; filter: blur(10px); transform: scale(0.92); }
  to   { opacity: 1; filter: blur(0px);  transform: scale(1);    }
}
@keyframes lineReveal {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Elements wait hidden until JS triggers them */
[data-anim] { opacity: 0; }
[data-anim].anim-ready { opacity: 1; }

/* Section / card / text entrance */
[data-anim~="section"].anim-in,
[data-anim~="card"].anim-in,
[data-anim~="text"].anim-in {
  animation: blurSlideUp 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

/* Image entrance */
[data-anim~="image"].anim-in {
  animation: blurSlideUpImage 0.65s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* Line reveal */
[data-anim~="line"].anim-in {
  transform-origin: left;
  animation: lineReveal 0.9s cubic-bezier(0.76, 0, 0.24, 1) both;
}

/* Word-by-word hero words (JS splits and adds these) */
.hero-word {
  display: inline-block;
  margin-right: 0.28em;
  opacity: 0;
}
.hero-word.anim-in {
  animation: blurSlideUp 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

/* ─── Auto fade-up (applied by JS to elements without data-anim) ── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(60px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up { opacity: 0; }
.fade-up.anim-in {
  animation: fadeInUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ─── Reduced motion overrides ──────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  [data-anim~="section"].anim-in,
  [data-anim~="card"].anim-in,
  [data-anim~="text"].anim-in,
  [data-anim~="image"].anim-in,
  [data-anim~="line"].anim-in,
  .hero-word.anim-in,
  .fade-up.anim-in {
    animation: fadeIn 0.4s ease both;
  }
}

/* ─── Card hover lift ───────────────────────────────────────────── */
.hover-lift {
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.25s ease;
}
.hover-lift:hover { transform: translateY(-7px) scale(1.018); }
.hover-lift:active { transform: scale(0.97); }

/* Button press */
.btn-press {
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.btn-press:hover  { transform: scale(1.05); }
.btn-press:active { transform: scale(0.97); }

/* Active nav link — desktop horizontal nav */
.nav-link-active {
  color: #a60003 !important;
  font-weight: 800;
  border-bottom: 3px solid #a60003;
  padding-bottom: 2px;
}

/* Mobile dropdown: left-accent instead of bottom border */
#mobile-menu .nav-link-active {
  border-bottom: none;
  padding-bottom: 0;
  border-left: 3px solid #a60003;
  padding-left: 13px; /* 16px total - 3px border */
  background: rgba(166, 0, 3, 0.05);
  border-radius: 0 4px 4px 0;
}

/* Nav link underline draw */
.nav-underline { position: relative; }
.nav-underline::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 100%; height: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.nav-underline:hover::after { transform: scaleX(1); }

/* Line-reveal (decorative dividers) */
[data-anim~="line"] {
  transform-origin: left;
  transform: scaleX(0);
}

/* Enroladinho image crop */
.img-enroladinho { object-position: center 65%; }

/* Focus-visible ring for keyboard nav */
:focus-visible {
  outline: 3px solid #a60003;
  outline-offset: 2px;
  border-radius: 4px;
}

/* ─── Cart toast ────────────────────────────────────────────────── */
.cart-toast {
  position: fixed;
  bottom: 5.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(0.75rem);
  background: #1c1b1f;
  color: #fff;
  padding: 0.6rem 1.2rem;
  border-radius: 9999px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.875rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 8500;
  white-space: nowrap;
  pointer-events: none;
}
.cart-toast--show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.cart-toast .material-symbols-outlined { font-size: 1.1rem; color: #4caf50; }

/* ─── FAQ accordion ─────────────────────────────────────────────── */
.faq-item summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: 'expand_more';
  font-family: 'Material Symbols Outlined';
  font-size: 1.5rem;
  color: #a60003;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
}
.faq-item[open] summary::after { transform: rotate(180deg); }
.faq-body {
  overflow: hidden;
  transition: height 0.32s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ─── Page transition overlay ───────────────────────────────────── */
#page-transition {
  position: fixed;
  inset: 0;
  background: #a60003;
  z-index: 9999;
  transform: translateY(105%);
  will-change: transform;
  pointer-events: none;
}
@keyframes ptEnter {
  from { transform: translateY(105%); }
  to   { transform: translateY(0); }
}
@keyframes ptLeave {
  from { transform: translateY(0); }
  to   { transform: translateY(-105%); }
}
#page-transition.pt-enter {
  pointer-events: all;
  animation: ptEnter 0.42s cubic-bezier(0.76, 0, 0.24, 1) forwards;
}
#page-transition.pt-leave {
  animation: ptLeave 0.48s cubic-bezier(0.76, 0, 0.24, 1) forwards;
}

/* ─── Sticky Cart Note ──────────────────────────────────────────── */
#sticky-cart {
  position: fixed;
  top: calc(5.5rem + 50px);
  right: 18%;
  width: 215px;
  background: #fef9a7;
  padding: 2.8rem 1.3rem 1.3rem;
  border-radius: 2px;
  box-shadow:
    3px 4px 0 rgba(200, 175, 0, 0.28),
    5px 8px 24px rgba(0, 0, 0, 0.22);
  transform: rotate(-3deg);
  transform-origin: top center;
  z-index: 1100;
  opacity: 0;
  pointer-events: none;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
#sticky-cart button { cursor: pointer; }
#sticky-cart.note-open {
  opacity: 1;
  pointer-events: all;
  animation: noteEnter 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
#sticky-cart.note-close {
  animation: noteExit 0.3s ease forwards;
  pointer-events: none;
}
@keyframes noteEnter {
  from { opacity: 0; transform: translateY(-28px) rotate(-3deg) scale(0.75); }
  to   { opacity: 1; transform: translateY(0)      rotate(-3deg) scale(1);   }
}
@keyframes noteExit {
  to   { opacity: 0; transform: translateY(-18px) rotate(-3deg) scale(0.82); }
}

#sticky-clear {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  background: none;
  border: none;
  padding: 2px;
  line-height: 1;
  cursor: pointer;
  color: rgba(100, 80, 0, 0.35);
  transition: color 0.15s ease, transform 0.15s ease;
}
#sticky-clear:hover { color: #a60003; transform: scale(1.15); }
#sticky-clear .material-symbols-outlined { font-size: 1rem; }

.sticky-pin {
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 38px;
  filter: drop-shadow(1px 2px 4px rgba(0,0,0,0.38));
}

.sticky-title {
  font-family: 'Caveat', cursive;
  font-size: 1rem;
  font-weight: 700;
  color: #555;
  margin: 0 0 0.45rem;
  padding-bottom: 0.4rem;
  border-bottom: 1.5px solid rgba(100, 80, 0, 0.18);
}

#sticky-items {
  list-style: none;
  padding: 0;
  margin: 0 0 0.5rem;
}

.sticky-item {
  font-family: 'Caveat', cursive;
  font-size: 1.05rem;
  color: #333;
  line-height: 1.65;
  overflow: hidden;
}
.sticky-item.instant  { clip-path: inset(0 0% 0 0); }
.sticky-item.write-in {
  clip-path: inset(0 100% 0 0);
  animation: writeIn 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.08s forwards;
}
@keyframes writeIn {
  to { clip-path: inset(0 0% 0 0); }
}

.sticky-divider {
  border: none;
  border-top: 1.5px dashed rgba(100, 80, 0, 0.22);
  margin: 0 0 0.5rem;
}

.sticky-total-row {
  font-family: 'Caveat', cursive;
  font-size: 1.05rem;
  font-weight: 700;
  color: #a60003;
  display: flex;
  justify-content: space-between;
}

.sticky-order-btn {
  margin-top: 0.7rem;
  width: 100%;
  background: #a60003;
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0.38rem 0;
  font-family: 'Caveat', cursive;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.01em;
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
  min-height: unset;
}
.sticky-order-btn:hover  { transform: scale(1.05) rotate(-1deg); }
.sticky-order-btn:active { transform: scale(0.97); }

/* ─── Logo watermark on red cards ──────────────────────────────── */
.logo-watermark::before {
  content: '';
  position: absolute;
  bottom: -30%;
  right: -30%;
  width: 110%;
  height: 110%;
  background-image: url('logo.png');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.13;
  pointer-events: none;
  z-index: 0;
}
.logo-watermark > * {
  position: relative;
  z-index: 1;
}

/* ─── Responsive guards ─────────────────────────────────────────── */
html, body { overflow-x: hidden; }
/* scroll-behavior: smooth; — handled by Lenis in smooth-scroll.js */

/* Ensure hero image doesn't overflow its column on small screens */
@media (max-width: 767px) {
  .hero-img-wrap { margin-top: 1.5rem; }
  /* Slightly shrink hero H1 on very small phones */
  .text-h1-hero-mobile { font-size: clamp(36px, 10vw, 48px); }
}

/* Minimum tap target size across interactive elements */
button, [role="button"], a {
  min-height: 44px;
  min-width: 44px;
}
/* Override for inline text links (don't need 44px height) */
p a, footer a, nav a { min-height: unset; min-width: unset; }

/* ─── Checkout Order Overlay ─────────────────────────────────────── */
@keyframes spinOrder { to { transform: rotate(360deg); } }
@keyframes ckDraw    { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
@keyframes xPop      { 0% { transform: scale(0); opacity: 0; } 60% { transform: scale(1.25); opacity: 1; } 100% { transform: scale(1); } }
@keyframes ovFadeUp  { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

#order-overlay {
  position: absolute; inset: 0; border-radius: 20px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; z-index: 10;
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease;
  background: #fff8ee;
}
#order-overlay.ov-active { opacity: 1; pointer-events: all; }

.ov-spinner {
  width: 52px; height: 52px; border-radius: 50%;
  border: 3.5px solid #f0d9be; border-top-color: #a60003;
  animation: spinOrder .75s linear infinite;
}
.ov-icon-wrap {
  width: 68px; height: 68px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.ov-icon-wrap.ok  { background: #d4edda; }
.ov-icon-wrap.err { background: #ffdad5; }
.ov-icon-wrap svg.ok  { animation: xPop .35s ease both; }
.ov-icon-wrap svg.err { animation: xPop .35s ease both; }
.ov-label {
  font-family: Nunito, sans-serif; font-size: 15px; font-weight: 700;
  text-align: center; animation: ovFadeUp .4s .15s ease both;
}
.ov-label.ok  { color: #1a6b00; }
.ov-label.err { color: #a60003; }
.ov-retry {
  padding: 8px 22px; border-radius: 20px; border: 1.5px solid #f0d9be;
  background: #fff; font-family: Nunito, sans-serif; font-size: 12px;
  font-weight: 700; color: #5c403c; cursor: pointer;
  animation: ovFadeUp .4s .3s ease both; min-height: unset;
}

/* ─── Encomendas overlay (same mechanics as checkout) ─── */
#enc-overlay {
  position: absolute; inset: 0; border-radius: 20px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; z-index: 10;
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease;
  background: #fff8ee;
}
#enc-overlay.ov-active { opacity: 1; pointer-events: all; }

/* form fade-out on success */
#form-inner {
  transition: opacity .35s ease, transform .35s ease;
}
#form-inner.enc-fading {
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
}
