/* Responsive shop stylesheet with stronger CTA and improved microinteractions
   - Keeps previous responsive fixes (min-width:0, box-sizing, word-break)
   - CTA improvements:
     * pill-shaped gradient CTA with stronger drop shadow
     * hover scale + shadow, active scale for press feedback
     * keyboard-focus visible outline for accessibility
     * subtle animated shimmer using ::before (respects prefers-reduced-motion)
     * right-arrow cue via ::after
     * full-width CTA on small screens
*/

/* Make sizing predictable and prevent overflow from children */
.shop, .shop * {
  box-sizing: border-box;
}

/* Shop grid (mobile-first) */
.shop-container {
  display: grid;
  grid-template-columns: 1fr; /* single column by default */
  gap: 16px;
  padding: 16px;
  max-width: 1200px;
  width: calc(100% - 40px);
  margin: 0 auto;
  overflow: visible;
}
@media (min-width: 640px) {
  .shop-container { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
}
@media (min-width: 900px) {
  .shop-container { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
}

/* Product card */
.shop {
  background: var(--color-surface);
  border: 1px solid #eef1f5;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  padding: 16px;
  transition: box-shadow .15s ease, transform .12s ease;
  min-width: 0; /* allow flex/grid child to shrink below content width */
  overflow-wrap: break-word;
  word-break: break-word;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.shop:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

/* Heading */
.shop-heading {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: auto;
  text-align: center;
  color: #0f172a;
  font-weight: 700;
  padding-bottom: 6px;
}
.shop-heading h3 {
  margin: 4px 0;
  font-size: clamp(1rem, 1.4vw + 0.6rem, 1.25rem);
  line-height: 1.2;
  word-break: break-word;
}

/* Feature / Price */
.shop-feature {
  position: relative;
  padding: 10px 0 0;
  text-align: center;
}
.shop-price {
  margin-top: 6px;
  font-size: clamp(1.05rem, 1.6vw + 0.5rem, 1.25rem);
  color: var(--color-text);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Description */
.shop-description {
  padding: 12px 0 0;
  text-align: left;
  color: var(--color-muted);
  min-width: 0;
}
.shop-description h4 {
  color: #111827;
  margin: 0 0 6px;
  font-size: 0.95rem;
}
.shop-description p {
  margin: 0;
  font-size: clamp(0.9rem, 1.2vw + 0.2rem, 1rem);
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.shop-description ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.shop-description li {
  margin-bottom: 8px;
}

/* Footer / CTA area */
.shop-footer {
  text-align: center;
  padding-top: 12px;
  margin-top: auto; /* pushes footer to bottom in variable-height cards */
  display: flex;
  justify-content: center;
  align-items: center;
}

/* CTA button improvements
   - gradient background using primary color variables if available (falls back gracefully)
   - pill shape, stronger box-shadow, arrow cue, shimmer animation, keyboard focus visible
*/
.btn-shop {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: linear-gradient(135deg, var(--color-primary) 0%, color-mix(in srgb, var(--color-primary) 80%, white 20%) 100%);
  color: #fff;
  text-decoration: none;
  border-radius: 999px; /* pill */
  transition: transform .12s cubic-bezier(.2,.9,.2,1), box-shadow .12s ease, background-color .2s ease;
  border: none;
  box-shadow: 0 8px 26px rgba(37,99,235,0.18);
  font-weight: 700;
  font-size: 1rem;
  justify-content: center;
  white-space: nowrap;
  overflow: visible;
  cursor: pointer;
  outline: none;
  /* create stacking context for shimmer and arrow */
  z-index: 0;
}

/* If CSS color-mix isn't supported, fallback to single color (using var directly) */
@supports not (background: color-mix(in srgb, var(--color-primary) 80%, white 20%)) {
  .btn-shop {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-600, rgba(37,99,235,0.85)) 100%);
  }
}

/* Hover: lift and brighten */
.btn-shop:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 14px 40px rgba(37,99,235,0.2);
  filter: saturate(1.05);
}

/* Active/press feedback */
.btn-shop:active {
  transform: translateY(0) scale(0.995);
  box-shadow: 0 6px 18px rgba(37,99,235,0.14);
}

/* Keyboard focus visible for accessibility */
.btn-shop:focus-visible {
  box-shadow: 0 0 0 4px rgba(59,130,246,0.15), 0 10px 28px rgba(37,99,235,0.16);
  border-radius: 999px;
}

/* Arrow cue using ::after */
.btn-shop::after {
  content: '→';
  display: inline-block;
  margin-left: 6px;
  transform: translateX(0);
  transition: transform .14s ease;
  font-weight: 700;
  opacity: 0.95;
  font-size: 1.05em;
}

/* Slight arrow motion on hover */
.btn-shop:hover::after {
  transform: translateX(6px);
}

/* Subtle shimmer using ::before (respects reduced motion) */
.btn-shop::before {
  content: '';
  position: absolute;
  left: -40%;
  top: 0;
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0) 100%);
  transform: skewX(-20deg);
  pointer-events: none;
  transition: opacity .2s ease;
  opacity: 0;
  z-index: 1;
  mix-blend-mode: screen; /* ensure shimmer is visible on various backgrounds */
}

/* animate shimmer on hover/focus, disabled for users who prefer reduced motion */
@media (prefers-reduced-motion: no-preference) {
  .btn-shop:hover::before,
  .btn-shop:focus-visible::before {
    animation: shimmer 1.2s linear;
    opacity: 1;
  }
  @keyframes shimmer {
    0% { left: -40%; opacity: 0; }
    10% { opacity: 1; }
    100% { left: 140%; opacity: 0; }
  }
}

/* Accessibility: if disabled (aria-disabled) show subdued appearance and disable interactions */
.btn-shop[aria-disabled="true"],
.btn-shop[disabled] {
  opacity: 0.6;
  pointer-events: none;
  transform: none;
  box-shadow: none;
}

/* Checkout form refinement (kept and slightly padded) */
.shop-container .checkout-form {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  background: var(--color-surface);
  border: 1px solid #eef1f5;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px;
}
.shop-container .checkout-form label { font-weight: 600; color: #111827; }
.shop-container .checkout-form input[type="text"],
.shop-container .checkout-form input[type="email"] { border: 1px solid #e5e7eb; border-radius: 8px; }
.shop-container .checkout-form input:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.15); }
.shop-container .checkout-form .btn-shop { width: 100%; justify-content: center; margin-top: 4px; }

/* Media queries: tighter spacing on small screens and full-width CTA */
@media (max-width: 640px) {
  .shop-container { gap: 12px; padding: 12px; width: calc(100% - 24px); }
  .shop {
    padding: 12px;
  }
  .shop-heading h3 {
    font-size: 1.05rem;
  }
  .shop-price {
    font-size: 1.1rem;
  }
  .btn-shop {
    width: 100%;
    padding: 12px;
    font-size: 0.98rem;
  }
  .shop-description p {
    font-size: 0.95rem;
  }
}

@media (max-width: 420px) {
  .shop-container { gap: 10px; padding: 10px; width: calc(100% - 20px); }
  .shop {
    padding: 10px;
  }
  .shop-heading {
    padding-bottom: 4px;
  }
  .shop-heading h3 {
    font-size: 1rem;
  }
  .shop-price {
    font-size: 1rem;
  }
  .btn-shop {
    padding: 10px;
    font-size: 0.95rem;
  }
}