:root {
  --primary-color: #1A202C;
  --secondary-color: #FFD700;
  --text-color-dark: #333333;
  --text-color-light: #ffffff;
  --background-light: #f8f8f8;
  --background-dark: #1A202C;
  --border-color: #e0e0e0;
  --header-offset: 120px; /* Fallback, actual value comes from shared.css */
}

/* Base styles for the page content */
.page-affiliate-program {
  font-family: 'Arial', sans-serif;
  color: var(--text-color-dark);
  line-height: 1.6;
  background-color: var(--background-light); /* Default light background for body */
}

.page-affiliate-program__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.page-affiliate-program__section {
  padding: 80px 0;
  text-align: center;
}

.page-affiliate-program__section-title {
  font-size: 36px;
  font-weight: bold;
  margin-bottom: 20px;
  color: var(--primary-color);
  text-transform: uppercase;
}

.page-affiliate-program__section-title--light {
  color: var(--text-color-light);
}

.page-affiliate-program__text-block {
  font-size: 17px;
  max-width: 800px;
  margin: 0 auto 30px;
  color: var(--text-color-dark);
}

.page-affiliate-program__text-block--light {
  color: var(--text-color-light);
}

.page-affiliate-program__link {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: bold;
}

.page-affiliate-program__link:hover {
  text-decoration: underline;
}

/* Hero Section */
.page-affiliate-program__hero-section {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
  padding-top: var(--header-offset, 120px); /* Ensure content is not hidden by fixed header */
  background-color: var(--primary-color); /* Dark background for hero */
  color: var(--text-color-light);
}

.page-affiliate-program__hero-container {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.page-affiliate-program__hero-image {
  width: 100%;
  margin-bottom: 30px;
}

.page-affiliate-program__hero-image img {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
  border-radius: 8px;
  object-fit: cover;
}

.page-affiliate-program__hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  width: 100%;
}

.page-affiliate-program__main-title {
  font-size: 48px;
  font-weight: 900;
  margin-bottom: 20px;
  color: var(--secondary-color); /* Gold for main title */
  line-height: 1.2;
}

.page-affiliate-program__hero-description {
  font-size: 20px;
  margin-bottom: 40px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  color: var(--text-color-light);
}

.page-affiliate-program__cta-button {
  display: inline-block;
  padding: 15px 40px;
  background: var(--secondary-color);
  color: var(--primary-color); /* Dark text on gold button */
  text-decoration: none;
  border-radius: 50px;
  font-size: 18px;
  font-weight: bold;
  margin-top: 30px;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  border: none;
}

.page-affiliate-program__cta-button:hover {
  background: #FFC107; /* Slightly darker gold on hover */
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.page-affiliate-program__cta-button--gold {
  background: var(--secondary-color);
  color: var(--primary-color);
}
.page-affiliate-program__cta-button--gold:hover {
  background: #FFC107;
}

/* Introduction Section */
.page-affiliate-program__introduction .page-affiliate-program__text-block {
  text-align: left;
  margin-left: auto;
  margin-right: auto;
}

/* Benefits Section */
.page-affiliate-program__benefits {
  background-color: var(--background-dark); /* Dark background */
  color: var(--text-color-light);
}

.page-affiliate-program__benefits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  margin-top: 50px;
}

.page-affiliate-program__card {
  background-color: #ffffff; /* Light card background */
  color: var(--text-color-dark);
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.page-affiliate-program__card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.page-affiliate-program__card--light {
  background-color: rgba(255, 255, 255, 0.95); /* Slightly transparent white on dark background */
  color: var(--text-color-dark);
}

.page-affiliate-program__card img {
  width: 100%;
  max-width: 200px; /* Constrain image width within card */
  height: auto;
  margin-bottom: 20px;
  border-radius: 8px;
  object-fit: cover;
}

.page-affiliate-program__card-title {
  font-size: 22px;
  font-weight: bold;
  margin-bottom: 15px;
  color: var(--primary-color);
}

.page-affiliate-program__card-text {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-color-dark);
}

/* Commission Structure Section */
.page-affiliate-program__commission-structure {
  background-color: var(--background-light);
}

.page-affiliate-program__commission-table-wrapper {
  overflow-x: auto;
  margin-top: 40px;
}

.page-affiliate-program__commission-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 auto;
  min-width: 600px; /* Ensure table is readable on smaller screens */
}

.page-affiliate-program__commission-table th,
.page-affiliate-program__commission-table td {
  border: 1px solid var(--border-color);
  padding: 15px;
  text-align: center;
  font-size: 16px;
}

.page-affiliate-program__commission-table th {
  background-color: var(--primary-color);
  color: var(--text-color-light);
  font-weight: bold;
  text-transform: uppercase;
}

.page-affiliate-program__commission-table tr:nth-child(even) {
  background-color: #f2f2f2;
}

.page-affiliate-program__commission-table tr:hover {
  background-color: #e9e9e9;
}

.page-affiliate-program__note {
  font-size: 14px;
  margin-top: 20px;
  color: #666;
  text-align: center;
}

/* Marketing Tools Section */
.page-affiliate-program__marketing-tools {
  background-color: var(--background-light);
}

.page-affiliate-program__tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 50px;
}

/* Join Process Section */
.page-affiliate-program__join-process {
  background-color: var(--background-dark);
  color: var(--text-color-light);
}

.page-affiliate-program__process-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  margin-top: 50px;
}

.page-affiliate-program__step {
  background-color: rgba(255, 255, 255, 0.08); /* Slightly transparent white on dark background */
  padding: 30px;
  border-radius: 10px;
  text-align: center;
  position: relative;
  transition: background-color 0.3s ease;
}

.page-affiliate-program__step:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

.page-affiliate-program__step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: var(--secondary-color);
  color: var(--primary-color);
  font-size: 30px;
  font-weight: bold;
  margin-bottom: 20px;
  border: 3px solid var(--primary-color);
  box-shadow: 0 0 0 5px rgba(255, 215, 0, 0.3);
}

.page-affiliate-program__step-title {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 15px;
  color: var(--secondary-color);
}

.page-affiliate-program__step-description {
  font-size: 16px;
  color: var(--text-color-light);
}

.page-affiliate-program__center-button {
  text-align: center;
  margin-top: 60px;
}

/* Terms & Conditions Section */
.page-affiliate-program__terms {
  background-color: var(--background-light);
}

.page-affiliate-program__terms-list {
  list-style: disc;
  text-align: left;
  max-width: 800px;
  margin: 30px auto;
  padding-left: 40px;
  font-size: 17px;
  color: var(--text-color-dark);
}

.page-affiliate-program__terms-list li {
  margin-bottom: 10px;
}

/* FAQ Section */
.page-affiliate-program__faq-section {
  background-color: var(--background-light);
  padding-bottom: 80px;
}

.page-affiliate-program__faq-list {
  max-width: 900px;
  margin: 50px auto 0;
  text-align: left;
}

.page-affiliate-program__faq-item {
  margin-bottom: 15px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.page-affiliate-program__faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s ease, opacity 0.3s ease;
  padding: 0 20px; /* Adjusted padding */
  opacity: 0;
  background-color: #f9f9f9;
}

.page-affiliate-program__faq-item.active .page-affiliate-program__faq-answer {
  max-height: 2000px !important; /* 🚨 Ensure it expands */
  padding: 20px !important; /* Adjusted padding */
  opacity: 1;
  background-color: #f9f9f9;
  border-radius: 0 0 8px 8px;
}

.page-affiliate-program__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  background-color: #fff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  position: relative;
}

.page-affiliate-program__faq-question:hover {
  background-color: #f5f5f5;
  border-color: #d0d0d0;
}

.page-affiliate-program__faq-question:active {
  background-color: #eeeeee;
}

.page-affiliate-program__faq-question h3 {
  margin: 0;
  padding: 0;
  flex: 1;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--primary-color);
  pointer-events: none; /* Prevent h3 from blocking click */
}

.page-affiliate-program__faq-toggle {
  font-size: 28px; /* Larger for better visibility */
  font-weight: bold;
  line-height: 1;
  color: var(--secondary-color);
  transition: transform 0.3s ease, color 0.3s ease;
  flex-shrink: 0;
  margin-left: 15px;
  pointer-events: none; /* Prevent icon from blocking click */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; /* Larger touch target */
  height: 32px;
}

.page-affiliate-program__faq-item.active .page-affiliate-program__faq-toggle {
  color: var(--primary-color);
  transform: rotate(45deg); /* Optional: rotate for 'x' effect */
}

.page-affiliate-program__faq-answer p {
  margin: 0;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-color-dark);
}

/* Final CTA Section */
.page-affiliate-program__final-cta {
  background-color: var(--background-dark);
  color: var(--text-color-light);
  padding: 100px 0;
}

.page-affiliate-program__center-text {
  text-align: center;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .page-affiliate-program__hero-section {
    padding-top: var(--header-offset, 120px);
  }
  .page-affiliate-program__main-title {
    font-size: 40px;
  }
  .page-affiliate-program__hero-description {
    font-size: 18px;
  }
  .page-affiliate-program__section-title {
    font-size: 32px;
  }
  .page-affiliate-program__text-block {
    font-size: 16px;
  }
  .page-affiliate-program__card-title {
    font-size: 20px;
  }
  .page-affiliate-program__step-title {
    font-size: 22px;
  }
}

@media (max-width: 768px) {
  .page-affiliate-program__hero-section {
    padding-top: var(--header-offset, 120px) !important; /* Mobile specific offset */
    padding-bottom: 40px;
    padding-left: 15px;
    padding-right: 15px;
  }
  .page-affiliate-program__hero-image img {
    border-radius: 4px;
  }
  .page-affiliate-program__main-title {
    font-size: 32px;
  }
  .page-affiliate-program__hero-description {
    font-size: 16px;
    margin-bottom: 30px;
  }
  .page-affiliate-program__cta-button {
    padding: 12px 30px;
    font-size: 16px;
    max-width: 100% !important; /* Button responsive */
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
  }

  .page-affiliate-program__section {
    padding: 60px 0;
  }
  .page-affiliate-program__container {
    padding: 0 15px;
  }
  .page-affiliate-program__section-title {
    font-size: 28px;
  }
  .page-affiliate-program__text-block {
    font-size: 15px;
  }

  /* Image responsiveness for all img tags within the page content */
  .page-affiliate-program img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    box-sizing: border-box !important;
  }
  .page-affiliate-program__section,
  .page-affiliate-program__card,
  .page-affiliate-program__container,
  .page-affiliate-program__commission-table-wrapper,
  .page-affiliate-program__faq-list,
  .page-affiliate-program__tools-grid,
  .page-affiliate-program__benefits-grid,
  .page-affiliate-program__process-steps,
  .page-affiliate-program__center-button,
  .page-affiliate-program__cta-buttons,
  .page-affiliate-program__button-group,
  .page-affiliate-program__btn-container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }
  .page-affiliate-program__card {
    padding: 20px;
  }
  .page-affiliate-program__card img {
     /* Adjust max-width for smaller screens if needed */
  }
  .page-affiliate-program__card-title {
    font-size: 18px;
  }
  .page-affiliate-program__card-text {
    font-size: 14px;
  }
  .page-affiliate-program__commission-table-wrapper {
    margin-left: -15px; /* Adjust for padding on container */
    margin-right: -15px;
    width: calc(100% + 30px); /* Fill full width */
  }
  .page-affiliate-program__commission-table th,
  .page-affiliate-program__commission-table td {
    padding: 10px;
    font-size: 14px;
  }
  .page-affiliate-program__process-steps {
    grid-template-columns: 1fr;
  }
  .page-affiliate-program__step {
    padding: 25px;
  }
  .page-affiliate-program__step-number {
    width: 50px;
    height: 50px;
    font-size: 26px;
  }
  .page-affiliate-program__step-title {
    font-size: 20px;
  }
  .page-affiliate-program__faq-question {
    padding: 15px;
    flex-wrap: wrap;
  }
  .page-affiliate-program__faq-question h3 {
    font-size: 15px;
    margin-bottom: 0;
    width: calc(100% - 40px);
  }
  .page-affiliate-program__faq-toggle {
    margin-left: 10px;
    width: 24px;
    height: 24px;
    font-size: 20px;
  }
  .page-affiliate-program__faq-answer {
    padding: 0 15px;
  }
  .page-affiliate-program__faq-item.active .page-affiliate-program__faq-answer {
    padding: 15px !important;
  }
  .page-affiliate-program__terms-list {
    padding-left: 20px;
    font-size: 15px;
  }
}

/* Color contrast fixes based on body background (default light, so dark text) */
.page-affiliate-program {
  color: var(--text-color-dark); /* Default text color for the page */
}

.page-affiliate-program__dark-bg {
  background: var(--background-dark);
  color: var(--text-color-light); /* White text on dark background */
}

.page-affiliate-program__light-bg {
  background: var(--background-light);
  color: var(--text-color-dark); /* Dark text on light background */
}

/* Ensure buttons have good contrast */
.page-affiliate-program__cta-button {
  background: var(--secondary-color);
  color: var(--primary-color); /* Gold background, dark text */
}

.page-affiliate-program__cta-button:hover {
  background: #FFC107; /* Slightly darker gold */
}

/* Specific text elements for contrast */
.page-affiliate-program__main-title {
  color: var(--secondary-color); /* Gold title on dark hero */
}
.page-affiliate-program__hero-description {
  color: var(--text-color-light); /* White text on dark hero */
}
.page-affiliate-program__card-title {
  color: var(--primary-color); /* Dark title on light card */
}
.page-affiliate-program__step-title {
  color: var(--secondary-color); /* Gold title on dark step */
}
.page-affiliate-program__faq-question h3 {
  color: var(--primary-color); /* Dark text for FAQ question */
}
.page-affiliate-program__faq-toggle {
  color: var(--secondary-color); /* Gold for FAQ toggle */
}
.page-affiliate-program__faq-item.active .page-affiliate-program__faq-toggle {
  color: var(--primary-color); /* Dark for active FAQ toggle */
}