/* =========================================
   WooCommerce Search & Coverage UI - OPTIMIZED
   Matches Original Orange Gradient Theme
   ========================================= */

/* Theme tokens - Original Orange Palette */
:root {
  --wcsc-primary: #ff6b35;
  --wcsc-secondary: #f7931e;
  --wcsc-ink: #333333;
  --wcsc-muted: #666666;
  --wcsc-border: #e0e0e0;
  --wcsc-surface: #ffffff;
  --wcsc-soft: rgba(255, 107, 53, 0.1);
  --wcsc-soft2: rgba(247, 147, 30, 0.1);
  --wcsc-gradient: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
  --wcsc-gradient-hover: linear-gradient(135deg, #f7931e 0%, #ff6b35 100%);
  --wcsc-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  --wcsc-shadow-hover: 0 15px 40px rgba(0, 0, 0, 0.15);
  --wcsc-radius: 15px;
  --wcsc-radius-sm: 10px;
  --wcsc-ring: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

/* Container cards */
.wc-search-container,
.wc-coverage-container,
.wc-regions-container {
  background: #ffffff;
  border-radius: var(--wcsc-radius);
  padding: 30px;
  margin: 20px 0;
  border: 1px solid #f0f0f0;
  box-shadow: var(--wcsc-shadow);
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Animated top bar */
.wc-search-container::before,
.wc-coverage-container::before,
.wc-regions-container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--wcsc-gradient);
  animation: shimmer 2s ease-in-out infinite alternate;
}

@keyframes shimmer {
  0% { opacity: 0.6; }
  100% { opacity: 1; }
}

.wc-search-container:hover,
.wc-coverage-container:hover,
.wc-regions-container:hover {
  transform: translateY(-2px);
  box-shadow: var(--wcsc-shadow-hover);
}

/* Titles */
.wc-search-title,
.wc-coverage-title,
.wc-regions-title {
  color: var(--wcsc-primary);
  font-size: 28px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 25px;
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
}

.wc-search-title::after,
.wc-coverage-title::after,
.wc-regions-title::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--wcsc-gradient);
  border-radius: 2px;
}

/* Forms */
.wc-search-form,
.wc-coverage-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 600px;
  margin: 0 auto;
}

/* Input groups */
.wc-input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.wc-input-group label {
  font-weight: 600;
  color: var(--wcsc-ink);
  font-size: 16px;
  margin-left: 5px;
}

/* Inputs & select */
.wc-search-input,
.wc-coverage-input,
.wc-search-select {
  padding: 15px 20px;
  border: 2px solid var(--wcsc-border);
  border-radius: var(--wcsc-radius-sm);
  font-size: 16px;
  transition: all 0.3s ease;
  background: var(--wcsc-surface);
}

.wc-search-input:focus,
.wc-coverage-input:focus,
.wc-search-select:focus {
  outline: none;
  border-color: var(--wcsc-primary);
  box-shadow: var(--wcsc-ring);
  transform: translateY(-1px);
}

.wc-search-input:hover,
.wc-coverage-input:hover,
.wc-search-select:hover {
  border-color: var(--wcsc-secondary);
}

/* Primary buttons */
.wc-search-btn,
.wc-coverage-btn {
  background: var(--wcsc-gradient);
  color: white;
  border: none;
  padding: 15px 30px;
  border-radius: 25px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 10px;
  position: relative;
  overflow: hidden;
}

.wc-search-btn:hover,
.wc-coverage-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 107, 53, 0.3);
  background: var(--wcsc-gradient-hover);
}

.wc-search-btn:active,
.wc-coverage-btn:active {
  transform: translateY(0);
}

.wc-search-btn:disabled,
.wc-coverage-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Loading spinner */
.wc-loading {
  display: none;
  text-align: center;
  padding: 20px;
  color: var(--wcsc-muted);
  font-size: 16px;
}

.wc-spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--wcsc-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 10px;
  vertical-align: middle;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Results section */
.wc-results {
  margin-top: 30px;
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Result cards */
.wc-result-item {
  background: #fff;
  border: 2px solid #f0f0f0;
  border-radius: 12px;
  padding: 20px;
  margin: 15px 0;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.wc-result-item:hover {
  border-color: var(--wcsc-primary);
  transform: translateX(5px);
  box-shadow: 0 5px 15px rgba(255, 107, 53, 0.1);
}

.wc-product-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--wcsc-ink);
  margin-bottom: 10px;
}

.wc-product-details {
  color: var(--wcsc-muted);
  margin-bottom: 15px;
  font-size: 14px;
}

.wc-product-price {
  font-size: 24px;
  font-weight: 700;
  color: var(--wcsc-primary);
}

/* Product actions */
.wc-product-actions {
  margin-top: 15px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.wc-add-to-cart-btn,
.wc-view-product-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

/* Add to cart button */
.wc-add-to-cart-btn {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
}

.wc-add-to-cart-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
  background: linear-gradient(135deg, #20c997 0%, #28a745 100%);
}

.wc-add-to-cart-btn:disabled {
  background: #6c757d;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* View product button */
.wc-view-product-btn {
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  color: white;
}

.wc-view-product-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 123, 255, 0.3);
  background: linear-gradient(135deg, #0056b3 0%, #007bff 100%);
  color: white;
  text-decoration: none;
}

/* Success messages */
.wc-cart-success {
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  border: 2px solid #28a745;
  color: #155724;
  padding: 15px;
  border-radius: 10px;
  margin: 15px 0;
  text-align: center;
  font-weight: 600;
  animation: fadeIn 0.5s ease-in;
}

/* Error messages */
.wc-cart-error,
.wc-error-message {
  background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
  border: 2px solid #dc3545;
  color: #721c24;
  padding: 15px;
  border-radius: 10px;
  margin: 15px 0;
  text-align: center;
  font-weight: 600;
  animation: fadeIn 0.5s ease-in;
}

/* Warning messages */
.wc-error-message {
  background: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%);
  border: 2px solid #ffc107;
  color: #856404;
}

/* Checkout button */
.wc-checkout-btn {
  background: var(--wcsc-gradient);
  color: white;
  border: none;
  padding: 15px 30px;
  border-radius: 25px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 10px;
  text-decoration: none;
  display: inline-block;
}

.wc-checkout-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 107, 53, 0.3);
  background: var(--wcsc-gradient-hover);
  color: white;
  text-decoration: none;
}

/* Coverage result messages */
.wc-coverage-result {
  padding: 20px;
  border-radius: 12px;
  margin-top: 20px;
  text-align: center;
  font-weight: 600;
  animation: fadeIn 0.5s ease-in;
}

.wc-coverage-success {
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  border: 2px solid #28a745;
  color: #155724;
}

.wc-coverage-error {
  background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
  border: 2px solid #dc3545;
  color: #721c24;
}

/* Buy plans button */
.wc-buy-plans-btn {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
  border: none;
  padding: 12px 25px;
  border-radius: 25px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 15px;
  display: inline-block;
}

.wc-buy-plans-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(40, 167, 69, 0.3);
  background: linear-gradient(135deg, #20c997 0%, #28a745 100%);
}

.wc-buy-plans-btn:active {
  transform: translateY(0);
}

/* No results */
.wc-no-results {
  text-align: center;
  padding: 40px;
  color: var(--wcsc-muted);
  font-style: italic;
  font-size: 18px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 12px;
  border: 2px dashed #dee2e6;
}

/* Country Suggestions */
.wc-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 2px solid var(--wcsc-primary);
  border-top: none;
  border-radius: 0 0 10px 10px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.wc-suggestion-item {
  padding: 12px 20px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  transition: all 0.2s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.wc-suggestion-item:hover,
.wc-suggestion-item.active {
  background: var(--wcsc-gradient);
  color: white;
}

.wc-suggestion-item:last-child {
  border-bottom: none;
}

.wc-suggestion-flag {
  font-size: 18px;
  margin-right: 10px;
}

.wc-suggestion-iso {
  font-size: 12px;
  opacity: 0.7;
  font-weight: 600;
}

/* Regions Menu Styles */
.wc-regions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 25px;
  margin-top: 30px;
}

.wc-continent {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: var(--wcsc-radius);
  border: 2px solid #dee2e6;
  transition: all 0.3s ease;
  overflow: hidden;
}

.wc-continent.expanded {
  border-color: var(--wcsc-primary);
}

.wc-continent-header {
  padding: 20px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  transition: all 0.3s ease;
}

.wc-continent-header:hover {
  background: var(--wcsc-gradient);
  color: white;
}

.wc-continent-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--wcsc-primary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0;
  transition: all 0.3s ease;
}

.wc-continent-header:hover .wc-continent-title {
  color: white;
}

.wc-dropdown-icon {
  font-size: 18px;
  font-weight: bold;
  transition: transform 0.3s ease;
  color: var(--wcsc-primary);
}

.wc-continent-header:hover .wc-dropdown-icon {
  color: white;
}

.wc-continent.expanded .wc-dropdown-icon {
  transform: rotate(180deg);
}

.wc-countries-dropdown {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background: white;
  border-top: 1px solid #dee2e6;
}

.wc-continent.expanded .wc-countries-dropdown {
  max-height: 400px;
  overflow-y: auto;
}

/* Scrollbar styling */
.wc-countries-dropdown::-webkit-scrollbar {
  width: 8px;
}

.wc-countries-dropdown::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.wc-countries-dropdown::-webkit-scrollbar-thumb {
  background: var(--wcsc-primary);
  border-radius: 4px;
}

.wc-countries-dropdown::-webkit-scrollbar-thumb:hover {
  background: var(--wcsc-secondary);
}

.wc-countries-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  padding: 20px;
}

.wc-country-item {
  background: #f8f9fa;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid #e0e0e0;
  font-size: 14px;
  text-align: center;
}

.wc-country-item:hover {
  background: var(--wcsc-gradient);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(255, 107, 53, 0.3);
}

.wc-close-dropdown {
  position: absolute;
  top: 10px;
  right: 15px;
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 50%;
  width: 25px;
  height: 25px;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
}

.wc-close-dropdown:hover {
  background: #c82333;
  transform: scale(1.1);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .wc-search-container,
  .wc-coverage-container,
  .wc-regions-container {
    padding: 20px;
    margin: 10px 0;
  }
  
  .wc-search-title,
  .wc-coverage-title,
  .wc-regions-title {
    font-size: 24px;
  }
  
  .wc-search-input,
  .wc-coverage-input,
  .wc-search-select {
    padding: 12px 15px;
  }
  
  .wc-search-btn,
  .wc-coverage-btn {
    padding: 12px 25px;
    font-size: 16px;
  }
  
  .wc-regions-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .wc-countries-list {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }
  
  .wc-product-actions {
    flex-direction: column;
  }
  
  .wc-add-to-cart-btn,
  .wc-view-product-btn {
    width: 100%;
  }
}

/* Accessibility - Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}