/* Page-level component styles for Fista frontend (pairs with local tailwind.css) */
* { scroll-behavior: smooth; }
body { font-family: 'Inter', sans-serif; }
.font-display { font-family: 'Playfair Display', serif; }

.hero-gradient { background: linear-gradient(135deg, #e8e4d9 0%, #d4cfc3 50%, #c8c3b5 100%); }
.animate-float { animation: float 6s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0px); } 50% { transform: translateY(-15px); } }
.animate-slide-up { animation: slideUp 0.8s ease-out forwards; opacity: 0; }
@keyframes slideUp { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: translateY(0); } }

/* Hero image slider */
.hero-slider {
  position: relative;
  border-radius: 1.5rem;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.28);
  background: #ddd8cc;
}
.hero-slider-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 5 / 6;
  max-height: 600px;
}
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.7s ease, visibility 0.7s ease;
  z-index: 1;
}
.hero-slide.is-active {
  opacity: 1;
  visibility: visible;
  z-index: 2;
}
.hero-slide-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hero-slide-caption {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 3;
  padding: 0.65rem 1rem;
  border-radius: 0.75rem;
  background: rgba(15, 41, 24, 0.72);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  backdrop-filter: blur(4px);
}
.hero-slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  border: none;
  background: rgba(255, 255, 255, 0.92);
  color: #1a4d2e;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.35);
  transition: background 0.2s ease, transform 0.2s ease;
}
.hero-slider-btn:hover {
  background: #fff;
  transform: translateY(-50%) scale(1.05);
}
.hero-slider-prev { left: 0.75rem; }
.hero-slider-next { right: 0.75rem; }
.hero-slider-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.85rem;
  z-index: 5;
  display: flex;
  justify-content: center;
  gap: 0.45rem;
  pointer-events: none;
}
.hero-slider-dot {
  pointer-events: auto;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 9999px;
  border: none;
  padding: 0;
  background: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transition: width 0.25s ease, background 0.25s ease;
}
.hero-slider-dot.is-active {
  width: 1.35rem;
  background: #1a4d2e;
}
.hero-float-badge {
  position: absolute;
  left: -1rem;
  bottom: -1rem;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 20px 40px -16px rgba(0, 0, 0, 0.3);
  padding: 1rem;
}
@media (max-width: 640px) {
  .hero-float-badge { left: 0.75rem; bottom: 2.75rem; padding: 0.75rem; }
  .hero-slider-viewport { aspect-ratio: 4 / 5; max-height: 420px; }
}

.category-card { transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); }
.category-card:hover { transform: translateY(-8px); box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25); }
.product-card { transition: all 0.3s ease; }
.product-card:hover { transform: scale(1.02); }
.btn-primary { background: linear-gradient(135deg, #1a4d2e 0%, #2d6a4f 100%); transition: all 0.3s ease; color: #fff; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -10px rgba(26, 77, 46, 0.5); }

.scroll-indicator { position: fixed; top: 0; left: 0; height: 3px; background: linear-gradient(90deg, #1a4d2e, #c9a227); z-index: 9999; transition: width 0.1s; pointer-events: none; }

/* Off-screen overlays must NOT block clicks (fixes cart icon) */
.mobile-menu { transform: translateX(-100%); transition: transform 0.3s ease-in-out; pointer-events: none; }
.mobile-menu.active { transform: translateX(0); pointer-events: auto; }

.modal-overlay { opacity: 0; visibility: hidden; pointer-events: none; transition: all 0.3s ease; }
.modal-overlay.active { opacity: 1; visibility: visible; pointer-events: auto; }
.modal-content { transform: scale(0.92) translateY(24px); transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); }
.modal-overlay.active .modal-content { transform: scale(1) translateY(0); }

/* ===== Auth Modal (CSS-driven medium size) ===== */
.auth-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.auth-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.auth-modal {
  position: relative;
  z-index: 1;
  width: 100%;
  background: #fff;
  border-radius: 1.25rem;
  box-shadow: 0 22px 50px -14px rgba(15, 41, 24, 0.4);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
/* Size variants */
.auth-modal--sm { max-width: 360px; max-height: min(88vh, 560px); }
.auth-modal--md { max-width: 440px; max-height: min(90vh, 640px); }
.auth-modal--lg { max-width: 520px; max-height: min(92vh, 720px); }

.auth-modal-close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  z-index: 10;
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  background: #f3f4f6;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}
.auth-modal-close:hover { background: #e5e7eb; color: #111827; }

.auth-modal-header {
  padding: 1.75rem 1.75rem 0;
  text-align: center;
  flex-shrink: 0;
}
.auth-modal-brand { margin-bottom: 1.15rem; }
.auth-brand-logo {
  display: inline-block;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.85rem;
  font-weight: 700;
  font-style: italic;
  color: #b91c1c;
  line-height: 1;
  letter-spacing: -0.02em;
}
.auth-brand-logo span {
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 400;
  vertical-align: super;
  margin-left: 1px;
}
.auth-brand-sub {
  margin: 0.45rem 0 0;
  font-size: 0.8125rem;
  color: #6b7280;
  font-weight: 400;
}

.auth-tabs {
  display: flex;
  justify-content: center;
  gap: 2.25rem;
  border-bottom: 1px solid #e5e7eb;
}
.auth-tab {
  position: relative;
  padding: 0 0.15rem 0.7rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: #9ca3af;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s ease;
}
.auth-tab:hover { color: #4b5563; }
.auth-tab::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 0;
  height: 2.5px;
  border-radius: 2px 2px 0 0;
  background: #1a4d2e;
  transition: width 0.25s ease;
}
.auth-tab.active { color: #1a4d2e; font-weight: 700; }
.auth-tab.active::after { width: 100%; }

.auth-form-body {
  padding: 1.15rem 1.75rem 1.5rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
  min-height: 0;
}
.auth-form-body::-webkit-scrollbar { width: 5px; }
.auth-form-body::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }

.auth-form { display: flex; flex-direction: column; gap: 0.8rem; }
.auth-field label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.35rem;
}
.auth-input {
  position: relative;
  display: flex;
  align-items: center;
}
.auth-input > i:first-child {
  position: absolute;
  left: 0.9rem;
  color: #9ca3af;
  font-size: 0.82rem;
  pointer-events: none;
  z-index: 1;
}
.auth-input input {
  width: 100%;
  height: 2.65rem;
  padding: 0 2.5rem 0 2.5rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  background: #f9fafb;
  font-size: 0.875rem;
  color: #111827;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.auth-input input::placeholder { color: #9ca3af; }
.auth-input input:focus {
  outline: none;
  border-color: #1a4d2e;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(26, 77, 46, 0.12);
}
.auth-toggle-pass {
  position: absolute;
  right: 0.75rem;
  color: #9ca3af;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
  font-size: 0.85rem;
}
.auth-toggle-pass:hover { color: #1a4d2e; }
.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: -0.15rem;
}
.auth-check {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  font-size: 0.78rem;
  color: #6b7280;
}
.auth-check input {
  width: 0.95rem;
  height: 0.95rem;
  accent-color: #1a4d2e;
  border-radius: 0.25rem;
}
.auth-submit {
  width: 100%;
  height: 2.75rem;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 0.9rem;
  margin-top: 0.2rem;
  border: none;
  cursor: pointer;
  color: #fff;
}
.auth-switch {
  text-align: center;
  font-size: 0.78rem;
  color: #6b7280;
  margin: 0.15rem 0 0;
}
.auth-switch-btn {
  background: none;
  border: none;
  color: #1a4d2e;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  font-size: inherit;
}
.auth-switch-btn:hover { text-decoration: underline; }
.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.65rem 0.8rem;
  border-radius: 0.65rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 0.78rem;
  line-height: 1.4;
}
.auth-alert i { margin-top: 0.1rem; }

.tab-btn { position: relative; }
.tab-btn.active { color: #1a4d2e; font-weight: 600; }
.form-section { display: none; animation: formFade 0.35s ease; }
.form-section.active { display: block; }
@keyframes formFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.account-dropdown.show { display: block !important; animation: formFade 0.2s ease; }

@media (max-width: 480px) {
  .auth-modal-overlay { padding: 0.75rem; align-items: flex-end; }
  .auth-modal--md,
  .auth-modal--sm,
  .auth-modal--lg {
    max-width: 100%;
    max-height: min(92vh, 680px);
    border-radius: 1.25rem 1.25rem 0.75rem 0.75rem;
  }
  .auth-modal-header { padding: 1.5rem 1.25rem 0; }
  .auth-form-body { padding: 1rem 1.25rem 1.35rem; }
  .auth-tabs { gap: 1.75rem; }
  .auth-brand-logo { font-size: 1.65rem; }
}

.star-rating { color: #fbbf24; }
.discount-badge { background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%); }
.feature-icon { transition: all 0.3s ease; }
.feature-icon:hover { transform: rotate(10deg) scale(1.1); }
.blog-card img { transition: transform 0.5s ease; }
.blog-card:hover img { transform: scale(1.1); }
.reveal { opacity: 0; transform: translateY(30px); transition: all 0.8s ease-out; }
.reveal.active { opacity: 1; transform: translateY(0); }

.chatbot-widget {
  position: fixed;
  bottom: 6rem;
  right: 1.5rem;
  z-index: 50;
  /* Parent must not steal clicks over cart/checkout (window still has layout size when scaled) */
  pointer-events: none;
}
.chatbot-widget #chatToggle {
  pointer-events: auto;
}
.chatbot-window {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.75rem);
  transform: scale(0);
  transform-origin: bottom right;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  visibility: hidden;
}
.chatbot-window.active {
  transform: scale(1);
  pointer-events: auto;
  visibility: visible;
}
.chat-message { animation: msgPop 0.3s ease; }
@keyframes msgPop { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.typing-dot { animation: typing 1.4s infinite ease-in-out both; }
.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }
@keyframes typing { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1); } }

.faq-item { border-bottom: 1px solid #e5e7eb; }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.4s ease, padding 0.4s ease; }
.faq-answer.open { max-height: 300px; }
.faq-icon { transition: transform 0.3s ease; }
.faq-icon.open { transform: rotate(180deg); }

/* Keep header clickable above off-screen menus */
#navbar { position: sticky; z-index: 60; }
#navbar a, #navbar button { position: relative; z-index: 1; pointer-events: auto; }

/* Toast notifications */
.fista-toast-wrap {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: min(380px, calc(100vw - 2rem));
  pointer-events: none;
}
.fista-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(15, 41, 24, 0.18);
  border: 1px solid #e5e7eb;
  animation: toastIn 0.35s ease;
  font-size: 0.875rem;
  color: #1f2937;
}
.fista-toast.hide { animation: toastOut 0.3s ease forwards; }
.fista-toast.success { border-left: 4px solid #1a4d2e; }
.fista-toast.error { border-left: 4px solid #dc2626; }
.fista-toast.info { border-left: 4px solid #c9a227; }
.fista-toast .toast-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.85rem;
}
.fista-toast.success .toast-icon { background: rgba(26, 77, 46, 0.1); color: #1a4d2e; }
.fista-toast.error .toast-icon { background: #fef2f2; color: #dc2626; }
.fista-toast.info .toast-icon { background: rgba(201, 162, 39, 0.15); color: #c9a227; }
.fista-toast .toast-body { flex: 1; padding-top: 0.15rem; line-height: 1.4; }
.fista-toast .toast-close {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 0.15rem;
  line-height: 1;
}
.fista-toast .toast-close:hover { color: #374151; }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateX(24px); }
}

/* Submit button spinner (also injected by JS; kept here for first paint) */
.btn-loading { position: relative !important; pointer-events: none !important; opacity: 0.85 !important; cursor: wait !important; }
.btn-loading .btn-loading-label { opacity: 0 !important; }
.btn-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1.1rem;
  height: 1.1rem;
  margin: -0.55rem 0 0 -0.55rem;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: fistaSpin 0.7s linear infinite;
}
.btn-loading.btn-loading-dark::after {
  border-color: rgba(26, 77, 46, 0.2);
  border-top-color: #1a4d2e;
}
@keyframes fistaSpin { to { transform: rotate(360deg); } }
#fistaPageLoader {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(15, 41, 24, 0.28);
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}
#fistaPageLoader.active { display: flex; }
#fistaPageLoader .fista-page-spinner {
  width: 52px;
  height: 52px;
  border: 3px solid rgba(255,255,255,0.35);
  border-top-color: #c9a227;
  border-radius: 50%;
  animation: fistaSpin 0.7s linear infinite;
}
