/**
 * React Product Shipping Fees Manager — Frontend Styles
 * Version: 6.0.9
 *
 * Displays on: single product page, cart, checkout, order confirmation, emails.
 * Designed to work with any WooCommerce theme (Storefront, Woodmart, etc.)
 */

/* ═══════════════════════════════════════════════════════════════════════════
   PRODUCT PAGE — Simple one-line notice
   ═══════════════════════════════════════════════════════════════════════════ */

.rpsfm-product-simple-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0;
  padding: 10px 16px;
  background: #fff7e6;
  border: 1px solid #f0c36d;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.4;
  color: #7c5500;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
}

.rpsfm-product-simple-notice svg {
  flex-shrink: 0;
  color: #c68a22;
}


/* ═══════════════════════════════════════════════════════════════════════════
   CART PAGE — Fee badge under product name
   ═══════════════════════════════════════════════════════════════════════════ */

/* Active fee badge — orange, means fee IS applied */
.rpsfm-cart-fee-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 5px 12px;
  background: #fff7e6;
  border: 1px solid #f0c36d;
  border-radius: 6px;
  font-size: 12px !important;
  line-height: 1.4 !important;
  color: #7c5500;
  white-space: normal;
  word-break: break-word;
}

.rpsfm-cart-fee-badge svg {
  flex-shrink: 0;
  color: #c68a22;
  width: 14px !important;
  height: 14px !important;
}

.rpsfm-cart-fee-badge span {
  font-size: 12px !important;
  line-height: 1.4 !important;
}

.rpsfm-cart-fee-badge strong {
  color: #b85c00;
  font-weight: 700;
  font-size: 12px !important;
}

/* Info badge — gray/blue, means fees exist but not yet triggered */
.rpsfm-cart-fee-info {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 5px 12px;
  background: #f0f5ff;
  border: 1px solid #c5d5f0;
  border-radius: 6px;
  font-size: 12px !important;
  line-height: 1.4 !important;
  color: #3b5998;
  white-space: normal;
  word-break: break-word;
}

.rpsfm-cart-fee-info svg {
  flex-shrink: 0;
  color: #5b7cbf;
  width: 14px !important;
  height: 14px !important;
}

.rpsfm-cart-fee-info span {
  font-size: 12px !important;
  line-height: 1.4 !important;
}


/* ═══════════════════════════════════════════════════════════════════════════
   CART — Fee under subtotal column
   ═══════════════════════════════════════════════════════════════════════════ */

.rpsfm-subtotal-fee {
  margin-top: 4px;
  font-size: 12px !important;
  color: #b85c00;
  font-weight: 600;
  line-height: 1.3 !important;
}

.rpsfm-subtotal-fee * {
  font-size: 12px !important;
}

.rpsfm-subtotal-fee small {
  font-weight: 400;
  color: #8b6914;
  font-size: 11px !important;
}

.rpsfm-subtotal-fee .woocommerce-Price-amount,
.rpsfm-subtotal-fee .woocommerce-Price-currencySymbol {
  font-size: 12px !important;
  font-weight: 600;
}


/* ═══════════════════════════════════════════════════════════════════════════
   CHECKOUT — Fee badge under item in order review table
   ═══════════════════════════════════════════════════════════════════════════ */

.rpsfm-checkout-fee-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 5px 12px;
  background: #fff7e6;
  border: 1px solid #f0c36d;
  border-radius: 6px;
  font-size: 12px !important;
  line-height: 1.4 !important;
  color: #7c5500;
  white-space: normal;
  word-break: break-word;
}

.rpsfm-checkout-fee-badge svg {
  flex-shrink: 0;
  color: #c68a22;
  width: 14px !important;
  height: 14px !important;
}

.rpsfm-checkout-fee-badge span {
  font-size: 12px !important;
  line-height: 1.4 !important;
}

.rpsfm-checkout-fee-badge strong {
  color: #b85c00;
  font-weight: 700;
  font-size: 12px !important;
}

.rpsfm-checkout-fee-badge .woocommerce-Price-amount,
.rpsfm-checkout-fee-badge .woocommerce-Price-currencySymbol {
  font-size: 12px !important;
}


/* ═══════════════════════════════════════════════════════════════════════════
   ORDER DETAILS — Thank you page, my account, emails
   ═══════════════════════════════════════════════════════════════════════════ */

.rpsfm-order-fee-badge {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 10px;
  background: #fff7e6;
  border: 1px solid #f0c36d;
  border-radius: 5px;
  font-size: 12px !important;
  color: #7c5500;
  line-height: 1.4 !important;
}

.rpsfm-order-fee-badge * {
  font-size: 12px !important;
}


/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */

@media screen and (max-width: 768px) {
  .rpsfm-frontend-notice {
    margin: 16px 0 12px;
  }

  .rpsfm-notice-header {
    padding: 12px 14px 0;
  }

  .rpsfm-notice-desc {
    margin: 6px 14px 10px;
    font-size: 12.5px;
  }

  .rpsfm-frontend-table thead th,
  .rpsfm-frontend-table tbody td {
    padding: 8px 14px;
  }

  .rpsfm-cart-fee-badge,
  .rpsfm-cart-fee-info,
  .rpsfm-checkout-fee-badge {
    font-size: 11px !important;
    padding: 4px 10px;
  }

  .rpsfm-cart-fee-badge *,
  .rpsfm-cart-fee-info *,
  .rpsfm-checkout-fee-badge * {
    font-size: 11px !important;
  }
}

/* Very narrow (phones) — stack fee/qty vertically if needed */
@media screen and (max-width: 480px) {
  .rpsfm-frontend-table thead th,
  .rpsfm-frontend-table tbody td {
    padding: 7px 10px;
    font-size: 12px;
  }

  .rpsfm-frontend-table thead th:last-child,
  .rpsfm-frontend-table tbody td:last-child {
    text-align: right;
  }
}


/* ═══════════════════════════════════════════════════════════════════════════
   EMAIL — Force compatible inline-like styles via classes
   ═══════════════════════════════════════════════════════════════════════════ */

/* WooCommerce emails use tables, these ensure basic visibility */
.woocommerce-email .rpsfm-order-fee-badge,
.woocommerce-email .rpsfm-cart-fee-badge,
.woocommerce-email .rpsfm-checkout-fee-badge {
  display: inline-block;
  margin-top: 4px;
  padding: 3px 8px;
  background: #fff7e6;
  border: 1px solid #f0c36d;
  border-radius: 4px;
  font-size: 11px !important;
  color: #7c5500;
}


/* ═══════════════════════════════════════════════════════════════════════════
   WOODMART THEME — Specific overrides
   ═══════════════════════════════════════════════════════════════════════════ */

/* Woodmart uses .summary-inner, ensure notice isn't collapsed */
.summary-inner .rpsfm-frontend-notice,
.product-summary .rpsfm-frontend-notice {
  width: 100%;
  clear: both;
}

/* Woodmart cart table — force 12px on all our elements */
.woodmart-cart-design-1 .rpsfm-cart-fee-badge,
.woodmart-cart-design-1 .rpsfm-cart-fee-info,
.woodmart-cart-design-2 .rpsfm-cart-fee-badge,
.woodmart-cart-design-2 .rpsfm-cart-fee-info {
  display: flex;
  margin-top: 6px;
  font-size: 12px !important;
}

.woodmart-cart-design-1 .rpsfm-cart-fee-badge *,
.woodmart-cart-design-1 .rpsfm-cart-fee-info *,
.woodmart-cart-design-2 .rpsfm-cart-fee-badge *,
.woodmart-cart-design-2 .rpsfm-cart-fee-info * {
  font-size: 12px !important;
}

/* Woodmart checkout order review table */
.woocommerce-checkout-review-order-table .rpsfm-checkout-fee-badge {
  display: flex !important;
  margin-top: 6px;
  font-size: 12px !important;
}

.woocommerce-checkout-review-order-table .rpsfm-checkout-fee-badge * {
  font-size: 12px !important;
}

/* Woodmart subtotal column */
.woocommerce td.product-subtotal .rpsfm-subtotal-fee,
.woocommerce td.product-subtotal .rpsfm-subtotal-fee * {
  font-size: 12px !important;
}

/* Global force — any theme that sets larger fonts on WC tables */
.woocommerce .rpsfm-cart-fee-badge,
.woocommerce .rpsfm-cart-fee-badge *,
.woocommerce .rpsfm-cart-fee-info,
.woocommerce .rpsfm-cart-fee-info *,
.woocommerce .rpsfm-checkout-fee-badge,
.woocommerce .rpsfm-checkout-fee-badge *,
.woocommerce .rpsfm-subtotal-fee,
.woocommerce .rpsfm-subtotal-fee *,
.woocommerce .rpsfm-order-fee-badge,
.woocommerce .rpsfm-order-fee-badge * {
  font-size: 12px !important;
  line-height: 1.4 !important;
}


/* ═══════════════════════════════════════════════════════════════════════════
   DARK MODE SUPPORT (theme-dependent)
   ═══════════════════════════════════════════════════════════════════════════ */

@media (prefers-color-scheme: dark) {
  /* Only apply if body has a dark-mode class (theme must set this) */
  body.dark-mode .rpsfm-frontend-notice,
  body.woodmart-dark .rpsfm-frontend-notice {
    background: linear-gradient(135deg, #2a2010 0%, #302410 100%);
    border-color: #8b6914;
  }

  body.dark-mode .rpsfm-notice-title,
  body.woodmart-dark .rpsfm-notice-title {
    color: #f0c36d;
  }

  body.dark-mode .rpsfm-notice-desc,
  body.woodmart-dark .rpsfm-notice-desc {
    color: #d4a94e;
  }

  body.dark-mode .rpsfm-frontend-table thead th,
  body.woodmart-dark .rpsfm-frontend-table thead th {
    background: rgba(198, 138, 34, .15);
    color: #f0c36d;
    border-color: #8b6914;
  }

  body.dark-mode .rpsfm-frontend-table tbody td,
  body.woodmart-dark .rpsfm-frontend-table tbody td {
    color: #e8d4a8;
    border-color: rgba(139, 105, 20, .25);
  }

  body.dark-mode .rpsfm-qty-range,
  body.woodmart-dark .rpsfm-qty-range {
    color: #f0d88a;
  }

  body.dark-mode .rpsfm-fee-amount,
  body.woodmart-dark .rpsfm-fee-amount {
    color: #f5a623;
  }

  body.dark-mode .rpsfm-cart-fee-badge,
  body.woodmart-dark .rpsfm-cart-fee-badge,
  body.dark-mode .rpsfm-checkout-fee-badge,
  body.woodmart-dark .rpsfm-checkout-fee-badge {
    background: #2a2010;
    border-color: #8b6914;
    color: #e8d4a8;
  }
}


/* ═══════════════════════════════════════════════════════════════════════════
   PRINT
   ═══════════════════════════════════════════════════════════════════════════ */

@media print {
  .rpsfm-frontend-notice {
    border: 2px solid #999;
    background: #fff;
    box-shadow: none;
    page-break-inside: avoid;
  }

  .rpsfm-frontend-table thead th {
    background: #eee !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .rpsfm-cart-fee-badge,
  .rpsfm-cart-fee-info,
  .rpsfm-checkout-fee-badge {
    border: 1px solid #999;
    background: #fff;
  }
}
