/* Mobile Optimization Styles */

.mobile-sticky-bar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  width: 90%;
  max-width: 360px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 50px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  padding: 6px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  z-index: 9999;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.mobile-sticky-bar.visible {
  transform: translateX(-50%) translateY(0);
}

.sticky-btn {
  flex: 1;
  text-align: center;
  padding: 10px 0;
  border-radius: 40px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none !important;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
  white-space: nowrap;
}

.sticky-btn.primary {
  background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
  color: white !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.sticky-btn.secondary {
  background: #f1f5f9;
  color: #334155 !important;
  border: 1px solid #e2e8f0;
}

.sticky-btn:active {
  transform: scale(0.96);
}

/* Hide on desktop */
@media (min-width: 769px) {
  .mobile-sticky-bar { display: none !important; }
}

/* Global Responsive Table Fix */
@media (max-width: 768px) {
  /* Force tables to block to allow scrolling if wrapper missing */
  table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-collapse: collapse;
  }
  
  /* Fix Bamboo Layout Stacking */
  .spec-grid, .pros-cons, .features-grid, .review-content, .content-grid {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: 1fr !important;
  }
  .pros-cons .pros, .pros-cons .cons, .review-image, .review-details, .content-text, .content-image {
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 15px;
  }
  
  /* Fix Firm Pillows Layout */
  .firmness-scale {
    overflow-x: auto !important;
    width: 100% !important;
    display: block !important;
  }
  
  /* Ensure images don't overflow */
  img {
    max-width: 100%;
    height: auto;
  }
}
