/**
 * Dogalicious Rewards — storefront styles.
 *
 * Shipped with the plugin rather than added to the child theme, so it is
 * removed cleanly if the plugin is ever deactivated.
 *
 * ---------------------------------------------------------------------------
 * WHY THE PANEL DOES NOT USE .wc-points-rewards-message
 * ---------------------------------------------------------------------------
 * dogalicious-tokens.css:511-530 forces that class to `display:flex !important`
 * with `flex: 1 1 240px` on every child. That is right for a one-line banner,
 * but for a multi-part panel (intro + input + button + status line) it turns
 * each part into a separate wrapping row and blows the box up vertically.
 * Rather than fight it with more !important, the panel owns its own class and
 * its own layout.
 *
 * The one-line banners DO keep .wc-points-rewards-message, so they inherit the
 * existing look — but their text is wrapped in a single <span> so flex sees ONE
 * item instead of treating each bare text node as an anonymous flex item.
 */

/* --------------------------------------------------------------------------
 * Earn / thank-you note
 *
 * Fully self-contained. It does NOT reuse .woocommerce-info or
 * .wc-points-rewards-message, because both drag in theme rules that made this
 * one-line message hundreds of pixels tall on mobile — first by splitting it
 * into stacked flex rows, then via WooCommerce's own notice styling.
 *
 * The explicit `display:block` and `min-height:0` are defensive: they stop any
 * future flex/grid rule on an ancestor from stretching this box again.
 * ------------------------------------------------------------------------ */

.dga-points-note {
	display: block;
	box-sizing: border-box;
	width: 100%;
	min-height: 0;
	height: auto;
	margin: 16px 0;
	padding: 12px 16px;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 12px;
	background: #f2f8f4;
	font-size: 0.95em;
	font-weight: 600;
	line-height: 1.5;
	text-align: left;
}

/* WooCommerce's notice icon is attached to .woocommerce-info; we are not that
   class, but belt and braces in case a theme targets the container. */
.dga-points-note::before,
.dga-points-note::after {
	content: none !important;
}

.dga-points-note strong {
	font-weight: 800;
}

/* --------------------------------------------------------------------------
 * Redeem panel
 * ------------------------------------------------------------------------ */

.dga-points-panel {
	display: block;
	box-sizing: border-box;
	width: 100%;
	margin: 16px 0;
	padding: 16px 18px;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 12px;
	background: #f2f8f4;
	line-height: 1.5;
}

.dga-points-panel p {
	margin: 0 0 12px;
}

.dga-points-panel__applied {
	margin-bottom: 12px;
}

/* Input + button. `min-width: 0` on the input is what stops the button being
   pushed off-screen: without it a flex item refuses to shrink below its
   intrinsic width, which is how the button ended up outside the viewport on
   mobile. */
.dga-points-panel__controls {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	width: 100%;
}

/* The height is pinned deliberately. The checkout stylesheet stretched this
   field to several hundred pixels tall on mobile (the cart page was fine), so
   height/min-height/max-height are all stated and marked important rather than
   left to inheritance. `line-height` is set too — without it a tall inherited
   line-height re-inflates the box from the inside. */
.dga-points-panel__controls .dga-points-input,
.dga-points-panel__controls input[type="number"] {
	flex: 1 1 120px;
	min-width: 0;
	max-width: 100%;
	width: auto;
	box-sizing: border-box !important;
	height: 48px !important;
	min-height: 48px !important;
	max-height: 48px !important;
	margin: 0;
	padding: 0 12px !important;
	border: 1px solid rgba(0, 0, 0, 0.2);
	border-radius: 8px;
	line-height: 1.2 !important;
	font-size: 16px; /* 16px stops iOS Safari zooming the page on focus. */
	resize: none;
	appearance: textfield;
	-moz-appearance: textfield;
}

.dga-points-panel__controls .button,
.dga-points-panel .dga-points-remove {
	flex: 0 1 auto;
	min-width: 0;
	max-width: 100%;
	margin: 0;
	white-space: normal; /* allow the label to wrap rather than overflow */
	word-break: break-word;
}

.dga-points-panel__msg {
	margin-top: 10px;
	min-height: 0;
	font-size: 0.92em;
	opacity: 0.85;
}

.dga-points-panel__msg:empty {
	display: none;
	margin-top: 0;
}

/* Narrow phones: stack so a long bilingual button label can never overflow. */
@media (max-width: 480px) {
	.dga-points-panel__controls {
		flex-direction: column;
		align-items: stretch;
	}

	.dga-points-panel__controls .button,
	.dga-points-panel__controls .dga-points-input,
	.dga-points-panel__controls input[type="number"] {
		width: 100%;
		flex: 0 0 auto;
	}
}

/* --------------------------------------------------------------------------
 * My Account → DogaPoints
 *
 * The screen is a stack of five unrelated things: a renewal control, a claims
 * form, a referral link, an expiry table and a history table. Separated only by
 * <h3>s they ran together into one wall of text, so each gets its own card.
 *
 * Every rule here is scoped under .dga-points-account. The page is rendered
 * inside the theme's My Account template, and unscoped element selectors would
 * leak into Orders, Addresses and the rest.
 * ------------------------------------------------------------------------ */

.dga-points-account__balance {
	box-sizing: border-box;
	margin: 0 0 18px;
	padding: 16px 18px;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 12px;
	background: #f2f8f4;
	font-size: 1.05em;
	line-height: 1.5;
}

.dga-points-card {
	display: block;
	box-sizing: border-box;
	margin: 0 0 18px;
	padding: 18px 20px;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 12px;
	background: #fff;
	line-height: 1.55;
}

.dga-points-card:last-child {
	margin-bottom: 0;
}

.dga-points-card > h3 {
	margin: 0 0 12px;
	font-size: 1.1em;
	line-height: 1.35;
}

.dga-points-card > p {
	margin: 0 0 12px;
}

.dga-points-card > p:last-child,
.dga-points-card > form:last-child > p:last-child,
.dga-points-card > table:last-child {
	margin-bottom: 0;
}

.dga-points-card form {
	margin: 0;
}

/* Labels sit above their field. Without this the theme's inline-block label
   and the <br /> that follows it produce an uneven gap. */
.dga-points-card label {
	display: inline-block;
	margin-bottom: 6px;
	font-weight: 600;
}

/* The referral link and the points input are read-then-copied, so they get the
   full width rather than the theme's default narrow field. */
.dga-points-card input[type="text"],
.dga-points-card input[type="url"],
.dga-points-card input[type="number"],
.dga-points-card select {
	box-sizing: border-box;
	width: 100%;
	max-width: 420px;
	height: 44px;
	padding: 0 12px;
	border: 1px solid rgba(0, 0, 0, 0.2);
	border-radius: 8px;
	font-size: 16px; /* 16px stops iOS Safari zooming the page on focus. */
	line-height: 1.2;
}

/* Two tables live here (expiring, history) and both have a date column that
   will not fold. Let them scroll inside their own card instead of widening the
   page. */
.dga-points-card table {
	display: block;
	width: 100%;
	overflow-x: auto;
	margin: 0;
	border-collapse: collapse;
}

.dga-points-card table th,
.dga-points-card table td {
	padding: 8px 10px;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
	text-align: left;
	white-space: nowrap;
}

.dga-points-card table tr:last-child td {
	border-bottom: 0;
}

/* The submit button needs air after the file input, which has no margin of its
   own in any of the three browsers this page is used on. */
.dga-points-card input[type="file"] {
	display: block;
	margin: 0 0 14px;
	max-width: 100%;
}

/* Claim form: numbered how-to, and the per-platform blocks the inline script
   toggles. [hidden] is restated with !important because themes routinely set
   `display` on divs by class or descendant selector, which beats the UA
   stylesheet's [hidden] rule and would leave both platforms' fields on screen. */
.dga-points-card .dga-claim-step[hidden] {
	display: none !important;
}

.dga-points-card .dga-claim-how {
	margin: 0 0 14px;
	padding-left: 1.3em;
}

.dga-points-card .dga-claim-how li {
	margin-bottom: 4px;
}

.dga-points-card .dga-claim-hint {
	display: block;
	margin-top: 4px;
	font-size: 0.9em;
	opacity: 0.75;
}

@media (max-width: 480px) {

	.dga-points-card {
		padding: 16px 14px;
	}
}

/* --------------------------------------------------------------------------
 * Product page
 * ------------------------------------------------------------------------ */

.wc-points-rewards-product-message {
	margin: 8px 0;
	line-height: 1.5;
}

/* pdp-v2 renders its own points line and hides the plugin's
   (pdp-v2.css:97-98). Keep the subscription hint hidden there too so the two
   systems never double up. */
.dga-pdp__points ~ .dga-points-sub-hint {
	display: none;
}
