/* ============================================
   Bean & Brew Coffee Shop — Main Stylesheet
   Using Bootstrap 5 + Custom CSS Variables
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --coffee-dark: #2C1810;
  --coffee-brown: #6F4E37;
  --coffee-medium: #A0673A;
  --coffee-light: #C49A6C;
  --coffee-cream: #F5F0E8;
  --coffee-latte: #D9C5A7;
  --accent-gold: #D4A853;
  --accent-green: #4A7C59;
  --text-primary: #2C1810;
  --text-secondary: #6B5B4E;
  --text-muted: #9B8A7D;
  --white: #FFFFFF;
  --bg-light: #FAF7F3;
  --shadow-sm: 0 2px 12px rgba(44,24,16,0.08);
  --shadow-md: 0 8px 30px rgba(44,24,16,0.12);
  --shadow-lg: 0 20px 60px rgba(44,24,16,0.16);
  --border-radius: 16px;
  --transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-light);
  color: var(--text-primary);
  line-height: 1.7;
}

h1, h2, h3, h4, h5, .font-serif {
  font-family: 'Playfair Display', serif;
  color: var(--coffee-dark);
}

/* ============ NAVBAR ============ */
.navbar-brand-text {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--coffee-dark) !important;
  letter-spacing: -0.02em;
}

.navbar-custom {
  background: rgba(255,255,255,0.95) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(111,78,55,0.1);
  padding: 0.75rem 0;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.navbar-custom.scrolled {
  padding: 0.5rem 0;
  box-shadow: var(--shadow-md);
}

.navbar-custom .nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary) !important;
  padding: 0.5rem 1rem !important;
  border-radius: 8px;
  transition: var(--transition);
}

.navbar-custom .nav-link:hover,
.navbar-custom .nav-link.active {
  color: var(--coffee-brown) !important;
  background: rgba(111,78,55,0.08);
}

.cart-btn {
  position: relative;
  background: var(--coffee-brown) !important;
  border: none !important;
  border-radius: 50px !important;
  padding: 0.45rem 1.2rem !important;
  font-size: 0.85rem !important;
  color: white !important;
  transition: var(--transition);
}

.cart-btn:hover { background: var(--coffee-dark) !important; transform: translateY(-1px); }

.cart-count {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--accent-gold);
  color: var(--coffee-dark);
  font-size: 0.7rem;
  font-weight: 700;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============ BUTTONS ============ */
.btn-coffee {
  background: var(--coffee-brown);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 0.75rem 2rem;
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition);
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-coffee:hover {
  background: var(--coffee-dark);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(111,78,55,0.35);
}

.btn-outline-coffee {
  background: transparent;
  color: var(--coffee-brown);
  border: 2px solid var(--coffee-brown);
  border-radius: 50px;
  padding: 0.7rem 2rem;
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition);
}

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

.btn-gold {
  background: linear-gradient(135deg, var(--accent-gold), #B8922E);
  color: var(--coffee-dark);
  border: none;
  border-radius: 50px;
  padding: 0.75rem 2rem;
  font-weight: 700;
  font-size: 0.9rem;
  transition: var(--transition);
}

.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(212,168,83,0.4);
  color: var(--coffee-dark);
}

/* ============ SECTIONS ============ */
.section-title { font-size: 2.5rem; font-weight: 700; margin-bottom: 0.5rem; }
.section-subtitle { color: var(--text-muted); font-size: 1rem; margin-bottom: 3rem; }
.section-tag {
  display: inline-block;
  background: rgba(111,78,55,0.1);
  color: var(--coffee-brown);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.4rem 1rem;
  border-radius: 50px;
  margin-bottom: 1rem;
}

/* ============ CARDS ============ */
.product-card {
  background: white;
  border-radius: var(--border-radius);
  overflow: hidden;
  transition: var(--transition);
  border: 1px solid rgba(111,78,55,0.08);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

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

.product-card:hover .product-card-img { transform: scale(1.05); }
.product-card-img-wrapper { overflow: hidden; position: relative; }

.product-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--accent-gold);
  color: var(--coffee-dark);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
}

.product-card-body { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; }

.product-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--coffee-dark);
  margin-bottom: 0.25rem;
}

.product-name-th { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.75rem; }

.product-price {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--coffee-brown);
  margin-top: auto;
}

.product-price span { font-size: 0.75rem; font-weight: 400; color: var(--text-muted); }

.star-rating { color: var(--accent-gold); font-size: 0.8rem; }

/* ============ HERO ============ */
.hero-section {
  min-height: 100vh;
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--coffee-dark) 0%, var(--coffee-brown) 50%, var(--coffee-medium) 100%);
  z-index: 0;
}

.hero-bg-img {
  position: absolute;
  inset: 0;
  object-fit: cover;
  width: 100%;
  height: 100%;
  opacity: 0.25;
  z-index: 1;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(44,24,16,0.85) 0%, rgba(111,78,55,0.7) 100%);
  z-index: 2;
}

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

.hero-tag {
  display: inline-block;
  background: rgba(212,168,83,0.2);
  border: 1px solid rgba(212,168,83,0.5);
  color: var(--accent-gold);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.4rem 1.2rem;
  border-radius: 50px;
  margin-bottom: 1.5rem;
}

.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 700;
  color: white;
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

.hero-title .highlight { color: var(--accent-gold); }

.hero-subtitle { font-size: 1.1rem; color: rgba(255,255,255,0.8); max-width: 500px; margin-bottom: 2.5rem; }

.hero-stats { display: flex; gap: 2.5rem; margin-top: 3rem; }
.hero-stat-num { font-size: 2rem; font-weight: 700; color: var(--accent-gold); font-family: 'Playfair Display', serif; }
.hero-stat-label { font-size: 0.8rem; color: rgba(255,255,255,0.6); }

/* ============ FOOTER ============ */
.footer-custom {
  background: var(--coffee-dark);
  color: rgba(255,255,255,0.85);
  padding: 5rem 0 2rem;
}

.footer-brand {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  color: white;
  font-weight: 700;
}

.footer-tagline { color: rgba(255,255,255,0.5); font-size: 0.9rem; margin-top: 0.5rem; }

.footer-title { color: var(--accent-gold); font-size: 0.85rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 1.25rem; }

.footer-links { list-style: none; padding: 0; }
.footer-links li { margin-bottom: 0.6rem; }
.footer-links a { color: rgba(255,255,255,0.6); text-decoration: none; font-size: 0.9rem; transition: var(--transition); }
.footer-links a:hover { color: var(--accent-gold); padding-left: 4px; }

.footer-social { display: flex; gap: 0.75rem; margin-top: 1.5rem; }
.footer-social a {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 1rem;
  transition: var(--transition);
  text-decoration: none;
}
.footer-social a:hover { background: var(--accent-gold); color: var(--coffee-dark); transform: translateY(-3px); }

.footer-divider { border-color: rgba(255,255,255,0.1); margin: 3rem 0 1.5rem; }
.footer-copy { color: rgba(255,255,255,0.4); font-size: 0.8rem; }

.footer-newsletter input {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  border-radius: 50px 0 0 50px;
  padding: 0.6rem 1.2rem;
  font-size: 0.85rem;
}
.footer-newsletter input::placeholder { color: rgba(255,255,255,0.4); }
.footer-newsletter input:focus { outline: none; border-color: var(--accent-gold); background: rgba(255,255,255,0.15); box-shadow: none; }
.footer-newsletter .btn {
  background: var(--accent-gold);
  color: var(--coffee-dark);
  border-radius: 0 50px 50px 0;
  font-weight: 700;
  font-size: 0.85rem;
  border: none;
  padding: 0.6rem 1.2rem;
}

/* ============ MISC ============ */
.bg-coffee-cream { background: var(--coffee-cream); }
.bg-coffee-dark { background: var(--coffee-dark); }
.text-coffee { color: var(--coffee-brown); }
.text-gold { color: var(--accent-gold); }

.badge-coffee {
  background: rgba(111,78,55,0.1);
  color: var(--coffee-brown);
  border-radius: 50px;
  padding: 0.3rem 0.8rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.fade-up { opacity: 0; transform: translateY(30px); transition: opacity 0.6s ease, transform 0.6s ease; }
.fade-up.visible { opacity: 1; transform: translateY(0); }

/* Cart Sidebar */
.cart-sidebar {
  position: fixed;
  top: 0; right: -420px;
  width: 420px;
  max-width: 100%;
  height: 100vh;
  background: white;
  z-index: 9999;
  box-shadow: -10px 0 50px rgba(0,0,0,0.2);
  transition: right 0.35s cubic-bezier(0.4,0,0.2,1);
  display: flex; flex-direction: column;
}

.cart-sidebar.open { right: 0; }
.cart-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9998;
  backdrop-filter: blur(4px);
}
.cart-overlay.open { display: block; }

/* Toast */
.toast-container { position: fixed; bottom: 2rem; right: 2rem; z-index: 10000; }
.toast-custom {
  background: var(--coffee-dark);
  color: white;
  border-radius: 12px;
  padding: 1rem 1.5rem;
  font-size: 0.9rem;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 0.75rem;
  animation: slideInRight 0.4s ease;
}
@keyframes slideInRight {
  from { transform: translateX(100px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Page Header */
.page-header {
  background: linear-gradient(135deg, var(--coffee-dark), var(--coffee-brown));
  padding: 8rem 0 4rem;
  color: white;
  position: relative;
  overflow: hidden;
}
.page-header::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0; right: 0;
  height: 60px;
  background: var(--bg-light);
  clip-path: ellipse(55% 100% at 50% 100%);
}

.page-header h1 { font-size: clamp(2rem, 5vw, 3.5rem); color: white; }
.page-header p { color: rgba(255,255,255,0.75); font-size: 1.05rem; }

/* Testimonial */
.testimonial-card {
  background: white;
  border-radius: var(--border-radius);
  padding: 2rem;
  border: 1px solid rgba(111,78,55,0.08);
  transition: var(--transition);
  height: 100%;
}
.testimonial-card:hover { box-shadow: var(--shadow-md); transform: translateY(-4px); }
.testimonial-avatar { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; }

/* Admin */
.admin-sidebar {
  background: var(--coffee-dark);
  min-height: 100vh;
  width: 260px;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  padding: 2rem 0;
  overflow-y: auto;
}
.admin-sidebar .brand { color: white; font-family: 'Playfair Display', serif; font-size: 1.4rem; padding: 0 1.5rem 2rem; border-bottom: 1px solid rgba(255,255,255,0.1); }
.admin-nav-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.9rem 1.5rem; color: rgba(255,255,255,0.65); text-decoration: none; font-size: 0.9rem; transition: var(--transition); }
.admin-nav-item:hover, .admin-nav-item.active { background: rgba(255,255,255,0.1); color: white; border-right: 3px solid var(--accent-gold); }
.admin-content { margin-left: 260px; min-height: 100vh; background: #F5F5F5; }
.stat-card { background: white; border-radius: var(--border-radius); padding: 1.75rem; border: none; transition: var(--transition); }
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-icon { width: 56px; height: 56px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; }

/* Loyalty */
.loyalty-card-gfx {
  background: linear-gradient(135deg, var(--coffee-dark), var(--coffee-brown));
  border-radius: 20px;
  padding: 2.5rem;
  color: white;
  position: relative;
  overflow: hidden;
}
.loyalty-card-gfx::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 300px; height: 300px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
}
.tier-badge { padding: 0.4rem 1.2rem; border-radius: 50px; font-size: 0.85rem; font-weight: 700; }
.tier-bronze { background: linear-gradient(135deg, #CD7F32, #A0522D); color: white; }
.tier-silver { background: linear-gradient(135deg, #C0C0C0, #808080); color: white; }
.tier-gold { background: linear-gradient(135deg, var(--accent-gold), #B8922E); color: var(--coffee-dark); }
.tier-platinum { background: linear-gradient(135deg, #E5E4E2, #BCC6CC); color: #333; }

/* Order page */
.order-type-btn {
  border: 2px solid rgba(111,78,55,0.2);
  border-radius: 16px;
  padding: 1.25rem;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  background: white;
}
.order-type-btn:hover, .order-type-btn.selected {
  border-color: var(--coffee-brown);
  background: rgba(111,78,55,0.05);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.order-type-btn.selected { border-width: 2px; }

/* Form Styles */
.form-control-coffee {
  border: 1.5px solid rgba(111,78,55,0.2);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  transition: var(--transition);
  background: white;
}
.form-control-coffee:focus {
  border-color: var(--coffee-brown);
  box-shadow: 0 0 0 3px rgba(111,78,55,0.1);
  outline: none;
}

/* Blog */
.blog-card { background: white; border-radius: var(--border-radius); overflow: hidden; transition: var(--transition); border: 1px solid rgba(111,78,55,0.08); height: 100%; }
.blog-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.blog-img { height: 200px; object-fit: cover; width: 100%; }
.blog-meta { font-size: 0.8rem; color: var(--text-muted); }
.blog-category { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--coffee-brown); background: rgba(111,78,55,0.1); padding: 0.2rem 0.6rem; border-radius: 50px; }

/* Animations */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
.float-anim { animation: float 3s ease-in-out infinite; }

@keyframes pulse-gold {
  0%, 100% { box-shadow: 0 0 0 0 rgba(212,168,83,0.4); }
  50% { box-shadow: 0 0 0 12px rgba(212,168,83,0); }
}

.scroll-top-btn {
  position: fixed; bottom: 2rem; left: 2rem;
  width: 45px; height: 45px;
  background: var(--coffee-brown);
  color: white; border: none; border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer; z-index: 999;
  transition: var(--transition);
  display: none; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md);
}
.scroll-top-btn.show { display: flex; }
.scroll-top-btn:hover { background: var(--coffee-dark); transform: translateY(-3px); }

@media (max-width: 768px) {
  .section-title { font-size: 1.75rem; }
  .hero-stats { gap: 1.5rem; }
  .cart-sidebar { width: 100%; right: -100%; }
  .admin-sidebar { width: 100%; min-height: auto; position: relative; }
  .admin-content { margin-left: 0; }
}
