/* ==========================================================================
   Celebration Holdings (CHL) - Main Stylesheet
   Modern, High-Performance, Mobile-First, Accessible
   ========================================================================== */

@import url('./variables.css');

/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300..800;1,9..144,300..800&family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

/* Modern Box-Sizing & Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

body {
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
  background-color: var(--color-bg);
  background-image: url('../assets/images/decorations/ceylon-mandala-seamless-pattern.png');
  background-repeat: repeat;
  background-size: 580px 580px;
  background-attachment: fixed;
}

/* Accessible focus styles */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

/* Typography Base */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--color-primary-dark);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

h1 { font-size: var(--text-4xl); font-weight: 800; }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
  margin-bottom: 1rem;
  color: var(--color-text-muted);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.7;
}

p:last-child {
  margin-bottom: 0;
}

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

a:hover {
  color: var(--color-accent);
}

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

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

ul, ol {
  list-style: none;
}

/* Containers */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-padding);
}

.container-wide {
  width: 100%;
  max-width: var(--container-wide);
  margin-inline: auto;
  padding-inline: var(--container-padding);
}

.container-narrow {
  width: 100%;
  max-width: var(--container-narrow);
  margin-inline: auto;
  padding-inline: var(--container-padding);
}

/* Section Wrapper */
.section {
  padding-block: clamp(3.5rem, 6vw, 6rem);
  position: relative;
}

.section-muted {
  background-color: rgba(242, 239, 231, 0.75);
  background-image: url('../assets/images/decorations/ceylon-mandala-seamless-pattern.png');
  background-repeat: repeat;
  background-size: 580px 580px;
}

.section-dark {
  background-color: var(--color-surface-dark);
  color: var(--color-text-inverse);
  position: relative;
  overflow: hidden;
}

#payment-section {
  background-color: var(--color-surface-dark);
  position: relative;
  overflow: hidden;
}

#payment-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url('../assets/images/decorations/botanical-lines-seamless-tile.png');
  background-repeat: repeat;
  background-size: 800px auto;
  opacity: 0.12; /* Light transparent white botanical line art with zero seam mismatch */
  pointer-events: none;
  z-index: 0;
}

#payment-section > .container {
  position: relative;
  z-index: 1;
}

.section-dark h1,
.section-dark h2,
.section-dark h3,
.section-dark h4 {
  color: var(--color-text-inverse);
}

.section-dark p {
  color: var(--color-text-inverse-muted);
}

/* Section Headers */
.section-header {
  text-align: center;
  max-width: 760px;
  margin-inline: auto;
  margin-bottom: clamp(2.5rem, 4vw, 4rem);
}

.section-header.text-left {
  text-align: left;
  margin-inline: 0;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 1rem;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.85rem;
  border: 1px solid rgba(12, 77, 47, 0.12);
}

.section-dark .section-tag {
  background: rgba(198, 139, 44, 0.15);
  color: var(--color-accent-light);
  border-color: rgba(198, 139, 44, 0.3);
}

.section-title {
  margin-bottom: 1rem;
}

.section-subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.8rem 1.6rem;
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
  text-align: center;
  white-space: nowrap;
}

.btn-primary {
  background: var(--color-primary);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(12, 77, 47, 0.25);
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(12, 77, 47, 0.35);
}

.btn-accent {
  background: var(--color-accent);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(198, 139, 44, 0.28);
}

.btn-accent:hover {
  background: var(--color-accent-dark);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(198, 139, 44, 0.38);
}

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

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

.btn-outline-white {
  background: transparent;
  color: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.6);
}

.btn-outline-white:hover {
  background: #ffffff;
  color: var(--color-primary-dark);
  border-color: #ffffff;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: var(--text-xs);
}

.btn-lg {
  padding: 1rem 2.2rem;
  font-size: var(--text-base);
}

.btn-icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Badge Tags */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  font-size: 0.725rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
}

.badge-organic {
  background: #dcfce7;
  color: #14532d;
  border: 1px solid #bbf7d0;
}

.badge-gold {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

/* Form Controls */
.form-group {
  margin-bottom: 1.25rem;
  position: relative;
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--color-text);
}

.form-control {
  width: 100%;
  padding: 0.85rem 1.1rem;
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  font-family: inherit;
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(12, 77, 47, 0.12);
  background: #ffffff;
}

.form-control::placeholder {
  color: var(--color-text-subtle);
  opacity: 0.8;
}

textarea.form-control {
  resize: vertical;
  min-height: 120px;
}

/* Card Styling */
.card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-light);
  overflow: hidden;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-sm);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(12, 77, 47, 0.15);
}

/* Responsive Grid helpers */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(1.5rem, 2.5vw, 2rem);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: clamp(1.25rem, 2vw, 1.8rem);
}

@media (min-width: 992px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Accessibility: Visually Hidden */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ==========================================================================
   Ceylon Heritage Mandala Watermark Accents (Close to 90% transparent)
   ========================================================================== */
.watermark-mandala {
  position: absolute;
  width: clamp(300px, 34vw, 520px);
  height: clamp(300px, 34vw, 520px);
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  pointer-events: none;
  z-index: 0;
  opacity: 0.08; /* Close to 90% transparent */
  user-select: none;
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.04));
  transition: transform 0.8s ease, opacity 0.4s ease;
}

.watermark-mandala-right {
  top: 50%;
  right: -140px;
  transform: translateY(-50%) rotate(12deg);
}

.watermark-mandala-left {
  top: 45%;
  left: -140px;
  transform: translateY(-50%) rotate(-12deg);
}

.watermark-mandala-top-right {
  top: -80px;
  right: -80px;
  transform: rotate(20deg);
}

.watermark-mandala-bottom-left {
  bottom: -80px;
  left: -80px;
  transform: rotate(-20deg);
}

/* Ensure section containers sit above background watermarks */
.section > .container,
.section > .container-fluid {
  position: relative;
  z-index: 1;
}

@media (max-width: 768px) {
  .watermark-mandala {
    opacity: 0.05;
    width: 260px;
    height: 260px;
  }
  .watermark-mandala-right { right: -90px; }
  .watermark-mandala-left { left: -90px; }
}

