/* ═══════════════════════════════════════════════════
   MUA THẺ CÀO — Stylesheet
   Tailwind CSS v3 via CDN + Custom Design Tokens
   ═══════════════════════════════════════════════════ */

/* ===== Design Tokens ===== */
:root {
  --brand-50:  #FEF2F2;
  --brand-100: #FEE2E2;
  --brand-200: #FECACA;
  --brand-600: #DC2626;
  --brand-700: #B91C1C;
  --brand-800: #991B1B;
}

/* ===== Global Resets ===== */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior-y: none;
  margin: 0;
}

/* ===== Focus Styles ===== */
*:focus-visible {
  outline: 2px solid var(--brand-700);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ===== Custom Scrollbar ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #D1D5DB; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9CA3AF; }

/* ===== Touch target ===== */
.touch-target { min-width: 44px; min-height: 44px; }

/* ===== Animations ===== */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes bounceIn {
  0%   { transform: scale(0.3); opacity: 0; }
  50%  { transform: scale(1.05); }
  70%  { transform: scale(0.9); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes slideFromRight {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}
@keyframes fadeOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(10px); }
}

/* ===== Animation Classes ===== */
.animate-fade-in   { animation: fadeIn  0.35s ease-out; }
.animate-slide-up  { animation: slideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) both; }
.animate-slide-down { animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
.animate-scale-in  { animation: scaleIn  0.2s ease-out; }
.animate-bounce-in { animation: bounceIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); }

/* ===== Page enter ===== */
.page-enter { animation: slideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

/* ===== Menu drawer ===== */
.menu-overlay { animation: fadeIn 0.2s ease-out forwards; }
.menu-drawer  { animation: slideFromRight 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

/* ═══════════════════════════════════════════════════
   PROVIDERS GRID
   ═══════════════════════════════════════════════════ */
.providers-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

@media (min-width: 480px) {
  .providers-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ═══════════════════════════════════════════════════
   PROVIDER BUTTON  (created by script.js)
   ═══════════════════════════════════════════════════ */
.provider-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 12px;
  border: 2px solid #F3F4F6;
  padding: 10px 8px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s, transform 0.15s;
  min-height: 64px;
  width: 100%;
}

.provider-btn img {
  width: 100%;
  height: 36px;
  object-fit: contain;
}

.provider-btn:hover {
  border-color: var(--brand-200);
  background: #F9FAFB;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.provider-btn:active {
  transform: scale(0.97);
}

.provider-btn.active {
  border-color: var(--brand-600);
  background: rgba(254, 242, 242, 0.7);
  box-shadow: 0 1px 4px rgba(185, 28, 28, 0.12);
}

@media (min-width: 768px) {
  .provider-btn { min-height: 76px; padding: 12px; }
  .provider-btn img { height: 42px; }
}

/* ═══════════════════════════════════════════════════
   VALUES GRID
   ═══════════════════════════════════════════════════ */
.values-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

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

/* ═══════════════════════════════════════════════════
   VALUE BUTTON  (created by script.js)
   ═══════════════════════════════════════════════════ */
.value-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 12px;
  border: 2px solid #F3F4F6;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s, transform 0.15s;
  min-height: 80px;
  width: 100%;
  text-align: left;
}

.value-btn:hover {
  border-color: var(--brand-200);
  background: #F9FAFB;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.value-btn:active {
  transform: scale(0.97);
}

.value-btn.active {
  border-color: var(--brand-600);
  background: rgba(254, 242, 242, 0.7);
  box-shadow: 0 1px 4px rgba(185, 28, 28, 0.12);
}

.value-btn .original-price {
  font-weight: 700;
  font-size: 1rem;
  color: #111827;
  margin-bottom: 4px;
  line-height: 1.3;
}

.value-btn .discount-price {
  font-size: 0.82rem;
  font-weight: 600;
  color: #16A34A;
}

@media (min-width: 768px) {
  .value-btn { min-height: 90px; padding: 14px 16px; }
  .value-btn .original-price { font-size: 1.1rem; }
}

/* ═══════════════════════════════════════════════════
   EMPTY / ERROR states in grids
   ═══════════════════════════════════════════════════ */
.no-provider-msg {
  grid-column: 1 / -1;
  text-align: center;
  color: #9CA3AF;
  font-size: 0.875rem;
  padding: 1rem 0;
}
