/* ============================================
   Rasa Jawara — Stylesheet
   ============================================ */

/* --- Base & Variables --- */
:root {
  --gold: #C8A165;
  --brown: #4A3321;
  --cream: #F9F5F0;
  --gold-light: rgba(200, 161, 101, 0.15);
  --brown-light: rgba(74, 51, 33, 0.08);
}

/* --- Hero Background --- */
.hero-bg {
  background-image: linear-gradient(rgba(30, 20, 10, 0.7), rgba(30, 20, 10, 0.7)),
    url("../assets/images/hero.jpg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

@media (max-width: 768px) {
  .hero-bg {
    background-attachment: scroll; /* Fixed BG breaks on mobile */
  }
}

/* --- Nav Link Underline --- */
.nav-link {
  position: relative;
  padding-bottom: 4px;
}

.nav-link::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 0;
  background-color: var(--gold);
  transition: width 0.3s ease-in-out;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* --- Category Button Active --- */
.cat-btn-active {
  background-color: var(--brown) !important;
  color: white !important;
  border-color: var(--brown) !important;
}

/* --- Skeleton Loading --- */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: 8px;
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-card {
  border-radius: 1rem;
  overflow: hidden;
  background: white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.skeleton-card .skeleton-img {
  height: 16rem;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

.skeleton-card .skeleton-text {
  height: 1rem;
  margin: 0.5rem 0;
  border-radius: 4px;
}

.skeleton-card .skeleton-text.short {
  width: 60%;
}

/* --- Scroll Animations --- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-60px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(60px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Staggered card animation */
.stagger-item {
  opacity: 0;
  transform: translateY(30px) scale(0.96);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.stagger-item.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* --- Product Card Hover --- */
.product-card {
  transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1),
              box-shadow 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(74, 51, 33, 0.12);
}

.product-card .card-img {
  transition: transform 0.7s cubic-bezier(0.23, 1, 0.32, 1);
}

.product-card:hover .card-img {
  transform: scale(1.08);
}

/* --- Cart Badge Pulse --- */
@keyframes badge-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.badge-pulse {
  animation: badge-pulse 0.4s ease-in-out;
}

/* --- Button Ripple --- */
.ripple-btn {
  position: relative;
  overflow: hidden;
}

.ripple-btn .ripple-effect {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transform: scale(0);
  animation: ripple-anim 0.6s ease-out;
  pointer-events: none;
}

@keyframes ripple-anim {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* --- Navbar Shrink --- */
.nav-shrink {
  padding-top: 0.5rem !important;
  padding-bottom: 0.5rem !important;
}

.nav-shrink img {
  height: 2rem !important;
}

/* --- Hero Typed Cursor --- */
.typed-cursor {
  display: inline-block;
  width: 3px;
  background-color: var(--gold);
  animation: blink 1s step-end infinite;
  margin-left: 2px;
  vertical-align: baseline;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* --- Floating Particles --- */
.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--gold);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  animation: float-up 4s ease-in-out infinite;
}

@keyframes float-up {
  0% { opacity: 0; transform: translateY(0) scale(0); }
  20% { opacity: 0.6; transform: translateY(-20px) scale(1); }
  100% { opacity: 0; transform: translateY(-120px) scale(0.3); }
}

/* --- Map Section --- */
.map-container {
  position: relative;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(74, 51, 33, 0.15);
}

.map-container iframe {
  width: 100%;
  height: 400px;
  border: none;
  filter: saturate(0.8) contrast(1.05);
  transition: filter 0.3s;
}

.map-container:hover iframe {
  filter: saturate(1) contrast(1);
}

.map-overlay-card {
  position: absolute;
  bottom: 1.5rem;
  left: 1.5rem;
  background: white;
  border-radius: 1rem;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  max-width: 320px;
  z-index: 10;
}

@media (max-width: 640px) {
  .map-overlay-card {
    position: relative;
    bottom: auto;
    left: auto;
    margin-top: 1rem;
    max-width: 100%;
  }

  .map-container iframe {
    height: 280px;
  }
}

/* --- Receipt / Kwitansi --- */
.receipt-paper {
  font-family: 'Courier New', monospace;
  max-width: 320px;
  margin: 0 auto;
}

/* --- Toast Notification --- */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--brown);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 0.875rem;
  z-index: 9999;
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s;
  box-shadow: 0 8px 24px rgba(74, 51, 33, 0.25);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* --- Smooth Product Grid Transition --- */
.product-grid-enter {
  animation: grid-fade-in 0.4s ease forwards;
}

@keyframes grid-fade-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Print Styles --- */
@media print {
  .no-print { display: none !important; }
  body { background: white; }
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--cream);
}

::-webkit-scrollbar-thumb {
  background: var(--gold);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--brown);
}

/* --- Selection --- */
::selection {
  background: var(--gold);
  color: white;
}
