/* Define CSS Variables for consistent colors */
:root {
  --color-gold-dark: #b38f40;
  --color-gold-light: #d4af37;
  --color-gold-deep-brown: #704c1b;
  --color-text-dark: #333;
  --color-white: #ffffff;
  --color-gray-100: #f3f4f6;
  --color-gray-200: #e5e7eb;
  --color-gray-300: #d1d5db;
  --color-gray-500: #6b7280;
  --color-gray-700: #4b5563;
  --color-gray-800: #1f2937;
  --color-green-500: #22c55e;
  --color-red-500: #ef4444;
  --color-blue-dark: #1e40af;
}

/* Base styles & Font Changes */
body {
  font-family: 'Montserrat', sans-serif; /* Primary font for body text */
  background: radial-gradient(circle at center, #fdfaf6 0%, #e0d9d0 100%);
  color: var(--color-text-dark);
  /* Optional: Styles for content protection (user-select) */
  /* -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none; */
}

/* Apply Playfair Display to all headings for a decorative look */
h1, h2, h3 {
  font-family: 'Playfair Display', serif;
}

/* Custom color utilities */
.text-gold-dark {
  color: var(--color-gold-dark);
}
.bg-gold-light {
  background-color: var(--color-gold-light);
}
.bg-gold-dark {
  background-color: var(--color-gold-deep-brown);
}

/* Primary Button Styling */
.btn-primary {
  background: linear-gradient(to bottom, #e0c15c, #d4af37);
  @apply text-white px-6 py-3 rounded-lg shadow-md hover:bg-gold-dark transition-colors duration-300;
}

/* Product Card Shadow */
.product-card-shadow {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Hero Overlay Text Readability - REMOVED as text is now part of the image */
/* .hero-overlay-text h2, .hero-overlay-text p {
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
} */

/* Main Hero Carousel Specific Styles */
.carousel-container {
  position: relative;
  width: 100%;
  overflow: hidden;
  /* REMOVED: max-height: 600px; - THIS LINE WAS HERE AND IS NOW REMOVED */
  min-height: 250px; /* Base height for mobile to prevent collapse */
  /* Dynamic height for the carousel on larger screens, matching 1920x872px aspect ratio */
  padding-top: 45.4%; /* (872 / 1920) * 100% - UPDATED FROM 40% */
  height: 0; /* Set height to 0 when using padding-top for aspect ratio */
  background-size: cover;
  background-position: center;
}

.carousel-slide {
  position: absolute; /* Layer slides */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%; /* Take full height of container */
  opacity: 0; /* Start invisible */
  visibility: hidden; /* Hide from screen readers/interaction when invisible */
  transition: opacity 0.7s ease-in-out; /* Smooth fade effect */
  pointer-events: none; /* Prevents interaction with hidden slides */
}
.carousel-slide.active {
  opacity: 1; /* Fade in */
  visibility: visible; /* Make visible */
  z-index: 1; /* Bring active slide to front */
  pointer-events: auto; /* Allow interaction on active slide */
}
.carousel-slide img {
  width: 100%;
  height: 100%; /* Fill the slide div */
  object-fit: cover; /* Ensures image covers the area, cropping if necessary */
}
.carousel-dots {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 2; /* Above carousel content */
}
.carousel-dots .dot {
  height: 10px;
  width: 10px;
  background-color: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.3s ease;
}
.carousel-dots .dot.active,
.carousel-dots .dot:hover {
  background-color: var(--color-white);
}

/* For mobile, fixed height for the carousel container and object-fit: cover */
@media (max-width: 767px) {
  .carousel-container {
    padding-top: 0;
    height: 250px;
  }
  .carousel-slide img { /* Target img within mobile carousel container */
    object-fit: cover; /* Changed to 'cover' to prevent background spaces on mobile */
  }
}


/* Testimonial Carousel Specific Styles */
.testimonial-carousel-container {
  position: relative;
  overflow: hidden;
  width: 100%;
}
.testimonial-carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  padding: 1rem;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.7s ease-in-out;
  pointer-events: none;
}
.testimonial-carousel-slide.active {
  opacity: 1;
  visibility: visible;
  position: relative;
  pointer-events: auto;
}
.testimonial-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(0, 0, 0, 0.3);
  color: var(--color-white);
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  z-index: 10;
  border-radius: 50%;
}
.testimonial-arrow-left {
  left: 10px;
}
.testimonial-arrow-right {
  right: 10px;
}

/* Loading Overlay Styles */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  transition: opacity 0.3s ease-in-out;
  opacity: 0;
  visibility: hidden;
}
.loading-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Spinner Styles (General) */
.spinner {
  border: 6px solid var(--color-gray-200);
  border-top: 6px solid var(--color-gold-light);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Blinking Text Animation for Rates */
@keyframes text-blink-blue {
  0%, 100% { color: var(--color-gold-dark); }
  50% { color: var(--color-blue-dark); }
}

.blinking-rate {
  animation: text-blink-blue 3s infinite alternate;
}

/* Back to Top Button Styles */
#back-to-top {
  position: fixed;
  bottom: 150px;
  right: 10px;
  background-color: var(--color-red-500);
  color: var(--color-white);
  border-radius: 50%;
  padding: 0.75rem;
  font-size: 1.5rem;
  line-height: 1;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
  opacity: 0;
  visibility: hidden;
  z-index: 40;
  cursor: pointer;
}
#back-to-top.show {
  opacity: 1;
  visibility: visible;
}

/* Mobile Bottom Navigation Bar Styles */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: var(--color-white);
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
  z-index: 100;
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 60px;
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  text-decoration: none;
  color: var(--color-text-dark);
  font-size: 0.75rem;
  font-weight: 500;
  transition: color 0.2s ease-in-out, transform 0.2s ease-in-out;
}
.bottom-nav-item:hover, .bottom-nav-item.active {
  color: var(--color-gold-dark);
  transform: translateY(-2px);
}
.bottom-nav-item svg {
  width: 24px;
  height: 24px;
  margin-bottom: 4px;
  fill: currentColor;
}
/* Hide on desktop */
@media (min-width: 768px) {
  .bottom-nav {
    display: none;
  }
}

/* Animation for elements appearing on scroll */
.animate-fade-in-zoom {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.animate-fade-in-zoom.is-visible {
  opacity: 1;
  transform: scale(1);
}

/* Visually hidden utility for accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Highlight active main navigation links (desktop/mobile) */
.active-nav {
  color: var(--color-gold-dark) !important;
  font-weight: 700;
  @media (min-width: 768px) {
    border-bottom: 2px solid var(--color-gold-dark);
    padding-bottom: 2px;
  }
}

/* Highlight active category navigation links */
.active-category-nav {
  color: var(--color-gold-dark) !important;
  font-weight: 700;
  border-bottom: 2px solid var(--color-gold-dark);
  padding-bottom: 2px;
}

/* Add a subtle scale effect for product images on hover */
.product-card img {
  transition: transform 0.3s ease-in-out;
}
.product-card:hover img {
  transform: scale(1.02); /* Slightly zoom in the image on hover */
}

/* --- LOGO Specific Adjustments --- */
.logo img {
  object-fit: contain;
  width: auto;
}

/* --- Product Modal Overlay --- */
.product-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

.product-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* --- Product Modal Content (Enhanced transition) --- */
.product-modal-content {
  position: relative;
  max-width: 90%;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  background-color: var(--color-white); /* Explicit background for content */
  border-radius: 1rem; /* Tailwind's rounded-xl */
  padding: 1.5rem; /* Tailwind's p-6 */
  /* Combined transform for initial state (scale and slight slide up) */
  transform: translateY(20px) scale(0.95);
  opacity: 0;
  transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

.product-modal-overlay.active .product-modal-content {
  transform: translateY(0) scale(1); /* Final state: no slide, full scale */
  opacity: 1;
}

/* Close button for modal */
.product-modal-close {
  cursor: pointer;
  line-height: 1;
}

/* Spinner for modal image loading */
#modal-image-spinner {
  width: 40px;
  height: 40px;
  border-top: 4px solid var(--color-gold-light);
  border: 4px solid rgba(0,0,0,0.1);
  border-radius: 50%; /* Make it round */
  animation: spin 1s linear infinite; /* Reuse existing spin animation */
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1; /* Above image when image is hidden */
}

/* Ensure body doesn't scroll when modal is open */
body.modal-open {
  overflow: hidden;
}