@layer components;

:root {
  --tariff-cream: #ffffff;
  --tariff-gold: #fbbf24;
  --tariff-gold-dark: #f59e0b;
  --tariff-red: #dc2626;
  --tariff-shadow: 0 8px 25px rgba(15, 23, 42, 0.08);
  --tariff-hover-shadow: 0 20px 40px rgba(251, 191, 36, 0.2);
}

/* Compact Tariff Section */
.section-light {
  background: #f9fafb;
  padding: clamp(2.5rem, 7vw, 3.5rem) clamp(1rem, 4vw, 2rem);
}

.tariff-section h2 {
  text-align: center;
  font-size: clamp(1.75rem, 6vw, 2.25rem);
  margin-bottom: clamp(0.5rem, 1.5vw, 0.75rem);
}

.tariff-section .section-intro {
  text-align: center;
  font-size: clamp(0.875rem, 2.5vw, 1rem);
  margin-bottom: clamp(1.75rem, 5vw, 2.5rem);
}

.note {
  background: hsla(0,0%,95%,0.9);
  border-left: 3px solid var(--tariff-gold);
  padding: clamp(0.875rem, 2.5vw, 1.125rem) clamp(1rem, 3vw, 1.5rem);
  margin-top: clamp(1.75rem, 5vw, 2.5rem);
  font-size: clamp(0.8rem, 2.3vw, 0.875rem);
  border-radius: 0 0.5rem 0.5rem 0;
}

/* Compact Grid - 4 Cards Desktop */
.tariff-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1.25rem, 4vw, 1.75rem);
  margin: clamp(1.5rem, 4vw, 2rem) auto;
  max-width: min(95vw, 1100px);
}

@media (min-width: 480px) {
  .tariff-grid {
    grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  }
}

@media (min-width: 768px) {
  .tariff-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(1.5rem, 3vw, 2rem);
  }
}

@media (min-width: 1024px) {
  .tariff-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
  }
}

/* Smaller Tariff Cards */
.tariff-card {
  background: var(--tariff-cream);
  border-radius: clamp(1rem, 3vw, 1.25rem);
  overflow: hidden;
  box-shadow: var(--tariff-shadow);
  border: 1px solid hsla(38,100%,60%,0.1);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
}

.tariff-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: hsla(38,100%,60%,0.02);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.tariff-card:hover::before {
  opacity: 1;
}

/* Compact Image */
.tariff-img-wrapper {
  height: clamp(8rem, 22vw, 10rem);
  overflow: hidden;
  position: relative;
}

.tariff-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s ease;
}

.tariff-card:hover .tariff-img {
  transform: scale(1.08);
}

/* Compact Content */
.tariff-content {
  padding: clamp(1.125rem, 3vw, 1.5rem);
}

.tariff-content h3 {
  font-size: clamp(1rem, 3vw, 1.25rem);
  font-weight: 800;
  margin-bottom: clamp(0.375rem, 1vw, 0.5rem);
  color: #1e293b;
}

.tariff-price {
  font-size: clamp(1.5rem, 5vw, 2rem);
  font-weight: 900;
  background: linear-gradient(135deg, var(--tariff-red), #ef4444);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: clamp(0.125rem, 0.75vw, 0.25rem) auto clamp(0.25rem, 0.75vw, 0.375rem);
  line-height: 1.1;
  animation: priceGlow 1.5s ease-in-out infinite alternate;
}

@keyframes priceGlow {
  0% { text-shadow: 0 1px 4px rgba(220, 38, 38, 0.3); }
  100% { text-shadow: 0 2px 8px rgba(251, 191, 36, 0.4); }
}

.tariff-label {
  color: #64748b;
  font-size: clamp(0.75rem, 2.2vw, 0.8rem);
  font-weight: 600;
  margin-bottom: clamp(1rem, 3vw, 1.25rem);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Compact Button */
.tariff-btn {
  background: linear-gradient(135deg, var(--tariff-gold), var(--tariff-gold-dark));
  color: #111827;
  padding: clamp(0.75rem, 2vw, 0.875rem) clamp(1.5rem, 4vw, 1.75rem);
  border-radius: 2rem;
  font-weight: 700;
  font-size: clamp(0.85rem, 2.5vw, 0.95rem);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 6px 20px rgba(251, 191, 36, 0.35);
  text-decoration: none;
}

.tariff-btn:hover,
.tariff-btn:focus-visible {
  transform: translateY(-0.2rem);
  box-shadow: 0 12px 30px rgba(251, 191, 36, 0.5);
}

/* Reduced Hover Lift */
.tariff-card:hover {
  transform: translateY(-0.75rem) scale(1.02);
  box-shadow: var(--tariff-hover-shadow);
}

/* Responsive Fine-Tuning */
@media (min-width: 1024px) {
  .tariff-grid {
    grid-template-columns: repeat(4, minmax(16rem, 1fr));
    gap: 1.25rem;
  }
  
  .tariff-img-wrapper {
    height: 10rem;
  }
  
  .tariff-content {
    padding: 1.25rem;
  }
}

/* Accessibility */
.tariff-card:focus-within {
  outline: 2px solid var(--tariff-gold);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .tariff-card,
  .tariff-img,
  .tariff-btn {
    transition: none;
    animation: none;
  }
}

@media (prefers-contrast: high) {
  .tariff-card {
    border: 2px solid;
  }
}
