/* PearBlog Components Styles */

/* HERO Component */
.pb-hero {
  position: relative;
  padding: var(--pb-space-3xl) 0;
  background: linear-gradient(135deg, var(--pb-primary) 0%, var(--pb-secondary) 100%);
  color: var(--pb-text-white);
  overflow: hidden;
  margin-bottom: var(--pb-space-2xl);
}

.pb-hero.has-image {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.pb-hero.has-image::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.8) 0%, rgba(124, 58, 237, 0.8) 100%);
  z-index: 1;
}

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

.pb-hero-title {
  font-size: 2.5rem;
  margin-bottom: var(--pb-space-lg);
  color: var(--pb-text-white);
}

.pb-hero-intro {
  font-size: 1.125rem;
  max-width: 700px;
  margin: 0 auto;
  opacity: 0.95;
  line-height: 1.7;
}

@media (min-width: 768px) {
  .pb-hero {
    padding: var(--pb-space-3xl) 0 4rem;
  }

  .pb-hero-title {
    font-size: 3.5rem;
  }

  .pb-hero-intro {
    font-size: 1.25rem;
  }
}

/* CARD Component */
.pb-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--pb-space-xl);
  margin-bottom: var(--pb-space-2xl);
}

@media (min-width: 640px) {
  .pb-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .pb-cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

.pb-card {
  background: var(--pb-bg);
  border-radius: var(--pb-radius-lg);
  box-shadow: var(--pb-shadow-md);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

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

.pb-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.pb-card-content {
  padding: var(--pb-space-lg);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.pb-card-title {
  font-size: 1.25rem;
  margin-bottom: var(--pb-space-sm);
  color: var(--pb-text);
}

.pb-card-title a {
  color: var(--pb-text);
  text-decoration: none;
}

.pb-card-title a:hover {
  color: var(--pb-primary);
}

.pb-card-excerpt {
  color: var(--pb-text-light);
  margin-bottom: var(--pb-space-lg);
  flex: 1;
}

.pb-card-meta {
  font-size: 0.875rem;
  color: var(--pb-text-light);
  margin-bottom: var(--pb-space-md);
}

.pb-card-cta {
  display: inline-block;
  padding: var(--pb-space-sm) var(--pb-space-lg);
  background: var(--pb-primary);
  color: var(--pb-text-white);
  border-radius: var(--pb-radius-md);
  font-weight: 600;
  transition: background 0.2s ease;
  text-align: center;
}

.pb-card-cta:hover {
  background: var(--pb-primary-hover);
  color: var(--pb-text-white);
}

/* RELATED Component */
.pb-related {
  background: var(--pb-bg-alt);
  padding: var(--pb-space-2xl) 0;
  margin: var(--pb-space-3xl) 0;
  border-top: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
}

.pb-related-title {
  text-align: center;
  margin-bottom: var(--pb-space-xl);
}

.pb-related-list {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--pb-space-lg);
}

@media (min-width: 768px) {
  .pb-related-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

.pb-related-item {
  background: var(--pb-bg);
  padding: var(--pb-space-lg);
  border-radius: var(--pb-radius-md);
  box-shadow: var(--pb-shadow-sm);
  transition: box-shadow 0.2s ease;
}

.pb-related-item:hover {
  box-shadow: var(--pb-shadow-md);
}

.pb-related-item a {
  text-decoration: none;
  color: var(--pb-text);
  font-weight: 600;
}

.pb-related-item a:hover {
  color: var(--pb-primary);
}

/* FAQ Component */
.pb-faq {
  margin: var(--pb-space-2xl) 0;
}

.pb-faq-title {
  margin-bottom: var(--pb-space-xl);
}

.pb-faq-item {
  background: var(--pb-bg);
  border: 1px solid #e5e7eb;
  border-radius: var(--pb-radius-md);
  margin-bottom: var(--pb-space-md);
  overflow: hidden;
}

.pb-faq-question {
  padding: var(--pb-space-lg);
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

.pb-faq-question:hover {
  background: var(--pb-bg-alt);
}

.pb-faq-icon {
  transition: transform 0.3s ease;
}

.pb-faq-item.active .pb-faq-icon {
  transform: rotate(180deg);
}

.pb-faq-answer {
  padding: 0 var(--pb-space-lg);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.pb-faq-item.active .pb-faq-answer {
  padding: 0 var(--pb-space-lg) var(--pb-space-lg);
  max-height: 500px;
}

.pb-faq-answer p:last-child {
  margin-bottom: 0;
}

/* ADS Component */
.pb-ad-slot {
  margin: var(--pb-space-2xl) auto;
  text-align: center;
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pb-ad-slot.pb-ad-header {
  margin-top: var(--pb-space-lg);
}

.pb-ad-slot.pb-ad-content {
  margin: var(--pb-space-2xl) 0;
}

.pb-ad-slot.pb-ad-sidebar {
  margin: var(--pb-space-lg) 0;
  position: sticky;
  top: var(--pb-space-lg);
}

/* SEO Layout Components */
.pb-content-header {
  margin-bottom: var(--pb-space-2xl);
}

.pb-post-title {
  margin-bottom: var(--pb-space-md);
}

.pb-post-meta {
  color: var(--pb-text-light);
  font-size: 0.875rem;
  margin-bottom: var(--pb-space-lg);
}

.pb-intro {
  font-size: 1.125rem;
  color: var(--pb-text-light);
  margin-bottom: var(--pb-space-xl);
  padding: var(--pb-space-lg);
  background: var(--pb-bg-alt);
  border-left: 4px solid var(--pb-primary);
  border-radius: var(--pb-radius-md);
}

.pb-tldr {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(124, 58, 237, 0.1) 100%);
  padding: var(--pb-space-xl);
  border-radius: var(--pb-radius-lg);
  margin-bottom: var(--pb-space-2xl);
}

.pb-tldr-title {
  font-size: 1.25rem;
  margin-bottom: var(--pb-space-md);
  color: var(--pb-primary);
}

.pb-tldr ul {
  list-style-position: inside;
  margin-left: 0;
}

.pb-content-section {
  margin-bottom: var(--pb-space-2xl);
}

.pb-content-section h2 {
  margin-top: var(--pb-space-3xl);
  padding-top: var(--pb-space-lg);
  border-top: 1px solid #e5e7eb;
}

.pb-content-section h3 {
  margin-top: var(--pb-space-xl);
}

/* CTA Component */
.pb-cta {
  background: linear-gradient(135deg, var(--pb-primary) 0%, var(--pb-secondary) 100%);
  color: var(--pb-text-white);
  padding: var(--pb-space-3xl) var(--pb-space-xl);
  text-align: center;
  border-radius: var(--pb-radius-lg);
  margin: var(--pb-space-3xl) 0;
}

.pb-cta-title {
  color: var(--pb-text-white);
  margin-bottom: var(--pb-space-lg);
}

.pb-cta-button {
  display: inline-block;
  padding: var(--pb-space-lg) var(--pb-space-2xl);
  background: var(--pb-text-white);
  color: var(--pb-primary);
  border-radius: var(--pb-radius-md);
  font-weight: 700;
  font-size: 1.125rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pb-cta-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--pb-shadow-lg);
  color: var(--pb-primary);
}

/* Mobile Navigation */
.pb-nav {
  background: var(--pb-bg);
  box-shadow: var(--pb-shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.pb-nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--pb-space-md) 0;
}

.pb-logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--pb-primary);
}

.pb-menu-toggle {
  display: block;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--pb-text);
}

@media (min-width: 768px) {
  .pb-menu-toggle {
    display: none;
  }
}

.pb-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

@media (max-width: 767px) {
  .pb-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--pb-bg);
    box-shadow: var(--pb-shadow-md);
  }

  .pb-menu.active {
    display: block;
  }

  .pb-menu li {
    border-bottom: 1px solid #e5e7eb;
  }

  .pb-menu a {
    display: block;
    padding: var(--pb-space-md) var(--pb-space-lg);
  }
}

@media (min-width: 768px) {
  .pb-menu {
    display: flex;
    gap: var(--pb-space-lg);
  }

  .pb-menu a {
    padding: var(--pb-space-sm) 0;
  }
}

/* Footer */
.pb-footer {
  background: var(--pb-bg-dark);
  color: var(--pb-text-white);
  padding: var(--pb-space-2xl) 0 var(--pb-space-lg);
  margin-top: var(--pb-space-3xl);
}

.pb-footer a {
  color: var(--pb-text-white);
  opacity: 0.8;
}

.pb-footer a:hover {
  opacity: 1;
}

.pb-footer-copyright {
  text-align: center;
  padding-top: var(--pb-space-xl);
  margin-top: var(--pb-space-xl);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  opacity: 0.7;
  font-size: 0.875rem;
}

/* ========================================
   PEARBLOG v2 PRO COMPONENTS
   ======================================== */

/* HERO v2 PRO - Video Support */
.pb-hero.has-video {
  position: relative;
}

.pb-hero-video-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
}

.pb-hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pb-hero-video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.7) 0%, rgba(124, 58, 237, 0.7) 100%);
  z-index: 1;
}

.pb-hero-subtitle {
  font-size: 1.125rem;
  max-width: 700px;
  margin: 0 auto var(--pb-space-lg);
  opacity: 0.9;
}

.pb-hero-cta {
  margin-top: var(--pb-space-xl);
}

.pb-hero-cta-button {
  display: inline-block;
  padding: var(--pb-space-md) var(--pb-space-2xl);
  background: var(--pb-text-white);
  color: var(--pb-primary);
  border-radius: var(--pb-radius-md);
  font-weight: 700;
  font-size: 1.125rem;
  transition: var(--pb-transition);
  box-shadow: var(--pb-shadow-lg);
}

.pb-hero-cta-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--pb-shadow-xl);
  color: var(--pb-primary-hover);
}

/* TABLE OF CONTENTS (TOC) */
.pb-toc {
  background: var(--pb-bg);
  border-radius: var(--pb-radius-lg);
  padding: var(--pb-space-lg);
  box-shadow: var(--pb-shadow-md);
  margin-bottom: var(--pb-space-xl);
}

.pb-toc-sticky {
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

.pb-toc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--pb-space-md);
  padding-bottom: var(--pb-space-md);
  border-bottom: 1px solid #e5e7eb;
}

.pb-toc-title {
  font-size: 1.125rem;
  margin: 0;
  color: var(--pb-text);
}

.pb-toc-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--pb-text-light);
  font-size: 1rem;
}

@media (max-width: 767px) {
  .pb-toc-toggle {
    display: block;
  }

  .pb-toc.collapsed .pb-toc-list {
    display: none;
  }

  .pb-toc.collapsed .pb-toc-icon {
    transform: rotate(-90deg);
  }
}

.pb-toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.pb-toc-item {
  margin-bottom: var(--pb-space-sm);
}

.pb-toc-level-3 {
  padding-left: var(--pb-space-lg);
}

.pb-toc-link {
  display: block;
  color: var(--pb-text-light);
  text-decoration: none;
  transition: var(--pb-transition);
  padding: var(--pb-space-xs) 0;
  font-size: 0.9375rem;
}

.pb-toc-link:hover,
.pb-toc-link.active {
  color: var(--pb-primary);
  padding-left: var(--pb-space-xs);
}

.pb-toc-progress {
  margin-top: var(--pb-space-md);
  height: 4px;
  background: var(--pb-bg-alt);
  border-radius: var(--pb-radius-sm);
  overflow: hidden;
}

.pb-toc-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--pb-primary), var(--pb-secondary));
  width: 0%;
  transition: width 0.1s ease;
}

/* CTA BLOCK v2 PRO */
.pb-cta {
  background: linear-gradient(135deg, var(--pb-primary) 0%, var(--pb-secondary) 100%);
  color: var(--pb-text-white);
  padding: var(--pb-space-3xl) var(--pb-space-xl);
  text-align: center;
  border-radius: var(--pb-radius-lg);
  margin: var(--pb-space-3xl) 0;
}

.pb-cta-style-solid {
  background: var(--pb-primary);
}

.pb-cta-style-outline {
  background: transparent;
  border: 2px solid var(--pb-primary);
  color: var(--pb-text);
}

.pb-cta-style-minimal {
  background: var(--pb-bg-alt);
  color: var(--pb-text);
}

.pb-cta-container {
  max-width: 800px;
  margin: 0 auto;
}

.pb-cta-title {
  color: var(--pb-text-white);
  margin-bottom: var(--pb-space-lg);
  font-size: 2rem;
}

.pb-cta-style-outline .pb-cta-title,
.pb-cta-style-minimal .pb-cta-title {
  color: var(--pb-text);
}

.pb-cta-subtitle {
  font-size: 1.125rem;
  margin-bottom: var(--pb-space-xl);
  opacity: 0.9;
}

.pb-cta-buttons {
  display: flex;
  gap: var(--pb-space-md);
  justify-content: center;
  flex-wrap: wrap;
}

.pb-cta-button {
  display: inline-block;
  padding: var(--pb-space-lg) var(--pb-space-2xl);
  border-radius: var(--pb-radius-md);
  font-weight: 700;
  font-size: 1.125rem;
  transition: var(--pb-transition);
  text-decoration: none;
  cursor: pointer;
  border: none;
}

.pb-cta-button-primary {
  background: var(--pb-text-white);
  color: var(--pb-primary);
}

.pb-cta-button-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--pb-shadow-lg);
  color: var(--pb-primary-hover);
}

.pb-cta-button-secondary {
  background: transparent;
  color: var(--pb-text-white);
  border: 2px solid var(--pb-text-white);
}

.pb-cta-button-secondary:hover {
  background: var(--pb-text-white);
  color: var(--pb-primary);
}

.pb-cta-form {
  margin-top: var(--pb-space-xl);
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.pb-form-group {
  margin-bottom: var(--pb-space-md);
}

.pb-form-input {
  width: 100%;
  padding: var(--pb-space-md);
  border: 2px solid #e5e7eb;
  border-radius: var(--pb-radius-md);
  font-size: 1rem;
}

/* GRID SYSTEM v2 PRO */
.pb-grid-wrapper {
  margin-bottom: var(--pb-space-2xl);
}

.pb-grid-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--pb-space-xl);
  padding: var(--pb-space-md);
  background: var(--pb-bg-alt);
  border-radius: var(--pb-radius-md);
}

.pb-view-switcher {
  display: flex;
  gap: var(--pb-space-sm);
}

.pb-view-btn {
  background: var(--pb-bg);
  border: 1px solid #e5e7eb;
  padding: var(--pb-space-sm) var(--pb-space-md);
  border-radius: var(--pb-radius-sm);
  cursor: pointer;
  transition: var(--pb-transition);
  color: var(--pb-text-light);
}

.pb-view-btn.active {
  background: var(--pb-primary);
  color: var(--pb-text-white);
  border-color: var(--pb-primary);
}

.pb-view-btn:hover:not(.active) {
  background: var(--pb-bg-alt);
  border-color: var(--pb-primary);
}

.pb-grid {
  display: grid;
  gap: var(--pb-space-xl);
}

.pb-grid-view-grid.pb-grid-columns-2 {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.pb-grid-view-grid.pb-grid-columns-3 {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.pb-grid-view-list {
  grid-template-columns: 1fr;
}

.pb-grid-view-list .pb-card {
  flex-direction: row;
}

.pb-grid-view-list .pb-card-image {
  width: 300px;
  height: auto;
}

.pb-featured-post {
  grid-column: 1 / -1;
}

.pb-card-featured {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, rgba(124, 58, 237, 0.05) 100%);
  border: 2px solid var(--pb-primary);
}

.pb-grid-filter select {
  padding: var(--pb-space-sm) var(--pb-space-md);
  border: 1px solid #e5e7eb;
  border-radius: var(--pb-radius-sm);
  background: var(--pb-bg);
  color: var(--pb-text);
}

/* DARK MODE */
body.pb-dark-mode .pb-nav,
body.pb-dark-mode .pb-card,
body.pb-dark-mode .pb-toc,
body.pb-dark-mode .pb-faq-item {
  background: var(--pb-bg-alt);
  border-color: #374151;
}

body.pb-dark-mode .pb-view-btn {
  background: var(--pb-bg);
  border-color: #374151;
}

body.pb-dark-mode .pb-form-input {
  background: var(--pb-bg);
  border-color: #374151;
  color: var(--pb-text);
}

/* STICKY MOBILE AD */
.pb-ad-sticky-mobile {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--pb-bg);
  box-shadow: 0 -4px 6px rgba(0, 0, 0, 0.1);
  padding: var(--pb-space-sm);
  z-index: 999;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.pb-ad-sticky-mobile.visible {
  transform: translateY(0);
}

.pb-ad-close {
  position: absolute;
  top: 0;
  right: 0;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--pb-text-light);
  padding: var(--pb-space-xs) var(--pb-space-sm);
}

.pb-ad-inline {
  margin: var(--pb-space-2xl) 0;
  padding: var(--pb-space-lg);
  background: var(--pb-bg-alt);
  border-radius: var(--pb-radius-md);
  text-align: center;
}

.pb-ad-label {
  font-size: 0.75rem;
  color: var(--pb-text-light);
  text-transform: uppercase;
  margin-bottom: var(--pb-space-sm);
}

/* DARK MODE TOGGLE BUTTON */
#pb-dark-mode-toggle {
  background: none;
  border: 1px solid #e5e7eb;
  padding: var(--pb-space-sm);
  border-radius: var(--pb-radius-md);
  cursor: pointer;
  font-size: 1.25rem;
  transition: var(--pb-transition);
}

#pb-dark-mode-toggle:hover {
  background: var(--pb-bg-alt);
  transform: scale(1.1);
}

/* AI BLOCKS (Placeholder) */
.pb-ai-block {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, rgba(124, 58, 237, 0.05) 100%);
  border-left: 4px solid var(--pb-primary);
  padding: var(--pb-space-lg);
  margin: var(--pb-space-xl) 0;
  border-radius: var(--pb-radius-md);
}

.pb-ai-block-title {
  display: flex;
  align-items: center;
  gap: var(--pb-space-sm);
  margin-bottom: var(--pb-space-md);
  font-weight: 600;
  color: var(--pb-primary);
}

.pb-ai-block-title::before {
  content: '🤖';
  font-size: 1.5rem;
}

/* RESPONSIVE REFINEMENTS */
@media (max-width: 767px) {
  .pb-hero-title {
    font-size: 2rem;
  }

  .pb-cta-title {
    font-size: 1.5rem;
  }

  .pb-grid-view-list .pb-card {
    flex-direction: column;
  }

  .pb-grid-view-list .pb-card-image {
    width: 100%;
    height: 200px;
  }

  .pb-toc-sticky {
    position: relative;
    top: auto;
    max-height: none;
  }
}

/* AFFILIATE BOX Component */
.pb-affiliate-box {
  background: var(--pb-bg-secondary);
  border: 2px solid var(--pb-border);
  border-radius: var(--pb-radius-lg);
  padding: var(--pb-space-xl);
  margin: var(--pb-space-2xl) 0;
  box-shadow: var(--pb-shadow-sm);
}

.pb-affiliate-box.pb-affiliate-position-top {
  margin-top: var(--pb-space-lg);
  margin-bottom: var(--pb-space-2xl);
}

.pb-affiliate-box.pb-affiliate-position-middle {
  margin: var(--pb-space-2xl) 0;
}

.pb-affiliate-box.pb-affiliate-position-bottom {
  margin-top: var(--pb-space-2xl);
  margin-bottom: var(--pb-space-lg);
}

.pb-affiliate-container {
  max-width: 100%;
}

/* Affiliate Header */
.pb-affiliate-header {
  margin-bottom: var(--pb-space-lg);
  text-align: center;
}

.pb-affiliate-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--pb-text);
  margin: 0 0 var(--pb-space-sm);
}

.pb-affiliate-location {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--pb-space-xs);
  color: var(--pb-text-muted);
  font-size: 0.9rem;
  margin: 0;
}

.pb-affiliate-location .pb-icon {
  color: var(--pb-primary);
}

/* Affiliate Offers */
.pb-affiliate-offers {
  display: grid;
  gap: var(--pb-space-lg);
  margin-bottom: var(--pb-space-lg);
}

.pb-affiliate-offer {
  display: flex;
  gap: var(--pb-space-md);
  background: var(--pb-bg);
  border: 1px solid var(--pb-border);
  border-radius: var(--pb-radius-md);
  padding: var(--pb-space-md);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.pb-affiliate-offer:hover {
  box-shadow: var(--pb-shadow-md);
  transform: translateY(-2px);
}

.pb-offer-image {
  flex-shrink: 0;
  width: 120px;
  height: 90px;
  border-radius: var(--pb-radius-sm);
  overflow: hidden;
}

.pb-offer-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pb-offer-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--pb-space-sm);
}

.pb-offer-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--pb-text);
  margin: 0;
  line-height: 1.3;
}

.pb-offer-rating {
  display: flex;
  align-items: center;
  gap: var(--pb-space-xs);
}

.pb-stars {
  display: flex;
  gap: 2px;
}

.pb-star {
  color: var(--pb-text-muted);
}

.pb-star-filled {
  color: #f59e0b;
}

.pb-rating-value {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--pb-text);
}

.pb-offer-price {
  display: flex;
  align-items: baseline;
  gap: var(--pb-space-xs);
  flex-wrap: wrap;
}

.pb-price-label {
  font-size: 0.875rem;
  color: var(--pb-text-muted);
}

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

.pb-price-period {
  font-size: 0.875rem;
  color: var(--pb-text-muted);
}

.pb-offer-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--pb-space-xs);
  padding: var(--pb-space-sm) var(--pb-space-lg);
  background: var(--pb-primary);
  color: white;
  text-decoration: none;
  border-radius: var(--pb-radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.2s ease, transform 0.1s ease;
  align-self: flex-start;
  margin-top: auto;
}

.pb-offer-cta:hover {
  background: var(--pb-primary-dark, #1e40af);
  transform: translateX(2px);
}

.pb-offer-cta .pb-icon-arrow {
  width: 14px;
  height: 14px;
  stroke-width: 2.5;
}

.pb-affiliate-footer {
  text-align: center;
  padding-top: var(--pb-space-md);
  border-top: 1px solid var(--pb-border);
}

.pb-affiliate-disclaimer {
  font-size: 0.8rem;
  color: var(--pb-text-muted);
  margin: 0;
  font-style: italic;
}

/* Affiliate Fallback */
.pb-affiliate-fallback {
  text-align: center;
  padding: var(--pb-space-xl) var(--pb-space-lg);
}

.pb-fallback-content {
  max-width: 500px;
  margin: 0 auto;
}

.pb-fallback-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--pb-text);
  margin: 0 0 var(--pb-space-sm);
}

.pb-fallback-text {
  color: var(--pb-text-muted);
  margin: 0 0 var(--pb-space-lg);
  line-height: 1.6;
}

.pb-fallback-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--pb-space-md);
  align-items: center;
}

.pb-fallback-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--pb-space-sm);
  padding: var(--pb-space-md) var(--pb-space-xl);
  border-radius: var(--pb-radius-md);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  min-width: 200px;
  justify-content: center;
  box-shadow: var(--pb-shadow-sm);
}

.pb-fallback-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--pb-shadow-md);
}

.pb-fallback-booking {
  background: #003580;
  color: white;
}

.pb-fallback-booking:hover {
  background: #00244d;
}

.pb-fallback-airbnb {
  background: #FF5A5F;
  color: white;
}

.pb-fallback-airbnb:hover {
  background: #E04E53;
}

.pb-btn-icon {
  flex-shrink: 0;
}

/* Responsive - Desktop */
@media (min-width: 768px) {
  .pb-affiliate-offers {
    grid-template-columns: 1fr;
  }

  .pb-offer-image {
    width: 150px;
    height: 110px;
  }

  .pb-offer-name {
    font-size: 1.2rem;
  }

  .pb-fallback-buttons {
    flex-direction: row;
    justify-content: center;
  }

  .pb-affiliate-title {
    font-size: 1.75rem;
  }
}

/* Mobile optimization */
@media (max-width: 767px) {
  .pb-affiliate-box {
    padding: var(--pb-space-lg);
    margin-left: calc(var(--pb-space-md) * -1);
    margin-right: calc(var(--pb-space-md) * -1);
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .pb-affiliate-offer {
    flex-direction: column;
  }

  .pb-offer-image {
    width: 100%;
    height: 150px;
  }

  .pb-offer-cta {
    width: 100%;
    justify-content: center;
  }

  .pb-fallback-btn {
    width: 100%;
  }
}

/* -----------------------------------------------------------------------
   Page template
   ----------------------------------------------------------------------- */
.pb-page-header {
  background: linear-gradient(135deg, var(--pb-primary) 0%, var(--pb-secondary) 100%);
  color: white;
  padding: var(--pb-space-3xl) 0;
  margin-bottom: var(--pb-space-2xl);
}

.pb-page-title {
  color: white;
  margin-bottom: var(--pb-space-sm);
}

.pb-page-hero-image {
  margin-bottom: var(--pb-space-2xl);
}

.pb-page-hero-img {
  border-radius: var(--pb-radius-xl);
  max-height: 500px;
  width: 100%;
  object-fit: cover;
}

.pb-entry-content {
  line-height: 1.8;
  font-size: 1.0625rem;
}

.pb-entry-content h2, .pb-entry-content h3 {
  margin-top: var(--pb-space-2xl);
}

/* -----------------------------------------------------------------------
   Search results
   ----------------------------------------------------------------------- */
.pb-search-results-header {
  background: var(--pb-bg-alt);
  padding: var(--pb-space-2xl) 0;
  margin-bottom: var(--pb-space-2xl);
}

.pb-search-title {
  margin-bottom: var(--pb-space-md);
}

.pb-search-query {
  color: var(--pb-primary);
}

.pb-search-count {
  color: var(--pb-text-light);
  margin-bottom: var(--pb-space-lg);
}

.pb-search-refine-form {
  display: flex;
  gap: var(--pb-space-sm);
  max-width: 500px;
}

.pb-search-refine-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--pb-border, #e5e7eb);
  border-radius: var(--pb-radius-lg);
  font-size: 0.9375rem;
  color: var(--pb-text);
  background: var(--pb-bg);
}

.pb-search-refine-input:focus {
  outline: 2px solid var(--pb-primary);
  outline-offset: 2px;
}

.pb-search-results-body {
  padding-top: 0;
}

.pb-no-results {
  text-align: center;
  padding: var(--pb-space-3xl) 0;
}

.pb-no-results-icon {
  font-size: 3rem;
  margin-bottom: var(--pb-space-lg);
}

.pb-no-results h2 {
  margin-bottom: var(--pb-space-md);
}

.pb-category-browser {
  text-align: left;
  max-width: 400px;
  margin: var(--pb-space-2xl) auto 0;
}

.pb-category-browser h3 {
  margin-bottom: var(--pb-space-md);
}

.pb-category-browser ul {
  list-style: none;
  padding: 0;
  columns: 2;
}

.pb-category-browser li {
  margin-bottom: var(--pb-space-sm);
}

.pb-category-browser a {
  color: var(--pb-text);
  transition: color 0.2s;
}

.pb-category-browser a:hover {
  color: var(--pb-primary);
}

/* -----------------------------------------------------------------------
   404 page
   ----------------------------------------------------------------------- */
.pb-404-hero {
  background: linear-gradient(135deg, var(--pb-primary) 0%, var(--pb-secondary) 100%);
  color: white;
  padding: var(--pb-space-3xl) 0;
  margin-bottom: var(--pb-space-3xl);
  text-align: center;
}

.pb-404-code {
  font-size: 6rem;
  font-weight: 800;
  line-height: 1;
  opacity: 0.3;
  margin-bottom: var(--pb-space-md);
}

.pb-404-title {
  font-size: 2rem;
  color: white;
  margin-bottom: var(--pb-space-md);
}

.pb-404-desc {
  color: rgba(255,255,255,0.85);
  font-size: 1.1rem;
  max-width: 480px;
  margin: 0 auto var(--pb-space-xl);
}

.pb-404-actions {
  display: flex;
  gap: var(--pb-space-md);
  justify-content: center;
  flex-wrap: wrap;
}

.pb-404-content {
  padding-bottom: var(--pb-space-3xl);
}

.pb-404-search,
.pb-404-popular,
.pb-404-categories {
  margin-bottom: var(--pb-space-3xl);
}

.pb-404-search h2,
.pb-404-popular h2,
.pb-404-categories h2 {
  margin-bottom: var(--pb-space-lg);
}

.pb-404-cat-list {
  list-style: none;
  padding: 0;
  columns: 2;
  gap: var(--pb-space-md);
}

.pb-404-cat-list li {
  margin-bottom: var(--pb-space-sm);
}

/* -----------------------------------------------------------------------
   Button helpers
   ----------------------------------------------------------------------- */
.pb-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--pb-radius-lg);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.pb-btn-primary {
  background: var(--pb-primary);
  color: white;
}

.pb-btn-primary:hover {
  background: var(--pb-primary-hover);
  color: white;
}

.pb-text-center {
  text-align: center;
}
