/* Global styles that complement Tailwind (loaded after Tailwind CDN) */
:root {
  --brand-bg: #f5f0e6;
  --brand-orange: #EE6B48;
}

/* Font rendering and base tweaks */
html {
  color-scheme: light;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Improve focus visibility for keyboard users */
:focus-visible {
  outline: 2px solid rgba(251, 191, 36, 0.75); /* amber-400-ish */
  outline-offset: 2px;
}

/* Better link affordance by default */
a {
  text-underline-offset: 3px;
}

/* Selection color that fits on darkened imagery */
::selection {
  background: rgba(251, 191, 36, 0.35); /* amber-ish highlight */
}

/* Utility: clamp paragraphs to a comfortable line length when not using Tailwind's prose */
.content-readable p {
  max-width: 70ch;
}

.btn-amz{display:inline-block;border-radius:9999px;text-decoration:none;font-weight:600;transition:all .2s ease}
.btn-amz--sm{font-size:.9rem;padding:.45rem .9rem}
.btn-amz--md{font-size:1rem;padding:.65rem 1.05rem}

/* subtle pill (default) */
.btn-amz--ghost{background:rgba(255,153,0,.08);color:#9a5a00;border:1px solid rgba(255,153,0,.35)}
.btn-amz--ghost:hover{background:rgba(255,153,0,.14);border-color:rgba(255,153,0,.5)}

/* keep a solid option if you need emphasis later */
.btn-amz--solid{background:#FF9900;color:#fff;border:1px solid #e68a00}
.btn-amz--solid:hover{background:#e68a00}



.content-article{--c-text:#1F2937;--c-accent:#FF9900;--c-accent-d:#e68a00;--c-head:#92400E}
.content-article *{box-sizing:border-box}
.content-article h2{font-size:1.375rem;font-weight:600;margin:0.75rem 0 0.5rem;color:var(--c-head);line-height:1.25}
.content-article h3{font-size:1.125rem;font-weight:600;margin:0.5rem 0 0.375rem;color:var(--c-head);line-height:1.3}
.content-article p{margin:0.5rem 0;color:var(--c-text);line-height:1.65;font-weight:400}
.content-article ul,.content-article ol{margin:0.5rem 0 0.75rem 1.1rem;color:var(--c-text);line-height:1.6}
.content-article li{margin:0.2rem 0}
/* Links upgraded */
.content-article a{color:#B45309;text-decoration:underline;text-underline-offset:2px}
.content-article a:hover{text-decoration-thickness:2px}
/* "Amazon" button */
.content-article .btn-amazon{display:inline-block;padding:.65rem 1rem;background:var(--c-accent);color:#fff;border-radius:.5rem;
text-decoration:none;font-weight:600;box-shadow:0 1px 0 rgba(0,0,0,.06)}
.content-article .btn-amazon:hover{background:var(--c-accent-d)}
.content-article .btn-row{display:flex;gap:.5rem;flex-wrap:wrap;margin:.375rem 0 .75rem}
/* Make product images/cards clickable & tighter */
.content-article img{border-radius:.5rem;margin:.75rem auto;display:block;max-width:100%;height:auto;max-height:520px;object-fit:cover}
/* Optional: wrap the image/title in an <a class="card-link">… */
.content-article .card-link{display:block;text-decoration:none}
.content-article .card-link:hover img{filter:brightness(1.03)}
.content-article strong{color:#374151}
.content-article hr{border-color:#D1D5DB;margin:1rem 0}
.content-article blockquote{border-left:4px solid #FACC15;margin:.75rem 0;padding-left:.75rem;color:#6B7280;font-style:italic}
/* Hero section tighter (if your article template wraps the hero in .article-hero) */
.article-hero{margin-bottom:.75rem}
/* Small screens: keep headings readable without huge blocks */
@media (max-width:640px){
.content-article h2{font-size:1.25rem}
.content-article h3{font-size:1.0625rem}
.content-article img{max-height:420px}
}

/* Intro CTA — compact, subtle */
.cta-intro--compact{
  display:grid; grid-template-columns:auto 1fr auto; gap:.5rem 1rem;
  align-items:center; margin:.5rem 0 .75rem; padding:.5rem .75rem;
  background: var(--brand-bg);
  border: 1px solid rgba(0,0,0,.05);
  border-radius: .5rem;
}
.cta-intro__icon{font-size:1.05rem; line-height:1}
.cta-intro__text{font-weight:400; font-size:.95rem; color:#374151}
@media (max-width:640px){
  .cta-intro--compact{grid-template-columns:1.25rem 1fr; gap:.5rem}
  .cta-intro--compact .btn-amz{grid-column:1 / -1; justify-self:start; margin-top:.25rem}
}

/* MOBILE REFINEMENTS */
@media (max-width:640px){
  .cta-intro--compact{
    grid-template-columns:1fr;         /* stack everything */
    gap:.4rem;
    padding:.55rem .65rem;              /* tighter padding */
    border-radius:.65rem;
    background:var(--brand-bg);         /* unify background */
    border:1px solid rgba(0,0,0,.04);   /* lighter border */
  }
  .cta-intro__icon{display:none}        /* lose emoji to save space */
  .cta-intro__text{
    font-size:.95rem; line-height:1.45; /* readable, not shouty */
    font-weight:400; margin:0
  }
  .cta-intro--compact .btn-amz{
    grid-column:1/-1; width:100%;       /* big, tappable button */
    justify-self:stretch; text-align:center;
    padding:.7rem 1rem;                  /* slightly taller target */
  }
}

/* Muted search link (replaces button styling) */
.search-link{
  color:#6B7280;              /* gray-500 */
  text-decoration:underline;
  text-underline-offset:2px;
  font-weight:400;
}
.search-link:hover{
  color:#4B5563;              /* gray-600 */
  text-decoration-thickness:2px;
}

/* ===== PRODUCT CARDS ===== */
.products-section {
  margin-top: 1.5rem;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  position: relative;
}

/* Fade indicator on the left edge (when scrolled away from start) */
.products-section::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 0;
  bottom: 12px;
  width: 4px;
  background: linear-gradient(to right, rgba(77, 163, 255, 0.6) 0%, rgba(251, 191, 36, 0) 100%);
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Show left fade when scrolled away from start */
.products-section.scrolled-start::before {
  opacity: 1;
}

/* Fade indicator on the right edge to show more content */
.products-section::after {
  content: '';
  position: absolute;
  top: 4px;
  right: 0;
  bottom: 12px;
  width: 4px;
  background: linear-gradient(to left, rgba(77, 163, 255, 0.6) 0%, rgba(251, 191, 36, 0) 100%);
  pointer-events: none;
  z-index: 2;
  transition: opacity 0.3s ease;
}

/* Hide right fade when scrolled to the end */
.products-section.scrolled-end::after {
  opacity: 0;
}

.products-scroll-container {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 0 12px 0;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(77, 163, 255, 0.3) transparent;
  transition: opacity 0.3s ease;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.products-scroll-container::-webkit-scrollbar {
  height: 8px;
}

.products-scroll-container::-webkit-scrollbar-track {
  background: rgba(77, 163, 255, 0.05);
  border-radius: 4px;
}

.products-scroll-container::-webkit-scrollbar-thumb {
  background: rgba(77, 163, 255, 0.3);
  border-radius: 4px;
}

.products-scroll-container::-webkit-scrollbar-thumb:hover {
  background: rgba(77, 163, 255, 0.5);
}

/* Product Card */
.product-card {
  min-width: 180px;
  max-width: 200px;
  flex-shrink: 0;
  background: rgba(255, 255, 255);
  backdrop-filter: blur(4px);
  border-radius: 10px;
  border: 1px solid rgba(77, 163, 255, 0.3);
  overflow: hidden;
  transition: all 0.2s ease;
  box-sizing: border-box;
  box-shadow: 0 1px 3px rgba(77, 163, 255, 0.1);
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(77, 163, 255, 0.2);
  border-color: rgba(77, 163, 255, 0.5);
}

.product-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
  padding: 20px;
  box-sizing: border-box;
}

.product-image {
  width: 100% !important;
  height: 140px !important;
  max-width: 100% !important;
  object-fit: contain;
  background: white;
  padding: 0;
  display: block;
  box-sizing: border-box;
  margin: 0 auto;
}

.product-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-sizing: border-box;
  min-width: 0;
  margin-top: 12px;
}

.product-brand {
  font-size: 11px;
  color: #777;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  word-wrap: break-word;
}

.product-name {
  font-size: 13px;
  line-height: 1.3;
  color: #374151;
  font-weight: 400;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 34px;
  word-wrap: break-word;
}

.product-price {
  font-size: 17px;
  font-weight: 600;
  color: #4DA3FF;
  margin-top: auto;
  word-wrap: break-word;
}

.product-cta {
  padding: 10px 20px;
  background: #4DA3FF;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  border-radius: 9999px;
  margin-top: 8px;
  box-shadow: 0 2px 6px rgba(77, 163, 255, 0.4);
}

.product-cta:hover {
  background: #398CE0;
  transform: scale(1.05);
}

.product-cta span {
  font-size: 12px;
  font-weight: 600;
  color: #FFFFFF;
  text-transform: none;
  letter-spacing: 0;
}

@media (max-width: 640px) {
  .product-cta {
    padding: 8px 16px;
  }
}

.product-retailer-logo {
  height: 20px;
  width: auto;
}

/* Skeleton Loaders */
.product-skeleton {
  min-width: 180px;
  max-width: 200px;
  flex-shrink: 0;
  background: white;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.skeleton-image,
.skeleton-brand,
.skeleton-name,
.skeleton-price,
.skeleton-button {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: 6px;
}

.skeleton-image {
  width: 100%;
  height: 140px;
}

.skeleton-brand {
  width: 60%;
  height: 10px;
}

.skeleton-name {
  width: 100%;
  height: 12px;
}

.skeleton-name.short {
  width: 75%;
}

.skeleton-price {
  width: 50%;
  height: 16px;
}

.skeleton-button {
  width: 100%;
  height: 24px;
}

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

/* Mobile optimizations */
@media (max-width: 640px) {
  .product-card,
  .product-skeleton {
    min-width: 160px;
    max-width: 180px;
  }

  .product-image,
  .skeleton-image {
    height: 120px !important;
  }

  .product-link {
    padding: 16px;
  }

  .product-name {
    font-size: 12px;
  }

  .product-price {
    font-size: 15px;
  }
}