/* =============================================================
   Tayyab Organics — Product Description Tab Styles
   File: /yourtheme/assets/css/product-description.css
   Enqueued via: functions.php (is_product() check)
============================================================= */

/* ── Layout: 2-column grid ── */
.cpd-wrap {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 48px;
	align-items: start;
	padding: 40px 0 20px;
	font-family: 'DM Sans', sans-serif;
}

/* ── Left column: 2x2 image collage ── */
.cpd-images {
	/* no sticky — scrolls naturally with the page */
}

.cpd-collage {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 6px;
	border-radius: 18px;
	overflow: hidden;
}

/* Single image: full width */
.cpd-collage--single {
	grid-template-columns: 1fr;
}

/* Odd last image spans both columns */
.cpd-collage-cell:last-child:nth-child(odd) {
	grid-column: span 2;
}

.cpd-collage-cell {
	overflow: hidden;
	aspect-ratio: 1 / 1;
	background: #f5f2ed;
}

/* Round only the true outer corners of the collage */
.cpd-collage-cell:first-child        { border-radius: 12px 0 0 0; }
.cpd-collage-cell:nth-child(2)       { border-radius: 0 12px 0 0; }

/* Bottom-left: last item if even count, or second-to-last if odd */
.cpd-collage-cell:nth-last-child(2):nth-child(odd)  { border-radius: 0 0 0 12px; }
.cpd-collage-cell:nth-last-child(1):nth-child(even) { border-radius: 0 0 12px 0; }
.cpd-collage-cell:nth-last-child(2):nth-child(even) { border-radius: 0 0 0 12px; }

/* Last item bottom corners */
.cpd-collage-cell:last-child:nth-child(odd)  { border-radius: 0 0 12px 12px; } /* spans full width */
.cpd-collage-cell:last-child:nth-child(even) { border-radius: 0 0 12px 0; }

.cpd-collage-cell img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.4s ease;
}

.cpd-collage-cell:hover img {
	transform: scale(1.04);
}

/* ── Right column: description typography ── */
.cpd-content {
	color: #2a2a2a;
	font-size: 15px;
	line-height: 1.75;
}

.cpd-content h1,
.cpd-content h2 {
	font-family: 'Playfair Display', serif;
	font-weight: 800;
	color: #1a1a1a;
	margin-top: 32px;
	margin-bottom: 12px;
	line-height: 1.2;
}

.cpd-content h1 { font-size: 1.6rem; }
.cpd-content h2 { font-size: 1.35rem; }

.cpd-content h3 {
	font-size: 1.05rem;
	font-weight: 700;
	color: #1a1a1a;
	margin-top: 24px;
	margin-bottom: 8px;
}

/* Remove top margin from very first heading */
.cpd-content > *:first-child {
	margin-top: 0;
}

.cpd-content p {
	margin-bottom: 14px;
	color: #444;
}

.cpd-content strong {
	color: #1a1a1a;
	font-weight: 700;
}

.cpd-content ul,
.cpd-content ol {
	padding-left: 20px;
	margin-bottom: 16px;
}

.cpd-content li {
	margin-bottom: 6px;
	color: #444;
}

/* Green accent on li bullet */
.cpd-content ul li::marker {
	color: #1a6b2f;
}

/* ── Responsive: stack on tablet/mobile ── */
@media ( max-width: 860px ) {
	.cpd-wrap {
		grid-template-columns: 1fr;
		gap: 28px;
	}
}

@media ( max-width: 480px ) {
	.cpd-thumb {
		width: 56px;
		height: 56px;
	}
}

/* =============================================================
   FAQs Section
============================================================= */

.cpd-faqs {
	margin-top: 64px;
	max-width: 760px;
	margin-left: auto;
	margin-right: auto;
}

.cpd-faqs-header {
	text-align: center;
	margin-bottom: 32px;
}

.cpd-faqs-eyebrow {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: #888;
	margin-bottom: 8px;
}

.cpd-faqs-title {
	font-family: 'Playfair Display', serif;
	font-size: 2.2rem;
	font-weight: 800;
	color: #1a1a1a;
	margin: 0;
}

.cpd-faq-list {
	display: flex;
	flex-direction: column;
	gap: 0;
	border-top: 1px solid #e5e5e5;
}

.cpd-faq-item {
	border-bottom: 1px solid #e5e5e5;
	border-left: 3px solid transparent;
	transition: border-color 0.2s ease;
	padding-left: 12px;
}

.cpd-faq-item.open {
	border-left-color: #1a6b2f;
}

.cpd-faq-q {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	background: transparent !important;
	border: none;
	outline: none;
	box-shadow: none !important;
	padding: 18px 0;
	cursor: pointer;
	text-align: left;
	font-family: 'DM Sans', sans-serif;
	font-size: 14.5px;
	font-weight: 700;
	color: #1a1a1a;
	transition: color 0.18s;
}

.cpd-faq-q:hover  { color: #1a6b2f; background: transparent !important; }
.cpd-faq-q:focus  { background: transparent !important; outline: none; box-shadow: none; }
.cpd-faq-q:active { background: transparent !important; }

.cpd-faq-icon {
	flex-shrink: 0;
	color: #1a6b2f;
}
.cpd-faq-icon svg { width: 18px; height: 18px; display: block; }

.cpd-faq-q span:nth-child(2) { flex: 1; }

.cpd-faq-chevron {
	flex-shrink: 0;
	color: #888;
	transition: transform 0.3s ease;
}
.cpd-faq-chevron svg { width: 18px; height: 18px; display: block; }

/* Rotate chevron when open */
.cpd-faq-item.open .cpd-faq-chevron { transform: rotate(180deg); }
.cpd-faq-item.open .cpd-faq-q       { color: #1a6b2f; }

.cpd-faq-a {
	overflow: hidden;
	max-height: 0;
	transition: max-height 0.35s ease, padding 0.25s ease;
}

.cpd-faq-a[hidden] { display: block !important; max-height: 0; } /* override hidden for animation */

.cpd-faq-item.open .cpd-faq-a {
	max-height: 400px;
	padding-bottom: 16px;
}

.cpd-faq-a p {
	font-size: 14px;
	color: #555;
	line-height: 1.7;
	margin: 0;
	padding-left: 30px; /* align with question text */
}

/* =============================================================
   Recently Viewed Products
============================================================= */

.cpd-recently-viewed {
	margin-top: 64px;
	padding-top: 40px;
	border-top: 1px solid #e5e5e5;
}

.cpd-rv-title {
	font-family: 'Playfair Display', serif;
	font-size: 1.6rem;
	font-weight: 800;
	color: #1a1a1a;
	text-align: center;
	margin-bottom: 28px;
}

.cpd-rv-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: 16px;
}

.cpd-rv-card {
	text-decoration: none;
	color: inherit;
	background: #fff;
	border: 1px solid #e8e8e8;
	border-radius: 14px;
	overflow: hidden;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.cpd-rv-card:hover {
	box-shadow: 0 6px 24px rgba(0,0,0,0.09);
	transform: translateY(-3px);
}

.cpd-rv-img {
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background: #f5f2ed;
}

.cpd-rv-img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.35s ease;
}

.cpd-rv-card:hover .cpd-rv-img img { transform: scale(1.05); }

.cpd-rv-info {
	padding: 10px 12px 12px;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.cpd-rv-name {
	font-size: 12.5px;
	font-weight: 600;
	color: #1a1a1a;
	line-height: 1.35;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.cpd-rv-price {
	font-size: 13px;
	font-weight: 700;
	color: #c0392b;
}

.cpd-rv-price * { font-size: inherit !important; font-weight: inherit !important; color: inherit !important; }

@media ( max-width: 600px ) {
	.cpd-rv-grid {
		grid-template-columns: repeat(2, 1fr);
	}
	.cpd-faqs-title { font-size: 1.8rem; }
}

/* =============================================================
   Customer Reviews Section
   Scoped under .cpd-reviews-body to avoid global conflicts
============================================================= */

.cpd-reviews {
	margin-top: 64px;
	padding-top: 48px;
	border-top: 1px solid #e5e5e5;
	max-width: 860px;
	margin-left: auto;
	margin-right: auto;
}

.cpd-reviews-header {
	text-align: center;
	margin-bottom: 36px;
}

/* Inherit eyebrow + title styles from FAQ header (already defined) */

/* ── Reviews list ── */
.cpd-reviews-body #reviews {
	margin: 0;
	padding: 0;
}

.cpd-reviews-body #reviews h2,
.cpd-reviews-body #reviews h3 {
	font-family: 'DM Sans', sans-serif;
	font-size: 14px;
	font-weight: 700;
	color: #1a1a1a;
	margin-bottom: 16px;
}

.cpd-reviews-body .commentlist {
	list-style: none;
	margin: 0 0 32px;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0;
}

.cpd-reviews-body .commentlist .comment {
	padding: 20px 0;
	border-bottom: 1px solid #e5e5e5;
}

.cpd-reviews-body .commentlist .comment:first-child {
	border-top: 1px solid #e5e5e5;
}

/* Star rating row */
.cpd-reviews-body .star-rating {
	font-size: 14px;
	margin-bottom: 6px;
	color: #1a6b2f;
}

/* Reviewer name + meta */
.cpd-reviews-body .comment-author {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 8px;
}

.cpd-reviews-body .comment-author img {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	object-fit: cover;
	border: 2px solid #e5e5e5;
}

.cpd-reviews-body .comment-author .woocommerce-review__author {
	font-size: 13.5px;
	font-weight: 700;
	color: #1a6b2f;
}

.cpd-reviews-body .woocommerce-review__dash,
.cpd-reviews-body .woocommerce-review__published-date {
	font-size: 12px;
	color: #aaa;
}

/* Review text */
.cpd-reviews-body .comment-text p,
.cpd-reviews-body .description p {
	font-size: 14px;
	color: #444;
	line-height: 1.7;
	margin: 0;
}

/* Review photos (if any) */
.cpd-reviews-body .comment-text img {
	max-width: 120px;
	border-radius: 8px;
	margin-top: 10px;
}

/* ── Review form ── */
.cpd-reviews-body #review_form_wrapper {
	margin-top: 32px;
	padding-top: 28px;
	border-top: 1px solid #e5e5e5;
}

.cpd-reviews-body #review_form_wrapper h3 {
	font-family: 'Playfair Display', serif;
	font-size: 1.2rem;
	font-weight: 700;
	margin-bottom: 20px;
}

.cpd-reviews-body .comment-form label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: #333;
	margin-bottom: 5px;
}

.cpd-reviews-body .comment-form input[type="text"],
.cpd-reviews-body .comment-form input[type="email"],
.cpd-reviews-body .comment-form textarea {
	width: 100%;
	border: 1.5px solid #ddd;
	border-radius: 10px;
	padding: 10px 14px;
	font-family: 'DM Sans', sans-serif;
	font-size: 14px;
	color: #1a1a1a;
	transition: border-color 0.18s;
	background: #fff;
}

.cpd-reviews-body .comment-form input:focus,
.cpd-reviews-body .comment-form textarea:focus {
	outline: none;
	border-color: #1a6b2f;
}

.cpd-reviews-body .comment-form textarea {
	min-height: 100px;
	resize: vertical;
}

.cpd-reviews-body .comment-form-rating {
	margin-bottom: 16px;
}

.cpd-reviews-body #submit,
.cpd-reviews-body .submit {
	background: #1a6b2f;
	color: #fff;
	border: none;
	border-radius: 10px;
	padding: 12px 28px;
	font-family: 'DM Sans', sans-serif;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.18s, transform 0.12s;
}

.cpd-reviews-body #submit:hover { background: #2a8c42; transform: translateY(-1px); }

@media ( max-width: 600px ) {
	.cpd-reviews { margin-top: 48px; }
}