/**
 * LSK PRINTS — PWA & RESPONSIVE MOBILE EXPERIENCE STYLESHEET (v2.2)
 * Clean, app-like bottom navigation, touch targets, camera upload buttons, and zero horizontal overflow.
 */

/* 1. Global Viewport & Safe Area Resets */
html, body {
  max-width: 100vw;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

/* Ensure padding on mobile for bottom navigation */
@media (max-width: 767px) {
  body {
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  }
}

/* 2. Touch-Friendly Interactive Targets (Min 44px) */
button, 
.btn, 
.nav-item, 
.card-action-btn, 
.google-review-actions a, 
.whatsapp-action-btn {
  min-height: 44px;
  touch-action: manipulation;
}

/* 3. Modern Mobile App Bottom Navigation Bar */
.lsk-mobile-bottom-nav {
  display: none;
}

@media (max-width: 767px) {
  .lsk-mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: calc(60px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(226, 232, 240, 0.85);
    z-index: 9990;
    box-shadow: 0 -4px 20px rgba(15, 43, 92, 0.08);
    justify-content: space-around;
    align-items: center;
  }

  .lsk-bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #64748b;
    text-decoration: none;
    font-size: 0.72rem;
    font-weight: 700;
    flex: 1;
    height: 100%;
    transition: all 0.2s ease;
    gap: 2px;
  }

  .lsk-bottom-nav-item i {
    font-size: 1.35rem;
    line-height: 1;
    transition: transform 0.2s ease;
  }

  .lsk-bottom-nav-item.active,
  .lsk-bottom-nav-item:active {
    color: #0f2b5c;
  }

  .lsk-bottom-nav-item.active i {
    color: #f59e0b;
    transform: translateY(-1px);
  }

  .lsk-bottom-nav-item.whatsapp-nav-item i {
    color: #25d366;
  }
}

/* 4. Desktop Rule: Strictly hide mobile bottom navigation */
@media (min-width: 768px) {
  .lsk-mobile-bottom-nav {
    display: none !important;
  }
}

/* 5. Mobile Camera & Gallery Upload Controls */
.upload-source-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.btn-upload-choice {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: #0f2b5c;
  transition: all 0.2s ease;
  flex: 1;
  min-width: 140px;
}

.btn-upload-choice:hover,
.btn-upload-choice:active {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
}

.btn-upload-choice.camera-choice {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border-color: #93c5fd;
  color: #1d4ed8;
}

/* 6. Smart Optimization Metrics Banner */
.optimization-metrics-card {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-top: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.opt-stat-item {
  display: flex;
  flex-direction: column;
}

.opt-stat-label {
  font-size: 0.72rem;
  color: #166534;
  font-weight: 700;
  text-transform: uppercase;
}

.opt-stat-val {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f2b5c;
}

.saved-badge {
  background: #15803d;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* 7. Sticky Mobile Detail Actions */
@media (max-width: 767px) {
  .sticky-mobile-actions {
    position: sticky;
    bottom: calc(60px + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(8px);
    padding: 0.75rem 1rem;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
    z-index: 990;
  }
}
