/* CND Price Table – Frontend Styles */

/* ── Wrapper ─────────────────────────────────────────────────────────────── */

.cnd-price-table-wrap {
	margin: 1.5em 0;
}

/* ── Tabbed layout ───────────────────────────────────────────────────────── */

.cnd-pt-tabs-layout {
	display: flex;
	align-items: flex-start;
	gap: 0;
	border: 1px solid #dee2e6;
	border-radius: 6px;
	overflow: hidden;
	box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

/* Left tab column */
.cnd-pt-tab-list {
	display: flex;
	flex-direction: column;
	flex-shrink: 0;
	min-width: 130px;
	max-width: 200px;
	background: #f1f3f5;
	border-right: 2px solid #dee2e6;
}

.cnd-pt-tab {
	display: block;
	width: 100%;
	padding: 13px 16px;
	background: transparent;
	border: none;
	border-bottom: 1px solid #dee2e6;
	cursor: pointer;
	text-align: left;
	font-size: 14px;
	font-weight: 500;
	color: #495057;
	line-height: 1.4;
	transition: background .12s, color .12s;
}

.cnd-pt-tab:last-child {
	border-bottom: none;
}

.cnd-pt-tab:hover {
	background: #e2e6ea;
	color: #212529;
}

.cnd-pt-tab.cnd-pt-tab-active {
	background: #2c3e50;
	color: #fff;
	font-weight: 600;
}

.cnd-pt-tab.cnd-pt-tab-active:hover {
	background: #34495e;
}

/* Table panel */
.cnd-pt-table-container {
	flex: 1;
	min-width: 0; /* allow flex child to shrink */
}

/* ── Table scroll wrapper ────────────────────────────────────────────────── */

.cnd-pt-table-scroll {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

/* ── Table ───────────────────────────────────────────────────────────────── */

.cnd-price-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 15px;
	line-height: 1.5;
	background: #fff;
}

/* Non-tabbed wrapper gets its own border/shadow */
.cnd-price-table-wrap:not(.cnd-pt-has-groups) .cnd-pt-table-scroll {
	border: 1px solid #dee2e6;
	border-radius: 6px;
	overflow: hidden;
	box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

/* ── Header ──────────────────────────────────────────────────────────────── */

.cnd-price-table thead th {
	background-color: #2c3e50;
	color: #fff;
	font-weight: 600;
	text-align: center;
	padding: 13px 18px;
	font-size: 14px;
	letter-spacing: .03em;
	white-space: nowrap;
}

.cnd-price-table thead th.cnd-pt-size-col {
	text-align: left;
}

/* ── Body rows ───────────────────────────────────────────────────────────── */

.cnd-price-table tbody tr {
	border-bottom: 1px solid #e9ecef;
	transition: background .12s;
}

.cnd-price-table tbody tr:last-child {
	border-bottom: none;
}

/* Non-tabbed tables: nth-child works fine because all rows are visible. */
.cnd-price-table tbody tr:nth-child(even) {
	background-color: #f8f9fa;
}

/* Tabbed tables: nth-child counts hidden rows too, breaking the pattern.
   Disable it here and let JS apply .cnd-pt-row-alt to the visible rows. */
.cnd-pt-has-groups .cnd-price-table tbody tr:nth-child(even) {
	background-color: transparent;
}
.cnd-pt-has-groups .cnd-price-table tbody tr.cnd-pt-row-alt {
	background-color: #f8f9fa;
}

.cnd-price-table tbody tr:hover {
	/*background-color: #edf2fb;*/
}

/* ── Tabbed row visibility ───────────────────────────────────────────────── */

/* When groups are active, all rows are hidden by default. */
.cnd-pt-has-groups .cnd-price-table tbody tr {
	display: none;
}

/* Only the active group's rows are visible. */
.cnd-pt-has-groups .cnd-price-table tbody tr.cnd-pt-row-active {
	display: table-row;
}

/* ── Size cell ───────────────────────────────────────────────────────────── */

.cnd-price-table .cnd-pt-size-cell {
	background-color: #f8f9fa;
	font-weight: 600;
	color: #2c3e50;
	padding: 12px 18px;
	white-space: nowrap;
	border-right: 2px solid #dee2e6;
}

/* ── Price cell ──────────────────────────────────────────────────────────── */

.cnd-price-table .cnd-pt-price-cell {
	text-align: center;
	padding: 12px 18px;
	white-space: nowrap;
}

/* Original price with strikethrough */
.cnd-pt-original {
	margin-right: 5px;
}

.cnd-pt-original del,
.cnd-pt-original del .woocommerce-Price-amount {
	color: #9b9b9b;
	font-size: .9em;
	text-decoration: line-through;
}

/* Discounted price */
.cnd-pt-discounted {
	font-weight: 700;
	color: #27ae60;
}

.cnd-pt-discounted .woocommerce-Price-amount {
	color: inherit;
}

.cnd-pt-unavailable {
	color: #ccc;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
	.cnd-pt-tabs-layout {
		flex-direction: column;
	}

	.cnd-pt-tab-list {
		flex-direction: row;
		flex-wrap: wrap;
		max-width: 100%;
		border-right: none;
		border-bottom: 2px solid #dee2e6;
	}

	.cnd-pt-tab {
		flex: 1 1 auto;
		border-bottom: none;
		border-right: 1px solid #dee2e6;
		text-align: center;
		padding: 10px 12px;
	}

	.cnd-pt-tab:last-child {
		border-right: none;
	}

	.cnd-price-table {
		font-size: 13px;
	}

	.cnd-price-table thead th,
	.cnd-price-table .cnd-pt-size-cell,
	.cnd-price-table .cnd-pt-price-cell {
		padding: 10px 10px;
	}
}

/* ── Elementor editor placeholder ────────────────────────────────────────── */

.cnd-pt-elementor-placeholder {
	padding: 24px;
	background: #f0f4ff;
	border: 2px dashed #7b8cde;
	border-radius: 6px;
	text-align: center;
	color: #555;
	font-size: 14px;
}
