/* =============================================================================
   W3Circuit Store Offers — Frontend Styles v1.2
   ============================================================================= */

/* ── Box Sizing Reset ─────────────────────────────────────────────────────── */
.w3cso-wrap *, .w3cso-wrap *::before, .w3cso-wrap *::after { box-sizing: border-box; }

/* ── Wrapper ──────────────────────────────────────────────────────────────── */
.w3cso-wrap            { width: 100%; }
.w3cso-single-wrap,
.w3cso-archive-wrap    { padding: 1rem 0 2rem; }

/* =============================================================================
   ARCHIVE PAGE
   ============================================================================= */

/* ── Archive Header ───────────────────────────────────────────────────────── */
.w3cso-archive-header { margin-bottom: 1.8rem; }

.w3cso-archive-header-inner {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 1rem;
}

.w3cso-archive-title {
	font-size: 1.9rem;
	font-weight: 800;
	margin: 0 0 .35rem;
	color: #1e293b;
	line-height: 1.2;
}

.w3cso-archive-desc { color: #64748b; font-size: .95rem; margin: 0; }

.w3cso-archive-count {
	background: #f1f5f9;
	color: #475569;
	font-size: .82rem;
	font-weight: 700;
	padding: 6px 14px;
	border-radius: 999px;
	white-space: nowrap;
	align-self: center;
}

/* ── Filter Bar ───────────────────────────────────────────────────────────── */
.w3cso-filter-bar {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
	margin-bottom: 1.8rem;
}

.w3cso-filter-btn {
	padding: 7px 18px;
	border-radius: 999px;
	border: 1.5px solid #e2e8f0;
	background: #fff;
	color: #475569;
	text-decoration: none;
	font-size: .83rem;
	font-weight: 600;
	transition: all .18s ease;
	cursor: pointer;
	line-height: 1;
}

.w3cso-filter-btn:hover {
	border-color: #2563eb;
	color: #2563eb;
	background: #eff6ff;
}

.w3cso-filter-btn.w3cso-filter-active {
	background: #2563eb;
	color: #fff;
	border-color: #2563eb;
	box-shadow: 0 2px 8px rgba(37,99,235,.3);
}

/* ── Offer Grid ───────────────────────────────────────────────────────────── */
.w3cso-grid { display: grid; gap: 1.5rem; }
.w3cso-cols-1 { grid-template-columns: 1fr; }
.w3cso-cols-2 { grid-template-columns: repeat(2, 1fr); }
.w3cso-cols-3 { grid-template-columns: repeat(3, 1fr); }
.w3cso-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
	.w3cso-cols-3, .w3cso-cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
	.w3cso-cols-2, .w3cso-cols-3, .w3cso-cols-4 { grid-template-columns: 1fr; }
}

/* ── Archive Card ─────────────────────────────────────────────────────────── */
.w3cso-card {
	position: relative;
	border-radius: 14px;
	overflow: hidden;
	background: #fff;
	border: 1px solid #e8edf3;
	box-shadow: 0 2px 8px rgba(0,0,0,.05);
	transition: box-shadow .22s ease, transform .22s ease;
	display: flex;
	flex-direction: column;
}

.w3cso-card:hover {
	box-shadow: 0 8px 30px rgba(0,0,0,.12);
	transform: translateY(-3px);
}

/* Thumb */
.w3cso-thumb { position: relative; overflow: hidden; flex-shrink: 0; }
.w3cso-thumb img { width: 100%; height: 210px; object-fit: cover; display: block; transition: transform .35s ease; }
.w3cso-card:hover .w3cso-thumb img { transform: scale(1.05); }

/* Discount ribbon on image */
.w3cso-discount-ribbon {
	position: absolute;
	top: 14px; right: 0;
	background: #ef4444;
	color: #fff;
	font-size: .72rem;
	font-weight: 800;
	padding: 5px 14px 5px 10px;
	border-radius: 4px 0 0 4px;
	letter-spacing: .04em;
	box-shadow: -2px 2px 6px rgba(239,68,68,.35);
	text-transform: uppercase;
}

/* Days-left urgency badge */
.w3cso-days-left {
	position: absolute;
	bottom: 10px; left: 10px;
	background: rgba(234,179,8,.92);
	color: #1c1100;
	font-size: .7rem;
	font-weight: 700;
	padding: 4px 10px;
	border-radius: 6px;
	backdrop-filter: blur(2px);
}

/* HOT/badge pill */
.w3cso-badge {
	position: absolute;
	top: 12px; left: 12px;
	background: #ef4444;
	color: #fff;
	font-size: .68rem;
	font-weight: 800;
	letter-spacing: .07em;
	padding: 4px 12px;
	border-radius: 999px;
	z-index: 3;
	text-transform: uppercase;
	box-shadow: 0 2px 8px rgba(239,68,68,.4);
}

/* Card body */
.w3cso-body {
	padding: 1rem 1.2rem .9rem;
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: .4rem;
}

.w3cso-title { margin: 0; font-size: 1rem; font-weight: 700; line-height: 1.35; }
.w3cso-title a { text-decoration: none; color: #1e293b; }
.w3cso-title a:hover { color: #2563eb; }

.w3cso-dates {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
	margin: .1rem 0;
}

.w3cso-date-item {
	font-size: .76rem;
	color: #64748b;
	background: #f8fafc;
	padding: 3px 8px;
	border-radius: 5px;
	border: 1px solid #e2e8f0;
}

.w3cso-date-item.w3cso-expired-date { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }

.w3cso-read-more {
	display: inline-flex;
	align-items: center;
	gap: .3rem;
	margin-top: auto;
	padding-top: .6rem;
	color: #2563eb;
	text-decoration: none;
	font-size: .84rem;
	font-weight: 700;
	transition: gap .15s;
}
.w3cso-read-more:hover { gap: .55rem; }

/* Status strip */
.w3cso-status-label {
	text-align: center;
	padding: .38rem;
	font-size: .68rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .06em;
}
.w3cso-status-active   { background: #dcfce7; color: #15803d; }
.w3cso-status-inactive { background: #fef9c3; color: #a16207; }
.w3cso-status-expired  { background: #fee2e2; color: #b91c1c; }
.w3cso-card.w3cso-status-expired { opacity: .72; }

/* No offers state */
.w3cso-no-offers-wrap {
	text-align: center;
	padding: 3rem 1rem;
}
.w3cso-no-offers-icon { font-size: 3rem; display: block; margin-bottom: .75rem; }
.w3cso-no-offers { color: #64748b; font-size: 1rem; margin: 0; }

/* Pagination */
.w3cso-pagination { margin-top: 2.5rem; display: flex; justify-content: center; }
.w3cso-pagination .nav-links { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: center; }
.w3cso-pagination .page-numbers {
	padding: 7px 15px; border: 1.5px solid #e2e8f0; border-radius: 8px;
	text-decoration: none; color: #475569; font-weight: 600; font-size: .88rem;
	transition: all .15s;
}
.w3cso-pagination .page-numbers.current,
.w3cso-pagination .page-numbers:hover { background: #2563eb; color: #fff; border-color: #2563eb; }

/* Shortcode product pill links */
.w3cso-products { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.w3cso-product-link { font-size: .78rem; padding: 3px 10px; border: 1px solid #2563eb; color: #2563eb; border-radius: 4px; text-decoration: none; transition: background .15s, color .15s; }
.w3cso-product-link:hover { background: #2563eb; color: #fff; }

/* =============================================================================
   SINGLE OFFER PAGE
   ============================================================================= */

.w3cso-single-article {
	background: #fff;
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 4px 40px rgba(0,0,0,.09);
	border: 1px solid #e8edf3;
}

/* ── Single Header ────────────────────────────────────────────────────────── */
.w3cso-single-header {
	padding: 1.5rem 1.8rem 1.2rem;
	border-bottom: 1px solid #f1f5f9;
	display: flex;
	flex-direction: column;
	gap: .75rem;
}

.w3cso-single-header-top {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: .6rem;
}

.w3cso-single-title {
	font-size: 1.65rem;
	font-weight: 800;
	margin: 0;
	line-height: 1.22;
	color: #0f172a;
	word-break: break-word;
}

/* Status pill — inline, not strip */
.w3cso-status-pill {
	display: inline-block;
	padding: 4px 14px;
	border-radius: 999px;
	font-size: .7rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: .07em;
	white-space: nowrap;
}
.w3cso-status-pill.w3cso-status-active   { background: #dcfce7; color: #15803d; }
.w3cso-status-pill.w3cso-status-inactive { background: #fef9c3; color: #a16207; }
.w3cso-status-pill.w3cso-status-expired  { background: #fee2e2; color: #b91c1c; }

/* Discount hero display */
.w3cso-single-discount-hero {
	display: inline-flex;
	align-items: center;
	gap: .5rem;
	background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
	border: 1.5px solid #6ee7b7;
	border-radius: 10px;
	padding: .55rem 1rem;
	width: fit-content;
}

.w3cso-discount-hero-value {
	font-size: 1.55rem;
	font-weight: 900;
	color: #065f46;
	line-height: 1;
}

.w3cso-discount-hero-label {
	font-size: .8rem;
	font-weight: 600;
	color: #047857;
}

.w3cso-discount-icon { font-size: 1.2rem; }

/* Badge in header — static (not over image) */
.w3cso-single-header .w3cso-badge {
	position: static;
}

/* ── Single Image ─────────────────────────────────────────────────────────── */
.w3cso-single-thumb {
	position: relative;
	width: 100%;
	overflow: hidden;
}

.w3cso-single-thumb .w3cso-hero-img {
	width: 100%;
	max-height: 500px;
	object-fit: cover;
	display: block;
}

.w3cso-expired-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,.55);
	display: flex;
	align-items: center;
	justify-content: center;
}
.w3cso-expired-overlay span {
	background: #ef4444;
	color: #fff;
	font-size: 1.1rem;
	font-weight: 800;
	padding: .6rem 2rem;
	border-radius: 8px;
	letter-spacing: .05em;
	text-transform: uppercase;
}

/* ── Single Meta Bar ──────────────────────────────────────────────────────── */
.w3cso-single-meta-bar {
	display: flex;
	flex-wrap: wrap;
	background: #f8fafc;
	border-top: 1px solid #e8edf3;
	border-bottom: 1px solid #e8edf3;
}

.w3cso-meta-item {
	display: flex;
	align-items: center;
	gap: .65rem;
	padding: 1rem 1.8rem;
	border-right: 1px solid #e8edf3;
	flex: 1;
	min-width: 130px;
}
.w3cso-meta-item:last-child { border-right: none; }

.w3cso-meta-icon { font-size: 1.4rem; flex-shrink: 0; }

.w3cso-meta-item > div { display: flex; flex-direction: column; gap: 2px; }

.w3cso-meta-label {
	font-size: .65rem;
	text-transform: uppercase;
	letter-spacing: .1em;
	color: #94a3b8;
	font-weight: 700;
}

.w3cso-meta-value { font-size: 1rem; font-weight: 700; color: #1e293b; }
.w3cso-meta-discount .w3cso-meta-value { color: #16a34a; font-size: 1.25rem; }
.w3cso-meta-expired .w3cso-meta-value  { color: #dc2626; text-decoration: line-through; }

/* ── Single Content ───────────────────────────────────────────────────────── */
.w3cso-single-content {
	padding: 1.5rem 1.8rem;
	line-height: 1.8;
	color: #374151;
	font-size: .96rem;
	border-bottom: 1px solid #f1f5f9;
}
.w3cso-single-content p { margin-top: 0; margin-bottom: .8rem; }
.w3cso-single-content p:last-child { margin-bottom: 0; }

/* ── Single Products ──────────────────────────────────────────────────────── */
.w3cso-single-products {
	padding: 1.5rem 1.8rem 1.8rem;
}

.w3cso-products-heading {
	font-size: 1.05rem;
	font-weight: 800;
	margin: 0 0 1.1rem;
	color: #0f172a;
	display: flex;
	align-items: center;
	gap: .45rem;
}

.w3cso-products-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1.1rem;
}

@media (max-width: 700px) { .w3cso-products-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 420px) { .w3cso-products-grid { grid-template-columns: 1fr; } }

/* ── Product Card ─────────────────────────────────────────────────────────── */
.w3cso-product-card {
	display: flex;
	flex-direction: column;
	border: 1.5px solid #e8edf3;
	border-radius: 12px;
	overflow: hidden;
	background: #fff;
	transition: box-shadow .22s ease, transform .22s ease;
}

.w3cso-product-card:hover {
	box-shadow: 0 6px 20px rgba(0,0,0,.1);
	transform: translateY(-3px);
}

/* Product image wrapper */
.w3cso-product-img-wrap {
	display: block;
	position: relative;
	overflow: hidden;
	flex-shrink: 0;
}

.w3cso-product-img-wrap img.w3cso-product-img {
	width: 100%;
	height: 150px;
	object-fit: cover;
	display: block;
	transition: transform .3s ease;
}

.w3cso-product-card:hover .w3cso-product-img-wrap img { transform: scale(1.06); }

/* Out of stock overlay */
.w3cso-out-of-stock-badge {
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,.45);
	color: #fff;
	font-size: .72rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: .05em;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Product info */
.w3cso-product-info {
	padding: .75rem .85rem .5rem;
	display: flex;
	flex-direction: column;
	gap: 4px;
	flex: 1;
}

.w3cso-product-name {
	font-size: .84rem;
	font-weight: 700;
	color: #1e293b;
	line-height: 1.35;
	text-decoration: none;
	display: block;
}
.w3cso-product-name:hover { color: #2563eb; }

.w3cso-product-price,
.w3cso-product-price .woocommerce-Price-amount,
.w3cso-product-price bdi {
	font-size: .95rem;
	color: #16a34a;
	font-weight: 800;
}

/* ── Add to Cart Button ───────────────────────────────────────────────────── */
.w3cso-product-actions {
	padding: .55rem .85rem .85rem;
}

/* Add to Cart — primary green */
.w3cso-add-to-cart {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: .4rem;
	width: 100%;
	padding: .55rem .5rem;
	background: #16a34a;
	color: #fff;
	border: none;
	border-radius: 8px;
	font-size: .8rem;
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
	transition: background .18s ease, box-shadow .18s ease;
	line-height: 1;
}

.w3cso-add-to-cart:hover {
	background: #15803d;
	color: #fff;
	box-shadow: 0 3px 10px rgba(22,163,74,.35);
}

/* Loading state added by WooCommerce AJAX */
.w3cso-add-to-cart.loading {
	opacity: .7;
	pointer-events: none;
}

/* Added to cart state */
.w3cso-add-to-cart.added {
	background: #2563eb;
}
.w3cso-add-to-cart.added::after {
	content: " ✓";
}

/* Variable product — select options */
.w3cso-view-product {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: .4rem;
	width: 100%;
	padding: .55rem .5rem;
	background: #fff;
	color: #2563eb;
	border: 1.5px solid #2563eb;
	border-radius: 8px;
	font-size: .8rem;
	font-weight: 700;
	text-decoration: none;
	transition: background .18s, color .18s;
	line-height: 1;
}
.w3cso-view-product:hover { background: #2563eb; color: #fff; }

.w3cso-arrow { transition: transform .15s; }
.w3cso-view-product:hover .w3cso-arrow { transform: translateX(3px); }

/* Unavailable */
.w3cso-unavailable {
	display: block;
	text-align: center;
	width: 100%;
	padding: .5rem;
	font-size: .78rem;
	color: #94a3b8;
	font-weight: 600;
}

/* ── Single Back Link ─────────────────────────────────────────────────────── */
.w3cso-single-back {
	padding: 1rem 1.8rem 1.4rem;
	border-top: 1px solid #f1f5f9;
}

.w3cso-back-link {
	display: inline-flex;
	align-items: center;
	gap: .4rem;
	color: #2563eb;
	text-decoration: none;
	font-weight: 700;
	font-size: .88rem;
	transition: gap .15s;
}
.w3cso-back-link:hover { gap: .6rem; }

/* =============================================================================
   RESPONSIVE
   ============================================================================= */
@media (max-width: 640px) {
	.w3cso-single-header       { padding: 1.1rem 1.1rem .9rem; }
	.w3cso-single-title        { font-size: 1.3rem; }
	.w3cso-single-meta-bar     { flex-direction: column; }
	.w3cso-meta-item           { border-right: none; border-bottom: 1px solid #e8edf3; padding: .8rem 1.1rem; }
	.w3cso-meta-item:last-child{ border-bottom: none; }
	.w3cso-single-content,
	.w3cso-single-products,
	.w3cso-single-back         { padding-left: 1.1rem; padding-right: 1.1rem; }
	.w3cso-archive-title       { font-size: 1.45rem; }
	.w3cso-archive-header-inner{ flex-direction: column; }
	.w3cso-discount-hero-value { font-size: 1.25rem; }
}
