/* Sticky Buy Button Styles */
#sticky-buy-button-container {
  background: linear-gradient(to top, rgba(255,255,255,1) 0%, rgba(255,255,255,0.95) 70%, rgba(255,255,255,0) 100%);
  /*padding: 20px 15px 15px;*/
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.sticky-button-content {
  max-width: 400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  background: white;
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.sticky-product-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.sticky-product-image {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.sticky-product-name {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

#sticky-buy-button-container .buy-button {
  display: block;
  padding: 12px 20px;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  background: #ff6b35;
  color: white;
  border: none;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
  transition: all 0.3s ease;
  flex-shrink: 0;
  min-width: 120px;
}

#sticky-buy-button-container .buy-button:hover {
  background: #ff5722;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

/* Mobile specific styles */
@media (max-width: 768px) {
  #sticky-buy-button-container {
    /*padding: 15px 10px 10px;*/
  }
  
  .sticky-button-content {
    gap: 8px;
    padding: 6px;
  }
  
  .sticky-product-image {
    width: 35px;
    height: 35px;
  }
  
  .sticky-product-name {
    font-size: 13px;
  }
  
  #sticky-buy-button-container .buy-button {
    font-size: 14px;
    padding: 10px 16px;
    min-width: 100px;
  }
}

/* Ensure sticky button appears above other elements */
#sticky-buy-button-container {
  z-index: 9999;
}

/* Animation for smooth appearance */
#sticky-buy-button-container .buy-button {
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Ensure proper styling for cloned buttons */
.sticky-buy-button {
  cursor: pointer;
  user-select: none;
}

/* Handle text that might be too long */
#sticky-buy-button-container .buy-button span {
  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Product Controls Container */
.product-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 30px;
  margin: 0 0 20px 0;
  padding: 15px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  flex-wrap: wrap;
}

/* Skip Button Styles */
.skip-button {
  background: linear-gradient(135deg, #ff6b35 0%, #ff4757 100%);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}

.skip-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
}

.skip-arrow {
  font-size: 16px;
  animation: bounce-down 2s ease-in-out infinite;
}

@keyframes bounce-down {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(3px);
  }
  60% {
    transform: translateY(1px);
  }
}

/* Toggle Button Styles */
.toggle-container {
  display: flex;
  gap: 15px;
  align-items: center;
  flex-wrap: wrap;
}

.toggle-label {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin-right: 5px;
}

.toggle-button {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
  white-space: nowrap;
}

.toggle-button.active {
  background: linear-gradient(135deg, #ff6b35 0%, #ff4757 100%);
  box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
}

.toggle-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.toggle-button.active:hover {
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
}

.toggle-text {
  font-size: 14px;
  font-weight: 600;
}

/* Sticky Toggle Bar */
.sticky-toggle-bar {
  position: fixed;
  top: -80px;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  z-index: 10000;
  padding: 8px 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: top 0.3s ease;
}

.sticky-toggle-bar.visible {
  top: 0;
}

.sticky-toggle-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
}

.sticky-toggle-label {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin-right: 5px;
}

.sticky-toggle-button {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
  white-space: nowrap;
}

.sticky-toggle-button.active {
  background: linear-gradient(135deg, #ff6b35 0%, #ff4757 100%);
  box-shadow: 0 2px 6px rgba(255, 107, 53, 0.3);
}

.sticky-toggle-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(102, 126, 234, 0.4);
}

.sticky-toggle-button.active:hover {
  box-shadow: 0 3px 8px rgba(255, 107, 53, 0.4);
}

/* Product hiding */
.product-hidden {
  display: none !important;
}

/* Mobile styles */
@media (max-width: 768px) {
  .product-controls {
    gap: 15px;
    padding: 10px;
    flex-direction: column;
  }
  
  .skip-button {
    font-size: 12px;
    padding: 8px 16px;
    width: 100%;
    justify-content: center;
  }
  
  .toggle-container {
    justify-content: center;
    gap: 8px;
    flex-wrap: nowrap;
  }
  
  .toggle-button {
    font-size: 11px;
    padding: 5px 8px;
    flex-shrink: 0;
  }
  
  .toggle-text {
    font-size: 11px;
  }
  
  .toggle-label {
    font-size: 12px;
    flex-shrink: 0;
    margin-right: 2px;
  }
  
  .sticky-toggle-button {
    font-size: 11px;
    padding: 5px 10px;
  }
  
  .sticky-toggle-label {
    font-size: 12px;
  }
  
  .sticky-toggle-container {
    gap: 8px;
    padding: 0 15px;
  }
}

/* Condensed Product Grid */
@media (min-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(10, 1fr);
    gap: 0.75rem;
  }
  
  .product-card {
    font-size: 0.85rem;
  }
  
  .product-card .product-image {
    height: 120px;
    padding: 0.5rem;
  }
  
  .product-card h3 {
    font-size: 0.9rem;
    margin: 0.5rem 0 0.25rem 0;
  }
  
  .product-card .rating {
    font-size: 0.8rem;
    margin: 0.25rem 0;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .product-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
  }
  
  .product-card .product-image {
    height: 150px;
  }
}

/* Improved Button Styles */
.buy-button {
  background: linear-gradient(to bottom, #ff8a50, #ff6b35) !important;
  border: 1px solid #e55a2b !important;
  border-radius: 6px !important;
  color: white !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  display: block !important;
  text-align: center !important;
  padding: 12px 20px !important;
  font-size: 14px !important;
  line-height: 1.4 !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  width: 100% !important;
  box-sizing: border-box !important;
  text-shadow: 0 1px 2px rgba(0,0,0,0.1) !important;
  box-shadow: 0 2px 4px rgba(255,107,53,0.3) !important;
  margin: 0.25rem 0 !important;
}

.buy-button:hover {
  background: linear-gradient(to bottom, #ff7a40, #ff5a25) !important;
  border-color: #d44a21 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 8px rgba(255,107,53,0.4) !important;
  color: white !important;
  text-decoration: none !important;
}

/* Amazon Button Styling */
.amazon-button {
  background: linear-gradient(to bottom, #f7dfa5, #f0c14b) !important;
  border: 1px solid #a88734 !important;
  border-radius: 3px !important;
  color: #111 !important;
  font-weight: 400 !important;
  text-decoration: none !important;
  display: block !important;
  text-align: center !important;
  padding: 8px 16px !important;
  font-size: 13px !important;
  line-height: 19px !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
  width: 100% !important;
  box-sizing: border-box !important;
  margin: 0.25rem 0 !important;
}

.amazon-button:hover {
  background: linear-gradient(to bottom, #f5d78e, #edb933) !important;
  border-color: #9c7e31 !important;
  box-shadow: 0 1px 3px rgba(255,255,255,0.6) inset !important;
  color: #111 !important;
  text-decoration: none !important;
}

/* Condensed button spacing for grid */
@media (min-width: 1024px) {
  .product-card .buy-button,
  .product-card .amazon-button,
  .product-card .goto-review-button {
    padding: 8px 12px !important;
    font-size: 12px !important;
    margin: 0.2rem 0 !important;
  }
}