/**
 * Shared MEP Widget Styles
 *
 * Common styles for MEP product widgets including table-style layouts.
 *
 * @package SmartAcre\ProductDemo
 * @since 0.3.0
 */

/* ==========================================================================
   CSS Custom Properties
   ========================================================================== */

:root {
	--mep-navy: #02244e;
	--mep-gray-bg: #f8fafc;
	--mep-white: #ffffff;
}

/* ==========================================================================
   Editor Notices
   ========================================================================== */

.sa-product-demo-notice {
    padding: 16px;
    border: 1px solid currentColor;
    border-radius: 8px;
    font-size: 14px;
}

/* ==========================================================================
   Shared Table Base Styles
   ========================================================================== */

/**
 * Base table container styles
 * Used by specs, downloads, and future table-style widgets
 */
.mep-table {
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
	font-size: 18px;
	line-height: 1.6;
	color: var(--mep-navy);
}

/**
 * Table row styles with alternating backgrounds
 */
.mep-table__row {
	display: flex;
	align-items: center;
	padding: 10px 24px;
	border-radius: 8px;
	margin-bottom: 0;
}

.mep-table__row--odd {
	background-color: var(--mep-gray-bg);
}

.mep-table__row--even {
	background-color: var(--mep-white);
}

/**
 * One column layout
 */
.mep-table--one-column .mep-table__row {
	width: 100%;
}

/**
 * Two column layout with CSS Grid
 */
.mep-table--two-columns .mep-table__columns {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
}

.mep-table--two-columns .mep-table__column {
	display: flex;
	flex-direction: column;
}

.mep-table p {
	margin-block-end: 0;
}

/* ==========================================================================
   Responsive Behavior
   ========================================================================== */

/**
 * Tablet breakpoint - collapse to single column
 */
@media (max-width: 768px) {
	.mep-table--two-columns .mep-table__columns {
		display: block;
		grid-template-columns: none;
		gap: 0;
	}

	.mep-table--two-columns .mep-table__column {
		width: 100%;
	}
}

/**
 * Mobile breakpoint - adjust padding
 */
@media (max-width: 480px) {
	.mep-table__row {
		padding: 10px 16px;
	}

	.mep-table {
		font-size: 16px;
	}
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

/**
 * Focus styles for keyboard navigation
 */
.mep-table__row:focus-within {
	outline: 2px solid var(--mep-navy);
	outline-offset: 2px;
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
	.mep-table--two-columns .mep-table__columns {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 10px;
	}

	.mep-table__row {
		padding: 8px 16px;
		page-break-inside: avoid;
	}

	.mep-table__row--odd,
	.mep-table__row--even {
		background-color: transparent;
		border: 1px solid #e0e0e0;
	}
}

/* ==========================================================================
   Legacy Styles (will be deprecated)
   ========================================================================== */

.sa-product-specs,
.sa-product-downloads {
    width: 100%;
}

.sa-product-specs__heading,
.sa-product-downloads__heading {
    margin: 0 0 1rem;
}

.sa-product-specs__table {
    margin: 0;
}

.sa-product-specs__row {
    display: grid;
    grid-template-columns: minmax(140px, 1fr) 2fr;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid currentColor;
}

.sa-product-specs__label {
    font-weight: 700;
}

.sa-product-specs__value {
    margin: 0;
}

.sa-product-specs__cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.sa-product-specs__card,
.sa-product-downloads__item {
    padding: 1rem;
    border: 1px solid currentColor;
    border-radius: 10px;
}

.sa-product-downloads__list {
    display: grid;
    gap: 0.75rem;
}

.sa-product-downloads__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    text-decoration: none;
}

.sa-product-downloads__title {
    font-weight: 700;
}

.sa-product-downloads__button {
    font-size: 0.875rem;
    text-decoration: underline;
}
