/* ==========================================================================
   Woo Product Docs — Frontend Styles
   ========================================================================== */

/* ------------------------------------------------------------------
 *  Document list
 * ------------------------------------------------------------------ */

.ccdm-doc-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.ccdm-doc-list li {
	padding: 8px 0;
	border-bottom: 1px solid #eee;
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.ccdm-doc-list li:last-child {
	border-bottom: none;
}

.ccdm-doc-group {
	margin-bottom: 24px;
}

.ccdm-doc-group-title {
	font-size: 1.1em;
	margin: 0 0 8px;
	padding-bottom: 4px;
	border-bottom: 2px solid #333;
}

/* ------------------------------------------------------------------
 *  Document item (button + download)
 * ------------------------------------------------------------------ */

.ccdm-doc-item {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.ccdm-view-btn {
	background: none;
	border: 1px solid #333;
	color: #333;
	padding: 6px 14px;
	cursor: pointer;
	font-size: 0.9em;
	border-radius: 3px;
	transition: background 0.2s, color 0.2s;
}

.ccdm-view-btn:hover,
.ccdm-view-btn:focus {
	background: #333;
	color: #fff;
}

.ccdm-download-link {
	color: #666;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
}

.ccdm-download-link:hover {
	color: #333;
}

.ccdm-download-link .dashicons {
	font-size: 18px;
	width: 18px;
	height: 18px;
}

.ccdm-doc-link {
	color: #333;
	text-decoration: underline;
}

.ccdm-doc-link:hover {
	color: #000;
}

/* ------------------------------------------------------------------
 *  Modal (dialog)
 * ------------------------------------------------------------------ */

dialog.ccdm-modal {
	border: none;
	border-radius: 8px;
	padding: 0;
	max-width: 90vw;
	max-height: 90vh;
	width: 900px;
	box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
	overflow: hidden;
}

dialog.ccdm-modal::backdrop {
	background: rgba(0, 0, 0, 0.6);
}

/* Fallback for browsers without ::backdrop support */
dialog.ccdm-modal.ccdm-modal--fallback-open {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 999999;
}

.ccdm-modal-inner {
	display: flex;
	flex-direction: column;
	max-height: 90vh;
}

.ccdm-modal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 16px 20px;
	border-bottom: 1px solid #eee;
	flex-shrink: 0;
}

.ccdm-modal-title {
	margin: 0;
	font-size: 1.2em;
	font-weight: 600;
}

.ccdm-modal-close {
	background: none;
	border: none;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	color: #999;
	padding: 0 4px;
}

.ccdm-modal-close:hover {
	color: #333;
}

.ccdm-modal-body {
	padding: 20px;
	overflow: auto;
	flex: 1;
}

/* ------------------------------------------------------------------
 *  Viewer content (inside modal or embedded)
 * ------------------------------------------------------------------ */

.ccdm-viewer-iframe {
	width: 100%;
	height: 75vh;
	min-height: 400px;
	border: none;
}

.ccdm-viewer-image {
	max-width: 100%;
	height: auto;
	display: block;
	margin: 0 auto;
}

/* ------------------------------------------------------------------
 *  Embedded viewer
 * ------------------------------------------------------------------ */

.ccdm-embed-wrap {
	margin: 16px 0;
}

.ccdm-embed-title {
	margin: 0 0 8px;
	font-size: 1em;
	font-weight: 600;
}

/* ------------------------------------------------------------------
 *  Scroll lock
 * ------------------------------------------------------------------ */

body.ccdm-modal-open {
	overflow: hidden;
}

/* ------------------------------------------------------------------
 *  Responsive
 * ------------------------------------------------------------------ */

@media (max-width: 768px) {
	dialog.ccdm-modal {
		max-width: 98vw;
		width: 98vw;
	}

	.ccdm-viewer-iframe {
		height: 60vh;
		min-height: 300px;
	}

	.ccdm-modal-header {
		padding: 12px 16px;
	}

	.ccdm-modal-body {
		padding: 12px;
	}
}
