/**
 * Codeful Studio — WooCommerce Styles
 * @package Codeful_Studio
 */

/* Base WooCommerce reset — ensure our variables take effect */
.woocommerce,
.woocommerce-page {
	font-family: var(--cs-font-sans);
}

/* ─── Product Archive ─── */
.woocommerce ul.products {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
	gap: 2rem;
	margin: 0;
	padding: 0;
}
.woocommerce ul.products li.product {
	background: var(--cs-white);
	border: 1px solid var(--cs-gray-200);
	border-radius: var(--cs-radius-lg);
	overflow: hidden;
	transition: var(--cs-transition);
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: 0;
}
.woocommerce ul.products li.product:hover {
	border-color: var(--cs-blue);
	box-shadow: var(--cs-shadow-lg);
	transform: translateY(-3px);
}
.woocommerce ul.products li.product a img {
	border-radius: 0;
	margin-bottom: 0;
	width: 100%;
	height: 200px;
	object-fit: cover;
}
.woocommerce ul.products li.product .woocommerce-loop-product__title {
	font-size: 1.0625rem;
	font-weight: 700;
	padding: 1rem 1.25rem .5rem;
	color: var(--cs-dark);
}
.woocommerce ul.products li.product .price {
	padding: 0 1.25rem .75rem;
	font-weight: 700;
	color: var(--cs-blue);
}
.woocommerce ul.products li.product .price del {
	color: var(--cs-gray-400);
	font-weight: 400;
	font-size: .875rem;
}
.woocommerce ul.products li.product .button {
	margin: auto 1.25rem 1.25rem;
}
.woocommerce ul.products li.product .onsale {
	top: .75rem;
	right: .75rem;
	left: auto;
	border-radius: var(--cs-radius) !important;
}

/* ─── Product Sorting ─── */
.woocommerce .woocommerce-ordering select {
	border: 1px solid var(--cs-gray-300);
	border-radius: var(--cs-radius);
	padding: .5rem .875rem;
	font-size: .9rem;
}
.woocommerce .woocommerce-result-count {
	font-size: .9rem;
	color: var(--cs-gray-500);
}

/* ─── Single Product ─── */
.woocommerce div.product div.images {
	border-radius: var(--cs-radius-lg);
	overflow: hidden;
}
.woocommerce div.product .woocommerce-product-gallery__image:first-child {
	border-radius: var(--cs-radius-lg);
	overflow: hidden;
}
.woocommerce div.product p.price,
.woocommerce div.product span.price {
	font-size: 2rem;
	font-weight: 800;
	color: var(--cs-dark);
}
.woocommerce div.product p.price del,
.woocommerce div.product span.price del {
	color: var(--cs-gray-400);
	font-size: 1rem;
	font-weight: 400;
}
.woocommerce div.product p.price ins,
.woocommerce div.product span.price ins {
	color: var(--cs-blue);
	text-decoration: none;
}
.woocommerce div.product .woocommerce-tabs ul.tabs {
	padding: 0;
	border-bottom: 2px solid var(--cs-gray-200);
}
.woocommerce div.product .woocommerce-tabs ul.tabs li {
	background: none;
	border: none;
}
.woocommerce div.product .woocommerce-tabs ul.tabs li a {
	font-weight: 600;
	color: var(--cs-gray-600);
	padding: .875rem 1.25rem;
}
.woocommerce div.product .woocommerce-tabs ul.tabs li.active a {
	color: var(--cs-blue);
}
.woocommerce div.product .woocommerce-tabs ul.tabs::before { display: none; }
.woocommerce div.product .woocommerce-tabs ul.tabs li { border-bottom: 2px solid transparent; margin-bottom: -2px; }
.woocommerce div.product .woocommerce-tabs ul.tabs li.active { border-bottom-color: var(--cs-blue); }

/* ─── Input Quantity ─── */
.woocommerce .quantity .qty {
	border: 1px solid var(--cs-gray-300);
	border-radius: var(--cs-radius);
	padding: .75rem;
	font-size: .9375rem;
	width: 70px;
	text-align: center;
}

/* ─── Checkout ─── */
.woocommerce-checkout .woocommerce-billing-fields h3,
.woocommerce-checkout .woocommerce-shipping-fields h3,
.woocommerce-checkout #order_review_heading,
.woocommerce-checkout .woocommerce-additional-fields h3 {
	font-size: 1.125rem;
	padding-bottom: .75rem;
	border-bottom: 1px solid var(--cs-gray-200);
	margin-bottom: 1.5rem;
}
.woocommerce form .form-row label {
	font-size: .875rem;
	font-weight: 600;
	color: var(--cs-gray-700);
}
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row select,
.woocommerce form .form-row textarea {
	border: 1px solid var(--cs-gray-300);
	border-radius: var(--cs-radius);
	padding: .75rem 1rem;
	font-size: .9375rem;
	font-family: var(--cs-font-sans);
	transition: var(--cs-transition);
	width: 100%;
}
.woocommerce form .form-row input.input-text:focus,
.woocommerce form .form-row select:focus {
	border-color: var(--cs-blue);
	box-shadow: 0 0 0 3px rgba(27,127,225,.12);
	outline: none;
}
.woocommerce #payment {
	background: var(--cs-gray-50);
	border-radius: var(--cs-radius-lg);
	border: 1px solid var(--cs-gray-200);
}
.woocommerce #payment ul.payment_methods {
	border-bottom: 1px solid var(--cs-gray-200);
}
.woocommerce #payment ul.payment_methods li label {
	font-weight: 600;
}
.woocommerce #payment #place_order {
	background: var(--cs-blue) !important;
	border-radius: var(--cs-radius) !important;
	padding: 1rem 2rem !important;
	font-size: 1rem !important;
	font-weight: 700 !important;
	width: 100%;
	letter-spacing: .01em;
}
.woocommerce #payment #place_order:hover { background: var(--cs-blue-dark) !important; }

/* ─── Order Review Table ─── */
.woocommerce table.shop_table {
	border-radius: var(--cs-radius-lg);
	border: 1px solid var(--cs-gray-200);
	overflow: hidden;
	font-size: .9375rem;
}
.woocommerce table.shop_table th {
	background: var(--cs-gray-50);
	font-weight: 700;
	font-size: .8125rem;
	text-transform: uppercase;
	letter-spacing: .05em;
	color: var(--cs-gray-600);
	border-bottom: 2px solid var(--cs-gray-200);
}
.woocommerce table.shop_table td { border-top: 1px solid var(--cs-gray-100); }
.woocommerce table.shop_table tfoot tr:last-child td,
.woocommerce table.shop_table tfoot tr:last-child th {
	font-size: 1.0625rem;
	font-weight: 800;
	color: var(--cs-dark);
}

/* ─── My Account ─── */
.woocommerce-account .woocommerce-MyAccount-navigation {
	background: var(--cs-gray-50);
	border: 1px solid var(--cs-gray-200);
	border-radius: var(--cs-radius-lg);
	padding: 1rem;
}
.woocommerce-account .woocommerce-MyAccount-navigation ul {
	padding: 0;
}
.woocommerce-account .woocommerce-MyAccount-navigation ul li {
	margin-bottom: .25rem;
}
.woocommerce-account .woocommerce-MyAccount-navigation ul li a {
	display: block;
	padding: .625rem 1rem;
	border-radius: var(--cs-radius-sm);
	color: var(--cs-gray-700);
	font-weight: 500;
	transition: var(--cs-transition);
}
.woocommerce-account .woocommerce-MyAccount-navigation ul li a:hover,
.woocommerce-account .woocommerce-MyAccount-navigation ul li.is-active a {
	background: var(--cs-blue);
	color: var(--cs-white);
}

/* ─── Notices ─── */
.woocommerce-message { background: #f0f9ff; border-left-color: var(--cs-blue) !important; }
.woocommerce-error   { background: #fef2f2; border-left-color: var(--cs-red) !important; }
.woocommerce-info    { background: #fffbeb; border-left-color: var(--cs-orange) !important; }

/* ─── After Add to Cart Guarantees ─── */
.cs-atc-guarantees {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	margin-top: 1.25rem;
	padding-top: 1.25rem;
	border-top: 1px solid var(--cs-gray-200);
	font-size: .875rem;
	color: var(--cs-gray-600);
}
.cs-atc-guarantees span {
	display: flex;
	align-items: center;
	gap: .4rem;
}
.cs-atc-guarantees i { color: var(--cs-blue); }

/* ─── Stars ─── */
.woocommerce .star-rating {
	color: var(--cs-orange);
}
.woocommerce .star-rating::before,
.woocommerce .star-rating span::before {
	color: var(--cs-orange);
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
	.woocommerce ul.products {
		grid-template-columns: 1fr;
	}
	.woocommerce-checkout .col2-set {
		grid-template-columns: 1fr;
	}
}

/* ─── Entry content (plugin/product description) ─── */
.cs-entry-content h2,
.cs-entry-content h3,
.cs-entry-content h4 { margin: 1.5rem 0 .75rem; }
.cs-entry-content p { color: var(--cs-gray-700); margin-bottom: 1.25rem; }
.cs-entry-content ul, .cs-entry-content ol { list-style: disc; padding-left: 1.5rem; margin-bottom: 1.25rem; }
.cs-entry-content ul li, .cs-entry-content ol li { padding: .25rem 0; color: var(--cs-gray-700); }
.cs-entry-content ol { list-style: decimal; }
.cs-entry-content pre {
	background: var(--cs-gray-900);
	color: #e5e7eb;
	padding: 1.25rem 1.5rem;
	border-radius: var(--cs-radius);
	font-family: var(--cs-font-mono);
	font-size: .875rem;
	overflow-x: auto;
	margin: 1.5rem 0;
}
.cs-entry-content code {
	background: var(--cs-gray-100);
	color: var(--cs-blue);
	padding: .125rem .375rem;
	border-radius: 4px;
	font-family: var(--cs-font-mono);
	font-size: .875em;
}
.cs-entry-content pre code { background: none; color: inherit; padding: 0; }
.cs-entry-content blockquote {
	border-left: 4px solid var(--cs-blue);
	padding-left: 1.25rem;
	margin: 1.5rem 0;
	font-style: italic;
	color: var(--cs-gray-600);
}
.cs-entry-content img { border-radius: var(--cs-radius); margin: 1.5rem 0; }
.cs-entry-content table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; }
.cs-entry-content table th, .cs-entry-content table td { padding: .75rem 1rem; border: 1px solid var(--cs-gray-200); text-align: left; }
.cs-entry-content table th { background: var(--cs-gray-50); font-weight: 700; }
