/* ============================================================
   MEC Membership Discount — Frontend CSS
   ============================================================ */

/* ── Eligibility banner on event pages ───────────────────── */
.mec-md-eligibility-banner {
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    border-radius: 6px;
    padding: 10px 14px;
    margin: 10px 0 14px;
    font-size: 14px;
    line-height: 1.5;
    display: flex;
    align-items: center;
    gap: 8px;
}
.mec-md-eligibility-icon { font-size: 18px; flex-shrink: 0; }

/* ── Autofill notices (booking form) ─────────────────────── */
.mec-md-readonly-notice,
.mec-md-name-notice {
    border-radius: 6px;
    padding: 9px 13px;
    margin: 0 0 12px;
    font-size: 13px;
    line-height: 1.5;
}
.mec-md-readonly-notice { background: #eef2f7; border: 1px solid #cbd5e1; color: #334155; }
.mec-md-name-notice { background: #fdf3e3; border: 1px solid #f2cf8a; color: #92400e; }
.mec-md-name-notice a { font-weight: 600; color: #92400e; text-decoration: underline; }

/* ── Membership badge ────────────────────────────────────── */
.mec-md-badge {
    display: inline-block;
    background: #2e7d32;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 3px;
    vertical-align: middle;
    white-space: nowrap;
}

/* ── Price display ───────────────────────────────────────── */
.mec-md-original-price,
del.mec-md-original-price {
    color: #767676; /* WCAG AA: 4.54:1 on white (was #999 = 2.85:1, failed AA) */
    text-decoration: line-through;
    margin-right: 4px;
}
ins.mec-md-discounted-price,
.mec-md-discounted-price {
    color: #2e7d32;
    font-weight: 600;
    text-decoration: none;
}

/* ── Cart item name block: MEC details ───────────────────── */
/* Each MEC detail on its own line with consistent spacing */
td.product-name .mec-woo-cart-product-name,
td.product-name .mec-woo-cart-product-person-name,
td.product-name .mec-woo-cart-product-person-email,
td.product-name .mec-woo-cart-booking-date,
td.product-name .mec-md-name-price {
    display: block;
    margin-top: 4px;
    line-height: 1.5;
}
td.product-name .mec-woo-cart-product-name {
    font-weight: 600;
    font-size: 13px;
}
td.product-name .mec-woo-cart-product-name a {
    color: inherit;
    text-decoration: none;
}
td.product-name .mec-woo-cart-product-name a:hover {
    text-decoration: underline;
}
td.product-name .mec-woo-cart-product-person-name {
    font-size: 13px;
    color: #333;
}
td.product-name .mec-woo-cart-product-person-email {
    font-size: 12px;
    color: #767676; /* WCAG AA fix, was #777 (4.48:1) */
    margin-top: 1px;
}
td.product-name .mec-woo-cart-booking-date {
    font-size: 12px;
    color: #555;
}

/* ── Cart item name: discount tag ────────────────────────── */
td.product-name .mec-md-name-price {
    margin-top: 6px;
    font-size: 13px;
}
td.product-name .mec-md-name-price--mixed .mec-md-mix-line {
    display: block;
    font-size: 12px;
    color: #555;
    margin-top: 2px;
}

/* ── WC get_item_data rows (Elementor / Blocks) ──────────── */
/* WC renders these as <dl><dt>Key</dt><dd>Value</dd></dl> */
.woocommerce-cart-form dl.variation,
.cart-item__meta dl,
.wc-block-cart-item__description dl {
    margin: 6px 0 0;
}
.woocommerce-cart-form dl.variation dt,
.cart-item__meta dl dt {
    font-weight: 600;
    font-size: 12px;
    color: #555;
    margin-bottom: 1px;
    float: none;
    width: auto;
}
.woocommerce-cart-form dl.variation dd,
.cart-item__meta dl dd {
    font-size: 13px;
    color: #333;
    margin: 0 0 4px;
}

/* ── Subtotal breakdown ──────────────────────────────────── */
.mec-md-subtotal-wrap {
    display: block;
}
.mec-md-sub-line {
    display: block;
    font-size: 12px;
    color: #555;
    margin-bottom: 2px;
}
.mec-md-sub-line small {
    color: #767676; /* WCAG AA fix, was #888 (3.54:1) */
}
strong.mec-md-sub-total {
    display: block;
    margin-top: 4px;
    font-size: 14px;
    color: #333;
    border-top: 1px solid #eee;
    padding-top: 4px;
}

/* ── MEC booking form price display ──────────────────────── */
.mec-md-price-wrap { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mec-md-subtotal-wrap .mec-md-sub-disc,
.mec-md-subtotal-wrap .mec-md-sub-full { display: block; }
.mec-md-total-note  { display: block; font-size: 12px; color: #767676; /* WCAG AA fix, was #777 (4.48:1) */ }
.mec-md-line-label  { color: #767676; /* WCAG AA fix, was #888 (3.54:1) */ font-size: 11px; }

/* ── Member price badge (cart line) ───────────────────────────────────────
   Moved out of inline style="" in class-hadnow-discount.php::display_cart_meta().
   Inline attributes there beat any site override and repeated themselves on
   every cart line. */

.mec-md-price-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.mec-md-original-price   { color: #999; font-size: 12px; }
.mec-md-discounted-price { color: #2e7d32; font-weight: 700; text-decoration: none; }

.mec-md-badge {
    background: #2e7d32;
    color: #fff;
    border-radius: 3px;
    padding: 1px 6px;
    font-size: 11px;
    font-weight: 600;
}

/* ── Membership number at checkout ────────────────────────────────────────
   WooCommerce appends "(optional)" to the label of any field with
   required => false. On this field that is misleading rather than helpful:
   it is read-only, filled from the member's record, and the customer cannot
   supply it either way — there is nothing for them to opt into. The field is
   only rendered for members who HAVE a number (see
   MEC_MD_Membership_Number::checkout_field), so hiding the suffix cannot
   leave a genuinely optional field looking mandatory.

   Done in CSS because WooCommerce offers no per-field flag to suppress it —
   the string is hard-coded in woocommerce_form_field(). */
.ama-membership-number-field label .optional {
    display: none;
}

/* Read-only: look settled rather than editable, so nobody tries to type in it. */
.ama-membership-number-field input[readonly] {
    background: #f6f7f9;
    cursor: default;
}


/* The member rate withdrawn because the attendee is not the member.
   Warning colours, not error colours: nothing has gone wrong and the booking
   still works — the ticket is simply at the price anyone else would pay. */
.mec-md-identity-notice,
.mec-md-duplicate-notice {
	background: #fff4e5;
	border: 1px solid #e0a733;
	border-left-width: 4px;
	border-radius: 4px;
	padding: 10px 14px;
	margin: 0 0 14px;
	font-size: 0.875rem;
	line-height: 1.5;
	color: #5a3d00;
}
