/* ==========================================================================
   Al Fardan Jewellers – Products & Price Calculator page (products.php)
   Uses the site palette: #c6a12f gold, #7f174b plum, Cormorant Garamond + Lato
   ========================================================================== */

.page-products .afp-section-head { text-align: center; margin-bottom: 40px; }
.page-products .afp-eyebrow {
	display: inline-block;
	color: #7f174b;
	text-transform: uppercase;
	letter-spacing: 2px;
	font-size: 13px;
	margin-bottom: 8px;
}
.page-products .afp-section-title {
	font-family: "Cormorant Garamond", serif;
	font-size: 40px;
	font-weight: 600;
	color: #000;
	margin: 0;
	line-height: 1.2;
}
.page-products .afp-section-title:after {
	content: "";
	display: block;
	width: 60px;
	height: 2px;
	background: #c6a12f;
	margin: 18px auto 0;
}
.page-products .afp-lead { color: #868686; margin: 16px auto 0; max-width: 620px; }
.page-products .afp-updated { color: #868686; font-size: 14px; margin: 14px 0 0; }
.page-products .afp-empty { text-align: center; color: #868686; padding: 30px 0; margin: 0; }
.page-products .afp-empty a { color: #7f174b; }

/* ---------- Rates ---------- */
.afp-rates-section { padding-top: 70px; }
.afp-rates { margin-bottom: 0 !important; justify-content: center; }
.afp-rates .afj-highlight { max-width: 280px; }
.afp-rates .afp-unit { display: block; font-size: 13px; color: #868686; margin-top: 4px; }

/* ---------- Filters ---------- */
.afp-filters {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
	margin-bottom: 40px;
}
.afp-filter {
	background: transparent;
	border: 1px solid #e5e5e5;
	color: #000;
	font-size: 13px;
	letter-spacing: 1.5px;
	text-transform: uppercase;
	padding: 10px 22px;
	cursor: pointer;
	transition: all .25s ease;
}
.afp-filter:hover { border-color: #c6a12f; color: #c6a12f; }
.afp-filter.is-active { background: #c6a12f; border-color: #c6a12f; color: #fff; }
.afp-filter:focus-visible { outline: 2px solid #7f174b; outline-offset: 2px; }

/* ---------- Product grid ---------- */
.afp-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 30px;
}
.afp-card[hidden] { display: none; }
.afp-card-link {
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	background: #fff;
	text-align: center;
	cursor: pointer;
	font: inherit;
	color: inherit;
}
.afp-card-link:focus-visible { outline: 2px solid #c6a12f; outline-offset: 4px; }
.afp-card-img { position: relative; overflow: hidden; background: #f5f5f5; aspect-ratio: 1 / 1; }
.afp-card-img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .6s ease;
}
.afp-card-link:hover .afp-card-img img { transform: scale(1.06); }
.afp-badge {
	position: absolute;
	top: 12px;
	left: 12px;
	background: #7f174b;
	color: #fff;
	font-size: 11px;
	letter-spacing: 1px;
	text-transform: uppercase;
	padding: 4px 10px;
}
.afp-card-body { padding: 18px 10px 6px; }
.afp-card-cat {
	display: block;
	font-size: 12px;
	letter-spacing: 1.5px;
	text-transform: uppercase;
	color: #868686;
	margin-bottom: 4px;
}
.afp-card-title {
	font-family: "Cormorant Garamond", serif;
	font-size: 22px;
	font-weight: 600;
	color: #000;
	margin: 0 0 6px;
	line-height: 1.25;
}
.afp-card-meta { font-size: 13px; color: #868686; margin-bottom: 8px; }
.afp-card-price { font-size: 18px; color: #7f174b; font-weight: 700; }
.afp-approx { font-size: 12px; font-weight: 400; color: #868686; margin-right: 4px; }
.afp-on-request { font-size: 14px; font-weight: 400; color: #c6a12f; letter-spacing: .5px; }
.afp-card-more {
	display: inline-block;
	margin-top: 10px;
	font-size: 12px;
	letter-spacing: 1.5px;
	text-transform: uppercase;
	color: #000;
	border-bottom: 1px solid #c6a12f;
	padding-bottom: 2px;
	transition: color .25s ease;
}
.afp-card-link:hover .afp-card-more { color: #c6a12f; }

/* ---------- Calculator ---------- */
.afp-calc {
	border: 1px solid #e5e5e5;
	background: #fff;
	padding: 50px;
	position: relative;
}
.afp-calc:before {
	content: "";
	position: absolute;
	top: -1px; left: -1px; right: -1px;
	height: 3px;
	background: #c6a12f;
}
.afp-calc-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 50px;
	align-items: start;
}
.afp-calc-form { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 24px; }
.afp-field label {
	display: block;
	font-size: 12px;
	letter-spacing: 1.2px;
	text-transform: uppercase;
	color: #000;
	margin-bottom: 8px;
}
.afp-field label small { text-transform: none; letter-spacing: 0; color: #a9a8a8; font-size: 12px; }
.afp-field input,
.afp-field select {
	width: 100%;
	height: 48px;
	border: 1px solid #e5e5e5;
	background: #fff;
	padding: 0 14px;
	font-size: 15px;
	color: #000;
	border-radius: 0;
	-webkit-appearance: none;
	appearance: none;
}
.afp-field select {
	background-image: linear-gradient(45deg, transparent 50%, #868686 50%), linear-gradient(135deg, #868686 50%, transparent 50%);
	background-position: calc(100% - 20px) 21px, calc(100% - 15px) 21px;
	background-size: 5px 5px;
	background-repeat: no-repeat;
	padding-right: 36px;
}
.afp-field input:focus,
.afp-field select:focus { border-color: #c6a12f; outline: none; box-shadow: 0 0 0 2px rgba(198,161,47,.15); }

.afp-calc-result { background: #fcfbfe; border-top: 2px solid #c6a12f; padding: 26px 28px; }
.afp-breakdown { width: 100%; border-collapse: collapse; margin: 0; border: 0 !important; background: transparent; }
.afp-breakdown th,
.afp-breakdown td { padding: 9px 0 !important; border: 0 !important; border-bottom: 1px dashed #e5e5e5 !important; font-size: 15px; background: transparent !important; vertical-align: middle; }
.afp-breakdown th { font-weight: 400; color: #868686; text-align: left; }
.afp-breakdown td { text-align: right; color: #000; }
.afp-total {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin-top: 18px;
	gap: 10px;
}
.afp-total span { font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; color: #000; }
.afp-total strong {
	font-family: "Cormorant Garamond", serif;
	font-size: 38px;
	font-weight: 700;
	color: #7f174b;
	line-height: 1;
}
.afp-disclaimer { font-size: 13px; color: #868686; margin: 30px 0 0; text-align: center; font-style: italic; }

/* ---------- Product popup ---------- */
.afp-modal[hidden] { display: none; }
.afp-modal { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.afp-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.6); }
.afp-modal-dialog {
	position: relative;
	background: #fff;
	width: 100%;
	max-width: 960px;
	max-height: calc(100vh - 40px);
	overflow-y: auto;
	animation: afpIn .25s ease;
}
@keyframes afpIn { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: none; } }
.afp-modal-close {
	position: absolute;
	top: 8px;
	right: 12px;
	z-index: 2;
	border: 0;
	background: rgba(255,255,255,.9);
	font-size: 32px;
	line-height: 1;
	width: 40px;
	height: 40px;
	cursor: pointer;
	color: #000;
}
.afp-modal-close:hover { color: #c6a12f; }
.afp-modal-grid { display: grid; grid-template-columns: 1fr 1fr; }
.afp-modal-img { background: #f5f5f5; }
.afp-modal-img img { width: 100%; height: 100%; object-fit: cover; display: block; aspect-ratio: 1 / 1; }
.afp-modal-info { padding: 40px 36px; }
.afp-modal-info h3 {
	font-family: "Cormorant Garamond", serif;
	font-size: 32px;
	font-weight: 600;
	margin: 0 0 10px;
	line-height: 1.2;
}
.afp-m-price { font-size: 24px; color: #7f174b; font-weight: 700; margin-bottom: 16px; }
.afp-m-price .afp-approx { font-size: 13px; }
.afp-m-desc { color: #555; margin-bottom: 18px; white-space: pre-line; }
.afp-m-desc:empty { display: none; }
.afp-m-specs { margin-bottom: 24px; }
.afp-m-specs th, .afp-m-specs td { font-size: 14px; }
.afp-m-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.afp-m-actions .button {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 22px;
	font-size: 13px;
	letter-spacing: 1.5px;
	text-transform: uppercase;
	line-height: 1.4;
}
.afp-btn-gold { background: #c6a12f; color: #fff !important; border: 1px solid #c6a12f; }
.afp-btn-gold:hover { background: #7f174b; border-color: #7f174b; }
.afp-btn-outline { background: #fff; color: #000; border: 1px solid #000; }
.afp-btn-outline:hover { background: #000; color: #fff; }
button.afp-btn-outline { cursor: pointer; font-family: inherit; }
.afp-m-note { font-size: 12px; color: #a9a8a8; margin: 16px 0 0; font-style: italic; }
.afp-m-note:empty { display: none; }
body.afp-modal-open { overflow: hidden; }

/* ---------- Responsive ---------- */
@media (max-width: 1199px) {
	.afp-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 991px) {
	.afp-calc { padding: 35px 25px; }
	.afp-calc-grid { grid-template-columns: 1fr; gap: 30px; }
	.afp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
	.afp-modal-grid { grid-template-columns: 1fr; }
	.afp-modal-img img { max-height: 420px; }
	.afp-modal-info { padding: 28px 24px; }
}
@media (max-width: 767px) {
	.page-products .afp-section-title { font-size: 30px; }
	.afp-rates-section { padding-top: 45px; }
	.afp-calc { padding: 28px 18px; }
	.afp-calc-form { grid-template-columns: 1fr; }
	.afp-grid { gap: 18px 14px; }
	.afp-card-title { font-size: 19px; }
	.afp-card-price { font-size: 16px; }
	.afp-filter { padding: 8px 14px; font-size: 12px; }
	.afp-total strong { font-size: 32px; }
	.afp-modal { padding: 0; align-items: flex-end; }
	.afp-modal-dialog { max-height: 92vh; }
}
@media (max-width: 380px) {
	.afp-grid { grid-template-columns: 1fr; }
}

/* v3: unit selector, conversion hint, subtotal row */
.afp-unit-input { display: flex; }
.afp-unit-input input { flex: 1; min-width: 0; }
.afp-unit-input select { width: auto !important; flex: 0 0 auto; border-left: 0 !important; background-color: #fcfbfe !important; }
.afp-conv { display: block; color: #7f174b; font-size: 12px; margin-top: 6px; min-height: 14px; }
.afp-breakdown tr.afp-sub th, .afp-breakdown tr.afp-sub td { color: #000 !important; font-weight: 700; border-bottom-style: solid !important; }
