/* ========================================
   GLOBAL CSS FRAMEWORK - Modern E-commerce
   ======================================== */

:root {
  /* MODERN COLOR PALETTE */
  --primary: #00B894;      /* Vibrant green - primary action */
  --primary-light: #1DD1A1;
  --primary-dark: #009B75;
  --secondary: #2563eb;    /* Professional blue */
  --accent: #FF6B6B;       /* Coral for urgent actions */
  --accent-2: #FFB60B;     /* Gold for highlights */
  
  /* NEUTRALS */
  --bg: #f8fafb;           /* Light background */
  --bg-dark: #f1f5f9;
  --card: #ffffff;         /* Card/section background */
  --text: #0f172a;         /* Dark text */
  --text-secondary: #64748b; /* Muted text */
  --text-light: #cbd5e1;
  --border: #e2e8f0;       /* Light borders */
  --border-dark: #cbd5e1;
  
  /* SUCCESS/ERROR/WARNING */
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
  
  /* SPACING SYSTEM */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;
  --space-2xl: 32px;
  --space-3xl: 48px;
  
  /* RADIUS */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;
  
  /* SHADOWS */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.15);
  
  /* TYPOGRAPHY */
  --font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  
  /* FONT SIZES */
  --text-xs: 12px;
  --text-sm: 14px;
  --text-base: 16px;
  --text-lg: 18px;
  --text-xl: 20px;
  --text-2xl: 24px;
  --text-3xl: 30px;
  --text-4xl: 36px;
  --text-5xl: 48px;
  
  /* LINE HEIGHTS */
  --line-height-tight: 1.3;
  --line-height-normal: 1.5;
  --line-height-loose: 1.75;
  
  /* TRANSITIONS */
  --transition-fast: 0.15s ease;
  --transition-base: 0.25s ease;
  --transition-slow: 0.35s ease;
  
  /* CONTAINER */
  --container-max: 1200px;
  --container-md: 960px;
  --container-sm: 720px;
  
  /* Z-INDEX */
  --z-dropdown: 100;
  --z-sticky: 50;
  --z-fixed: 200;
  --z-modal-backdrop: 1000;
  --z-modal: 1010;
}

/* ========================================
   BASE STYLES
   ======================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  font-size: var(--text-base);
  line-height: var(--line-height-normal);
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

/* ========================================
   TYPOGRAPHY
   ======================================== */

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  margin-bottom: var(--space-md);
}

h1 { font-size: var(--text-5xl); margin-bottom: var(--space-xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

p {
  margin-bottom: var(--space-md);
  color: var(--text-secondary);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-dark);
}

small {
  font-size: var(--text-sm);
}

strong, b {
  font-weight: var(--font-weight-bold);
}

/* ========================================
   IMAGES & MEDIA
   ======================================== */

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

img {
  border-radius: var(--radius-md);
}

/* ========================================
   FORMS
   ======================================== */

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

input, textarea, select, button {
  padding: var(--space-md) var(--space-lg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  transition: all var(--transition-fast);
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 184, 148, 0.1);
}

button {
  cursor: pointer;
  font-weight: var(--font-weight-semibold);
  border: none;
  white-space: nowrap;
}

/* ========================================
   BUTTONS
   ======================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--secondary);
  color: white;
  border-color: var(--secondary);
}

.btn-secondary:hover {
  background: #1d4ed8;
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: white;
}

.btn-danger {
  background: var(--error);
  color: white;
  border-color: var(--error);
}

.btn-danger:hover {
  background: #dc2626;
  box-shadow: var(--shadow-md);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: transparent;
}

.btn-ghost:hover {
  background: var(--bg-dark);
}

.btn-sm {
  padding: var(--space-sm) var(--space-md);
  font-size: var(--text-sm);
}

.btn-lg {
  padding: var(--space-lg) var(--space-2xl);
  font-size: var(--text-lg);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ========================================
   CONTAINERS & LAYOUT
   ======================================== */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.section {
  padding: var(--space-3xl) 0;
}

.section-sm {
  padding: var(--space-2xl) 0;
}

.section-lg {
  padding: var(--space-3xl) var(--space-lg);
}

/* ========================================
   GRID SYSTEMS
   ======================================== */

.grid {
  display: grid;
  gap: var(--space-xl);
}

/* Product Grid Responsive */
.grid-products {
  display: grid;
  gap: var(--space-xl);
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

/* Mobile: 2 columns */
@media (max-width: 640px) {
  .grid-products {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
  }
}

/* Tablet: 3 columns */
@media (min-width: 768px) {
  .grid-products {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Desktop: 4 columns */
@media (min-width: 1024px) {
  .grid-products {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ========================================
   CARDS
   ======================================== */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.card-header {
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border);
}

.card-body {
  flex: 1;
}

.card-footer {
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border);
}

/* ========================================
   PRODUCT CARD
   ======================================== */

.product-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-base);
  cursor: pointer;
}

.product-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-6px);
}

.product-image {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--bg-dark);
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-base);
}

.product-card:hover .product-image img {
  transform: scale(1.08);
}

.product-badge {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--accent);
  color: white;
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-bold);
  z-index: 10;
}

.product-badge.new {
  background: var(--primary);
}

.product-badge.sale {
  background: var(--accent);
}

.product-badge.hot {
  background: var(--accent-2);
  color: var(--text);
}

.product-wishlist {
  position: absolute;
  top: var(--space-md);
  left: var(--space-md);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  z-index: 10;
}

.product-wishlist:hover {
  background: var(--primary);
  color: white;
}

.product-content {
  padding: var(--space-lg);
}

.product-name {
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--text);
  margin-bottom: var(--space-sm);
  line-height: var(--line-height-tight);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-rating {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin-bottom: var(--space-sm);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.product-stars {
  color: var(--accent-2);
}

.product-price {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.product-price-current {
  font-size: var(--text-lg);
  font-weight: var(--font-weight-bold);
  color: var(--primary);
}

.product-price-old {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-decoration: line-through;
}

.product-discount {
  font-size: var(--text-xs);
  font-weight: var(--font-weight-bold);
  color: var(--accent);
}

.product-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-md);
}

.product-actions .btn {
  width: 100%;
}

.product-actions .btn-icon {
  width: auto;
  padding: var(--space-md);
}

/* ========================================
   BADGES & LABELS
   ======================================== */

.badge {
  display: inline-block;
  padding: var(--space-xs) var(--space-md);
  background: var(--bg-dark);
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-semibold);
}

.badge-primary { background: var(--primary); color: white; }
.badge-success { background: var(--success); color: white; }
.badge-danger { background: var(--error); color: white; }
.badge-warning { background: var(--warning); color: white; }
.badge-info { background: var(--info); color: white; }

/* ========================================
   TABLES
   ======================================== */

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

thead {
  background: var(--bg-dark);
  border-bottom: 2px solid var(--border);
}

th {
  padding: var(--space-lg);
  text-align: left;
  font-weight: var(--font-weight-bold);
  color: var(--text);
}

td {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border);
}

tbody tr:hover {
  background: var(--bg);
}

/* ========================================
   ALERTS & MESSAGES
   ======================================== */

.alert {
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  border-left: 4px solid;
  margin-bottom: var(--space-lg);
}

.alert-success {
  background: #ecfdf5;
  color: #065f46;
  border-color: var(--success);
}

.alert-error {
  background: #fef2f2;
  color: #7f1d1d;
  border-color: var(--error);
}

.alert-warning {
  background: #fffbeb;
  color: #78350f;
  border-color: var(--warning);
}

.alert-info {
  background: #eff6ff;
  color: #1e3a8a;
  border-color: var(--info);
}

/* ========================================
   UTILITIES
   ======================================== */

.text-primary { color: var(--primary); }
.text-secondary { color: var(--text-secondary); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.text-warning { color: var(--warning); }

.bg-primary { background: var(--primary); }
.bg-secondary { background: var(--secondary); }

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.font-bold { font-weight: var(--font-weight-bold); }
.font-semibold { font-weight: var(--font-weight-semibold); }
.font-medium { font-weight: var(--font-weight-medium); }

.underline { text-decoration: underline; }
.no-underline { text-decoration: none; }

.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }

.hidden { display: none !important; }
.visible { display: block !important; }

/* ========================================
   RESPONSIVE BREAKPOINTS
   ======================================== */

@media (max-width: 640px) {
  .hide-mobile { display: none !important; }
  .section { padding: var(--space-2xl) 0; }
  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }
  h3 { font-size: var(--text-xl); }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .hide-tablet { display: none !important; }
}

@media (min-width: 1025px) {
  .hide-desktop { display: none !important; }
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.animate-fade { animation: fadeIn var(--transition-base); }
.animate-slide-up { animation: slideInUp var(--transition-base); }
.animate-slide-down { animation: slideInDown var(--transition-base); }
.animate-pulse { animation: pulse 2s infinite; }
.animate-spin { animation: spin 1s linear infinite; }

/* ========================================
   LOADER
   ======================================== */

.loader {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* ========================================
   SCROLLBAR
   ======================================== */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border-dark);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}
