/**
 * Stili WooCommerce integrati con AI Business Pro
 * File: frontend/css/woocommerce-integration.css
 * 
 * Applica il design system del plugin a tutte le pagine WooCommerce
 * Compatibile con GeneratePress e altri temi moderni
 * 
 * @package AI_Business_Pro
 */

/* ===== IMPORTA VARIABILI CSS DAL DESIGN SYSTEM ===== */
:root {
  /* Colori brand (riutilizza sistema esistente) */
  --aibp-woo-primary: var(--aibp-primary, #1D4ED8);
  --aibp-woo-primary-light: var(--aibp-primary-light, #3B82F6);
  --aibp-woo-primary-dark: var(--aibp-primary-dark, #1E40AF);
  --aibp-woo-primary-50: var(--aibp-primary-50, #EFF6FF);
  
  /* Colori funzionali */
  --aibp-woo-success: var(--aibp-success, #10B981);
  --aibp-woo-warning: var(--aibp-warning, #F59E0B);
  --aibp-woo-error: var(--aibp-error, #EF4444);
  --aibp-woo-info: var(--aibp-info, #06B6D4);
  
  /* Grigi (mantiene sistema esistente) */
  --aibp-woo-gray-50: var(--aibp-gray-50, #F9FAFB);
  --aibp-woo-gray-100: var(--aibp-gray-100, #F3F4F6);
  --aibp-woo-gray-200: var(--aibp-gray-200, #E5E7EB);
  --aibp-woo-gray-300: var(--aibp-gray-300, #D1D5DB);
  --aibp-woo-gray-500: var(--aibp-gray-500, #6B7280);
  --aibp-woo-gray-700: var(--aibp-gray-700, #374151);
  --aibp-woo-gray-800: var(--aibp-gray-800, #1F2937);
  --aibp-woo-gray-900: var(--aibp-gray-900, #111827);
  
  /* Spacing e radius */
  --aibp-woo-radius-sm: var(--aibp-radius-sm, 6px);
  --aibp-woo-radius-md: var(--aibp-radius-md, 8px);
  --aibp-woo-radius-lg: var(--aibp-radius-lg, 12px);
  --aibp-woo-space-sm: var(--aibp-space-sm, 8px);
  --aibp-woo-space-md: var(--aibp-space-md, 16px);
  --aibp-woo-space-lg: var(--aibp-space-lg, 24px);
  
  /* Shadows */
  --aibp-woo-shadow-sm: var(--aibp-shadow-sm, 0 1px 2px 0 rgba(0, 0, 0, 0.05));
  --aibp-woo-shadow-md: var(--aibp-shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.1));
  --aibp-woo-shadow-lg: var(--aibp-shadow-lg, 0 10px 15px -3px rgba(0, 0, 0, 0.1));
  
  /* Transizioni */
  --aibp-woo-transition: var(--aibp-transition, all 0.2s ease-in-out);
}

/* ===== APPLICAZIONE SOLO ALLE PAGINE WOOCOMMERCE ===== */
.aibp-woocommerce-styled {
  /* Assicura che gli stili si applichino solo quando la classe è presente */
}

/* ===== RESET E BASE WOOCOMMERCE ===== */
.woocommerce,
.woocommerce-page {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ===== PULSANTI GLOBALI ===== */
.woocommerce .button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit,
.woocommerce a.button,
.woocommerce button.button.alt,
.woocommerce input.button.alt,
.woocommerce a.button.alt {
  background: var(--aibp-woo-primary) !important;
  color: #ffffff !important;
  border: 2px solid var(--aibp-woo-primary) !important;
  border-radius: var(--aibp-woo-radius-md) !important;
  padding: 12px 24px !important;
  font-weight: 600 !important;
  font-size: 16px !important;
  text-transform: none !important;
  transition: var(--aibp-woo-transition) !important;
  box-shadow: var(--aibp-woo-shadow-sm) !important;
  text-decoration: none !important;
  display: inline-block !important;
  cursor: pointer !important;
}

.woocommerce .button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce #respond input#submit:hover,
.woocommerce a.button:hover,
.woocommerce button.button.alt:hover,
.woocommerce input.button.alt:hover,
.woocommerce a.button.alt:hover {
  background: var(--aibp-woo-primary-dark) !important;
  border-color: var(--aibp-woo-primary-dark) !important;
  transform: translateY(-2px) !important;
  box-shadow: var(--aibp-woo-shadow-md) !important;
}

/* Pulsanti secondari */
.woocommerce .button.secondary,
.woocommerce a.button.secondary {
  background: var(--aibp-woo-gray-100) !important;
  color: var(--aibp-woo-gray-700) !important;
  border-color: var(--aibp-woo-gray-300) !important;
}

.woocommerce .button.secondary:hover,
.woocommerce a.button.secondary:hover {
  background: var(--aibp-woo-gray-200) !important;
  color: var(--aibp-woo-gray-800) !important;
}

/* ===== PAGINA SHOP E ARCHIVI ===== */
.woocommerce ul.products {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
  gap: var(--aibp-woo-space-lg) !important;
  margin: 0 !important;
  padding: 0 !important;
}

.woocommerce ul.products li.product {
  background: #ffffff !important;
  border: 1px solid var(--aibp-woo-gray-200) !important;
  border-radius: var(--aibp-woo-radius-lg) !important;
  padding: var(--aibp-woo-space-md) !important;
  box-shadow: var(--aibp-woo-shadow-sm) !important;
  transition: var(--aibp-woo-transition) !important;
  position: relative !important;
  overflow: hidden !important;
}

.woocommerce ul.products li.product:hover {
  transform: translateY(-4px) !important;
  box-shadow: var(--aibp-woo-shadow-lg) !important;
  border-color: var(--aibp-woo-primary) !important;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
  color: var(--aibp-woo-gray-900) !important;
  font-weight: 700 !important;
  font-size: 18px !important;
  margin-bottom: var(--aibp-woo-space-sm) !important;
}

.woocommerce ul.products li.product .price {
  color: var(--aibp-woo-primary) !important;
  font-weight: 700 !important;
  font-size: 20px !important;
  margin-bottom: var(--aibp-woo-space-md) !important;
}

.woocommerce ul.products li.product .price del {
  color: var(--aibp-woo-gray-500) !important;
  font-size: 16px !important;
}

/* ===== PAGINA PRODOTTO SINGOLO ===== */
.woocommerce div.product {
  background: #ffffff !important;
  border-radius: var(--aibp-woo-radius-lg) !important;
  padding: var(--aibp-woo-space-lg) !important;
  box-shadow: var(--aibp-woo-shadow-md) !important;
  margin-bottom: var(--aibp-woo-space-lg) !important;
}

.woocommerce div.product .product_title {
  color: var(--aibp-woo-gray-900) !important;
  font-weight: 800 !important;
  font-size: 32px !important;
  margin-bottom: var(--aibp-woo-space-md) !important;
}

.woocommerce div.product p.price {
  color: var(--aibp-woo-primary) !important;
  font-weight: 700 !important;
  font-size: 28px !important;
  margin-bottom: var(--aibp-woo-space-lg) !important;
}

.woocommerce div.product .woocommerce-product-details__short-description {
  color: var(--aibp-woo-gray-700) !important;
  font-size: 16px !important;
  line-height: 1.6 !important;
  margin-bottom: var(--aibp-woo-space-lg) !important;
}

/* Form aggiunta al carrello */
.woocommerce div.product form.cart {
  background: var(--aibp-woo-gray-50) !important;
  border-radius: var(--aibp-woo-radius-md) !important;
  padding: var(--aibp-woo-space-lg) !important;
  margin-bottom: var(--aibp-woo-space-lg) !important;
}

.woocommerce div.product form.cart .quantity input[type="number"] {
  border: 2px solid var(--aibp-woo-gray-300) !important;
  border-radius: var(--aibp-woo-radius-sm) !important;
  padding: 8px 12px !important;
  font-size: 16px !important;
  width: 80px !important;
  margin-right: var(--aibp-woo-space-md) !important;
}

.woocommerce div.product form.cart .quantity input[type="number"]:focus {
  border-color: var(--aibp-woo-primary) !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.1) !important;
}

/* ===== MESSAGGI E NOTIFICHE ===== */
.woocommerce .woocommerce-message,
.woocommerce .woocommerce-info {
  background: var(--aibp-woo-primary-50) !important;
  color: var(--aibp-woo-primary-dark) !important;
  border: 1px solid var(--aibp-woo-primary) !important;
  border-radius: var(--aibp-woo-radius-md) !important;
  padding: var(--aibp-woo-space-md) !important;
  margin-bottom: var(--aibp-woo-space-lg) !important;
}

.woocommerce .woocommerce-error {
  background: #fef2f2 !important;
  color: var(--aibp-woo-error) !important;
  border: 1px solid var(--aibp-woo-error) !important;
  border-radius: var(--aibp-woo-radius-md) !important;
  padding: var(--aibp-woo-space-md) !important;
  margin-bottom: var(--aibp-woo-space-lg) !important;
}

/* ===== CARRELLO ===== */
.woocommerce table.cart {
  border-radius: var(--aibp-woo-radius-md) !important;
  overflow: hidden !important;
  box-shadow: var(--aibp-woo-shadow-sm) !important;
}

.woocommerce table.cart th {
  background: var(--aibp-woo-primary) !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  padding: var(--aibp-woo-space-md) !important;
}

.woocommerce table.cart td {
  border-bottom: 1px solid var(--aibp-woo-gray-200) !important;
  padding: var(--aibp-woo-space-md) !important;
  vertical-align: middle !important;
}

.woocommerce table.cart tr:nth-child(even) {
  background: var(--aibp-woo-gray-50) !important;
}

.woocommerce .cart-collaterals .cart_totals {
  background: #ffffff !important;
  border: 1px solid var(--aibp-woo-gray-200) !important;
  border-radius: var(--aibp-woo-radius-lg) !important;
  padding: var(--aibp-woo-space-lg) !important;
  box-shadow: var(--aibp-woo-shadow-md) !important;
}

.woocommerce .cart-collaterals .cart_totals h2 {
  color: var(--aibp-woo-gray-900) !important;
  font-weight: 700 !important;
  margin-bottom: var(--aibp-woo-space-md) !important;
}

/* ===== CHECKOUT ===== */
.woocommerce-checkout .woocommerce-billing-fields h3,
.woocommerce-checkout .woocommerce-shipping-fields h3 {
  color: var(--aibp-woo-gray-900) !important;
  font-weight: 700 !important;
  border-bottom: 2px solid var(--aibp-woo-primary) !important;
  padding-bottom: var(--aibp-woo-space-sm) !important;
  margin-bottom: var(--aibp-woo-space-lg) !important;
}

.woocommerce-checkout .woocommerce-billing-fields,
.woocommerce-checkout .woocommerce-shipping-fields {
  background: #ffffff !important;
  border-radius: var(--aibp-woo-radius-lg) !important;
  padding: var(--aibp-woo-space-lg) !important;
  margin-bottom: var(--aibp-woo-space-lg) !important;
  box-shadow: var(--aibp-woo-shadow-sm) !important;
}

.woocommerce-checkout .form-row input[type="text"],
.woocommerce-checkout .form-row input[type="email"],
.woocommerce-checkout .form-row input[type="tel"],
.woocommerce-checkout .form-row textarea,
.woocommerce-checkout .form-row select {
  border: 2px solid var(--aibp-woo-gray-300) !important;
  border-radius: var(--aibp-woo-radius-sm) !important;
  padding: 12px !important;
  font-size: 16px !important;
  transition: var(--aibp-woo-transition) !important;
  width: 100% !important;
}

.woocommerce-checkout .form-row input:focus,
.woocommerce-checkout .form-row textarea:focus,
.woocommerce-checkout .form-row select:focus {
  border-color: var(--aibp-woo-primary) !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.1) !important;
}

.woocommerce-checkout #order_review {
  background: #ffffff !important;
  border: 1px solid var(--aibp-woo-gray-200) !important;
  border-radius: var(--aibp-woo-radius-lg) !important;
  padding: var(--aibp-woo-space-lg) !important;
  box-shadow: var(--aibp-woo-shadow-md) !important;
}

.woocommerce-checkout #order_review h3 {
  color: var(--aibp-woo-gray-900) !important;
  font-weight: 700 !important;
  border-bottom: 2px solid var(--aibp-woo-primary) !important;
  padding-bottom: var(--aibp-woo-space-sm) !important;
  margin-bottom: var(--aibp-woo-space-lg) !important;
}

.woocommerce-checkout #payment {
  background: var(--aibp-woo-gray-50) !important;
  border-radius: var(--aibp-woo-radius-md) !important;
  padding: var(--aibp-woo-space-lg) !important;
}

.woocommerce-checkout #place_order {
  background: var(--aibp-woo-success) !important;
  border-color: var(--aibp-woo-success) !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  padding: 16px 32px !important;
  width: 100% !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
}

.woocommerce-checkout #place_order:hover {
  background: #059669 !important;
  border-color: #059669 !important;
  transform: translateY(-2px) !important;
}

/* ===== ACCOUNT UTENTE ===== */
.woocommerce-account .woocommerce-MyAccount-navigation ul {
  background: #ffffff !important;
  border-radius: var(--aibp-woo-radius-lg) !important;
  padding: 0 !important;
  box-shadow: var(--aibp-woo-shadow-sm) !important;
  overflow: hidden !important;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li {
  border-bottom: 1px solid var(--aibp-woo-gray-200) !important;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li:last-child {
  border-bottom: none !important;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li a {
  color: var(--aibp-woo-gray-700) !important;
  padding: var(--aibp-woo-space-md) var(--aibp-woo-space-lg) !important;
  font-weight: 500 !important;
  transition: var(--aibp-woo-transition) !important;
  display: block !important;
  text-decoration: none !important;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li a:hover,
.woocommerce-account .woocommerce-MyAccount-navigation ul li.is-active a {
  background: var(--aibp-woo-primary-50) !important;
  color: var(--aibp-woo-primary) !important;
  border-left: 4px solid var(--aibp-woo-primary) !important;
}

.woocommerce-account .woocommerce-MyAccount-content {
  background: #ffffff !important;
  border-radius: var(--aibp-woo-radius-lg) !important;
  padding: var(--aibp-woo-space-lg) !important;
  box-shadow: var(--aibp-woo-shadow-sm) !important;
}

/* ===== AVVISO PRODOTTI CREDITI ===== */
.aibp-credit-product-notice {
  background: linear-gradient(135deg, var(--aibp-woo-warning) 0%, #F59E0B 100%) !important;
  color: #1F2937 !important;
  border-radius: var(--aibp-woo-radius-md) !important;
  padding: var(--aibp-woo-space-md) !important;
  margin-bottom: var(--aibp-woo-space-lg) !important;
  display: flex !important;
  align-items: center !important;
  gap: var(--aibp-woo-space-sm) !important;
  font-weight: 600 !important;
  box-shadow: var(--aibp-woo-shadow-md) !important;
}

.aibp-credit-product-notice .aibp-credit-icon {
  font-size: 24px !important;
}

.aibp-credit-product-notice .aibp-credit-text {
  flex: 1 !important;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
  .woocommerce ul.products {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) !important;
    gap: var(--aibp-woo-space-md) !important;
  }
  
  .woocommerce ul.products li.product {
    padding: var(--aibp-woo-space-sm) !important;
  }
  
  .woocommerce div.product {
    padding: var(--aibp-woo-space-md) !important;
  }
  
  .woocommerce div.product .product_title {
    font-size: 24px !important;
  }
  
  .woocommerce div.product p.price {
    font-size: 22px !important;
  }
  
  .woocommerce-checkout .form-row {
    margin-bottom: var(--aibp-woo-space-md) !important;
  }
}

@media (max-width: 480px) {
  .woocommerce ul.products {
    grid-template-columns: 1fr !important;
  }
  
  .woocommerce .button,
  .woocommerce button.button,
  .woocommerce input.button {
    padding: 10px 20px !important;
    font-size: 14px !important;
  }
  
  .woocommerce-checkout #place_order {
    font-size: 16px !important;
    padding: 14px 24px !important;
  }
}