/* Modern CSS Reset */
:root {
  --primary-color: #8b5e3c;
  --primary-light: #a87c56;
  --primary-dark: #6d4b2f;
  --text-color: #333;
  --text-light: #666;
  --background: #fff9f5;
  --white: #ffffff;
  --gray-light: #f5f5f5;
  --gray: #e0e0e0;
  --border-radius: 8px;
  --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  --transition: all 0.3s ease;
}

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

body {
  font-family: 'Open Sans', sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  padding-top: 140px; /* Space for fixed header (aligned with main page header height) */
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--primary-dark);
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.btn {
  display: inline-block;
  background-color: var(--primary-color);
  color: white;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.2px;
  border: none;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease;
  text-align: center;
  box-shadow: 0 2px 6px rgba(139, 94, 60, 0.25);
}

.btn:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(139, 94, 60, 0.25);
}

/* Header Styles */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: rgba(255,255,255,0.9);
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  z-index: 1000;
  padding: 10px 0 14px;
}

.header-container {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.logo {
  display: flex;
  align-items: center;
  height: 110px; /* Match main page header logo height for consistent header size */
  width: auto;
  margin: 0;
}

/* Ensure image inside logo scales and aligns correctly */
.logo img {
  height: 110px; /* Match main page */
  width: auto;
  display: block;
}

.main-nav {
  width: 100%;
  padding-top: 0;
}

.nav-list {
  display: flex;
  justify-content: center;
  list-style: none;
  gap: 30px;
  padding: 10px 0 0;
  margin: 0;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.nav-list a {
  font-weight: 600;
  color: var(--text-color);
  padding: 5px 0;
  position: relative;
}

.nav-list a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 0;
  background-color: var(--primary-color);
  transition: var(--transition);
}

.nav-list a:hover::after,
.nav-list a.active::after {
  width: 100%;
}

.nav-list a.active {
  color: var(--primary-color);
}

/* Hero Section */
.hero {
  background: transparent;
  padding: 56px 0 24px;
  text-align: center;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--primary-dark);
}

.hero .subtitle {
  font-size: 1.25rem;
  color: var(--text-light);
  max-width: 700px;
  margin: 0 auto;
}

/* Masterclasses Grid */
.masterclasses {
  padding: 16px 0 96px;
  position: relative;
}

.masterclasses::before {
  content: '';
  position: absolute;
  inset: 0;
  /* Subtle light accents without washing out cards */
  background: radial-gradient(1200px 600px at 20% 0%, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0) 60%),
              linear-gradient(to bottom, rgba(255, 248, 240, 0) 0%, rgba(255, 248, 240, 0.12) 100%);
  pointer-events: none;
}

.masterclass-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
  margin-top: 24px;
}

.masterclass-card {
  background: var(--white);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  transition: transform .3s ease, box-shadow .3s ease;
  display: flex;
  flex-direction: column;
}

.masterclass-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.12);
}

.card-image {
  height: 220px;
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

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

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

.card-content h2 {
  font-size: 1.35rem;
  margin: 0 0 10px;
  color: var(--primary-dark);
}

.card-content p {
  color: var(--text-light);
  margin: 0 0 16px;
  flex-grow: 1;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 16px;
  font-size: 0.9rem;
  color: var(--text-light);
}

.card-meta .duration,
.card-meta .level {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f7f3ef;
  color: #6d4b2f;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.price {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary-color);
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.modal-content {
  background: white;
  padding: 30px;
  border-radius: var(--border-radius);
  max-width: 500px;
  width: 100%;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 28px;
  cursor: pointer;
  color: var(--text-light);
  transition: var(--transition);
}

.close:hover {
  color: var(--text-color);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-color);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--gray);
  border-radius: 12px;
  font-family: 'Open Sans', sans-serif;
  font-size: 1rem;
  transition: var(--transition);
  background: #fff;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(139, 94, 60, 0.2);
}

.form-group textarea {
  min-height: 100px;
  resize: vertical;
}

.form-submit {
  margin-top: 30px;
  text-align: center;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
  padding: 12px 30px;
  font-size: 1rem;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
  max-width: 300px;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(139, 94, 60, 0.2);
}

/* Masterclass specific modal (isolated from global .modal) */
.mc-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.mc-modal-content {
  background: white;
  padding: 28px 24px 24px;
  border-radius: 16px;
  max-width: 500px;
  width: 100%;
  position: relative;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  animation: modalFadeIn 0.3s ease-out;
}

.mc-close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 28px;
  cursor: pointer;
  color: var(--text-light);
  transition: var(--transition);
}

.mc-close:hover {
  color: var(--text-color);
}

/* Purchase controls and video link styling */
.purchase-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.buy-button {
  margin-right: 10px;
}

.video-link {
  display: inline-flex;
  align-items: center;
  color: #4a6fa5;
  text-decoration: none;
  font-weight: 600;
  padding: 8px 15px;
  border: 1px solid #4a6fa5;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.video-link:hover {
  background-color: #4a6fa5;
  color: white;
}

.play-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: #4a6fa5;
  color: white;
  border-radius: 50%;
  margin-right: 8px;
  font-size: 12px;
  padding-left: 2px;
}

.success-icon {
  font-size: 50px;
  color: #4CAF50;
  text-align: center;
  margin: 20px 0;
}

/* Cart modal header alignment (scoped to this page) */
#cartModal .modal-content {
  padding: 22px 18px 18px 18px; /* leave room for close button */
}

#cartModal .modal-content h3 {
  margin: 0 42px 14px 0; /* keep clear of the close button */
  line-height: 1.2;
}

#cartModal .close {
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  line-height: 30px;
  text-align: center;
  border-radius: 50%;
}

@media (max-width: 480px) {
  #cartModal .modal-content {
    padding: 18px 14px 16px 14px;
  }
  #cartModal .modal-content h3 {
    margin: 0 40px 12px 0;
    font-size: 1.05rem;
  }
  #cartModal .close {
    top: 10px;
    right: 10px;
  }
}

/* Footer */
.site-footer {
  /* Light warm gradient to match site colors */
  background: linear-gradient(to right, #fff7ee, #fde8d9);
  color: #5c3b24; /* Slightly deeper for contrast on warm light */
  padding: 36px 0;
  text-align: center;
  font-size: 0.9rem;
  margin-top: 56px;
  border-top: 1px solid #f0e4d8; /* subtle separator */
}

.site-footer a {
  color: #8b5e3c;
  text-decoration: none;
}

.site-footer a:hover {
  color: #a87c56;
}

/* Ensure masterclass cards are not greyed out before hover */
.masterclass-card {
  opacity: 1;
  filter: none;
}

.masterclass-card .card-image img {
  opacity: 1;
  filter: none;
}

/* Responsive Design */
@media (max-width: 768px) {
  body {
    padding-top: 140px; /* Keep comfortable space on mobile as header is taller now */
  }
  
  .hero h1 {
    font-size: 2rem;
  }
  
  .hero .subtitle {
    font-size: 1.1rem;
  }
  
  .masterclass-grid {
    grid-template-columns: 1fr;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
  }
  
  .nav-list {
    flex-wrap: wrap;
    gap: 15px;
    padding-top: 15px;
  }
  
  .nav-list a {
    font-size: 0.9rem;
  }

  /* Slightly smaller mobile stars pill on masterclass page */
  .mobile-stars {
    transform: scale(0.9);
    transform-origin: center;
  }
}

@media (max-width: 480px) {
  .header-container {
    padding: 0 15px;
  }
  
  .logo {
    height: 50px;
  }
  
  .hero {
    padding: 60px 0;
  }
  
  .hero h1 {
    font-size: 1.75rem;
  }
  
  .card-footer {
    flex-direction: column;
    gap: 15px;
  }
  
  .btn {
    width: 100%;
  }
}

/* === Sidebar (Category panel) styles aligned with main page === */
/* Hidden by default; slides in when .open is added */
.category-panel {
  position: fixed;
  top: 0;
  left: 0; /* use transform for sliding */
  width: 280px;
  height: 100%;
  background-color: #fff9f3;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  padding: 20px;
  z-index: 1000;
  transform: translateX(-100%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.3s ease, opacity 0.3s ease, visibility 0s linear 0.3s;
  overflow-y: auto;
}

.category-panel.open {
  transform: translateX(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: transform 0.3s ease, opacity 0.3s ease, visibility 0s linear 0s;
}

/* Prevent background scroll when menu open (optional, matches main) */
body.category-open {
  overflow: hidden;
}

/* Close button */
.close-category {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #8b5e3c;
}

/* Lists and headings inside the side panel */
.category-panel h3 {
  color: #8b5e3c;
  margin: 20px 0 10px 0;
  padding-bottom: 5px;
  border-bottom: 1px solid #e0d0c0;
}

.category-panel ul {
  list-style: none;
  padding: 0;
  margin: 10px 0 20px 0;
}

.category-panel ul li { margin-bottom: 12px; }

.category-panel ul li a {
  color: #8b5e3c;
  text-decoration: none;
  font-size: 16px;
  transition: color 0.2s ease;
}

.category-panel ul li a:hover {
  color: #a96b45;
}

/* Responsive tweaks consistent with main page */
@media (max-width: 1024px) {
  .category-panel {
    width: 85vw;
    max-width: 360px;
  }
}

@media (max-width: 560px) {
  .category-panel {
    width: 92vw;
    max-width: none;
  }
}

/* === Header menu typography to match main page === */
.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-links a {
  text-decoration: none;
  font-family: 'Open Sans', sans-serif;
  color: #8b5e3c;
  font-weight: 600;
  transition: color 0.3s ease;
}

.nav-links a:hover {
  color: #b9825a;
}

/* === Site-wide visual consistency with the main page === */
.floating-header .header-inner {
  max-width: none !important;
  padding: 0 !important;
}

.floating-header .search-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(106, 75, 60, 0.25);
  background: transparent;
  color: #6a4b3c;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.floating-header .search-icon:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

.masterclass-card,
.modal-content,
.form-container {
  border: 1px solid rgba(242, 140, 61, 0.12);
  border-radius: 24px;
  box-shadow: 0 18px 45px rgba(42, 24, 18, 0.08);
}

.btn,
#submitOrderBtn,
.buy-button {
  background: #f28c3d;
  color: #fff;
  border: 0;
  border-radius: 999px;
  box-shadow: 0 14px 26px rgba(242, 140, 61, 0.35);
}

.btn:hover,
#submitOrderBtn:hover,
.buy-button:hover {
  background: #cc6c20;
}
