/**
 * Installment grid (product tab and [moka_taksit_tablosu] shortcode).
 *
 * Loaded through wp_enqueue_style() from InstallmentAssets, and only on the
 * screens that actually render the table — never on the checkout, the cart or
 * the admin dashboard.
 *
 * Every rule is prefixed with a `moka-installment` class so nothing can reach
 * the surrounding theme or the WordPress interface. Colours come from the
 * theme where it defines them, with a neutral fallback, so the grid sits
 * inside a light or dark storefront without turning into a bright patch.
 */

/* One card per card family, four across on a wide screen. The columns
   stretch to fill the container rather than being a fixed card size, so the
   grid uses whatever width the product tab gives it. */
.moka-installment-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 0.9em;
	margin: 0 0 0.85em;
	width: 100%;
	box-sizing: border-box;
}

.moka-installment-grid .moka-installment-card {
	min-width: 0;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	background: var(--moka-card-bg, #fff);
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 10px;
	padding: 0.85em 0.8em 0.7em;
	overflow: hidden;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.06);
	transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.moka-installment-grid .moka-installment-card:hover {
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06), 0 8px 20px rgba(0, 0, 0, 0.1);
	transform: translateY(-1px);
}

/* The logo is 30% smaller than the original 30px. */
.moka-installment-grid .moka-installment-logo {
	display: block;
	height: 21px;
	width: auto;
	max-width: 100%;
	margin: 0 auto 0.55em;
	object-fit: contain;
}

.moka-installment-grid table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.72em;
	table-layout: fixed;
}

.moka-installment-grid .moka-installment-th {
	padding: 0.3em 0.55em;
	text-align: left;
	font-weight: 600;
	font-size: 0.82em;
	color: rgba(0, 0, 0, 0.5);
	text-transform: uppercase;
	letter-spacing: 0.02em;
	white-space: nowrap;
	border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

.moka-installment-grid .moka-installment-plan {
	padding: 0.32em 0.55em;
	text-align: left;
	font-weight: 400;
	color: inherit;
	border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.moka-installment-grid .moka-installment-total {
	padding: 0.32em 0.55em;
	text-align: right;
	font-weight: 600;
	border-bottom: 1px solid rgba(0, 0, 0, 0.05);
	white-space: nowrap;
}

.moka-installment-grid .moka-installment-rate {
	display: block;
	font-size: 0.78em;
	font-weight: 400;
	opacity: 0.6;
}

/* Row shading: a grey ladder from the first row (darkest) to the last
   (nearly white). It is decoration, not a claim — an earlier green highlight
   read as "this installment is cheaper", which is only true when the rate
   matches the pay-in-full rate.

   The ramp stays deliberately faint: it only has to group rows by price band,
   and anything heavier reads as a striped, busy table rather than a quiet
   reference card. */
.moka-installment-grid .moka-installment-shade-6 { background: rgba(0, 0, 0, 0.042); }
.moka-installment-grid .moka-installment-shade-5 { background: rgba(0, 0, 0, 0.034); }
.moka-installment-grid .moka-installment-shade-4 { background: rgba(0, 0, 0, 0.025); }
.moka-installment-grid .moka-installment-shade-3 { background: rgba(0, 0, 0, 0.017); }
.moka-installment-grid .moka-installment-shade-2 { background: rgba(0, 0, 0, 0.008); }

/* The accent bar marks the first rows — half of the configured maximum — so
   the eye lands on the range a customer is most likely to pick. It is
   independent of the grey ladder: a row can be accented and lightly shaded at
   the same time. */
.moka-installment-grid .moka-installment-accent .moka-installment-plan {
	box-shadow: inset 3px 0 0 rgba(0, 0, 0, 0.16);
	padding-left: 0.7em;
}

/* The table caption carries the card's accessible name; it must stay in the
   accessibility tree but out of the visual layout. Core ships a
   `.screen-reader-text` rule, but only when its own stylesheets are present,
   so the rule is repeated here scoped to the grid. */
.moka-installment-grid caption.screen-reader-text {
	position: absolute;
	left: -9999px;
}

.moka-installment-title {
	margin: 0 0 0.6em;
}

.moka-installment-empty {
	opacity: 0.75;
}

.moka-installment-note {
	margin: 0.2em 0 0;
	font-size: 0.85em;
	opacity: 0.75;
}

@media (max-width: 1000px) {
	.moka-installment-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 760px) {
	.moka-installment-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 480px) {
	.moka-installment-grid {
		grid-template-columns: 1fr;
	}
}
