/**
 * Sevi Product Showcase — Frontend Styles
 * Loaded only on single product pages.
 *
 * Kolay özelleştirme için tweakable değerler her bölümün başında
 * yorum satırı olarak listelenmiştir.
 */

/* =============================================================================
   1. ÜRÜN META BLOĞU
   Referans Kodu ve Barkod — fiyatın altında, kısa açıklamanın hemen üstünde.

   Tweakable değerler:
   ─ Etiket rengi      → .sevi-product-meta__label  { color }
   ─ Değer rengi       → .sevi-product-meta__value   { color }
   ─ Yazı boyutu       → .sevi-product-meta__row     { font-size }
   ─ Satır arası boşluk→ .sevi-product-meta           { gap }
   ─ Blok altı boşluk  → .sevi-product-meta           { margin-bottom }
   ─ Ayırıcı rengi     → .sevi-product-meta           { border-bottom-color }
   ============================================================================= */

.sevi-product-meta {
	display: flex;
	flex-direction: column;
	gap: 5px;
	margin-bottom: 18px;
	padding-bottom: 14px;
	border-bottom: 1px solid rgba( 0, 0, 0, 0.07 );
}

.sevi-product-meta__row {
	display: flex;
	align-items: baseline;
	gap: 8px;
	font-size: 0.8125em;   /* ~13px — ürün meta detayları için doğru hiyerarşi */
	line-height: 1.6;
}

.sevi-product-meta__label {
	color: #999;
	font-weight: 500;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	font-size: 0.9em;      /* row font-size'ına göreli — yaklaşık 11.7px */
	white-space: nowrap;
	flex-shrink: 0;
}

.sevi-product-meta__value {
	color: #444;
	font-weight: 500;
	letter-spacing: 0.01em;
	word-break: break-word;
}

/* =============================================================================
   2. ÜRÜN BELGELERİ ACCORDION
   Kısa açıklamanın hemen altında listelenen PDF belgeler.

   Tweakable değerler:
   ─ Toggle arka plan (hover) → .sevi-product-documents__toggle:hover { background }
   ─ Toggle border rengi      → .sevi-product-documents__toggle        { border-color }
   ─ Toggle yazı boyutu       → .sevi-product-documents__toggle        { font-size }
   ─ Chevron rengi            → .sevi-product-documents__icon           { border-color — currentColor miras alır }
   ─ Link rengi               → .sevi-product-documents__item a         { color }
   ─ Liste girintisi          → .sevi-product-documents__list           { padding-left }
   ─ Öğe yüksekliği           → .sevi-product-documents__item           { padding }
   ============================================================================= */

.sevi-product-documents {
	margin-top: 24px;
}

/* --- Toggle butonu --------------------------------------------------------- */

.sevi-product-documents__toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: 11px 14px;
	background: rgba( 0, 0, 0, 0.025 );
	border: 1px solid rgba( 0, 0, 0, 0.09 );
	border-radius: 4px;
	cursor: pointer;
	font-size: 0.875em;
	font-weight: 600;
	letter-spacing: 0.01em;
	color: inherit;
	text-align: left;
	line-height: 1.4;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.sevi-product-documents__toggle:hover {
	background: rgba( 0, 0, 0, 0.05 );
	border-color: rgba( 0, 0, 0, 0.15 );
}

.sevi-product-documents__toggle:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* Açık durum: toggle hafif vurgu */
.sevi-product-documents__toggle[aria-expanded="true"] {
	background: rgba( 0, 0, 0, 0.04 );
	border-bottom-left-radius: 0;
	border-bottom-right-radius: 0;
	border-bottom-color: transparent;
}

/* --- Chevron ikonu --------------------------------------------------------- */

.sevi-product-documents__icon {
	display: inline-block;
	width: 6px;
	height: 6px;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: rotate( 45deg ) translateY( -2px );
	transition: transform 0.2s ease;
	flex-shrink: 0;
	margin-left: 10px;
	opacity: 0.6;
}

.sevi-product-documents__toggle[aria-expanded="true"] .sevi-product-documents__icon {
	transform: rotate( -135deg ) translateY( -2px );
	opacity: 0.8;
}

/* --- Panel ----------------------------------------------------------------- */

/* İki katmanlı gizleme — visibility logic'e dokunma */
.sevi-product-documents__panel,
.sevi-product-documents__panel[hidden] {
	display: none !important;
}

.sevi-product-documents__panel.sevi-panel--open {
	display: block !important;
	padding: 0;
	border: 1px solid rgba( 0, 0, 0, 0.09 );
	border-top: none;
	border-radius: 0 0 4px 4px;
}

/* --- Belge listesi --------------------------------------------------------- */

.sevi-product-documents__list {
	list-style: none;
	margin: 0;
	padding: 4px 0;
}

.sevi-product-documents__item {
	margin: 0;
	padding: 0;
}

.sevi-product-documents__item + .sevi-product-documents__item {
	border-top: 1px solid rgba( 0, 0, 0, 0.05 );
}

/* --- PDF linki ------------------------------------------------------------ */

.sevi-product-documents__item a {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 14px;
	font-size: 0.875em;
	color: inherit;
	text-decoration: none;
	transition: background 0.12s ease;
}

.sevi-product-documents__item a:hover {
	background: rgba( 0, 0, 0, 0.03 );
	text-decoration: none;
}

.sevi-product-documents__item a:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: -2px;
}

/* PDF dosya ikonu — temiz, tek renkli SVG */
.sevi-product-documents__item a::before {
	content: '';
	display: block;
	width: 15px;
	height: 18px;
	flex-shrink: 0;
	opacity: 0.45;
	background-repeat: no-repeat;
	background-size: contain;
	background-position: center;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 15 18' fill='none'%3E%3Cpath d='M2 1h8l4 4v12H2V1z' stroke='%23000' stroke-width='1.25' stroke-linejoin='round'/%3E%3Cpath d='M10 1v4h4' stroke='%23000' stroke-width='1.25' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M5 10h5M5 13h3' stroke='%23000' stroke-width='1' stroke-linecap='round'/%3E%3C/svg%3E");
	transition: opacity 0.12s ease;
}

.sevi-product-documents__item a:hover::before {
	opacity: 0.7;
}

/* Link metni */
.sevi-product-documents__item a span,
.sevi-product-documents__item a {
	color: inherit;
}

/* =============================================================================
   3. PDF MODAL
   Görünürlük logic (!important) — dokunma.
   Sadece görsel tweaklar burada yapılabilir.

   Tweakable değerler:
   ─ Overlay saydamlığı   → .sevi-pdf-modal__overlay  { background }
   ─ Dialog max genişlik  → .sevi-pdf-modal__dialog    { max-width }
   ─ iframe yüksekliği   → .sevi-pdf-modal__iframe    { height }
   ============================================================================= */

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

.sevi-pdf-modal {
	display: none !important;
	position: fixed;
	inset: 0;
	z-index: 99999;
	align-items: center;
	justify-content: center;
	padding: 16px;
	box-sizing: border-box;
}

.sevi-pdf-modal.sevi-pdf-modal--open {
	display: flex !important;
}

.sevi-pdf-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba( 0, 0, 0, 0.6 );
	cursor: pointer;
}

.sevi-pdf-modal__dialog {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 900px;
	max-height: calc( 100vh - 32px );
	background: #fff;
	border-radius: 6px;
	box-shadow: 0 12px 48px rgba( 0, 0, 0, 0.28 );
	overflow: hidden;
}

.sevi-pdf-modal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 16px;
	border-bottom: 1px solid rgba( 0, 0, 0, 0.08 );
	flex-shrink: 0;
}

.sevi-pdf-modal__title {
	font-size: 0.9375em;
	font-weight: 600;
	color: #333;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	flex: 1;
}

.sevi-pdf-modal__actions {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-shrink: 0;
}

.sevi-pdf-modal__newtab {
	font-size: 0.8125em;
	color: #777;
	text-decoration: underline;
	white-space: nowrap;
}

.sevi-pdf-modal__newtab:hover {
	color: #222;
}

.sevi-pdf-modal__close {
	background: none;
	border: none;
	padding: 4px 8px;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	color: #888;
	border-radius: 3px;
	transition: color 0.12s ease, background 0.12s ease;
}

.sevi-pdf-modal__close:hover {
	color: #222;
	background: rgba( 0, 0, 0, 0.05 );
}

.sevi-pdf-modal__close:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.sevi-pdf-modal__body {
	flex: 1;
	overflow: hidden;
	min-height: 0;
}

.sevi-pdf-modal__iframe {
	display: block;
	width: 100%;
	height: 80vh;
	max-height: calc( 100vh - 120px );
	border: none;
}

/* Mobil */
@media ( max-width: 600px ) {
	.sevi-pdf-modal {
		padding: 0;
		align-items: flex-end;
	}

	.sevi-pdf-modal__dialog {
		max-width: 100%;
		max-height: 95vh;
		border-radius: 8px 8px 0 0;
	}

	.sevi-pdf-modal__iframe {
		height: calc( 95vh - 60px );
	}
}

/* =============================================================================
   4. HARİCİ SATIN ALMA BUTONU
   ============================================================================= */

/*
 * Tweakable değerler:
 *   margin-top: butonun üst boşluğu
 *
 * .button.alt sınıfı Woodmart'ın birincil buton stilini kullanır;
 * tema değiştirilirse bu sınıf güncellenebilir.
 */

.sevi-purchase-button {
	margin-top: 1em;
}

.sevi-purchase-button__link.button {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
}

.sevi-purchase-button__icon {
	flex-shrink: 0;
	vertical-align: middle;
}
