/*
 * Rasa Nusantara Cafe & Bakery - Premium Stylesheet
 * Custom CSS with a warm cream/espresso color palette, responsive layout, and interactive states.
 */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@300;400;500;600;700;800&display=swap');

/* Color Variables & Styling Tokens */
:root {
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Colors */
  --bg-primary: #FAF6F0; /* Soft warm cream */
  --bg-secondary: #FFFFFF; /* Pure white for cards */
  --text-main: #2C1E16; /* Deep dark roasted espresso */
  --text-muted: #6A5B52; /* Lighter warm brown/gray for subtitles */
  
  --accent-gold: #D4A373; /* Rich gold/caramel */
  --accent-gold-dark: #C29262;
  --accent-gold-light: #EADFC9;
  
  --accent-terracotta: #E76F51; /* Warm orange-red for badges/actions */
  --accent-terracotta-dark: #D45B3E;
  --accent-terracotta-light: #F8D5CE;
  
  --border-color: #EADFC9;
  --shadow-sm: 0 2px 4px rgba(44, 30, 22, 0.05);
  --shadow-md: 0 10px 20px rgba(44, 30, 22, 0.08);
  --shadow-lg: 0 15px 30px rgba(44, 30, 22, 0.12);
  
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease-out;
}

/* Reset & Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Typography */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-main);
}

a {
  text-decoration: none;
  color: inherit;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  outline: none;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Hero & Header Section */
header {
  background: linear-gradient(180deg, rgba(44, 30, 22, 0.9) 0%, rgba(44, 30, 22, 0.8) 100%), 
              url('https://images.unsplash.com/photo-1554118811-1e0d58224f24?auto=format&fit=crop&q=80&w=1200') no-repeat center center;
  background-size: cover;
  color: #FFFFFF;
  padding: 60px 0 80px 0;
  text-align: center;
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle, transparent 20%, rgba(44, 30, 22, 0.4) 100%);
  pointer-events: none;
}

.header-content {
  position: relative;
  z-index: 1;
}

.logo {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 5px;
  text-transform: uppercase;
  color: #FFFFFF;
}

.logo span {
  color: var(--accent-gold);
}

.tagline {
  font-size: 1.1rem;
  font-weight: 300;
  color: var(--accent-gold-light);
  margin-bottom: 20px;
  letter-spacing: 1px;
}

.cafe-info {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 20px;
  font-size: 0.9rem;
}

.info-item {
  background: rgba(255, 255, 255, 0.1);
  padding: 8px 16px;
  border-radius: 50px;
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-item svg {
  width: 16px;
  height: 16px;
  fill: var(--accent-gold);
}

/* Category Filter Bar */
.sticky-bar {
  position: sticky;
  top: 0;
  background: rgba(250, 246, 240, 0.9);
  backdrop-filter: blur(10px);
  padding: 15px 0;
  z-index: 10;
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  margin-bottom: 30px;
}

.filter-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.categories {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 5px;
  scrollbar-width: none; /* Firefox */
}

.categories::-webkit-scrollbar {
  display: none; /* Safari and Chrome */
}

.category-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 10px 20px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.category-btn:hover {
  background: var(--accent-gold-light);
  border-color: var(--accent-gold);
}

.category-btn.active {
  background: var(--text-main);
  color: #FFFFFF;
  border-color: var(--text-main);
}

/* Search Box */
.search-box {
  position: relative;
  flex-grow: 1;
  max-width: 300px;
}

.search-input {
  width: 100%;
  padding: 10px 15px 10px 40px;
  border-radius: 50px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-main);
  font-size: 0.9rem;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.search-input:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px rgba(212, 163, 115, 0.2);
}

.search-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  fill: var(--text-muted);
}

/* Menu Grid */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 25px;
  margin-bottom: 100px; /* Space for floating cart */
}

/* Menu Card */
.menu-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(234, 223, 201, 0.5);
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: var(--transition);
}

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

.menu-image-container {
  position: relative;
  width: 100%;
  height: 180px;
  overflow: hidden;
  background-color: #EADFC9;
}

.menu-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.menu-card:hover .menu-image {
  transform: scale(1.05);
}

.menu-badges {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  gap: 5px;
}

.badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 50px;
  color: #FFFFFF;
}

.badge.signature {
  background: var(--accent-gold);
}

.badge.spicy {
  background: var(--accent-terracotta);
}

.badge.fresh {
  background: #2A9D8F;
}

.menu-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.menu-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.menu-title {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
}

.menu-price {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent-terracotta);
  white-space: nowrap;
}

.menu-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.menu-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  border-top: 1px solid rgba(234, 223, 201, 0.3);
  padding-top: 15px;
}

/* Quantity Control Buttons */
.quantity-control {
  display: flex;
  align-items: center;
  background: var(--bg-primary);
  border-radius: 50px;
  border: 1px solid var(--border-color);
  padding: 3px;
}

.qty-btn {
  background: transparent;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.qty-btn:hover {
  background: var(--bg-secondary);
}

.qty-val {
  width: 30px;
  text-align: center;
  font-weight: 700;
  font-size: 0.95rem;
}

.add-btn {
  background: var(--text-main);
  color: #FFFFFF;
  border: none;
  padding: 8px 18px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 5px;
  box-shadow: var(--shadow-sm);
}

.add-btn:hover {
  background: var(--accent-gold);
}

.add-btn svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* Floating Cart Bar */
.floating-cart {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(150px);
  width: calc(100% - 40px);
  max-width: 600px;
  background: rgba(44, 30, 22, 0.95);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50px;
  color: #FFFFFF;
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  z-index: 99;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.floating-cart.visible {
  transform: translateX(-50%) translateY(0);
}

.cart-summary {
  display: flex;
  align-items: center;
  gap: 15px;
}

.cart-icon-wrapper {
  position: relative;
  background: var(--accent-gold);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-icon-wrapper svg {
  width: 20px;
  height: 20px;
  fill: var(--text-main);
}

.cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--accent-terracotta);
  color: #FFFFFF;
  font-size: 0.7rem;
  font-weight: 700;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(44, 30, 22, 1);
}

.cart-total-info h4 {
  color: #FFFFFF;
  font-size: 0.85rem;
  font-weight: 400;
  margin-bottom: 2px;
}

.cart-total-price {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent-gold);
}

.view-cart-btn {
  background: #FFFFFF;
  color: var(--text-main);
  border: none;
  padding: 10px 24px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 8px;
}

.view-cart-btn:hover {
  background: var(--accent-gold);
  color: var(--text-main);
}

.view-cart-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* Cart Modal overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(44, 30, 22, 0.7);
  backdrop-filter: blur(5px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-container {
  background: var(--bg-primary);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  transform: translateY(30px);
  transition: transform 0.3s cubic-bezier(0.1, 0.8, 0.25, 1);
  margin: 0 15px;
}

.modal-overlay.open .modal-container {
  transform: translateY(0);
}

.modal-header {
  background: var(--text-main);
  color: #FFFFFF;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  color: #FFFFFF;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-header h3 svg {
  width: 22px;
  height: 22px;
  fill: var(--accent-gold);
}

.close-modal-btn {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: #FFFFFF;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  transition: var(--transition-fast);
}

.close-modal-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.modal-content {
  padding: 20px;
  overflow-y: auto;
  flex-grow: 1;
}

/* Modal Cart Items List */
.cart-items-list {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 15px;
  border: 1px solid var(--border-color);
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  max-height: 200px;
  overflow-y: auto;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border-color);
}

.cart-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.cart-item:first-child {
  padding-top: 0;
}

.cart-item-details {
  flex-grow: 1;
  padding-right: 15px;
}

.cart-item-name {
  font-weight: 700;
  font-size: 0.95rem;
}

.cart-item-price {
  font-size: 0.85rem;
  color: var(--accent-terracotta);
  font-weight: 600;
  margin-top: 2px;
}

.cart-item-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.cart-item-subtotal {
  font-weight: 700;
  font-size: 0.95rem;
  min-width: 60px;
  text-align: right;
}

/* Customer details form */
.order-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

.form-input {
  width: 100%;
  padding: 10px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-main);
  font-size: 0.9rem;
  transition: var(--transition-fast);
}

.form-input:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 2px rgba(212, 163, 115, 0.2);
}

/* Segmented Control for Options */
.dining-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: var(--border-color);
  padding: 4px;
  border-radius: var(--radius-sm);
}

.dining-option {
  position: relative;
}

.dining-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.dining-label {
  display: block;
  text-align: center;
  padding: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  background: transparent;
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.dining-option input[type="radio"]:checked + .dining-label {
  background: #FFFFFF;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

/* Order Summary Box */
.order-summary-box {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 15px;
  border: 1px solid var(--border-color);
  margin-top: 15px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.summary-row:last-child {
  margin-bottom: 0;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
  font-size: 1.1rem;
  font-weight: 800;
}

.summary-row.total .total-price {
  color: var(--accent-terracotta);
}

/* Modal Footer checkout button */
.modal-footer {
  padding: 20px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
}

.whatsapp-btn {
  width: 100%;
  background: #25D366; /* WhatsApp green */
  color: #FFFFFF;
  border: none;
  padding: 14px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 10px rgba(37, 211, 102, 0.3);
  transition: var(--transition-fast);
}

.whatsapp-btn:hover {
  background: #128C7E;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(37, 211, 102, 0.4);
}

.whatsapp-btn svg {
  width: 22px;
  height: 22px;
  fill: #FFFFFF;
}

/* Footer Section */
footer {
  background: var(--text-main);
  color: #FFFFFF;
  padding: 50px 0;
  margin-top: 80px;
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  font-size: 0.9rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
  margin-bottom: 30px;
}

.footer-col h3 {
  color: var(--accent-gold);
  font-size: 1.2rem;
  margin-bottom: 20px;
  font-family: var(--font-heading);
}

.footer-col p {
  color: #EADFC9;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-col p svg {
  width: 16px;
  height: 16px;
  fill: var(--accent-gold);
  flex-shrink: 0;
}

.map-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  padding: 10px 20px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
  transition: var(--transition-fast);
}

.map-btn:hover {
  background: var(--accent-gold);
  color: var(--text-main);
  border-color: var(--accent-gold);
}

.map-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.social-links {
  display: flex;
  gap: 15px;
  margin-top: 15px;
}

.social-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: var(--transition-fast);
}

.social-btn:hover {
  background: var(--accent-gold);
  color: var(--text-main);
  border-color: var(--accent-gold);
}

.social-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.footer-bottom {
  border-top: 1px solid rgba(234, 223, 201, 0.1);
  padding-top: 20px;
  text-align: center;
  color: #EADFC9;
  font-size: 0.8rem;
}

/* Empty State Styling */
.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px dashed var(--border-color);
}

.no-results svg {
  width: 48px;
  height: 48px;
  fill: var(--text-muted);
  margin-bottom: 15px;
}

.no-results p {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Utility Animations */
@keyframes pop {
  0% { transform: scale(0.95); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.cart-item-added {
  animation: pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
