/* CSS Custom Properties for Purple + Ivory Theme with fallbacks */
:root {
  --primary-purple: #800080;
  --secondary-purple: #663399;
  --light-purple: #9370DB;
  --dark-purple: #4B0082;
  --ivory: #FFFFF0;
  --off-white: #F5F5DC;
  --light-ivory: #FAF0E6;
  --text-dark: #2C1810;
  --text-muted: #6C757D;
  --shadow-custom: 0 8px 32px rgba(128, 0, 128, 0.15);
  --shadow-hover: 0 12px 40px rgba(128, 0, 128, 0.25);
  --transition: all 0.3s ease;
}

/* Fallback for browsers that don't support CSS custom properties */
@supports not (--custom: property) {
  :root {
    --primary-purple: #800080;
    --secondary-purple: #663399;
    --light-purple: #9370DB;
    --dark-purple: #4B0082;
    --ivory: #FFFFF0;
    --off-white: #F5F5DC;
    --light-ivory: #FAF0E6;
    --text-dark: #2C1810;
    --text-muted: #6C757D;
    --shadow-custom: 0 8px 32px rgba(128, 0, 128, 0.15);
    --shadow-hover: 0 12px 40px rgba(128, 0, 128, 0.25);
    --transition: all 0.3s ease;
  }
}

/* Typography with fallbacks */
body {
  font-family: 'Lato', 'Helvetica Neue', Arial, sans-serif;
  color: var(--text-dark);
  background-color: var(--ivory);
  /* Fallback for older browsers */
  color: #2C1810;
  background-color: #FFFFF0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', Georgia, serif;
  color: var(--dark-purple);
  /* Fallback for older browsers */
  color: #4B0082;
  font-weight: 600;
  line-height: 1.2;
}

/* Navbar Styling with vendor prefixes */
.navbar {
  background: rgba(255, 255, 240, 0.95) !important;
  background: -webkit-linear-gradient(rgba(255, 255, 240, 0.95), rgba(255, 255, 240, 0.95)) !important;
  background: linear-gradient(rgba(255, 255, 240, 0.95), rgba(255, 255, 240, 0.95)) !important;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  -webkit-transition: var(--transition);
  -moz-transition: var(--transition);
  -o-transition: var(--transition);
  transition: var(--transition);
  border-bottom: 1px solid rgba(128, 0, 128, 0.1);
  /* Fallback for browsers without backdrop-filter */
  background: rgba(255, 255, 240, 0.98) !important;
}

.navbar.scrolled {
  background: rgba(255, 255, 240, 0.98) !important;
  -webkit-box-shadow: var(--shadow-custom);
  -moz-box-shadow: var(--shadow-custom);
  box-shadow: var(--shadow-custom);
}

.navbar-brand {
  color: var(--primary-purple) !important;
  /* Fallback for older browsers */
  color: #800080 !important;
  font-weight: 700;
}

.navbar-brand i {
  color: var(--secondary-purple);
  /* Fallback for older browsers */
  color: #663399;
}

.nav-link {
  color: var(--dark-purple) !important;
  /* Fallback for older browsers */
  color: #4B0082 !important;
  font-weight: 500;
  position: relative;
  -webkit-transition: var(--transition);
  -moz-transition: var(--transition);
  -o-transition: var(--transition);
  transition: var(--transition);
}

.nav-link:hover {
  color: var(--primary-purple) !important;
  /* Fallback for older browsers */
  color: #800080 !important;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--primary-purple);
  /* Fallback for older browsers */
  background: #800080;
  -webkit-transition: var(--transition);
  -moz-transition: var(--transition);
  -o-transition: var(--transition);
  transition: var(--transition);
  -webkit-transform: translateX(-50%);
  -moz-transform: translateX(-50%);
  -ms-transform: translateX(-50%);
  -o-transform: translateX(-50%);
  transform: translateX(-50%);
}

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

/* Language Selector */
#languageSelect {
  border-color: var(--primary-purple);
  color: var(--dark-purple);
  /* Fallback for older browsers */
  border-color: #800080;
  color: #4B0082;
}

#languageSelect:focus {
  border-color: var(--secondary-purple);
  -webkit-box-shadow: 0 0 0 0.2rem rgba(128, 0, 128, 0.25);
  -moz-box-shadow: 0 0 0 0.2rem rgba(128, 0, 128, 0.25);
  box-shadow: 0 0 0 0.2rem rgba(128, 0, 128, 0.25);
}

/* Cart Button */
.btn-outline-primary {
  border-color: var(--primary-purple);
  color: var(--primary-purple);
  /* Fallback for older browsers */
  border-color: #800080;
  color: #800080;
}

.btn-outline-primary:hover {
  background-color: var(--primary-purple);
  border-color: var(--primary-purple);
  color: var(--ivory);
  /* Fallback for older browsers */
  background-color: #800080;
  border-color: #800080;
  color: #FFFFF0;
}

/* Hero Section */
.hero-section {
  height: 100vh;
  position: relative;
  background: var(--ivory);
  background: -webkit-linear-gradient(135deg, var(--ivory) 0%, var(--light-ivory) 100%);
  background: -moz-linear-gradient(135deg, var(--ivory) 0%, var(--light-ivory) 100%);
  background: -o-linear-gradient(135deg, var(--ivory) 0%, var(--light-ivory) 100%);
  background: linear-gradient(135deg, var(--ivory) 0%, var(--light-ivory) 100%);
  /* Fallback for older browsers */
  background: #FFFFF0;
}

.carousel {
  height: 100%;
}

.carousel-item {
  height: 100vh;
}

.carousel-item img {
  height: 100%;
  -webkit-object-fit: cover;
  -moz-object-fit: cover;
  -o-object-fit: cover;
  object-fit: cover;
  -webkit-filter: brightness(0.8) contrast(1.1);
  -moz-filter: brightness(0.8) contrast(1.1);
  -o-filter: brightness(0.8) contrast(1.1);
  filter: brightness(0.8) contrast(1.1);
}

.carousel-caption {
  background: rgba(255, 255, 240, 0.504);
  backdrop-filter: blur(10px);
  border-radius: 15px;
  padding: 2rem;
  color: var(--dark-purple);
  border: 1px solid rgba(128, 0, 128, 0.1);
}

.carousel-caption h1 {
  color: var(--primary-purple);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.carousel-caption p {
  color: var(--text-muted);
}

/* Buttons */
.btn-primary {
  background-color: var(--primary-purple);
  border-color: var(--primary-purple);
  color: var(--ivory);
  transition: var(--transition);
}

.btn-primary:hover {
  background-color: var(--secondary-purple);
  border-color: var(--secondary-purple);
  color: var(--ivory);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.btn-outline-primary {
  border-color: var(--primary-purple);
  color: var(--primary-purple);
}

.btn-outline-primary:hover {
  background-color: var(--primary-purple);
  border-color: var(--primary-purple);
  color: var(--ivory);
}

/* Product Cards */
.product-card {
  background: var(--ivory);
  border: 1px solid rgba(128, 0, 128, 0.1);
  border-radius: 15px;
  overflow: hidden;
  transition: var(--transition);
  box-shadow: var(--shadow-custom);
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary-purple);
}

.product-card .card-img-top {
  height: 250px;
  object-fit: cover;
  transition: var(--transition);
}

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

.product-card .card-title {
  color: var(--dark-purple);
  font-weight: 600;
}

.product-card .price {
  color: var(--primary-purple);
  font-size: 1.25rem;
  font-weight: 700;
}

.badge {
  background-color: var(--secondary-purple) !important;
  color: var(--ivory) !important;
}

/* Event Cards */
.event-card {
  background: var(--ivory);
  border: 1px solid rgba(128, 0, 128, 0.1);
  border-radius: 15px;
  transition: var(--transition);
  box-shadow: var(--shadow-custom);
}

.event-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary-purple);
}

.event-date {
  background: var(--primary-purple);
  color: var(--ivory);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  display: inline-block;
  margin-bottom: 1rem;
}

/* Contact Cards */
.contact-card {
  background: var(--ivory);
  border: 1px solid rgba(128, 0, 128, 0.1);
  border-radius: 15px;
  transition: var(--transition);
}

.contact-card:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--primary-purple);
}

.contact-info-item {
  display: flex;
  align-items: center;
  margin-bottom: 1.5rem;
}

.contact-info-item i {
  color: var(--primary-purple);
  font-size: 1.5rem;
  margin-right: 1rem;
}

/* Footer */
.footer-section {
  background: linear-gradient(135deg, var(--dark-purple) 0%, var(--primary-purple) 100%);
  color: var(--ivory);
}

.footer-section h5 {
  color: var(--ivory);
}

.footer-section a {
  color: var(--light-ivory);
  transition: var(--transition);
}

.footer-section a:hover {
  color: var(--ivory);
  text-decoration: none;
}

.social-links a {
  transition: var(--transition);
}

.social-links a:hover {
  color: var(--ivory) !important;
  transform: translateY(-2px);
}

/* Form Controls */
.form-control {
  border-color: rgba(128, 0, 128, 0.2);
  background-color: var(--light-ivory);
  color: var(--text-dark);
}

.form-control:focus {
  border-color: var(--primary-purple);
  box-shadow: 0 0 0 0.2rem rgba(128, 0, 128, 0.25);
  background-color: var(--ivory);
}

.form-label {
  color: var(--dark-purple);
  font-weight: 600;
}

/* Modal Styling */
.modal-content {
  background: var(--ivory);
  border: 1px solid rgba(128, 0, 128, 0.1);
  border-radius: 15px;
}

.modal-header {
  border-bottom: 1px solid rgba(128, 0, 128, 0.1);
  background: linear-gradient(135deg, var(--light-ivory) 0%, var(--ivory) 100%);
}

.modal-title {
  color: var(--dark-purple);
}

.modal-footer {
  border-top: 1px solid rgba(128, 0, 128, 0.1);
  background: var(--light-ivory);
}

/* Toast Styling */
.toast {
  background: var(--ivory);
  border: 1px solid rgba(128, 0, 128, 0.1);
  border-radius: 10px;
  box-shadow: var(--shadow-custom);
}

.toast-header {
  background: linear-gradient(135deg, var(--light-ivory) 0%, var(--ivory) 100%);
  border-bottom: 1px solid rgba(128, 0, 128, 0.1);
}

/* Cart Items */
.cart-item {
  display: flex;
  align-items: center;
  padding: 1rem;
  border: 1px solid rgba(128, 0, 128, 0.1);
  border-radius: 10px;
  margin-bottom: 1rem;
  background: var(--light-ivory);
  transition: var(--transition);
}

.cart-item:hover {
  background: var(--off-white);
  box-shadow: var(--shadow-custom);
}

.cart-item img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  margin-right: 1rem;
  border: 2px solid var(--primary-purple);
}

.cart-item-title {
  font-weight: 600;
  color: var(--dark-purple);
}

.cart-item-price {
  color: var(--primary-purple);
  font-weight: 700;
}

/* Cart refresh button styling */
.btn-outline-secondary {
  border-color: var(--primary-purple);
  color: var(--primary-purple);
  transition: var(--transition);
}

.btn-outline-secondary:hover {
  background-color: var(--primary-purple);
  border-color: var(--primary-purple);
  color: var(--ivory);
  transform: scale(1.05);
}

/* Cart refresh button specific styling */
.btn-outline-secondary[onclick*="refreshCart"] {
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.btn-outline-secondary[onclick*="refreshCart"]:hover {
  animation: spin 0.6s ease-in-out;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Ensure Bootstrap Icons are properly sized */
.bi {
  font-size: inherit;
  line-height: 1;
}

/* Cart badge styling */
#cartBadge {
  font-size: 0.65rem;
  font-weight: 600;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1;
  padding: 0 !important;
  transition: all 0.3s ease;
  z-index: 1000;
}

/* Cart badge animation */
#cartBadge.animate__animated {
  animation-duration: 0.5s;
}

#cartBadge.animate__pulse {
  animation-name: pulse;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

.quantity-btn {
  background: var(--primary-purple);
  color: var(--ivory);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  /* Fallback for older browsers */
  background: #800080;
  color: #FFFFF0;
}

.quantity-btn:hover {
  background: var(--secondary-purple);
  transform: scale(1.1);
  /* Fallback for older browsers */
  background: #663399;
}

.quantity-btn:active {
  transform: scale(0.95);
}

.quantity-btn i {
  font-size: 12px;
  line-height: 1;
}

/* Fallback for when Bootstrap Icons don't load */
.quantity-btn:not(:has(i))::before {
  content: attr(data-fallback);
  font-weight: bold;
}

/* Utility Classes */
.text-gold {
  color: var(--primary-purple) !important;
}

.bg-gold {
  background-color: var(--primary-purple) !important;
}

.border-gold {
  border-color: var(--primary-purple) !important;
}

.shadow-custom {
  box-shadow: var(--shadow-custom);
}

.rounded-custom {
  border-radius: 15px;
}

/* Animation Classes */
.fade-in {
  animation: fadeIn 0.8s ease-in-out;
}

.slide-in-left {
  animation: slideInLeft 0.8s ease-in-out;
}

.slide-in-right {
  animation: slideInRight 0.8s ease-in-out;
}

/* Keyframe Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Background Sections */
.bg-light {
  background-color: var(--light-ivory) !important;
}

/* Enhanced Mobile Responsiveness and Browser Compatibility */
@media (max-width: 768px) {
  .carousel-caption {
    padding: 1rem;
    margin: 0 1rem;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    /* Fallback for browsers without backdrop-filter */
    background: rgba(255, 255, 240, 0.95);
  }
  
  .carousel-caption h1 {
    font-size: 2rem;
    line-height: 1.3;
  }
  
  .carousel-caption p {
    font-size: 1rem;
    line-height: 1.4;
  }
  
  .product-card .card-img-top {
    height: 200px;
  }
  
  /* Improve touch targets on mobile */
  .btn {
    min-height: 44px;
    padding: 0.5rem 1rem;
  }
  
  .nav-link {
    padding: 0.75rem 1rem;
  }
  
  /* Better form controls on mobile */
  .form-control, .form-select {
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 0.75rem;
  }
}

@media (max-width: 576px) {
  .navbar-brand {
    font-size: 1.2rem;
  }
  
  .hero-section {
    height: 70vh;
  }
  
  .carousel-item {
    height: 70vh;
  }
  
  .cart-item {
    flex-direction: column;
    text-align: center;
  }
  
  .cart-item img {
    margin-right: 0;
    margin-bottom: 1rem;
  }
  
  /* Improve modal on small screens */
  .modal-dialog {
    margin: 0.5rem;
  }
  
  .modal-body {
    padding: 1rem;
  }
  
  /* Better button layout on small screens */
  .btn-group {
    flex-direction: column;
  }
  
  .btn-group .btn {
    margin-bottom: 0.5rem;
  }
}

/* Tablet optimizations */
@media (min-width: 577px) and (max-width: 991px) {
  .product-card .card-img-top {
    height: 220px;
  }
  
  .carousel-caption {
    padding: 1.5rem;
  }
  
  .carousel-caption h1 {
    font-size: 2.5rem;
  }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .product-card .card-img-top {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Print styles */
@media print {
  .navbar, .carousel, .btn, .modal, .toast-container {
    display: none !important;
  }
  
  .hero-section {
    height: auto;
    padding: 2rem 0;
  }
  
  .product-card {
    break-inside: avoid;
    margin-bottom: 1rem;
  }
  
  body {
    font-size: 12pt;
    line-height: 1.4;
  }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    -webkit-animation-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    -webkit-animation-iteration-count: 1 !important;
    animation-iteration-count: 1 !important;
    -webkit-transition-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  
  .carousel {
    -webkit-transition: none !important;
    transition: none !important;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --ivory: #1a1a1a;
    --off-white: #2d2d2d;
    --light-ivory: #333333;
    --text-dark: #ffffff;
    --text-muted: #cccccc;
  }
  
  body {
    background-color: var(--ivory);
    color: var(--text-dark);
  }
  
  .navbar {
    background: rgba(26, 26, 26, 0.95) !important;
  }
  
  .modal-content {
    background-color: var(--off-white);
    color: var(--text-dark);
  }
}

/* Additional Purple Theme Enhancements */
.section-title {
  color: var(--dark-purple);
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 60px;
  height: 3px;
  background: var(--primary-purple);
  border-radius: 2px;
}

.text-muted {
  color: var(--text-muted) !important;
}

/* Enhanced Button Styles */
.btn-lg {
  padding: 0.75rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.btn-secondary {
  background-color: var(--text-muted);
  border-color: var(--text-muted);
  color: var(--ivory);
}

.btn-secondary:hover {
  background-color: var(--dark-purple);
  border-color: var(--dark-purple);
  color: var(--ivory);
}

/* Success/Error States */
.text-success {
  color: #28a745 !important;
}

.text-danger {
  color: #dc3545 !important;
}

.text-info {
  color: var(--primary-purple) !important;
}

/* Loading States */
  .spinner-border {
    color: var(--primary-purple);
  }

  /* Advanced Filtering Styles */
  .filter-card {
    background: var(--ivory);
    border: 1px solid rgba(128, 0, 128, 0.1);
    border-radius: 15px;
    box-shadow: var(--shadow-custom);
  }

  .filter-card .card-body {
    padding: 1.5rem;
  }

  .form-label {
    color: var(--text-dark);
    font-weight: 600;
    margin-bottom: 0.5rem;
  }

  .form-select, .form-control {
    border: 1px solid rgba(128, 0, 128, 0.2);
    border-radius: 8px;
    transition: var(--transition);
  }

  .form-select:focus, .form-control:focus {
    border-color: var(--primary-purple);
    box-shadow: 0 0 0 0.2rem rgba(128, 0, 128, 0.25);
  }

  .input-group-text {
    background: var(--light-ivory);
    border: 1px solid rgba(128, 0, 128, 0.2);
    color: var(--text-dark);
  }

  /* Enhanced Product Card Styles */
  .product-card {
    transition: var(--transition);
    border: 1px solid rgba(128, 0, 128, 0.1);
    border-radius: 15px;
    overflow: hidden;
  }

  .product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
  }

  .product-card .card-img-top {
    height: 220px;
    object-fit: cover;
    transition: var(--transition);
  }

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

  .product-meta {
    border-top: 1px solid rgba(128, 0, 128, 0.1);
    padding-top: 0.75rem;
  }

  /* Badge Styles */
  .badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
  }

  .badge.bg-purple {
    background: var(--primary-purple) !important;
  }

  /* Pagination Styles */
  .pagination .page-link {
    color: var(--primary-purple);
    border: 1px solid rgba(128, 0, 128, 0.2);
    transition: var(--transition);
  }

  .pagination .page-link:hover {
    background: var(--light-purple);
    border-color: var(--primary-purple);
    color: white;
  }

  .pagination .page-item.active .page-link {
    background: var(--primary-purple);
    border-color: var(--primary-purple);
  }

  .pagination .page-item.disabled .page-link {
    color: var(--text-muted);
    border-color: rgba(128, 0, 128, 0.1);
  }

  /* Filter Results */
  #filterResults {
    font-size: 0.9rem;
    color: var(--text-muted);
  }

  /* Alert Styles */
  .alert-info {
    background: var(--light-ivory);
    border: 1px solid rgba(128, 0, 128, 0.2);
    color: var(--text-dark);
  }

  /* Rating Stars */
  .text-warning {
    color: #ffc107 !important;
  }

  /* Stock Status */
  .badge.bg-success {
    background: #28a745 !important;
  }

  .badge.bg-secondary {
    background: #6c757d !important;
  }

  /* Product Detail Modal Styles */
  .product-image-container {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
  }

  .product-image-container img {
    width: 100%;
    height: auto;
    transition: var(--transition);
  }

  .product-image-container:hover img {
    transform: scale(1.05);
  }

  .product-details {
    padding: 1rem 0;
  }

  .product-specs {
    background: var(--light-ivory);
    padding: 1rem;
    border-radius: 10px;
    border: 1px solid rgba(128, 0, 128, 0.1);
  }

  .product-specs strong {
    color: var(--dark-purple);
    font-weight: 600;
  }

  .price-section {
    border-top: 2px solid var(--light-purple);
    padding-top: 1rem;
  }

  .quantity-section .input-group {
    max-width: 150px;
  }

  .quantity-section .form-control {
    text-align: center;
    border-left: none;
    border-right: none;
  }

  .quantity-section .btn {
    border-color: var(--light-purple);
    color: var(--dark-purple);
  }

  .quantity-section .btn:hover {
    background: var(--light-purple);
    color: white;
  }

.action-buttons {
  border-top: 1px solid rgba(128, 0, 128, 0.1);
  padding-top: 1rem;
  gap: 0.5rem;
  flex-wrap: nowrap;
}

/* Keep both buttons on a single line and allow size to shrink */
.action-buttons .btn {
  white-space: nowrap;
  flex: 1 1 auto; /* allow shrink */
  min-width: 0;   /* permit flexbox shrinking */
}

@media (max-width: 576px) {
  /* On very small screens, still attempt inline layout by reducing size */
  .action-buttons .btn.btn-lg {
    padding: 0.45rem 0.8rem;
    font-size: 0.98rem;
  }
}

/* Ensure outline primary also turns purple on hover in all contexts */
.btn-outline-primary:hover,
.action-buttons .btn-outline-primary:hover,
.modal .btn-outline-primary:hover {
  background-color: var(--primary-purple);
  border-color: var(--primary-purple);
  color: var(--ivory);
}

/* Prevent action buttons from overflowing the modal width */
.modal .action-buttons { flex-wrap: nowrap; }

/* If extremely constrained, progressively reduce spacing and font-size to avoid wrapping */
@media (max-width: 400px) {
  .action-buttons { gap: 0.4rem; }
  .action-buttons .btn.btn-lg { padding: 0.4rem 0.7rem; font-size: 0.95rem; }
}

@media (max-width: 350px) {
  .action-buttons { gap: 0.3rem; }
  .action-buttons .btn.btn-lg { padding: 0.35rem 0.6rem; font-size: 0.9rem; }
}

  /* Enhanced Product Card Hover Effects */
  .product-card {
    cursor: pointer;
    transition: var(--transition);
  }

  .product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
  }

  .product-card .card-title:hover {
    color: var(--primary-purple);
  }

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

  /* Cart Refresh Button */
  .btn-outline-secondary:hover {
    background: var(--light-purple);
    border-color: var(--light-purple);
    color: white;
  }