/**
 * Enhanced Responsive Utilities
 * Comprehensive responsive design system with accessibility
 */

/* ========================================
   LOADING STATES
======================================== */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ========================================
   PRODUCT GRID RESPONSIVE
======================================== */
.products-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr;
}

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

@media (min-width: 768px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }
}

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

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

/* ========================================
   PRODUCT CARD RESPONSIVE
======================================== */
.product-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(252, 177, 216, 0.15);
  transition: all 0.3s ease;
}

.product-card:hover {
  box-shadow: 0 4px 16px rgba(252, 177, 216, 0.25);
  transform: translateY(-4px);
}

.product-image {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 0;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

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

.product-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 8px;
}

.product-info h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  line-height: 1.4;
  color: #202023;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.product-description {
  font-size: 14px;
  color: #202023;
  opacity: 0.7;
  margin: 0;
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  flex: 1;
  min-height: 42px;
}

.product-card .price {
  font-size: 20px;
  font-weight: 700;
  color: #FCB1D8;
  margin: 0;
}

.product-actions {
  display: flex;
  gap: 8px;
  padding: 0 16px 16px 16px;
  margin-top: auto;
}

.product-actions .btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  background: #FCB1D8;
  color: #202023;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.product-actions .btn:hover {
  background: #F6CCDE;
  transform: translateY(-2px);
}

.product-actions .btn i {
  font-size: 18px;
}

@media (max-width: 639px) {
  .product-info h3 {
    font-size: 14px;
  }
  
  .product-description {
    font-size: 13px;
    -webkit-line-clamp: 2;
  }
  
  .product-card .price {
    font-size: 18px;
  }
}

/* ========================================
   NAVBAR RESPONSIVE
======================================== */
.modern-navbar {
  padding: 0 20px;
}

@media (min-width: 768px) {
  .modern-navbar {
    padding: 0 40px;
  }
}

@media (min-width: 1024px) {
  .modern-navbar {
    padding: 0 60px;
  }
}

.navbar-brand {
  min-width: 200px;
}

@media (max-width: 767px) {
  .navbar-brand {
    min-width: 150px;
  }
  
  .navbar-menu {
    display: none;
  }
}

/* ========================================
   MOBILE MENU
======================================== */
.mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 280px;
  height: 100vh;
  background: white;
  z-index: 9999;
  transition: right 0.3s ease;
  overflow-y: auto;
  box-shadow: -2px 0 10px rgba(0,0,0,0.1);
}

.mobile-menu.active {
  right: 0;
}

.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu.active ~ .mobile-menu-overlay,
.mobile-menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

@media (min-width: 768px) {
  .mobile-menu-toggle {
    display: none;
  }
}

/* ========================================
   BUTTONS RESPONSIVE
======================================== */
.btn {
  padding: 10px 20px;
  font-size: 14px;
  border-radius: 6px;
  transition: all 0.2s;
}

.btn-small {
  padding: 8px 16px;
  font-size: 13px;
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 639px) {
  .btn {
    padding: 8px 16px;
    font-size: 13px;
  }
  
  .btn-small {
    padding: 6px 12px;
    font-size: 12px;
  }
  
  .btn-icon {
    width: 36px;
    height: 36px;
  }
}

/* ========================================
   UTILITY CLASSES
======================================== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

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

@media (min-width: 1024px) {
  .container {
    padding: 0 60px;
  }
}

/* Text utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* Display utilities */
.hidden { display: none !important; }
.block { display: block !important; }
.inline-block { display: inline-block !important; }
.flex { display: flex !important; }
.inline-flex { display: inline-flex !important; }

/* Responsive visibility */
@media (max-width: 639px) {
  .hidden-mobile { display: none !important; }
}

@media (min-width: 640px) and (max-width: 767px) {
  .hidden-tablet { display: none !important; }
}

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

@media (max-width: 639px) {
  .visible-mobile { display: block !important; }
}

@media (min-width: 640px) and (max-width: 767px) {
  .visible-tablet { display: block !important; }
}

@media (min-width: 768px) {
  .visible-desktop { display: block !important; }
}

/* ========================================
   ACCESSIBILITY
======================================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border-width: 0;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 10px;
  background: #667eea;
  color: white;
  padding: 10px 20px;
  border-radius: 4px;
  text-decoration: none;
  z-index: 10001;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 10px;
  outline: 2px solid white;
  outline-offset: 2px;
}

*:focus-visible {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

/* ========================================
   PRINT STYLES
======================================== */
@media print {
  .modern-navbar,
  .mobile-menu,
  .notification-container,
  .btn,
  footer {
    display: none !important;
  }
  
  body {
    font-size: 12pt;
    line-height: 1.5;
  }
  
  .product-card {
    page-break-inside: avoid;
  }
}
