/* Custom WooCommerce Frontend - Base */
.cwf-active {
  --cwf-font-sans: var(--cwf-font-family, Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif);
}

.cwf-container {
  width: 100%;
  max-width: var(--cwf-container-width, 1280px);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--cwf-page-spacing, 32px);
  padding-right: var(--cwf-page-spacing, 32px);
  box-sizing: border-box;
}

.cwf-card {
  background: var(--cwf-card-bg, #fff);
  border: 1px solid var(--cwf-border, #e2e8f0);
  border-radius: var(--cwf-radius, 12px);
  box-shadow: var(--cwf-shadow-sm, 0 1px 2px rgba(0,0,0,0.05));
  padding: var(--cwf-card-spacing, 20px);
}

.cwf-card__title {
  font-size: var(--cwf-h2-size, 24px);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 16px;
  color: var(--cwf-text, #0f172a);
}

.cwf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--cwf-btn-radius, 10px);
  font-weight: 600;
  font-size: 14px;
  line-height: 1;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  background: var(--cwf-btn-bg, #4f46e5);
  color: var(--cwf-btn-text, #fff);
  white-space: nowrap;
}

.cwf-btn:hover {
  background: var(--cwf-btn-hover-bg, #4338ca);
  color: var(--cwf-btn-hover-text, #fff);
  transform: translateY(-1px);
  box-shadow: var(--cwf-shadow-md);
}

.cwf-btn:focus-visible {
  outline: 2px solid var(--cwf-primary, #4f46e5);
  outline-offset: 2px;
}

.cwf-btn--secondary {
  background: var(--cwf-card-bg, #fff);
  color: var(--cwf-text, #0f172a);
  border-color: var(--cwf-border, #e2e8f0);
}

.cwf-btn--secondary:hover {
  background: var(--cwf-background, #f8fafc);
  border-color: var(--cwf-primary, #4f46e5);
  color: var(--cwf-primary, #4f46e5);
}

.cwf-btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--cwf-muted, #64748b);
}

.cwf-btn--ghost:hover {
  background: var(--cwf-background, #f8fafc);
  color: var(--cwf-text, #0f172a);
}

.cwf-btn--full {
  width: 100%;
}

.cwf-btn--small {
  padding: 8px 14px;
  font-size: 13px;
}

.cwf-btn:disabled {
  opacity: 0.6;
  pointer-events: none;
}

.cwf-input,
.cwf-active .input-text,
.cwf-active input[type="text"],
.cwf-active input[type="email"],
.cwf-active input[type="tel"],
.cwf-active input[type="number"],
.cwf-active input[type="password"],
.cwf-active select,
.cwf-active textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--cwf-input-border, #cbd5e1);
  border-radius: var(--cwf-input-radius, 10px);
  background: var(--cwf-input-bg, #fff);
  color: var(--cwf-input-text, #0f172a);
  font-size: 14px;
  line-height: 1.5;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.cwf-input:focus,
.cwf-active .input-text:focus {
  outline: none;
  border-color: var(--cwf-primary, #4f46e5);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--cwf-primary, #4f46e5) 15%, transparent);
}

.cwf-input-group {
  display: flex;
  gap: 8px;
}

.cwf-input-group .cwf-input {
  flex: 1;
}

.cwf-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--cwf-background, #f8fafc);
  color: var(--cwf-muted, #64748b);
  border: 1px solid var(--cwf-border, #e2e8f0);
}

.cwf-badge--sale {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}

.cwf-badge--status-processing {
  background: #dbeafe;
  color: #1e40af;
  border-color: #bfdbfe;
}
.cwf-badge--status-completed {
  background: #dcfce7;
  color: #166534;
  border-color: #bbf7d0;
}
.cwf-badge--status-on-hold {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}
.cwf-badge--status-failed,
.cwf-badge--status-cancelled {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}

.cwf-text-muted {
  color: var(--cwf-muted, #64748b);
}

.cwf-notice {
  padding: 12px 16px;
  border-radius: var(--cwf-input-radius, 10px);
  border: 1px solid;
  font-size: 14px;
  margin-bottom: 16px;
}

.cwf-notice--warning {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.cwf-notice--error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.cwf-notice--success {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

.cwf-totals-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cwf-totals-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 14px;
}

.cwf-totals-row--total {
  font-weight: 700;
  font-size: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--cwf-border, #e2e8f0);
  margin-top: 4px;
}

.cwf-fields-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.cwf-field {
  margin-bottom: 4px;
}

.cwf-field label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 6px;
  color: var(--cwf-text, #0f172a);
}

.cwf-field .required {
  color: var(--cwf-error, #dc2626);
}

.cwf-field__desc {
  font-size: 12px;
  color: var(--cwf-muted, #64748b);
  margin-top: 4px;
  display: block;
}

.cwf-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.cwf-empty {
  text-align: center;
  padding: 48px 24px;
}

.cwf-empty__icon {
  margin: 0 auto 20px;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cwf-background, #f8fafc);
  border-radius: 50%;
  color: var(--cwf-muted, #64748b);
}

.cwf-empty__title {
  font-size: var(--cwf-h1-size, 32px);
  margin: 0 0 12px;
}

.cwf-empty__text {
  color: var(--cwf-muted, #64748b);
  max-width: 420px;
  margin: 0 auto 24px;
}

.cwf-table {
  width: 100%;
  border-collapse: collapse;
}

.cwf-table th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--cwf-muted, #64748b);
  padding: 12px;
  border-bottom: 1px solid var(--cwf-border, #e2e8f0);
}

.cwf-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--cwf-border, #e2e8f0);
  font-size: 14px;
}

.cwf-hide-mobile {
  display: block;
}
.cwf-show-mobile {
  display: none;
}

@media (max-width: 768px) {
  .cwf-hide-mobile {
    display: none !important;
  }
  .cwf-show-mobile {
    display: block !important;
  }
  .cwf-container {
    padding-left: 16px;
    padding-right: 16px;
  }
  .cwf-fields-grid {
    grid-template-columns: 1fr;
  }
}

/* Focus states for accessibility */
.cwf-active *:focus-visible {
  outline: 2px solid var(--cwf-primary, #4f46e5);
  outline-offset: 2px;
}

/* Loading */
.cwf-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
}

.cwf-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid var(--cwf-border, #e2e8f0);
  border-top-color: var(--cwf-primary, #4f46e5);
  border-radius: 50%;
  animation: cwf-spin 0.6s linear infinite;
}

@keyframes cwf-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Coupon */
.cwf-coupon__title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 12px;
}

.cwf-coupon__feedback {
  margin-top: 8px;
  font-size: 13px;
  min-height: 18px;
}

.cwf-coupon__list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cwf-coupon__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--cwf-background, #f8fafc);
  border: 1px solid var(--cwf-border, #e2e8f0);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
}

.cwf-coupon__remove {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  display: flex;
  color: var(--cwf-muted, #64748b);
}

.cwf-coupon__remove:hover {
  color: var(--cwf-error, #dc2626);
}
