/* Modern Tendai Pastries Styles */
:root {
  --brand-primary: #d4904f;
  --brand-secondary: #8b5a3a;
  --brand-dark: #5d3a24;
  --cream: #fef9f3;
  --warm-white: #fefcfa;
  --light-brown: #f4e5d3;
  --accent-gold: #f4c842;
  --text-dark: #2d1810;
  --text-muted: #6c5448;
  --shadow-light: 0 2px 10px rgba(139, 90, 58, 0.1);
  --shadow-medium: 0 4px 20px rgba(139, 90, 58, 0.15);
  --shadow-heavy: 0 8px 30px rgba(139, 90, 58, 0.2);
  --gradient-warm: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  --gradient-gold: linear-gradient(135deg, var(--accent-gold), #e6b435);
}

/* Global Styles */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: var(--cream);
  color: var(--text-dark);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Typography */
.brand-text {
  font-family: 'Dancing Script', cursive;
  font-weight: 600;
  font-size: 1.8rem;
  color: var(--brand-primary);
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  color: var(--text-dark);
}

.display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
  font-weight: 700;
}

/* Brand Colors */
.text-brand { color: var(--brand-primary) !important; }
.bg-brand { background-color: var(--brand-primary) !important; }
.border-brand { border-color: var(--brand-primary) !important; }

/* Logo Styles */
.logo-image {
  height: 40px;
  width: auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.logo-image:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.footer-logo {
  height: 35px;
  width: auto;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* Hero Logo Styles */
.hero-logo {
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  animation: float 6s ease-in-out infinite;
}

.hero-logo:hover {
  transform: scale(1.02) rotate(1deg);
  box-shadow: 0 20px 40px rgba(0,0,0,0.3) !important;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

@media (max-width: 768px) {
  .logo-image {
    height: 35px;
  }
  
  .footer-logo {
    height: 30px;
  }
  
  .hero-logo {
    max-width: 280px !important;
  }
}

/* Navigation */
.navbar {
  background: rgba(254, 252, 250, 0.95) !important;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(139, 90, 58, 0.1);
  transition: all 0.3s ease;
  padding: 0.8rem 0;
}

.navbar-brand {
  font-size: 1.5rem !important;
  transition: transform 0.3s ease;
}

.navbar-brand:hover {
  transform: scale(1.05);
}

.navbar-nav .nav-link {
  font-weight: 500;
  color: var(--text-dark) !important;
  padding: 0.5rem 1rem !important;
  margin: 0 0.25rem;
  border-radius: 25px;
  transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover {
  background: var(--light-brown);
  color: var(--brand-dark) !important;
  transform: translateY(-2px);
}

/* Buttons */
.btn {
  font-weight: 500;
  border-radius: 25px;
  padding: 0.6rem 1.5rem;
  transition: all 0.3s ease;
  border: none;
  position: relative;
  overflow: hidden;
}

.btn-brand {
  background: var(--gradient-warm);
  color: white !important;
  box-shadow: var(--shadow-light);
}

.btn-brand:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
  color: white !important;
}

.btn-brand:active {
  transform: translateY(0);
}

.btn-outline-brand {
  border: 2px solid var(--brand-primary);
  color: var(--brand-primary);
  background: transparent;
}

.btn-outline-brand:hover {
  background: var(--brand-primary);
  color: white;
  transform: translateY(-2px);
}

/* Cards */
.card {
  border: none;
  border-radius: 20px;
  overflow: hidden;
  transition: all 0.4s ease;
  background: var(--warm-white);
  box-shadow: var(--shadow-light);
}

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

.card-img-top {
  height: 200px;
  object-fit: cover;
  transition: transform 0.4s ease;
}

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

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

.card-body {
  padding: 1.5rem;
}

/* Product Grid */
.product-grid .col-md-4 {
  margin-bottom: 2rem;
}

/* Hero Section */
.hero-section {
  background: var(--gradient-warm);
  color: white;
  padding: 4rem 0;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" x="0" y="0" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  opacity: 0.3;
}

.hero-content {
  position: relative;
  z-index: 2;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.animate-fadein {
  animation: fadeInUp 0.8s ease-out;
}

.animate-pulse {
  animation: pulse 2s infinite;
}

/* Cart Badge */
.badge {
  font-size: 0.7rem;
  animation: pulse 1s infinite;
}

/* Forms */
.form-control, .form-select {
  border-radius: 15px;
  border: 2px solid var(--light-brown);
  padding: 0.7rem 1rem;
  transition: all 0.3s ease;
}

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

/* Tables */
.table {
  background: var(--warm-white);
  border-radius: 15px;
  overflow: hidden;
  box-shadow: var(--shadow-light);
}

.table th {
  background: var(--light-brown);
  color: var(--brand-dark);
  font-weight: 600;
  border: none;
  padding: 1rem;
}

.table td {
  border: none;
  padding: 1rem;
  vertical-align: middle;
}

/* Alerts */
.alert {
  border: none;
  border-radius: 15px;
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
}

.alert-success {
  background: linear-gradient(135deg, #d4edda, #c3e6cb);
  color: #155724;
}

.alert-warning {
  background: linear-gradient(135deg, #fff3cd, #ffeaa7);
  color: #856404;
}

.alert-danger {
  background: linear-gradient(135deg, #f8d7da, #f5c6cb);
  color: #721c24;
}

/* Footer */
.footer-light {
  background: linear-gradient(135deg, var(--warm-white), var(--light-brown)) !important;
  border-top: 3px solid var(--brand-primary);
  margin-top: auto;
  box-shadow: 0 -5px 20px rgba(139, 90, 58, 0.1);
}

/* Footer Typography */
.footer-brand-text {
  color: var(--brand-primary) !important;
  font-weight: 700;
  font-size: 1.4rem;
}

.footer-heading {
  color: var(--brand-dark) !important;
  font-weight: 700;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 1rem !important;
}

.footer-description {
  color: var(--text-muted) !important;
  font-size: 0.95rem;
  line-height: 1.6;
  font-weight: 400;
}

.footer-text {
  color: var(--text-dark) !important;
  font-size: 0.9rem;
  font-weight: 500;
}

.footer-icon {
  color: var(--brand-primary) !important;
  font-size: 0.9rem;
}

.footer-newsletter-text {
  color: var(--text-muted) !important;
  font-size: 0.85rem;
  line-height: 1.5;
}

.footer-copyright, .footer-tagline {
  color: var(--text-muted) !important;
  font-size: 0.85rem;
  font-weight: 500;
}

/* Footer Links */
.footer-link {
  color: var(--text-dark) !important;
  text-decoration: none !important;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s ease;
  padding: 0.25rem 0;
  display: inline-block;
}

.footer-link:hover {
  color: var(--brand-primary) !important;
  transform: translateX(5px);
}

/* Social Links */
.footer-social-link {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--brand-primary) !important;
  color: white !important;
  text-decoration: none !important;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.footer-social-link:hover {
  background: var(--brand-dark) !important;
  color: white !important;
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(139, 90, 58, 0.3);
}

/* Footer Form */
.footer-input {
  border: 2px solid var(--light-brown) !important;
  background: var(--warm-white) !important;
  color: var(--text-dark) !important;
  font-size: 0.9rem;
}

.footer-input:focus {
  border-color: var(--brand-primary) !important;
  box-shadow: 0 0 0 0.2rem rgba(212, 144, 79, 0.25) !important;
  background: white !important;
}

.footer-input::placeholder {
  color: var(--text-muted) !important;
  font-size: 0.85rem;
}

.footer-divider {
  border-color: var(--brand-primary) !important;
  opacity: 0.3;
}

/* Newsletter Form */
.newsletter-form .form-control {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  background: var(--warm-white);
  border: 2px solid var(--light-brown);
  color: var(--text-dark);
  font-size: 0.9rem;
}

.newsletter-form .form-control:focus {
  border-color: var(--brand-primary);
  box-shadow: none;
  background: white;
}

.newsletter-form .form-control::placeholder {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.newsletter-form .btn {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border: 2px solid var(--brand-primary);
}

/* Loading States */
.btn.loading {
  color: transparent;
  pointer-events: none;
}

.btn.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1rem;
  height: 1rem;
  margin: -0.5rem 0 0 -0.5rem;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Mobile-First Responsive Design */

/* Extra Small Devices (phones, 576px and down) */
@media (max-width: 575.98px) {
  /* Typography */
  body {
    font-size: 14px;
    line-height: 1.5;
  }
  
  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.3rem; }
  h4 { font-size: 1.1rem; }
  h5 { font-size: 1rem; }
  
  .display-4 { font-size: 2rem; }
  .display-5 { font-size: 1.7rem; }
  .display-6 { font-size: 1.4rem; }
  
  .brand-text {
    font-size: 1.3rem;
  }
  
  /* Navigation */
  .navbar {
    padding: 0.5rem 0;
  }
  
  .navbar-brand {
    font-size: 1.2rem !important;
  }
  
  .navbar-nav .nav-link {
    padding: 0.7rem 1rem !important;
    margin: 0.2rem 0;
    text-align: center;
    border-radius: 12px;
  }
  
  .navbar-toggler {
    border: none;
    padding: 0.2rem 0.5rem;
  }
  
  .navbar-collapse {
    margin-top: 1rem;
    background: rgba(254, 252, 250, 0.98);
    border-radius: 15px;
    padding: 1rem;
    box-shadow: var(--shadow-medium);
  }
  
  /* Hero Section */
  .hero-section {
    padding: 1.5rem 0;
    text-align: center;
  }
  
  .hero-logo {
    max-width: 200px !important;
    margin-bottom: 1rem;
  }
  
  /* Buttons */
  .btn {
    padding: 0.8rem 1.2rem;
    font-size: 0.9rem;
    width: 100%;
    margin-bottom: 0.5rem;
  }
  
  .btn-sm {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
  }
  
  /* Cards */
  .card {
    margin-bottom: 1.5rem;
    border-radius: 15px;
  }
  
  .card-img-top {
    height: 180px;
  }
  
  .card-body {
    padding: 1rem;
  }
  
  .card-title {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
  }
  
  .card-text {
    font-size: 0.9rem;
  }
  
  /* Product Grid */
  .product-grid .col-md-4 {
    margin-bottom: 1.5rem;
  }
  
  /* Forms */
  .form-control, .form-select {
    padding: 0.8rem 1rem;
    font-size: 0.9rem;
    border-radius: 12px;
  }
  
  .form-label {
    font-size: 0.9rem;
    font-weight: 600;
  }
  
  /* Tables */
  .table-responsive {
    border-radius: 12px;
  }
  
  .table {
    font-size: 0.85rem;
  }
  
  .table th, .table td {
    padding: 0.75rem 0.5rem;
  }
  
  /* Alerts */
  .alert {
    padding: 0.8rem 1rem;
    font-size: 0.9rem;
    border-radius: 12px;
  }
  
  /* Footer */
  .footer-light {
    text-align: center;
  }
  
  .footer-brand-text {
    font-size: 1.2rem;
  }
  
  .footer-heading {
    font-size: 0.9rem;
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
  }
  
  .footer-text, .footer-link {
    font-size: 0.85rem;
  }
  
  .footer-social-link {
    width: 35px;
    height: 35px;
    font-size: 0.8rem;
    margin: 0.2rem;
  }
  
  /* WhatsApp Button */
  .whatsapp-float {
    width: 55px;
    height: 55px;
    bottom: 20px;
    right: 20px;
    font-size: 20px;
  }
  
  .whatsapp-float::before {
    font-size: 12px;
    padding: 6px 10px;
    right: 65px;
  }
  
  /* Container Spacing */
  .container, .container-fluid {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  /* Sections */
  section {
    padding: 2rem 0;
  }
  
  /* Utilities */
  .mb-mobile-3 { margin-bottom: 1rem !important; }
  .mt-mobile-3 { margin-top: 1rem !important; }
  .px-mobile-2 { padding-left: 0.5rem !important; padding-right: 0.5rem !important; }
}

/* Small Devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
  .brand-text {
    font-size: 1.4rem;
  }
  
  .hero-section {
    padding: 2rem 0;
  }
  
  .hero-logo {
    max-width: 240px !important;
  }
  
  .card-img-top {
    height: 190px;
  }
  
  .btn {
    width: auto;
  }
}

/* Medium Devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
  .brand-text {
    font-size: 1.6rem;
  }
  
  .hero-section {
    padding: 2.5rem 0;
  }
  
  .hero-logo {
    max-width: 260px !important;
  }
  
  .card:hover {
    transform: translateY(-6px);
  }
  
  .navbar-nav .nav-link {
    padding: 0.5rem 0.8rem !important;
  }
}

/* Large Devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .hero-section {
    padding: 3rem 0;
  }
  
  .brand-text {
    font-size: 1.7rem;
  }
}

/* Touch Device Optimizations */
@media (pointer: coarse) {
  /* Increase touch targets */
  .btn {
    min-height: 44px;
    padding: 0.8rem 1.5rem;
  }
  
  .nav-link {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  
  .form-control, .form-select {
    min-height: 44px;
  }
  
  /* Remove hover effects on touch devices */
  .card:hover {
    transform: none;
  }
  
  .btn:hover {
    transform: none;
  }
  
  .navbar-nav .nav-link:hover {
    transform: none;
  }
}

/* High DPI/Retina Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .logo-image, .footer-logo {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Landscape Phone Orientation */
@media (max-width: 767px) and (orientation: landscape) {
  .hero-section {
    padding: 1rem 0;
  }
  
  .navbar {
    padding: 0.3rem 0;
  }
  
  .hero-logo {
    max-width: 180px !important;
  }
}

/* Print Styles */
@media print {
  .navbar, .whatsapp-float, .btn, .alert {
    display: none !important;
  }
  
  .card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ddd;
  }
  
  body {
    background: white !important;
    color: black !important;
  }
}

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

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

::-webkit-scrollbar-thumb {
  background: var(--brand-primary);
  border-radius: 4px;
}

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

/* WhatsApp Floating Button */
.whatsapp-float {
  position: fixed;
  width: 60px;
  height: 60px;
  bottom: 25px;
  right: 25px;
  background-color: #25D366;
  color: white;
  border-radius: 50%;
  text-align: center;
  font-size: 24px;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4);
  z-index: 1000;
  transition: all 0.3s ease;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.whatsapp-float:hover {
  background-color: #128C7E;
  color: white;
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
}

.whatsapp-float i {
  transition: transform 0.3s ease;
}

.whatsapp-float:hover i {
  transform: scale(1.2);
}

/* WhatsApp tooltip */
.whatsapp-float::before {
  content: "Chat with us!";
  position: absolute;
  right: 70px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 8px 12px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  pointer-events: none;
}

.whatsapp-float:hover::before {
  opacity: 1;
  visibility: visible;
  right: 75px;
}

/* Award badge styling */
.award-badge {
  background: linear-gradient(135deg, #f4c842, #e6b435);
  color: var(--text-dark);
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 2px 8px rgba(244, 200, 66, 0.3);
}

.award-badge i {
  color: #d4a017;
}

/* Mobile-specific enhancements */
.touch-device .btn:hover {
  transform: none;
}

.touch-device .card:hover {
  transform: none;
}

/* Mobile viewport fix */
.mobile-vh {
  height: 100vh;
  height: calc(var(--vh, 1vh) * 100);
}

/* Improved touch targets */
.btn-touch {
  min-height: 44px;
  min-width: 44px;
  padding: 0.75rem 1.25rem;
}

/* Mobile-optimized form controls */
@media (max-width: 767px) {
  .form-control:focus {
    font-size: 16px; /* Prevents zoom on iOS */
  }
  
  .input-group .btn {
    min-width: 44px;
  }
  
  /* Improve select dropdowns on mobile */
  .form-select {
    background-size: 16px 12px;
    font-size: 16px;
  }
}

/* Loading states for touch devices */
.btn.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1rem;
  height: 1rem;
  margin: -0.5rem 0 0 -0.5rem;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Improved focus states for accessibility */
.btn:focus-visible,
.form-control:focus-visible,
.nav-link:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

/* Smooth scrolling behavior */
html {
  scroll-behavior: smooth;
}

/* Optimize images for different screen densities */
@media (-webkit-min-device-pixel-ratio: 2) {
  .hero-logo,
  .logo-image,
  .footer-logo {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Dark mode media query support */
@media (prefers-color-scheme: dark) {
  :root {
    --cream: #2a1810;
    --warm-white: #1f1410;
    --text-dark: #f5f5f5;
    --text-muted: #a0a0a0;
  }
}

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

/* High contrast mode support */
@media (prefers-contrast: high) {
  .btn-brand {
    border: 2px solid var(--brand-dark);
  }
  
  .card {
    border: 1px solid var(--text-dark);
  }
}
