/* ========================================
   PWA STYLES
   ======================================== */

/* Install Banner */
.pwa-install-banner {
  position: fixed;
  bottom: -100px;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #e91e63 0%, #ff6b9d 100%);
  color: white;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateY(0);
}

.pwa-install-banner.pwa-install-visible {
  transform: translateY(-100px);
}

.pwa-install-content {
  display: flex;
  align-items: center;
  padding: 15px 20px;
  gap: 15px;
  max-width: 1200px;
  margin: 0 auto;
}

.pwa-install-icon {
  font-size: 40px;
  flex-shrink: 0;
}

.pwa-install-text {
  flex: 1;
}

.pwa-install-text strong {
  display: block;
  font-size: 16px;
  margin-bottom: 4px;
}

.pwa-install-text p {
  margin: 0;
  font-size: 14px;
  opacity: 0.9;
}

.pwa-install-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.pwa-btn-install {
  background: white;
  color: #e91e63;
  border: none;
  padding: 10px 24px;
  border-radius: 25px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.pwa-btn-install:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.pwa-btn-install:active {
  transform: translateY(0);
}

.pwa-btn-dismiss {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pwa-btn-dismiss:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Update Banner */
.pwa-update-banner {
  position: fixed;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: #4caf50;
  color: white;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  z-index: 9999;
  transition: top 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 320px;
}

.pwa-update-banner.pwa-update-visible {
  top: 20px;
}

.pwa-update-content {
  display: flex;
  align-items: center;
  padding: 15px 20px;
  gap: 15px;
}

.pwa-update-text {
  flex: 1;
}

.pwa-update-text strong {
  display: block;
  font-size: 16px;
  margin-bottom: 4px;
}

.pwa-update-text p {
  margin: 0;
  font-size: 14px;
  opacity: 0.9;
}

.pwa-btn-update {
  background: white;
  color: #4caf50;
  border: none;
  padding: 8px 20px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.pwa-btn-update:hover {
  transform: scale(1.05);
}

/* Network Status Notification */
.pwa-network-status {
  position: fixed;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  border-radius: 25px;
  font-weight: 600;
  font-size: 14px;
  z-index: 9999;
  transition: top 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.pwa-network-status.pwa-network-visible {
  top: 20px;
}

.pwa-network-online {
  background: #4caf50;
  color: white;
}

.pwa-network-offline {
  background: #ff9800;
  color: white;
}

/* Loading States */
.loading-shimmer {
  background: linear-gradient(
    90deg,
    #f0f0f0 25%,
    #e0e0e0 50%,
    #f0f0f0 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Skeleton Loaders */
.skeleton-product-card {
  background: white;
  border-radius: 12px;
  padding: 15px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.skeleton-image {
  width: 100%;
  height: 200px;
  border-radius: 8px;
  margin-bottom: 15px;
}

.skeleton-title {
  width: 80%;
  height: 20px;
  border-radius: 4px;
  margin-bottom: 10px;
}

.skeleton-text {
  width: 60%;
  height: 16px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.skeleton-price {
  width: 40%;
  height: 24px;
  border-radius: 4px;
  margin-bottom: 15px;
}

.skeleton-button {
  width: 100%;
  height: 40px;
  border-radius: 8px;
}

/* Responsive Design for PWA */
@media screen and (max-width: 768px) {
  .pwa-install-content {
    padding: 12px 15px;
    gap: 12px;
  }

  .pwa-install-icon {
    font-size: 32px;
  }

  .pwa-install-text strong {
    font-size: 15px;
  }

  .pwa-install-text p {
    font-size: 13px;
  }

  .pwa-btn-install {
    padding: 8px 18px;
    font-size: 13px;
  }

  .pwa-update-banner {
    min-width: calc(100% - 40px);
    max-width: calc(100% - 40px);
  }

  .pwa-network-status {
    font-size: 13px;
    padding: 10px 20px;
  }
}

/* iOS Specific Fixes */
@supports (-webkit-touch-callout: none) {
  .pwa-install-banner,
  .pwa-update-banner,
  .pwa-network-status {
    /* Account for iOS safe areas */
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* Offline Indicator for Images */
img.offline-placeholder {
  background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
  position: relative;
}

img.offline-placeholder::after {
  content: '📷 Offline';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #999;
  font-size: 14px;
}

/* Enhanced Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.fade-in {
  animation: fadeIn 0.5s ease-out;
}

.slide-in-up {
  animation: slideInUp 0.5s ease-out;
}

.pulse {
  animation: pulse 2s ease-in-out infinite;
}

/* Smooth Transitions */
* {
  transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform;
  transition-duration: 0.3s;
  transition-timing-function: ease-in-out;
}

/* But disable transitions during page load to avoid flickering */
.no-transitions * {
  transition: none !important;
}
