
/* Base layout (unchanged logic) */
.smc-cps-row .smc-cps-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.smc-cps-row #smc_cps_postcode { max-width: 220px; }
.smc-cps-spinner { width: 18px; height: 18px; border: 2px solid #e5e7eb; border-top-color: #111827; border-radius: 50%; display: none; animation: smcSpin 1s linear infinite; }
@keyframes smcSpin { to { transform: rotate(360deg); } }
.smc-cps-help { display:block; max-width: 520px; white-space: normal; line-height: 1.35; }

/* Checkout: hide Billing country field */
#billing_country_field { display: none !important; }

/* --- MOBILE ORDER REVIEW LAYOUT --- */
@media (max-width: 640px){

  /* Ensure the container fits without horizontal scroll */
  .woocommerce-checkout-review-order,
  .woocommerce-checkout-review-order .shop_table { width: 100% !important; max-width: 100% !important; overflow-x: hidden; }

  /* Hide table head on mobile */
  .woocommerce-checkout-review-order-table thead { display: none; }

  /* Product rows: turn into flex rows with 80/20 columns */
  .woocommerce-checkout-review-order-table tbody tr.cart_item {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    border-bottom: 1px solid #e5e7eb;
    padding: 8px 0;
  }
  .woocommerce-checkout-review-order-table tbody tr.cart_item td {
    border: 0;
    padding: 6px 8px;
    font-size: 0.95rem;
  }
  .woocommerce-checkout-review-order-table tbody tr.cart_item td.product-name {
    width: 80%;
    order: 1;
    padding-right: 8px;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .woocommerce-checkout-review-order-table tbody tr.cart_item td.product-total {
    width: 20%;
    order: 2;
    text-align: right;
    white-space: nowrap;
  }

  /* Shipping/taxes/totals: stack header above value */
  .woocommerce-checkout-review-order-table tfoot tr {
    display: block;
    padding: 8px 0;
    border-top: 1px solid #f1f5f9;
  }
  .woocommerce-checkout-review-order-table tfoot th,
  .woocommerce-checkout-review-order-table tfoot td {
    display: block;
    width: 100%;
    padding: 4px 8px;
    box-sizing: border-box;
  }
  .woocommerce-checkout-review-order-table tfoot th {
    font-size: 0.9rem;
    opacity: .9;
    margin-bottom: 2px;
  }
  .woocommerce-checkout-review-order-table tfoot td {
    text-align: right;
    font-size: 1rem;
  }

  /* Shipping methods list wraps nicely */
  ul#shipping_method li label { display:flex; flex-wrap:wrap; gap:8px; align-items:center; line-height:1.25; }
  ul#shipping_method li img { max-height:18px; height:auto; width:auto; }

  /* Postnummer: stack input + button */
  .smc-cps-row .smc-cps-wrap { flex-direction: column; align-items: stretch; }
  .smc-cps-row #smc_cps_postcode { max-width: 100%; }
  .smc-cps-row #smc_cps_update { width: 100%; margin-top: 6px; }
  .smc-cps-help { max-width: 100%; }

  /* Remove extra table paddings to gain width */
  .woocommerce-checkout-review-order-table td,
  .woocommerce-checkout-review-order-table th { padding-left: 8px !important; padding-right: 8px !important; }
}
