/* Netsorna Global Styling Sheet - Glassmorphism, Responsive and CSS variables */

:root {
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* Light Mode Color System tokens */
  --bg-primary: #fcfcfd;
  --bg-surface: rgba(255, 255, 255, 0.7);
  --bg-surface-alt: #f4f5f6;
  --text-primary: #121314;
  --text-muted: #5c5e61;
  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-thick: #121314;
  --accent-gold: #c5a880;
  --error: #df4b4b;
  --success: #32a852;
  --skeleton-color: #e2e8f0;
  
  --radius-lg: 16px;
  --radius-sm: 8px;
  --transition-base: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #0a0b0c;
    --bg-surface: rgba(18, 19, 20, 0.75);
    --bg-surface-alt: #161719;
    --text-primary: #f3f4f6;
    --text-muted: #9ca3af;
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-thick: #f3f4f6;
    --skeleton-color: #1f2937;
  }
}

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

body {
  font-family: var(--font-primary);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
}

/* Glassmorphism styling helpers */
.glass {
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}

/* Header Elements */
header {
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 100;
  padding: 1.2rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
}

.logo-container h1 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-icon {
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  position: relative;
  font-size: 1.2rem;
  text-decoration: none;
}

.cart-count-badge {
  position: absolute;
  top: -8px;
  right: -10px;
  background: var(--text-primary);
  color: var(--bg-primary);
  border-radius: 50%;
  padding: 2px 6px;
  font-size: 0.65rem;
  font-weight: bold;
}

/* Main layouts layout */
main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

/* Global Button layout */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-base);
  text-decoration: none;
  border: none;
}

.btn-primary {
  background: var(--text-primary);
  color: var(--bg-primary);
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-secondary {
  background: none;
  border: 1px solid var(--border-thick);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: var(--text-primary);
  color: var(--bg-primary);
}

/* Fluid grids layout */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

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

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

.card {
  padding: 1rem;
  position: relative;
  transition: var(--transition-base);
}

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

.card-img-wrapper {
  aspect-ratio: 1;
  width: 100%;
  background: var(--bg-surface-alt);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 1rem;
}

.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Custom Product Display Grid */
.layout-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-top: 2rem;
}

@media (min-width: 768px) {
  .layout-grid {
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
  }
}

/* Checkout Form Layout Grid */
.checkout-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 900px) {
  .checkout-grid {
    grid-template-columns: 2fr 1fr;
  }
}

/* Split Form Inputs */
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 500px) {
  .form-grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

/* Sidebar Navigation Menu */
.sidebar-nav {
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
  overflow-x: auto;
  white-space: nowrap;
  padding: 1rem;
  -webkit-overflow-scrolling: touch;
}

.sidebar-nav::-webkit-scrollbar {
  height: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 2px;
}

.sidebar-nav button {
  flex: 0 0 auto;
}

@media (min-width: 1024px) {
  .sidebar-nav {
    flex-direction: column;
    overflow-x: visible;
    white-space: normal;
    padding: 1.5rem;
  }
  .sidebar-nav button {
    width: 100%;
  }
}

/* Dynamic Skeleton Pulse */
.skeleton {
  background: var(--skeleton-color);
  animation: pulse 1.5s infinite ease-in-out;
  border-radius: var(--radius-sm);
}

@keyframes pulse {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}

/* Cookie banner notification */
#cookie-banner {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  right: 2rem;
  max-width: 600px;
  z-index: 1000;
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  display: none;
}

/* Header Compact Alignment for Mobile */
@media (max-width: 480px) {
  header {
    padding: 1rem;
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }
  .nav-controls {
    width: 100%;
    justify-content: center;
    gap: 1.2rem;
  }
  main {
    padding: 1rem;
  }
  #cookie-banner {
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    padding: 1.2rem;
  }
}

/* Admin Grid Layouts */
.admin-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media(min-width: 1024px) {
  .admin-grid {
    grid-template-columns: 280px 1fr;
  }
}

/* Modal components styling */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999;
  background: rgba(0,0,0,0.5);
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-content {
  width: 100%;
  max-width: 500px;
  padding: 2rem;
  position: relative;
  box-sizing: border-box;
}

@media (max-width: 480px) {
  .modal-content {
    padding: 1.5rem 1rem;
  }
}