/* Global Styles */

/* PrimeNG and PrimeIcons */
@import 'primeicons/primeicons.css';

/* Google Fonts loaded via <link> in index.html for non-blocking rendering */

/* Default CSS Variables - will be overridden by theme files */
:root {
  --primary-color: #497671;
  --primary-hover: #3d635f;
  --secondary-color: #a1b4b5;
  --secondary-hover: #8da3a4;
  --accent-color: #a7ceca;
  --accent-hover: #91b9b5;
  
  --gradient-primary: linear-gradient(360deg, #497671 0%, #a7ceca 100%);
  --gradient-secondary: linear-gradient(135deg, #a1b4b5 0%, #677b78 100%);
  --gradient-hero: linear-gradient(360deg, #497671 0%, #a7ceca 100%);
  
  --text-primary: #1e3c38;
  --text-secondary: #667a77;
  --text-light: #828e8d;
  
  --bg-primary: #ffffff;
  --bg-secondary: #f5f5f5;
  --bg-tertiary: #f0f0f0;
  
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --error-color: #ef4444;
  --info-color: #3b82f6;
  
  --border-color: #d3dad9;
  --border-dark: #677b78;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 12px 32px rgba(73, 118, 113, 0.2);

  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 13px;
  --radius-xl: 22px;

  --transition-fast: 120ms ease;
  --transition-normal: 180ms ease;
  --transition-slow: 300ms ease;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

*::before,
*::after {
  box-sizing: inherit;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background: #f5f5f5;
  min-height: 100vh;
  overflow-x: hidden;

  &.platform-menu-open {
    overflow: hidden;
  }
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.25;
}

p {
  line-height: 1.5;
}

img,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
}

/* Smooth Transitions */
a, button, input, textarea, select {
  transition: all var(--transition-slow);
}

/* Responsive Typography */
@media (max-width: 768px) {
  html {
    font-size: 14px;
  }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: var(--gradient-primary);
  border-radius: 10px;
  transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gradient-secondary);
}

/* Focus Styles */
*:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Respect OS-level reduced-motion preference globally: neutralizes hover
   transforms, card-entrance/skeleton-shimmer animations, and smooth-scroll
   everywhere in one place rather than requiring every component to opt in
   individually (a few already did this locally, e.g. shared/ui/skeleton). */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Utility Classes */
.page-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--space-lg) var(--space-md);
  width: 100%;
}

/* Backward-compatible alias while foundation migration is in progress. */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--space-lg) var(--space-md);
  width: 100%;
}

.section {
  margin: 0;
  padding-block: clamp(16px, 2.5vw, 32px);
  animation: section-fade-in 320ms ease-out both;
}

.grid {
  display: grid;
  gap: var(--space-md);
}

.card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.product-card,
.item-card,
.catalog-product-card {
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.product-card:hover,
.item-card:hover,
.catalog-product-card:hover {
  transform: translateY(-2px) scale(1.01);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 0.625rem 1rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), background-color var(--transition-normal), color var(--transition-normal), border-color var(--transition-normal);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
}

.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn-secondary {
  background: var(--secondary-color);
  color: #fff;
  border-color: var(--secondary-color);
}

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

.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-color);
}

.btn-ghost:hover {
  background: rgba(73, 118, 113, 0.08);
  border-color: var(--primary-color);
}

@keyframes section-fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

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

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

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

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

.text-center {
  text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

// ─── Shared Badge & Tag Styles (from backOffice integration) ───

.item-badges-overlay {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  z-index: 2;
}

.item-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #fff;
  line-height: 1.4;

  &.badge-new       { background: #4caf50; }
  &.badge-sale       { background: #f44336; }
  &.badge-exclusive  { background: #9c27b0; }
  &.badge-hot        { background: #ff5722; }
  &.badge-limited    { background: #ff9800; }
  &.badge-bestseller { background: #2196f3; }
  &.badge-featured   { background: #607d8b; }
  &.badge-custom     { background: #78909c; }
}

.item-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.72rem;
  color: var(--primary-color);
  background: rgba(73, 118, 113, 0.08);
  border: 1px solid rgba(73, 118, 113, 0.15);
}

.item-simple-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin: 2px 0 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}



