/**
 * Sefareshtala Gold Pricing — Frontend UI
 * Minimal, premium gold-themed design system
 */

/* ══════════════════════════════════════
   PRODUCT ENGLISH SUBTITLE
   ══════════════════════════════════════ */
.product_title span.sub_head,
.product_title .stgp-product-subtitle {
	display: block;
	clear: both;
	margin-top: 3px;
	font-family: sans-serif;
	font-size: 11px;
	font-weight: 400;
	letter-spacing: 1px;
	line-height: 1.4;
	color: #a9a9a9;
	text-transform: capitalize;
}

/* ── Design tokens ── */
.stgp, .stgp-table, .stgc, .jewel_price_details {
	--stg-gold: #c9a227;
	--stg-gold-light: #f5e6b8;
	--stg-gold-dark: #9a7b1a;
	--stg-navy: #1a1f3c;
	--stg-navy-mid: #272b65;
	--stg-surface: #ffffff;
	--stg-surface-2: #f7f8fc;
	--stg-border: #e8ecf4;
	--stg-text: #1e2130;
	--stg-muted: #7a8299;
	--stg-radius: 14px;
	--stg-radius-sm: 8px;
	--stg-shadow: 0 4px 24px rgba(26, 31, 60, 0.08);
	--stg-font: Tahoma, 'Segoe UI', Arial, sans-serif;
}

/* ══════════════════════════════════════
   GOLD PRICE BADGE  [gold_price]
   ══════════════════════════════════════ */
.stgp {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	background: var(--stg-surface);
	border: 1px solid var(--stg-border);
	border-radius: 50px;
	padding: 8px 16px 8px 12px;
	font-family: var(--stg-font);
	box-shadow: var(--stg-shadow);
	transition: box-shadow 0.2s;
}

.stgp:hover {
	box-shadow: 0 6px 28px rgba(201, 162, 39, 0.18);
}

.stgp__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--stg-gold-light), var(--stg-gold));
	color: var(--stg-navy);
	font-size: 13px;
	flex-shrink: 0;
}

.stgp--silver .stgp__icon {
	background: linear-gradient(135deg, #e8edf5, #b0bec5);
}

.stgp__body {
	display: flex;
	flex-direction: column;
	gap: 1px;
	line-height: 1.2;
}

.stgp__price {
	font-size: 15px;
	font-weight: 700;
	color: var(--stg-text);
}

.stgp__price .woocommerce-Price-amount {
	font-size: inherit;
	font-weight: inherit;
}

.stgp__label {
	font-size: 11px;
	color: var(--stg-muted);
}

/* ══════════════════════════════════════
   GOLD PRICES TABLE  [gold_prices]
   ══════════════════════════════════════ */
.stgp-table {
	font-family: var(--stg-font);
	background: var(--stg-surface);
	border: 1px solid var(--stg-border);
	border-radius: var(--stg-radius);
	box-shadow: var(--stg-shadow);
	overflow: hidden;
	max-width: 480px;
}

.stgp-table__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 20px;
	background: var(--stg-navy);
	color: #fff;
}

.stgp-table__title {
	font-size: 14px;
	font-weight: 600;
}

.stgp-table__live {
	display: flex;
	align-items: center;
	gap: 5px;
	font-size: 11px;
	opacity: 0.75;
}

.stgp-table__live::before {
	content: '';
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #4caf50;
	animation: stg-pulse 2s infinite;
}

@keyframes stg-pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.4; }
}

.stgp-table__grid {
	display: flex;
	flex-direction: column;
}

.stgp-table__item {
	display: grid;
	grid-template-columns: 1fr auto auto;
	align-items: center;
	gap: 8px;
	padding: 14px 20px;
	border-bottom: 1px solid var(--stg-border);
	transition: background 0.15s;
}

.stgp-table__item:last-child {
	border-bottom: none;
}

.stgp-table__item:hover {
	background: var(--stg-surface-2);
}

.stgp-table__item-label {
	font-size: 13px;
	font-weight: 500;
	color: var(--stg-text);
}

.stgp-table__item-price {
	font-size: 15px;
	font-weight: 700;
	color: var(--stg-navy-mid);
}

.stgp-table__item-price .woocommerce-Price-amount {
	font-size: inherit;
	font-weight: inherit;
}

.stgp-table__item-unit {
	font-size: 11px;
	color: var(--stg-muted);
}

.stgp-table__item--gold18 .stgp-table__item-label::before {
	content: '●';
	color: var(--stg-gold);
	margin-left: 6px;
	font-size: 10px;
}

.stgp-table__item--gold24 .stgp-table__item-label::before {
	content: '●●';
	color: var(--stg-gold-dark);
	margin-left: 6px;
	font-size: 10px;
}

.stgp-table__item--silver .stgp-table__item-label::before {
	content: '◆';
	color: #90a4ae;
	margin-left: 6px;
	font-size: 10px;
}

/* ══════════════════════════════════════
   GOLD CALCULATOR  [jewel_calculator]
   ══════════════════════════════════════ */
.stgc {
	font-family: var(--stg-font);
	background: var(--stg-surface);
	border: 1px solid var(--stg-border);
	border-radius: var(--stg-radius);
	box-shadow: var(--stg-shadow);
	width: 100%;
	max-width: 100%;
	overflow: hidden;
	direction: rtl;
}

/* Header */
.stgc__header {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 20px 24px;
	background: linear-gradient(135deg, var(--stg-navy) 0%, var(--stg-navy-mid) 100%);
	color: #fff;
}

.stgc__header-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 12px;
	background: rgba(201, 162, 39, 0.2);
	border: 1px solid rgba(201, 162, 39, 0.4);
	color: var(--stg-gold-light);
	flex-shrink: 0;
}

.stgc__title {
	margin: 0;
	font-size: 17px;
	font-weight: 700;
	line-height: 1.3;
}

.stgc__subtitle {
	margin: 3px 0 0;
	font-size: 12px;
	opacity: 0.7;
}

/* Body layout */
.stgc__body {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0;
}

@media (max-width: 640px) {
	.stgc__body {
		grid-template-columns: 1fr;
	}
}

/* Inputs panel */
.stgc__inputs {
	padding: 24px;
	border-left: 1px solid var(--stg-border);
	display: flex;
	flex-direction: column;
	gap: 16px;
}

@media (max-width: 640px) {
	.stgc__inputs {
		border-left: none;
		border-bottom: 1px solid var(--stg-border);
	}
}

.stgc__row--2col {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px;
}

@media (max-width: 480px) {
	.stgc__row--2col {
		grid-template-columns: 1fr;
	}
}

.stgc__field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.stgc__label {
	font-size: 12px;
	font-weight: 600;
	color: var(--stg-text);
	display: flex;
	align-items: center;
	gap: 5px;
}

.stgc__hint {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: var(--stg-border);
	color: var(--stg-muted);
	font-size: 10px;
	cursor: help;
	font-weight: 400;
}

.stgc__input-wrap {
	display: flex;
	align-items: center;
	background: var(--stg-surface-2);
	border: 1.5px solid var(--stg-border);
	border-radius: var(--stg-radius-sm);
	overflow: hidden;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.stgc__input-wrap:focus-within {
	border-color: var(--stg-gold);
	box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.15);
}

.stgc__input-wrap--combo .stgc__input {
	border-left: 1px solid var(--stg-border);
}

.stgc__input {
	flex: 1;
	border: none;
	background: transparent;
	padding: 11px 14px;
	font-size: 15px;
	font-weight: 600;
	color: var(--stg-text);
	font-family: var(--stg-font);
	outline: none;
	min-width: 0;
}

.stgc__input--rate {
	font-size: 14px;
	letter-spacing: 0.02em;
}

.stgc__unit {
	padding: 0 12px;
	font-size: 11px;
	font-weight: 500;
	color: var(--stg-muted);
	white-space: nowrap;
	background: var(--stg-border);
	align-self: stretch;
	display: flex;
	align-items: center;
}

.stgc__select-inline {
	border: none;
	background: var(--stg-border);
	padding: 0 10px;
	font-size: 11px;
	font-family: var(--stg-font);
	color: var(--stg-text);
	cursor: pointer;
	outline: none;
	align-self: stretch;
}

/* Carat tabs */
.stgc__carat-tabs {
	display: flex;
	gap: 6px;
}

.stgc__carat-btn {
	flex: 1;
	padding: 10px 6px;
	border: 1.5px solid var(--stg-border);
	border-radius: var(--stg-radius-sm);
	background: var(--stg-surface-2);
	font-size: 13px;
	font-weight: 600;
	font-family: var(--stg-font);
	color: var(--stg-muted);
	cursor: pointer;
	transition: all 0.15s;
}

.stgc__carat-btn:hover {
	border-color: var(--stg-gold);
	color: var(--stg-gold-dark);
}

.stgc__carat-btn.is-active {
	background: linear-gradient(135deg, var(--stg-gold-light), var(--stg-gold));
	border-color: var(--stg-gold);
	color: var(--stg-navy);
	box-shadow: 0 2px 8px rgba(201, 162, 39, 0.3);
}

/* Results panel */
.stgc__results {
	padding: 24px;
	display: flex;
	flex-direction: column;
	gap: 16px;
	background: var(--stg-surface-2);
}

.stgc__total-card {
	background: linear-gradient(135deg, var(--stg-navy) 0%, var(--stg-navy-mid) 100%);
	border-radius: var(--stg-radius-sm);
	padding: 18px 20px;
	text-align: center;
	color: #fff;
}

.stgc__total-label {
	display: block;
	font-size: 12px;
	opacity: 0.75;
	margin-bottom: 6px;
}

.stgc__total-value {
	display: block;
	font-size: 26px;
	font-weight: 800;
	color: var(--stg-gold-light);
	letter-spacing: -0.02em;
	line-height: 1.2;
	transition: transform 0.15s;
}

.stgc__total-value.is-updated {
	animation: stg-flash 0.3s ease;
}

@keyframes stg-flash {
	0% { transform: scale(1); }
	50% { transform: scale(1.04); }
	100% { transform: scale(1); }
}

.stgc__total-formula {
	display: block;
	font-size: 10px;
	opacity: 0.55;
	margin-top: 6px;
}

/* Breakdown lines */
.stgc__breakdown {
	display: flex;
	flex-direction: column;
	gap: 0;
}

.stgc__line {
	padding: 12px 0;
	border-bottom: 1px solid var(--stg-border);
}

.stgc__line:last-child {
	border-bottom: none;
	padding-bottom: 0;
}

.stgc__line-head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 3px;
}

.stgc__line-label {
	font-size: 12px;
	font-weight: 500;
	color: var(--stg-text);
}

.stgc__line-value {
	font-size: 13px;
	font-weight: 700;
	color: var(--stg-navy-mid);
}

.stgc__line-formula {
	font-size: 10px;
	color: var(--stg-muted);
	display: block;
}

/* ══════════════════════════════════════
   PRODUCT PAGE — price details
   ══════════════════════════════════════ */
.jewel_price_details {
	margin: 12px 0;
	font-size: 13px;
	font-family: var(--stg-font);
	line-height: 1.8;
	color: var(--stg-muted);
	background: var(--stg-surface-2);
	border-radius: var(--stg-radius-sm);
	padding: 10px 14px;
	border: 1px solid var(--stg-border);
}

.jewel_price_breakdown {
	line-height: 1.9;
}

span.jewel_dtprice_btn {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	cursor: pointer;
	font-size: 12px;
	font-family: var(--stg-font);
	color: var(--stg-navy-mid);
	border: 1px solid var(--stg-border);
	border-radius: 50px;
	padding: 5px 14px;
	margin-top: 8px;
	transition: all 0.2s;
	background: var(--stg-surface);
}

span.jewel_dtprice_btn:hover {
	background: var(--stg-navy-mid);
	color: #fff;
	border-color: var(--stg-navy-mid);
}

/* Modal */
#jewel_price_detail {
	min-height: 120px;
	padding-top: 40px;
}

#jewel_price_detail .ajax-loader {
	border-radius: var(--stg-radius-sm);
	min-height: 80px;
	background: var(--stg-surface-2) url('../images/loading-oval.svg') no-repeat center center;
}

/* Legacy class compat */
.current_gold_rate {
	font-size: 13px;
	font-family: var(--stg-font);
	display: inline-block;
}

/* Invoice / misc */
.st-invoice-actions { margin-top: 12px; }
.st-invoice-actions .button { margin-left: 6px; font-size: 12px; }
.st-barcode { max-width: 100%; height: auto; vertical-align: middle; }

.woocommerce-cart .row .button.preinvoice_btn {
	margin-bottom: 10px;
	display: block;
	text-align: center;
	background: white;
	color: #444;
	font-size: 12px;
	font-weight: 500;
	border: 1px solid #e4e4e4;
	border-radius: var(--stg-radius-sm);
	padding: 10px;
}

.woocommerce-cart .row .button.preinvoice_btn:hover {
	background: var(--stg-surface-2);
}
