/* 
 * ClientGroupManager Frontend Styles
 * Clean CSS with only used classes
 */

/* ============================================================================
   Admin Interface Styles (Modern Components)
   ============================================================================ */

/* Typography */
.cgm-text-display {
  font-size: 1.875rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.25;
}

.cgm-text-subheading {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1e293b;
}

.cgm-text-body {
  font-size: 0.875rem;
  color: #475569;
  line-height: 1.5;
}

/* Cards */
.cgm-card-modern {
  background-color: #ffffff;
  border-radius: 0.5rem;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  border: 1px solid #e2e8f0;
}

.cgm-card-header-modern {
  padding: 1rem 1.5rem;
  background-color: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  border-top-left-radius: 0.5rem;
  border-top-right-radius: 0.5rem;
}

.cgm-card-title-modern {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1e293b;
  margin: 0;
}

.cgm-card-subtitle {
  font-size: 0.875rem;
  color: #64748b;
  margin-top: 0.25rem;
}

.cgm-card-body-modern {
  padding: 1.5rem;
}

/* Buttons */
.cgm-btn-modern {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1rem;
  border-radius: 0.375rem;
  font-weight: 500;
  font-size: 0.875rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
}

.cgm-btn-primary-modern {
  background-color: #1e293b;
  color: #ffffff;
  border-color: #1e293b;
}

.cgm-btn-primary-modern:hover {
  background-color: #0f172a;
  border-color: #0f172a;
}

.cgm-btn-secondary-modern {
  background-color: #ffffff;
  color: #1e293b;
  border-color: #e2e8f0;
}

.cgm-btn-secondary-modern:hover {
  background-color: #f8fafc;
}

.cgm-btn-success-modern {
  background-color: #16a34a;
  color: #ffffff;
  border-color: #16a34a;
}

.cgm-btn-success-modern:hover {
  background-color: #15803d;
}

.cgm-btn-accent-modern {
  background-color: #0ea5e9;
  color: #ffffff;
  border-color: #0ea5e9;
}

.cgm-btn-accent-modern:hover {
  background-color: #0284c7;
}

.cgm-btn-danger-modern {
  background-color: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
}

.cgm-btn-danger-modern:hover {
  background-color: #b91c1c;
}

/* Badges */
.cgm-badge-modern {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.cgm-badge-primary {
  background-color: #dbeafe;
  color: #1d4ed8;
}

.cgm-badge-success {
  background-color: #dcfce7;
  color: #16a34a;
}

.cgm-badge-warning {
  background-color: #fef3c7;
  color: #d97706;
}

/* Alerts */
.cgm-alert-modern {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 0.375rem;
  border: 1px solid;
}

.cgm-alert-info {
  background-color: #eff6ff;
  border-color: #bfdbfe;
  color: #1e40af;
}

.cgm-alert-success {
  background-color: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

.cgm-alert-danger {
  background-color: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
}

/* Tables */
.cgm-table-modern {
  border-collapse: collapse;
}

.cgm-table-modern th {
  background-color: #f8fafc;
  padding: 0.75rem;
  text-align: left;
  font-weight: 600;
  color: #374151;
  border-bottom: 1px solid #e5e7eb;
}

.cgm-table-modern td {
  padding: 0.75rem;
  border-bottom: 1px solid #f3f4f6;
}

/* ============================================================================
   Frontend Specific Styles
   ============================================================================ */

/* Free Shipping Gauge */
.cgm-shipping-gauge { 
  margin: 12px 0 16px; 
}

.cgm-shipping-gauge .cgm-message { 
  margin-bottom: 8px; 
  font-size: 14px; 
  color: #0f172a; 
}

.cgm-shipping-gauge .cgm-bar { 
  position: relative; 
  height: 8px; 
  background: #e2e8f0; 
  border-radius: 9999px; 
  overflow: hidden; 
}

.cgm-shipping-gauge .cgm-bar span { 
  display: block; 
  height: 100%; 
  background: var(--theme-palette-color-1);
  width: 0; 
  transition: width .3s ease; 
  border-radius: 9999px; 
}

/* Discount Badge */
.cgm-discount-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.125rem 0.375rem;
  margin-left: 0.25rem;
  border-radius: 0.25rem;
}

/* Free Label */
.cgm-free-label {
  font-size: 0.75rem;
  color: #16a34a;
  margin-left: 0.375rem;
  font-weight: 500;
}

/* ============================================================================
   Free Products Summary Styles (Rounded Div Design)
   ============================================================================ */

/* Main summary container - removes default table styling */
.cgm-selected-free-products-summary td {
  padding: 0 !important;
  border: none !important;
}

/* Main rounded container */
.cgm-free-products-summary {
  background: #f8f9fa;
  border-radius: 12px;
  border: 1px solid #e0e0e0;
  margin: 15px 0;
  overflow: hidden;
}

/* Header */
.cgm-free-products-header {
  background: #ffffff;
  padding: 15px 20px;
  border-bottom: 1px solid #e0e0e0;
  border-radius: 12px 12px 0 0;
}

.cgm-free-products-title {
  margin: 0;
  color: #2c3e50;
  font-weight: bold;
  font-size: 18px;
}

/* Product list container */
.cgm-free-products-list {
  padding: 15px 20px;
}

/* Individual product item */
.cgm-free-product-item {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  padding: 12px;
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.cgm-free-product-item:last-child {
  margin-bottom: 0;
}

/* Product image */
.cgm-product-image {
  width: 45px;
  height: 45px;
  object-fit: cover;
  margin-right: 15px;
  border-radius: 6px;
  flex-shrink: 0;
}

/* Product details container */
.cgm-product-details {
  flex: 1;
  min-width: 0;
}

.cgm-product-name {
  color: #2c3e50;
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 4px;
  line-height: 1.3;
  text-align: left;
}

.cgm-product-quantity {
  font-size: 14px;
  color: #7f8c8d;
  margin-bottom: 2px;
  text-align: left;
}

.cgm-product-offer {
  font-size: 12px;
  color: #27ae60;
  font-style: italic;
  text-align: left;
}

/* Free badge */
.cgm-free-badge {
  background: #27ae6020;
  color: #27ae60;
  padding: 6px 12px;
  border-radius: 15px;
  font-weight: bold;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Footer message */
.cgm-free-products-footer {
  padding: 12px 20px;
  background: #ffffff;
  border-top: 1px solid #e0e0e0;
  border-radius: 0 0 12px 12px;
}

.cgm-footer-message {
  margin: 0;
  font-size: 12px;
  color: #7f8c8d;
  font-style: italic;
  line-height: 1.4;
}

/* Offer Selection Section */
.cgm-offer-selection-section {
  margin-bottom: 20px;
  padding: 15px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #f9f9f9;
}

.cgm-free-quantity-input {
  width: 80px;
  padding: 4px 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

/* Loyalty Components */
.cgm-rewards {
  display: grid;
  gap: 12px;
  max-width: 680px;
}

.cgm-reward {
  border: 1px solid #e5e7eb;
  padding: 12px;
  border-radius: 8px;
}

.cgm-loyalty-redeem-form {
  max-width: 420px;
}

/* ============================================================================
   Responsive Design
   ============================================================================ */

@media (max-width: 768px) {
  .cgm-free-products-summary {
    margin: 10px 0;
    border-radius: 8px;
  }
  
  .cgm-free-products-header {
    padding: 12px 15px;
    border-radius: 8px 8px 0 0;
  }
  
  .cgm-free-products-title {
    font-size: 16px;
  }
  
  .cgm-free-products-list {
    padding: 12px 15px;
  }
  
  .cgm-free-product-item {
    padding: 10px;
    border-radius: 6px;
  }
  
  .cgm-product-image {
    width: 40px;
    height: 40px;
    margin-right: 12px;
  }
  
  .cgm-product-name {
    font-size: 14px;
  }
  
  .cgm-product-quantity {
    font-size: 13px;
  }
  
  .cgm-product-offer {
    font-size: 11px;
  }
  
  .cgm-free-badge {
    padding: 5px 10px;
    font-size: 10px;
  }
  
  .cgm-free-products-footer {
    padding: 10px 15px;
    border-radius: 0 0 8px 8px;
  }
}
