/* Card Pricing Module - External Styles */
/* Minimal external CSS - most styles are inlined for performance */

/* Print styles */
@media print {
  .p-card {
    break-inside: avoid;
    page-break-inside: avoid;
    border: 1px solid #ddd !important;
  }

  .card-flag {
    position: static !important;
    display: inline-block;
    margin-bottom: 0.5rem;
  }

  .p-btn {
    border: 1px solid currentColor !important;
    text-decoration: underline !important;
  }

  /* Show URLs in print */
  .p-btn::after {
    content: " (" attr(href) ")";
    font-size: 0.75em;
    opacity: 0.7;
  }

  /* Ensure features are visible */
  .p-feature.is-out {
    opacity: 1 !important;
  }

  .p-feature.is-out .p-feature__label::before {
    content: "[Not included] ";
  }
}

/* Container query support for truly responsive cards */
@supports (container-type: inline-size) {
  .p-card {
    container-type: inline-size;
  }

  @container (min-width: 400px) {
    .p-card__name {
      font-size: 1.5rem;
    }

    .p-card__price-value {
      font-size: 2.5rem;
    }
  }

  @container (min-width: 300px) {
    .p-card__ctas--inline {
      flex-direction: row;
    }
  }
}

/* Utility classes for grid layouts when using multiple pricing cards */
.pricing-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  align-items: stretch;
}

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

  .pricing-grid--3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .pricing-grid--4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Highlight popular card in a grid */
.pricing-grid .p-card--popular {
  transform: scale(1.05);
  z-index: 1;
}

@media (max-width: 767px) {
  .pricing-grid .p-card--popular {
    transform: none;
    order: -1; /* Move popular to top on mobile */
  }
}

/* Loading skeleton for async pricing data */
.p-card--skeleton {
  pointer-events: none;
}

.p-card--skeleton .p-card__name,
.p-card--skeleton .p-card__price,
.p-card--skeleton .p-card__desc,
.p-card--skeleton .p-feature__label,
.p-card--skeleton .p-btn {
  background: linear-gradient(90deg,
    rgba(0, 0, 0, 0.05) 25%,
    rgba(0, 0, 0, 0.1) 50%,
    rgba(0, 0, 0, 0.05) 75%
  );
  background-size: 200% 100%;
  animation: skeleton 1.5s ease-in-out infinite;
  border-radius: 4px;
  color: transparent !important;
}

.p-card--skeleton .p-card__name {
  width: 60%;
  height: 1.5em;
}

.p-card--skeleton .p-card__price {
  width: 40%;
  height: 2em;
}

.p-card--skeleton .p-feature__label {
  width: 80%;
  height: 1em;
}

@keyframes skeleton {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Dark mode support moved to conditional CSS in module.html for PageSpeed optimization */

/* Comparison mode for pricing tables */
.pricing-comparison {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.pricing-comparison table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
}

.pricing-comparison th,
.pricing-comparison td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.pricing-comparison .p-card {
  min-height: auto;
  margin: 0;
}

/* Mobile-specific comparison view */
@media (max-width: 640px) {
  .pricing-comparison {
    position: relative;
    padding-bottom: 2rem;
  }

  .pricing-comparison::after {
    content: "← Scroll for more →";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    opacity: 0.6;
  }
}