/* ============================================
   Unified Card Grid Item Styles
   Single source of truth for Tea & Teaware cards
   ============================================ */

.card-grid-item {
  background-color: #1a1a1a;
  padding: 0.625rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  border-radius: 1px;
  display: flex;
  flex-direction: column;
  height: 100%;
  cursor: pointer;
  position: relative;
  break-inside: avoid;
  transform: translateY(0) scale(1);
  transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.card-grid-item:active {
  transform: translateY(0) scale(0.98);
}

.card-grid-item:hover {
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
  transform: translateY(-4px) scale(1.02);
}

.card-grid-item:focus-visible {
  outline: 2px solid var(--color-tea-seal);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(201, 148, 58, 0.2);
}

@media (min-width: 768px) {
  .card-grid-item {
    padding: 0.75rem;
  }
}

.card-grid-image-container {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background-color: #1a1a1a;
  position: relative;
  border-radius: 1px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 0.75rem;
}

.card-grid-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.9;
  transition: all 700ms ease-out;
}

.card-grid-item:hover .card-grid-image {
  opacity: 1;
  transform: scale(1.05);
}

.card-grid-content {
  padding: 0 0.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-grid-title {
  font-size: 1rem;
  font-family: inherit;
  color: #E8DDCC;
  line-height: 1.25;
  font-weight: 500;
  transition: color 300ms ease-out;
}

.card-grid-item:hover .card-grid-title {
  color: var(--color-tea-seal);
}

.card-grid-price {
  font-family: 'Menlo', 'Courier New', monospace;
  font-size: 0.6875rem;
  color: var(--color-tea-seal);
  letter-spacing: 0.05em;
  opacity: 0.9;
  background-color: rgba(201, 148, 58, 0.05);
  padding: 0.375rem 0.375rem;
  border-radius: 1px;
  align-self: flex-start;
}

@media (min-width: 768px) {
  .card-grid-price {
    font-size: 0.75rem;
    background-color: transparent;
    padding: 0;
    align-self: auto;
  }
}

.card-grid-badge {
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(232, 221, 204, 0.7);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.375rem 0.375rem;
  border-radius: 1px;
  white-space: nowrap;
  display: inline-block;
}

.card-grid-description {
  font-size: 0.75rem;
  color: rgba(232, 221, 204, 0.8);
  font-family: inherit;
  font-style: italic;
  line-height: 1.5;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin-top: auto;
}

/* ============================================
   Light Mode Support
   ============================================ */

.light .card-grid-item {
  background-color: white;
  border: 1px solid #e5e7eb;
}

.light .card-grid-image-container {
  background-color: #f3f4f6;
  border: 1px solid #d1d5db;
}

.light .card-grid-title {
  color: #111827;
}

.light .card-grid-price {
  color: #2563eb;
}

/* ============================================
   Swipe Carousel Scroll Utilities
   ============================================ */

/* Hide scrollbar but keep functionality */
.hide-scrollbar {
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}

.hide-scrollbar::-webkit-scrollbar {
  display: none;  /* Chrome, Safari, Opera */
}

/* Smooth scroll with momentum on iOS */
.scroll-smooth {
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* Snap scroll */
.snap-x {
  scroll-snap-type: x mandatory;
}

.snap-center {
  scroll-snap-align: center;
}

/* Show scrollbar on desktop hover (optional) */
@media (min-width: 768px) {
  .hide-scrollbar:hover {
    scrollbar-width: thin;
  }

  .hide-scrollbar:hover::-webkit-scrollbar {
    display: block;
    height: 6px;
  }

  .hide-scrollbar:hover::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 3px;
  }

  .hide-scrollbar:hover::-webkit-scrollbar-track {
    background: transparent;
  }
}

/* Never show scrollbar, even on hover (for Reader/Magazine) */
.hide-scrollbar-always {
  -ms-overflow-style: none;
  scrollbar-width: none !important;
}

.hide-scrollbar-always::-webkit-scrollbar {
  display: none !important;
}

/* Hide body scrollbar on mobile where bottom nav bar is visible */
@media (max-width: 1023px) {
  html,
  body {
    -ms-overflow-style: none;
    scrollbar-width: none;
  }
  html::-webkit-scrollbar,
  body::-webkit-scrollbar {
    display: none;
  }
}

/* ============================================
   Shimmer Loading Animation
   ============================================ */

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(200%);
  }
}

.animate-shimmer {
  animation: shimmer 1.5s infinite;
}

/* ============================================
   Visual Features - Reveal Animation
   ============================================ */

@keyframes revealUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-reveal-up {
  opacity: 0;
  animation: revealUp 0.5s ease-out forwards;
}
