/**
 * NetCoreStore Modern Theme Enhancements
 * Bootstrap 5 utilities, Skeleton Loading, Lazy Loading, Modern UI
 */

/* =========================================
   Modern CSS Variables Override
   ========================================= */

:root {
  /* Primary Colors */
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #dbeafe;
  --secondary-color: #1e40af;
  --accent-color: #f59e0b;
  --accent-hover: #d97706;

  /* Neutral Colors */
  --text-primary: #1f2937;
  --text-secondary: #4b5563;
  --text-muted: #9ca3af;
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-tertiary: #f3f4f6;
  --border-color: #e5e7eb;
  --border-light: #f3f4f6;

  /* Status Colors */
  --success-color: #10b981;
  --success-light: #d1fae5;
  --warning-color: #f59e0b;
  --warning-light: #fef3c7;
  --error-color: #ef4444;
  --error-light: #fee2e2;

  /* Shadows */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;
  --transition-slower: 500ms ease;

  /* Spacing Scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* =========================================
   Modern Typography
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

body {
  font-family: var(--font-sans);
  color: var(--text-secondary);
  background-color: var(--bg-secondary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

/* =========================================
   Skeleton Loading Animation
   ========================================= */

.skeleton {
  position: relative;
  overflow: hidden;
  background-color: var(--bg-tertiary);
  border-radius: var(--radius-md);
}

.skeleton::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg,
      transparent,
      rgba(255, 255, 255, 0.6),
      transparent);
  animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
  100% {
    transform: translateX(100%);
  }
}

.skeleton-text {
  height: 1rem;
  margin-bottom: 0.5rem;
}

.skeleton-text.short {
  width: 60%;
}

.skeleton-image {
  width: 100%;
  padding-bottom: 100%;
}

.skeleton-button {
  height: 2.5rem;
  width: 120px;
}

.skeleton-price {
  height: 1.5rem;
  width: 80px;
}

/* Product Grid Skeleton */
.product-skeleton {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
}

.product-skeleton .skeleton-image {
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
}

/* =========================================
   Lazy Loading Images
   ========================================= */

img[loading="lazy"] {
  opacity: 0;
  transition: opacity var(--transition-slow);
}

img[loading="lazy"].loaded,
img.lazyloaded {
  opacity: 1;
}

.lazy-image-wrapper {
  position: relative;
  background-color: var(--bg-tertiary);
  overflow: hidden;
}

.lazy-image-wrapper::before {
  content: '';
  display: block;
  padding-bottom: 100%;
  /* 1:1 aspect ratio */
}

.lazy-image-wrapper img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* =========================================
   Modern Buttons
   ========================================= */

.btn-modern {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-weight: 500;
  font-size: 0.875rem;
  line-height: 1.5;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
}

.btn-primary {
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), 0 6px 20px -3px rgba(37, 99, 235, 0.5);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-tertiary);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Override existing button styles */
.button-1,
.add-to-cart-button,
input[type="submit"].button-1 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: var(--space-3) var(--space-8);
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white !important;
  font-weight: 600;
  font-size: 0.9375rem;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-md), 0 4px 14px -3px rgba(37, 99, 235, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.button-1:hover,
.add-to-cart-button:hover,
input[type="submit"].button-1:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), 0 6px 20px -3px rgba(37, 99, 235, 0.5);
}

.button-2 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: var(--space-2) var(--space-6);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-weight: 500;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
}

.button-2:hover {
  background: var(--bg-tertiary);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* =========================================
   Modern Product Cards
   ========================================= */

.product-item {
  position: relative;
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all var(--transition-slow);
  box-shadow: var(--shadow-sm);
}

.product-item:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
}

.product-item .picture {
  position: relative;
  overflow: hidden;
  background: var(--bg-tertiary);
}

.product-item .picture::after {
  content: '';
  display: block;
  padding-bottom: 100%;
}

.product-item .picture a {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.product-item .picture img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slower);
}

.product-item:hover .picture img {
  transform: scale(1.08);
}

.product-item .details {
  padding: var(--space-5);
}

.product-item .product-title {
  margin: 0 0 var(--space-3);
}

.product-item .product-title a {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  transition: color var(--transition-fast);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.product-item .product-title a:hover {
  color: var(--primary-color);
}

.product-item .prices {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.product-item .prices .price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-color);
}

.product-item .prices .old-price {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-decoration: line-through;
}

/* Product Badges */
.product-item .product-badge {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  z-index: 5;
  padding: var(--space-1) var(--space-3);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: var(--radius-full);
}

.product-item .product-badge.new {
  background: var(--success-color);
  color: white;
}

.product-item .product-badge.sale {
  background: var(--error-color);
  color: white;
}

/* Quick Action Buttons */
.product-item .buttons-wrapper {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-4);
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.03));
  transform: translateY(100%);
  opacity: 0;
  transition: all var(--transition-base);
}

.product-item:hover .buttons-wrapper {
  transform: translateY(0);
  opacity: 1;
}

.product-item .buttons-wrapper button {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-md);
}

.product-item .buttons-wrapper button:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

/* =========================================
   Modern Product Grid
   ========================================= */

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

@media (min-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-6);
  }
}

@media (min-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* =========================================
   Modern Header Enhancements
   ========================================= */

.header {
  background: var(--bg-primary);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-logo img {
  max-height: 60px;
  width: auto;
}

/* Glassmorphism effect for sticky header */
.header.is-sticky {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Modern Search Box */
.search-box form {
  display: flex;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
  transition: all var(--transition-base);
  border: 2px solid transparent;
}

.search-box form:focus-within {
  background: var(--bg-primary);
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px var(--primary-light);
}

.search-box input[type="text"] {
  flex: 1;
  border: none;
  background: transparent;
  padding: var(--space-3) var(--space-4);
  font-size: 0.9375rem;
}

.search-box input[type="text"]:focus {
  outline: none;
}

.search-box .search-box-button {
  width: 48px;
  border: none;
  background: var(--primary-color);
  color: white;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.search-box .search-box-button:hover {
  background: var(--primary-hover);
}

/* =========================================
   Modern Mini Cart
   ========================================= */

.mini-shopping-cart {
  position: fixed;
  top: 0;
  right: -400px;
  width: 100%;
  max-width: 400px;
  height: 100vh;
  background: var(--bg-primary);
  box-shadow: var(--shadow-xl);
  z-index: 1000;
  transition: right var(--transition-slow);
  display: flex;
  flex-direction: column;
}

.mini-shopping-cart.active {
  right: 0;
}

.mini-shopping-cart .header {
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mini-shopping-cart .items {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4);
}

.mini-shopping-cart .totals {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

/* =========================================
   Modern Footer
   ========================================= */

.footer {
  background: var(--text-primary);
  color: rgba(255, 255, 255, 0.8);
  padding: var(--space-12) 0 var(--space-6);
}

.footer h3 {
  color: white;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--space-4);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer a {
  color: rgba(255, 255, 255, 0.7);
  transition: color var(--transition-fast);
}

.footer a:hover {
  color: white;
}

.footer-newsletter {
  background: rgba(255, 255, 255, 0.05);
  padding: var(--space-6);
  border-radius: var(--radius-lg);
}

.footer-newsletter input[type="email"] {
  /* Removed by user request to prevent conflicts */
}

.footer-newsletter input[type="email"]::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.footer-bottom {
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.5);
}

/* =========================================
   Modern Forms
   ========================================= */

.form-fields {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
}

.inputs input[type="text"],
.inputs input[type="email"],
.inputs input[type="tel"],
.inputs input[type="password"],
.inputs select,
.inputs textarea {
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  transition: all var(--transition-base);
  background: var(--bg-primary);
}

.inputs input:focus,
.inputs select:focus,
.inputs textarea:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px var(--primary-light);
  outline: none;
}

/* =========================================
   Modern Navigation
   ========================================= */

.header-menu>ul>li>a {
  padding: var(--space-3) var(--space-4);
  font-weight: 500;
  color: var(--text-primary);
  transition: color var(--transition-fast);
}

.header-menu>ul>li>a:hover {
  color: var(--primary-color);
}

/* Dropdown Menu */
.header-menu .sublist {
  min-width: 220px;
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: var(--space-2);
  border: 1px solid var(--border-color);
}

.header-menu .sublist li a {
  display: block;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.header-menu .sublist li a:hover {
  background: var(--bg-tertiary);
  color: var(--primary-color);
}

/* =========================================
   Loading States
   ========================================= */

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* =========================================
   Rating Stars Modern
   ========================================= */

.rating {
  display: flex;
  gap: 2px;
}

.rating .star {
  width: 18px;
  height: 18px;
  color: var(--border-color);
}

.rating .star.filled {
  color: var(--accent-color);
}

/* =========================================
   Responsive Utilities
   ========================================= */

@media (max-width: 767px) {
  .product-item .details {
    padding: var(--space-4);
  }

  .product-item .product-title a {
    font-size: 0.875rem;
  }

  .product-item .prices .price {
    font-size: 1.1rem;
  }

  .button-1 {
    padding: var(--space-3) var(--space-5);
    font-size: 0.875rem;
  }
}

/* =========================================
   Animations
   ========================================= */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn var(--transition-slow) ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slide-up {
  animation: slideUp var(--transition-slower) ease-out;
}

/* Staggered animation for product grid */
.product-grid .product-item:nth-child(1) {
  animation-delay: 0.05s;
}

.product-grid .product-item:nth-child(2) {
  animation-delay: 0.1s;
}

.product-grid .product-item:nth-child(3) {
  animation-delay: 0.15s;
}

.product-grid .product-item:nth-child(4) {
  animation-delay: 0.2s;
}

.product-grid .product-item:nth-child(5) {
  animation-delay: 0.25s;
}

.product-grid .product-item:nth-child(6) {
  animation-delay: 0.3s;
}

.product-grid .product-item:nth-child(7) {
  animation-delay: 0.35s;
}

.product-grid .product-item:nth-child(8) {
  animation-delay: 0.4s;
}

/* =========================================
   Page Title Modern
   ========================================= */

.page-title {
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
  border: none;
  border-radius: var(--radius-lg);
  padding: var(--space-8) var(--space-6);
  margin-bottom: var(--space-8);
}

.page-title h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

/* =========================================
   Category/Manufacturer Boxes
   ========================================= */

.sub-category-item,
.manufacturer-item {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all var(--transition-slow);
  box-shadow: var(--shadow-sm);
}

.sub-category-item:hover,
.manufacturer-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* =========================================
   Breadcrumb Modern
   ========================================= */

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: var(--space-4) 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.breadcrumb a {
  color: var(--primary-color);
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb .delimiter {
  color: var(--border-color);
}

/* =========================================
   Menu Alignment Fix
   ========================================= */

.box-nav-menu .menu-item {
  position: relative;
}

.box-nav-menu .sub-menu {
  left: 0;
  right: auto;
  min-width: 220px;
  transform: none;
  margin-top: 0;
}

.footer-default .footer-top {
  margin-top: 98px;
}