/* =========================================================================
   REDEC SHOP PAGES — archive vertical cards + single product (Redec red + charcoal)
   Markup is owned by the plugin templates, so plain class selectors work.
   ========================================================================= */

:root{
	--rd-ink:#1a1a1a; --rd-soft:#6b6459; --rd-line:#e7e3da; --rd-line2:#f0ece3;
	--rd-bg:#f5f4ee; --rd-card:#fffdf9;
	--rd-brand:#e2001a; --rd-brand-dk:#b80016; --rd-accent:#fdecec;
	--rd-charcoal:#2b2b2b; --rd-charcoal-dk:#1a1a1a;
	--rd-ok:#12925a; --rd-ok-bg:#e6f6ee; --rd-amber:#c98a00; --rd-warn:#c2410c; --rd-warn-bg:#fdeee4;
	--rd-r:14px; --rd-r-sm:10px;
	--rd-sh:0 1px 2px rgba(40,35,25,.05),0 6px 18px rgba(40,35,25,.05);
	--rd-sh-h:0 6px 14px rgba(40,35,25,.08),0 18px 40px rgba(40,35,25,.11);
	--rd-sans:"Inter",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
	--rd-head:"Manrope","Inter",system-ui,sans-serif;
}

/* =========================================================================
   VAT price visibility — driven by body.show-inc-vat (synced to header toggle)
   ========================================================================= */
.price-inc-vat{display:none;}
body.show-inc-vat .price-ex-vat{display:none;}
body.show-inc-vat .price-inc-vat{display:block;}

/* =========================================================================
   ARCHIVE GRID  — force a tighter grid so cards aren't huge.
   Flatsome only gives 3 cols; we override to auto-fit ~4 and cap image size.
   ========================================================================= */
/* Page background tint — scoped to the shop CONTENT only, never the header.
   Target the WooCommerce content wrapper, not #main/#content (which can include
   the header region in Flatsome and caused the header to look wrong). */
.woocommerce.archive .shop-container,
.woocommerce-shop .shop-container,
.tax-product_cat .shop-container{
	background:var(--rd-bg) !important;
	padding-top:24px !important;
	padding-bottom:24px !important;
	border-radius:0;
}
.woocommerce ul.products.redec-grid,
ul.products{
	display:grid !important;
	grid-template-columns:repeat(auto-fill,minmax(215px,1fr)) !important;
	grid-auto-rows:1fr !important;
	gap:16px !important;
	width:100% !important;
	margin:0 0 30px !important;
	padding:0 !important;
	align-items:stretch !important;
}
ul.products li.product.redec-card-col{ display:flex !important; }
.redec-card-col .col-inner{ display:flex; width:100%; }
ul.products::before,ul.products::after{display:none !important;content:none !important;}
ul.products li.product.redec-card-col{
	width:auto !important;max-width:none !important;flex:none !important;
	margin:0 !important;padding:0 !important;float:none !important;clear:none !important;
}
.redec-card-col .col-inner{padding:0;}
.redec-card{
	display:flex;flex-direction:column;height:100%;width:100%;background:var(--rd-card);
	border:1px solid #e6e1d7;border-radius:var(--rd-r);box-shadow:0 1px 2px rgba(40,35,25,.06),0 10px 28px rgba(40,35,25,.07);
	overflow:hidden;font-family:var(--rd-sans);
	transition:transform .2s ease,box-shadow .2s ease,border-color .2s ease;
}
.redec-card:hover{
	transform:translateY(-2px);
	box-shadow:0 4px 12px rgba(40,35,25,.10),0 14px 32px rgba(40,35,25,.12);
	border-color:#ddd7ca;
}

.redec-card__media{position:relative;padding:12px;background:#fff;border-bottom:1px solid var(--rd-line2);}
.redec-card__badge{
	position:absolute;top:8px;left:8px;z-index:3;background:var(--rd-charcoal);color:#fff;
	font-size:10.5px;font-weight:700;letter-spacing:.3px;text-transform:uppercase;padding:4px 8px;border-radius:5px;
}
.redec-card__img-link{display:block;}
/* Medium, balanced image height */
.redec-card__media img{
	width:100% !important;height:150px !important;object-fit:contain !important;display:block;margin:0 auto;
}

.redec-card__body{display:flex;flex-direction:column;flex:1 1 auto;padding:12px 14px 14px;}
.redec-card__title{font-size:14.5px;line-height:1.3;font-weight:700;margin:0 0 6px;min-height:2.5em;
	display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
.redec-card__title a{color:var(--rd-ink);text-decoration:none;}
.redec-card__title a:hover{color:var(--rd-brand);}

/* "Agreed Price" = Flatsome badge:
   .badge-container > .callout.badge.badge-square > .badge-inner.secondary.on-sale > span.onsale
   Flatsome's .on-sale green is high-specificity, so we match its full chain. */
html body .redec-card .badge-container{
	top:10px !important; left:10px !important; right:auto !important; bottom:auto !important;
	width:auto !important; height:auto !important; margin:0 !important; padding:0 !important;
}
html body .redec-card .badge-container .badge,
html body .redec-card .badge-container .callout.badge,
html body .redec-card .badge-container .badge.badge-square{
	width:auto !important; height:auto !important; min-width:0 !important; min-height:0 !important;
	margin:0 !important; padding:0 !important; background:transparent !important;
}
html body .redec-card .badge-container .badge-inner,
html body .redec-card .badge-container .badge-inner.secondary,
html body .redec-card .badge-container .badge-inner.on-sale,
html body .redec-card .badge-container .badge-inner.secondary.on-sale{
	background:var(--rd-charcoal) !important; color:#fff !important;
	border-radius:5px !important; width:auto !important; height:auto !important;
	min-width:0 !important; min-height:0 !important; padding:4px 9px !important;
	display:inline-block !important; transform:none !important; box-shadow:none !important; border:0 !important;
	font-size:0 !important; /* collapse any stray whitespace/"$0" */ line-height:0 !important;
}
html body .redec-card .badge-container .badge-inner .onsale,
html body .redec-card .badge-container span.onsale{
	color:#fff !important; background:transparent !important;
	font-size:10.5px !important; font-weight:700 !important; letter-spacing:.3px !important;
	text-transform:uppercase !important; line-height:1.25 !important; padding:0 !important; margin:0 !important;
	display:inline-block !important;
}

/* SKU + stock lines from functions.php (.sku / .stock) */
.redec-card__body .sku,
.redec-card__body .stock{font-size:12.5px !important;margin:0 0 4px !important;padding:0 !important;}
.redec-card__body .stock.in-stock{color:var(--rd-ok) !important;font-weight:700 !important;}
.redec-card__body .stock.out-of-stock{color:var(--rd-warn) !important;font-weight:700 !important;}
.redec-card__body .sku{color:var(--rd-soft) !important;font-weight:500 !important;}

/* Hide any DUPLICATE price/bulk text that other hooks inject into the loop
   (e.g. a "No bulk discounts" line or a second price). Our template prints
   the price once in .redec-card__price; anything else in the body is a dupe. */
.redec-card__body > .price,
.redec-card__body .bulk-discount-summary,
.redec-card__body .price-wrapper:not(.redec-card__price),
.redec-card__body .woocommerce-Price-amount:not(.redec-card__price .woocommerce-Price-amount){
	display:none !important;
}

/* The verbose "Bulk Discounts" tier TABLE (and its "No bulk discounts" text)
   from the CSP/bulk feature makes cards uneven. Hide the table + heading + the
   empty "No bulk discounts" line on the archive; keep the compact .redec-card__bulk
   badge we render ourselves. */
.redec-card__body table,
.redec-card__body .bulk-discounts,
.redec-card__body [class*="bulk-discount-table"],
.redec-card__body h3:not(.redec-card__title),
.redec-card__body h4{
	display:none !important;
}
/* The "No bulk discounts" line is a .bulk-discount-badge that renders even with
   no discount. Hide the no-discount version. Real discount badges (which contain
   "% off") are shown via our own .redec-card__bulk, so hiding all inbound
   .bulk-discount-badge here is safe — we don't rely on this element. */
.redec-card__body .bulk-discount-badge,
.redec-card__body .bulk-discount-summary{
	display:none !important;
}

.redec-card__stockbar{height:5px;background:#ece8df;border-radius:3px;overflow:hidden;margin:8px 0 0;}
.redec-card__stockbar-fill{height:100%;border-radius:3px;transition:width .3s ease;opacity:.85;}
.redec-card__stocknote{font-size:12px;font-weight:600;margin-top:4px;}

.redec-card__bulk{
	background:#f7f2ea;color:var(--rd-ink);font-weight:600;font-size:12px;
	padding:5px 9px;border-left:3px solid var(--rd-brand);border-radius:5px;margin:8px 0 0;
}

/* Pin the price + actions block to the BOTTOM of every card so cards with a
   bulk badge line up with cards without one. */
.redec-card__price-row{margin-top:auto;padding-top:10px;}
.redec-card__price{font-size:17px;font-weight:800;color:var(--rd-ink);background:none;padding:0;border:0;}
.redec-card__price .woocommerce-Price-amount,
.redec-card__price bdi{color:var(--rd-ink) !important;}
.redec-card__price .price-ex-vat-label,
.redec-card__price .price-inc-vat-label{font-size:12.5px;color:var(--rd-soft);font-weight:500;}

/* Add-to-cart / call / colour buttons from functions.php */
.redec-card__actions{margin-top:10px;}
.redec-card__actions form,
.redec-card__actions form.cart{
	display:flex !important;gap:8px !important;align-items:stretch !important;margin:0 !important;flex-wrap:nowrap !important;width:100%;
}
/* Quantity group sits inline, left of the button */
.redec-card__actions .quantity{
	display:flex !important;align-items:stretch !important;flex:0 0 auto !important;margin:0 !important;width:auto !important;
}
/* Beat Flatsome's own .quantity width/float rules with card-scoped specificity */
html body .redec-card .redec-card__actions form .quantity{
	width:auto !important;max-width:none !important;float:none !important;display:flex !important;flex:0 0 auto !important;
}
html body .redec-card .redec-card__actions form{
	display:flex !important;align-items:stretch !important;flex-wrap:nowrap !important;gap:8px !important;
}
html body .redec-card .redec-card__actions form .button{
	flex:1 1 auto !important;width:auto !important;
}
.redec-card__actions .quantity input.qty{
	width:32px;height:40px;border:1px solid var(--rd-line);border-left:0;border-right:0;
	text-align:center;font-weight:700;font-size:13px;border-radius:0;background:#fff;
	-moz-appearance:textfield;
}
.redec-card__actions .quantity input.qty::-webkit-outer-spin-button,
.redec-card__actions .quantity input.qty::-webkit-inner-spin-button{-webkit-appearance:none;margin:0;}
/* +/- buttons LIGHT GREY so red is the only strong colour */
.redec-card__actions .quantity .minus,
.redec-card__actions .quantity .plus{
	width:28px;height:40px;background:#efeae1 !important;color:var(--rd-ink) !important;border:1px solid var(--rd-line) !important;
	font-size:15px;font-weight:600;display:flex;align-items:center;justify-content:center;cursor:pointer;user-select:none;
	transition:background .15s ease;
}
.redec-card__actions .quantity .minus{border-radius:var(--rd-r-sm) 0 0 var(--rd-r-sm);border-right:0;}
.redec-card__actions .quantity .plus{border-radius:0 var(--rd-r-sm) var(--rd-r-sm) 0;border-left:0;}
.redec-card__actions .quantity .minus:hover,
.redec-card__actions .quantity .plus:hover{background:#e4ded1 !important;}

/* Add to Cart button — RED, bigger, fills remaining width */
.redec-card__actions .button,
.redec-card__actions button.button,
.redec-card__actions .add_to_cart_button,
.redec-card__actions .choose-colour-button,
.redec-card__actions .call-for-details{
	flex:1 1 auto;display:inline-flex;align-items:center;justify-content:center;
	background:var(--rd-brand) !important;color:#fff !important;border:0 !important;border-radius:var(--rd-r-sm) !important;
	padding:11px 16px !important;font-size:14.5px !important;font-weight:700 !important;text-transform:none !important;
	text-align:center;text-decoration:none;box-shadow:var(--rd-sh);cursor:pointer;line-height:1.2 !important;height:40px !important;
	transition:background .16s ease;
}
.redec-card__actions .full-width-button{width:100%;}
.redec-card__actions .button:hover,
.redec-card__actions button.button:hover,
.redec-card__actions .add_to_cart_button:hover,
.redec-card__actions .choose-colour-button:hover{background:var(--rd-brand-dk) !important;color:#fff !important;}
.redec-card__actions .call-for-details{background:var(--rd-charcoal) !important;}
.redec-card__actions .call-for-details:hover{background:var(--rd-charcoal-dk) !important;}
.redec-card__actions .added_to_cart{display:none;}

/* =========================================================================
   SINGLE PRODUCT (PDP)
   ========================================================================= */
.redec-pdp{max-width:1200px;margin:0 auto;padding:20px;display:flex;flex-direction:column;gap:28px;font-family:var(--rd-sans);color:var(--rd-ink);}
.redec-pdp__header{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:20px;border-bottom:1px solid var(--rd-line);padding-bottom:20px;}
.redec-pdp__title{font-family:var(--rd-head);font-size:30px;font-weight:800;margin:0 0 6px;color:var(--rd-ink);line-height:1.15;}
.redec-pdp__sku{font-size:14px;color:var(--rd-soft);}
.redec-pdp__price{background:var(--rd-accent);border:1px solid #cfe1fb;border-radius:var(--rd-r-sm);padding:14px 20px;display:flex;flex-direction:column;}
.redec-pdp__price-ex{font-size:26px;font-weight:800;color:var(--rd-brand-dk);margin-bottom:4px;}
.redec-pdp__price-ex .amount,.redec-pdp__price-ex bdi{color:var(--rd-brand-dk) !important;}
.redec-pdp__price-unit{font-size:14px;font-weight:500;color:var(--rd-soft);}
.redec-pdp__price-inc{font-size:14px;color:var(--rd-soft);font-weight:500;}

.redec-pdp__main{display:grid;grid-template-columns:minmax(0,560px) 1fr;gap:36px;align-items:start;}
.redec-pdp__gallery{background:#fff;border:1px solid var(--rd-line);border-radius:var(--rd-r);box-shadow:var(--rd-sh);padding:20px;position:sticky;top:20px;}
.redec-pdp__gallery img{max-width:100%;height:auto;object-fit:contain;margin:0 auto;display:block;border-radius:8px;}
.redec-pdp__gallery .woocommerce-product-gallery{opacity:1 !important;width:100% !important;margin:0 !important;}

.redec-pdp__details{display:flex;flex-direction:column;gap:22px;}
.redec-pdp__desc{line-height:1.65;color:#3a4557;font-size:15.5px;}
.redec-pdp__desc h3{font-family:var(--rd-head);font-size:20px;font-weight:800;color:var(--rd-ink);margin:0 0 12px;}

.redec-pdp__specs{background:#fff;border:1px solid var(--rd-line);border-radius:var(--rd-r);box-shadow:var(--rd-sh);padding:22px;}
.redec-pdp__specs h3{font-family:var(--rd-head);font-size:18px;font-weight:800;margin:0 0 12px;color:var(--rd-ink);}
.redec-pdp__specs-table{width:100%;border-collapse:collapse;}
.redec-pdp__specs-table tr:nth-child(odd){background:var(--rd-bg);}
.redec-pdp__specs-table td{padding:11px 12px;border-bottom:1px solid var(--rd-line2);font-size:14.5px;}
.redec-pdp__specs-table td:first-child{font-weight:700;width:40%;color:var(--rd-ink);}

.redec-pdp__purchase{background:#fff;border:1px solid var(--rd-line);border-radius:var(--rd-r);box-shadow:var(--rd-sh);padding:22px;}
.redec-pdp__stock{display:flex;align-items:center;gap:8px;margin-bottom:12px;}
.redec-pdp__stock-ok{color:var(--rd-ok);font-weight:700;background:var(--rd-ok-bg);padding:6px 12px;border-radius:999px;font-size:14px;}
.redec-pdp__stock-out{color:var(--rd-warn);font-weight:700;background:var(--rd-warn-bg);padding:6px 12px;border-radius:999px;font-size:14px;}
.redec-pdp__stock-qty{color:var(--rd-soft);font-size:14px;}
.redec-pdp__stockbar{height:8px;background:#e5e9f0;border-radius:4px;overflow:hidden;margin-bottom:16px;}
.redec-pdp__stockbar-fill{height:100%;background:var(--rd-ok);border-radius:4px;}

/* Add-to-cart on PDP */
.redec-pdp__purchase form.cart{display:flex;flex-wrap:wrap;gap:12px;align-items:stretch;margin:0;}
.redec-pdp__purchase .quantity{display:flex;align-items:center;}
.redec-pdp__purchase .quantity input.qty{width:70px;height:52px;border:1px solid var(--rd-line);border-radius:var(--rd-r-sm);text-align:center;font-size:16px;font-weight:700;}
.redec-pdp__purchase .quantity .minus,.redec-pdp__purchase .quantity .plus{
	width:48px;height:52px;background:var(--rd-bg);border:1px solid var(--rd-line);font-size:18px;font-weight:600;
	display:flex;align-items:center;justify-content:center;cursor:pointer;user-select:none;
}
.redec-pdp__purchase .quantity .minus{border-radius:var(--rd-r-sm) 0 0 var(--rd-r-sm);border-right:0;}
.redec-pdp__purchase .quantity .plus{border-radius:0 var(--rd-r-sm) var(--rd-r-sm) 0;border-left:0;}
.redec-pdp__purchase .single_add_to_cart_button,
.redec-pdp__purchase button.button{
	flex:1 1 auto;min-width:200px;height:52px;background:var(--rd-brand) !important;color:#fff !important;border:0 !important;
	border-radius:var(--rd-r-sm) !important;font-size:16px !important;font-weight:800 !important;text-transform:none !important;
	box-shadow:var(--rd-sh);cursor:pointer;transition:background .16s ease;line-height:1.2 !important;height:52px !important;
}
.redec-pdp__purchase .single_add_to_cart_button:hover{background:var(--rd-brand-dk) !important;}
.redec-pdp__purchase .wc-points-rewards-product-message{
	flex-basis:100%;background:var(--rd-accent);color:var(--rd-brand-dk);border:1px solid #cfe1fb;border-radius:var(--rd-r-sm);
	padding:10px 14px;font-size:13.5px;font-weight:600;margin:10px 0 0;
}

.redec-pdp__related{margin-top:14px;}
.redec-pdp__related h3{font-family:var(--rd-head);font-size:22px;font-weight:800;color:var(--rd-ink);margin:0 0 18px;}
/* Related items reuse Flatsome's grid; give them the card look */
.redec-pdp__related ul.products li.product .box{background:var(--rd-card);border:1px solid var(--rd-line);border-radius:var(--rd-r);box-shadow:var(--rd-sh);overflow:hidden;}
.redec-pdp__related ul.products li.product .button{background:var(--rd-brand) !important;color:#fff !important;border-radius:var(--rd-r-sm) !important;text-transform:none !important;}

/* =========================================================================
   RESPONSIVE
   ========================================================================= */
@media (max-width:900px){
	.redec-pdp__main{grid-template-columns:1fr;gap:22px;}
	.redec-pdp__gallery{position:static;}
	.redec-pdp__title{font-size:25px;}
}
@media (max-width:600px){
	ul.products{grid-template-columns:repeat(2,1fr) !important;gap:12px !important;}
	.redec-card__media img{height:130px !important;}
	.redec-card__title{font-size:14px;}
	.redec-card__price{font-size:16px;}
	.redec-pdp{padding:14px;}
	.redec-pdp__header{flex-direction:column;align-items:flex-start;}
	.redec-pdp__purchase form.cart{flex-direction:column;}
	.redec-pdp__purchase .single_add_to_cart_button{width:100%;min-width:0;}
}
@media (max-width:380px){
	ul.products{grid-template-columns:1fr !important;}
}
