/* ===== MiniCats Modern Theme v2.0 ===== */
/* Mobile-first, clean, conversion-optimized */

:root {
  /* Colors */
  --bg: #0b0d10;
  --bg-secondary: #0e1117;
  --card: #12161b;
  --card-hover: #181d24;
  --border: #1f2937;
  --border-light: #273140;
  --muted: #94a3b8;
  --txt: #e5e7eb;
  --txt-bright: #ffffff;
  --brand: #ff7a18;
  --brand-hover: #ff8933;
  --brand-light: rgba(255, 122, 24, 0.1);
  --success: #22c55e;
  --success-bg: rgba(34, 197, 94, 0.1);
  --error: #ef4444;
  --error-bg: rgba(239, 68, 68, 0.1);
  --warning: #f59e0b;
  
  /* Spacing */
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --gap: 16px;
  
  /* Transitions */
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
  --shadow-md: 0 8px 20px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.35);
  --shadow-brand: 0 8px 24px rgba(255, 122, 24, 0.25);
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--txt);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 800;
  line-height: 1.2;
  color: var(--txt-bright);
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(28px, 5vw, 48px); }
h2 { font-size: clamp(24px, 4vw, 36px); }
h3 { font-size: clamp(20px, 3.5vw, 28px); }
h4 { font-size: clamp(18px, 3vw, 24px); }

p {
  margin-bottom: 1rem;
}

a {
  color: var(--brand);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--brand-hover);
}

/* ===== Container & Layout ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }
}

/* ===== Top Navigation Bar ===== */
.topbar {
  position: sticky;
  top: 0;
  background: rgba(11, 13, 16, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  transition: var(--transition);
}

.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.logo {
  font-weight: 900;
  font-size: 22px;
  color: var(--txt-bright);
  text-decoration: none;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

.logo:hover {
  color: var(--brand);
  transform: translateY(-1px);
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--txt-bright);
  font-size: 24px;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.menu-toggle:hover {
  background: var(--card);
}

@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }
}

/* Navigation Links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: flex-end;
}

@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 16px;
    gap: 8px;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
  }
  
  .nav-links.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  
  .nav-links a {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    text-align: center;
  }
}

.nav-links a {
  color: var(--txt);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.nav-links a:hover {
  color: var(--txt-bright);
  background: var(--card);
}

/* Cart Button */
.cart-btn {
  background: var(--brand);
  color: #000;
  font-weight: 800;
  padding: 10px 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  box-shadow: var(--shadow-brand);
  transition: var(--transition);
  position: relative;
}

.cart-btn:hover {
  background: var(--brand-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(255, 122, 24, 0.3);
}

.cart-count {
  background: #000;
  color: var(--brand);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 900;
  min-width: 20px;
  text-align: center;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-weight: 800;
  font-size: 15px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  line-height: 1;
}

.btn-primary {
  background: var(--brand);
  color: #000;
  box-shadow: var(--shadow-brand);
}

.btn-primary:hover {
  background: var(--brand-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(255, 122, 24, 0.3);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--card);
  color: var(--txt-bright);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--card-hover);
  border-color: var(--border-light);
}

.btn-outline {
  background: transparent;
  color: var(--txt-bright);
  border: 2px solid var(--border);
}

.btn-outline:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-light);
}

.btn-success {
  background: var(--success);
  color: #000;
}

.btn-success:hover {
  background: #16a34a;
  transform: translateY(-2px);
}

.btn-full {
  width: 100%;
}

.btn-lg {
  padding: 16px 32px;
  font-size: 16px;
  border-radius: var(--radius-lg);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* Quick Buy Button */
.btn-quick-buy {
  background: linear-gradient(135deg, var(--success) 0%, #16a34a 100%);
  color: #fff;
  box-shadow: 0 8px 24px rgba(34, 197, 94, 0.25);
}

.btn-quick-buy:hover {
  box-shadow: 0 12px 28px rgba(34, 197, 94, 0.35);
}

/* ===== Cards ===== */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.card:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow-lg);
}

.card-interactive:hover {
  transform: translateY(-4px);
}

/* Product Card */
.product-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-card img {
  width: 100%;
  height: 220px;
  object-fit: contain;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  transition: var(--transition);
}

.product-card:hover img {
  transform: scale(1.05);
}

.product-card h3 {
  font-size: 18px;
  margin-bottom: 8px;
  color: var(--txt-bright);
}

.product-card .price {
  font-size: 24px;
  font-weight: 900;
  color: var(--brand);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.product-card .old-price {
  font-size: 16px;
  color: var(--muted);
  text-decoration: line-through;
  font-weight: 600;
}

.product-card p {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 16px;
  flex: 1;
}

/* ===== Grid Layouts ===== */
.grid {
  display: grid;
  gap: var(--gap);
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(3, 1fr);
  }
}

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

@media (max-width: 480px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* ===== Forms ===== */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--txt);
  margin-bottom: 6px;
}

.form-label-required::after {
  content: " *";
  color: var(--error);
}

input, select, textarea {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--txt-bright);
  font-size: 15px;
  font-family: inherit;
  transition: var(--transition);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--card);
  box-shadow: 0 0 0 3px var(--brand-light);
}

textarea {
  resize: vertical;
  min-height: 100px;
}

.input-group {
  display: flex;
  gap: 8px;
}

/* ===== Badges & Tags ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--txt);
}

.badge-success {
  background: var(--success-bg);
  border-color: var(--success);
  color: var(--success);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.1);
  border-color: var(--warning);
  color: var(--warning);
}

.badge-brand {
  background: var(--brand);
  border-color: var(--brand);
  color: #000;
}

/* ===== Alerts & Messages ===== */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 600;
}

.alert-success {
  background: var(--success-bg);
  border: 1px solid var(--success);
  color: var(--success);
}

.alert-error {
  background: var(--error-bg);
  border: 1px solid var(--error);
  color: #fca5a5;
}

.alert-info {
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid #38bdf8;
  color: #7dd3fc;
}

/* ===== Loading States ===== */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--card) 0%,
    var(--card-hover) 50%,
    var(--card) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

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

/* ===== Tables ===== */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th, td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  font-weight: 800;
  color: var(--txt-bright);
  background: var(--bg-secondary);
}

tr:hover {
  background: var(--bg-secondary);
}

/* Responsive Tables */
@media (max-width: 768px) {
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ===== Utilities ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-muted { color: var(--muted); }
.text-bright { color: var(--txt-bright); }
.text-brand { color: var(--brand); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }

.font-bold { font-weight: 700; }
.font-black { font-weight: 900; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }
.p-4 { padding: 32px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }

/* ===== Footer ===== */
.footer {
  margin-top: 60px;
  padding: 40px 0 20px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 32px;
}

.footer h4 {
  font-size: 16px;
  margin-bottom: 12px;
  color: var(--txt-bright);
}

.footer ul {
  list-style: none;
}

.footer li {
  margin-bottom: 8px;
}

.footer a {
  color: var(--muted);
  transition: var(--transition);
}

.footer a:hover {
  color: var(--txt-bright);
}

.footer-bottom {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 13px;
}

@media (max-width: 768px) {
  .footer-content {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* ===== Animations ===== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.slide-in {
  animation: slideIn 0.3s ease-out;
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease-out;
}

.modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideIn 0.3s ease-out;
  position: relative;
  z-index: 9999;
}

.modal-header {
  padding: 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 22px;
  font-weight: 900;
  color: var(--txt-bright);
}

.modal-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--bg-secondary);
  color: var(--txt-bright);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* ===== Toast Notifications ===== */
.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 400px;
}

@media (max-width: 480px) {
  .toast-container {
    left: 20px;
    right: 20px;
    max-width: none;
  }
}

.toast {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideIn 0.3s ease-out;
}

.toast-success {
  border-color: var(--success);
  background: var(--success-bg);
}

.toast-error {
  border-color: var(--error);
  background: var(--error-bg);
}

.toast-icon {
  font-size: 20px;
}

.toast-message {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
}

/* ===== Empty States ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.empty-emoji {
  font-size: 64px;
  margin-bottom: 16px;
}

.empty-state h3 {
  color: var(--txt);
  margin-bottom: 8px;
}

.empty-state p {
  margin-bottom: 20px;
}

/* ===== Responsive Helpers ===== */
@media (max-width: 768px) {
  .hide-mobile {
    display: none !important;
  }
}

@media (min-width: 769px) {
  .hide-desktop {
    display: none !important;
  }
}