/*
Theme Name:   Carvo
Theme URI:    https://carvotrading.com
Description:  Child theme of Auto Parts and Car Accessories for carvotrading.com. Fixes the parent's shop/category templates (missing header and footer), replaces the front page with live WooCommerce product and category sections, a 3-column footer, and readable buttons. The parent theme stays untouched and updatable.
Author:       Carvo Trading
Template:     auto-parts-and-car-accessories
Version:      1.2.0
Requires at least: 6.7
Tested up to: 7.1
Requires PHP: 7.4
License:      GNU General Public License v2 or later
License URI:  http://www.gnu.org/licenses/gpl-2.0.html
Text Domain:  carvo
*/

/* ---------- Buttons: readable everywhere (parent default is white text on beige) ---------- */
.wc-block-components-product-button .wp-block-button__link,
.wc-block-components-product-button .wp-block-button__link.added_to_cart,
.wp-block-woocommerce-product-button .wp-block-button__link,
.product-section .add_to_cart_button,
.woocommerce-page .wc-block-components-product-button .added_to_cart.wc_forward,
.wc-block-cart__submit-button,
.wc-block-components-checkout-place-order-button,
.wc-block-components-button:not(.is-link),
.single-product .single_add_to_cart_button,
.woocommerce a.button,
.woocommerce button.button{
	background:#0f172a !important;
	color:#ffffff !important;
	border:0 !important;
	border-radius:6px !important;
	padding:10px 20px !important;
	font-weight:600 !important;
	line-height:1.3 !important;
	transition:background .2s;
}
.wc-block-components-product-button .wp-block-button__link:hover,
.wp-block-woocommerce-product-button .wp-block-button__link:hover,
.product-section .add_to_cart_button:hover,
.product-section .product-in-content li.wc-block-product:hover .add_to_cart_button,
.wc-block-cart__submit-button:hover,
.wc-block-components-checkout-place-order-button:hover,
.wc-block-components-button:not(.is-link):hover,
.single-product .single_add_to_cart_button:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover{
	background:#0067b2 !important;
	color:#ffffff !important;
}
.product-section .add_to_cart_button span{background:transparent;padding:0;}

/* ---------- Product grids (front page + shop + categories): 4 per row, tidy cards ---------- */
.product-section .wc-block-product-template,
.product-section .product-in-content,
.products-box .wc-block-product-template{
	display:grid !important;
	grid-template-columns:repeat(4,minmax(0,1fr)) !important;
	gap:24px !important;
}
.wc-block-product-template li.wc-block-product{
	display:flex;
	flex-direction:column;
	align-items:stretch;
	width:auto !important;
	margin:0 !important;
	padding:0 0 18px !important;
	background:#fff;
	border-radius:14px;
	overflow:hidden;
	box-shadow:0 6px 24px rgba(0,0,0,.06),0 0 0 1px rgba(0,0,0,.06);
	transition:transform .25s,box-shadow .25s;
}
.wc-block-product-template li.wc-block-product:hover{transform:translateY(-4px);box-shadow:0 14px 34px rgba(0,0,0,.10),0 0 0 1px rgba(0,0,0,.06);}
.wc-block-product-template li.wc-block-product .wc-block-components-product-image{position:relative;margin:0 0 14px !important;}
.wc-block-product-template li.wc-block-product .wc-block-components-product-image img{
	width:100% !important;
	aspect-ratio:1/1;
	height:auto !important;
	object-fit:cover;
	display:block;
}
.wc-block-product-template li.wc-block-product .wp-block-post-title,
.wc-block-product-template li.wc-block-product .product-title{
	text-align:center !important;
	padding:0 14px;
	font-size:16px !important;
	line-height:1.4 !important;
	min-height:calc(2 * 1.4 * 16px);
	margin:0 0 8px !important;
}
.wc-block-product-template li.wc-block-product .wp-block-post-title a{text-decoration:none;}
.wc-block-product-template li.wc-block-product .wc-block-components-product-price{
	text-align:center !important;
	display:block !important;
	padding:0 14px;
	margin:0 0 12px !important;
}
.wc-block-product-template li.wc-block-product .wc-block-components-product-price del{opacity:.5;margin-right:8px;}
.wc-block-product-template li.wc-block-product .wc-block-components-product-button{margin-top:auto !important;padding:0 14px;}
.wc-block-product-template li.wc-block-product .wc-block-components-product-sale-badge{
	position:absolute;top:12px;right:12px;left:auto;
	background:#f43f5e !important;color:#fff !important;border:0 !important;border-radius:6px !important;
	padding:4px 10px !important;font-size:12px !important;text-transform:uppercase;letter-spacing:.5px;
}
.product-section .product-price-box{flex-direction:column;align-items:stretch;gap:12px;padding:0 14px;}

/* ---------- Category tiles ---------- */
.category-section .category-bg .wp-block-cover__inner-container{height:320px;position:relative;}
.category-section .category-bg{border-radius:14px;overflow:hidden;}
.category-section .category-bg .category-title{position:absolute;bottom:0;left:0;right:0;margin:0;}
.category-section .category-bg .category-title a{text-decoration:none;color:#fff;}
.category-section .category-box:hover .category-bg .category-title{background-color:#0067b2 !important;}
.category-section .category-box:hover .category-bg .category-title a{color:#fff;}

/* ---------- Section headings ---------- */
.product-section .product-head-box,
.category-section .category-head-box{align-items:center;gap:20px;}
.product-section .product-head-box .product-border,
.category-section .category-head-box .category-border{flex:1;width:auto;margin:0;}

/* ---------- Footer ---------- */
.footer-section .footer-boxes .wp-block-column{min-width:0;}
.footer-section .footer-box3 ul,
.footer-section .footer-box4 ul{list-style:none;padding-left:0;margin:0;}
.footer-section .footer-legal{margin-top:12px;}
.footer-section .footer-box1 p{max-width:420px;line-height:1.7;}

/* ---------- Responsive ---------- */
@media (max-width:1024px){
	.product-section .wc-block-product-template,
	.product-section .product-in-content,
	.products-box .wc-block-product-template{grid-template-columns:repeat(3,minmax(0,1fr)) !important;}
}
@media (max-width:781px){
	.product-section .wc-block-product-template,
	.product-section .product-in-content,
	.products-box .wc-block-product-template{grid-template-columns:repeat(2,minmax(0,1fr)) !important;gap:16px !important;}
	.category-section .category-boxes{flex-wrap:wrap !important;}
	.category-section .category-boxes .wp-block-column{flex-basis:100% !important;}
	.category-section .category-bg .wp-block-cover__inner-container{height:240px;}
	.footer-section .footer-boxes{flex-wrap:wrap !important;}
	.footer-section .footer-boxes .wp-block-column{flex-basis:100% !important;}
}
@media (max-width:480px){
	.product-section .wc-block-product-template,
	.product-section .product-in-content,
	.products-box .wc-block-product-template{grid-template-columns:1fr !important;}
}

/* ---------- Price wrapper: the parent makes the outer price block a flex row (price hugged the left) ---------- */
.wc-block-product-template li.wc-block-product .wp-block-woocommerce-product-price,
.product-section .product-price{display:flex !important;justify-content:center !important;gap:0 !important;width:100%;}
.wc-block-product-template li.wc-block-product .wp-block-woocommerce-product-price > .wc-block-components-product-price{width:auto;display:inline-block !important;}

/* ---------- Shared section typography ---------- */
.carvo-eyebrow{display:inline-flex;align-items:center;gap:10px;color:#0067b2;font-size:12px;font-weight:800;letter-spacing:2px;text-transform:uppercase;margin:0 0 12px;}
.carvo-eyebrow::before{content:"";width:28px;height:2px;background:#0067b2;}
.carvo-eyebrow.light{color:#ffc928;}
.carvo-eyebrow.light::before{background:#ffc928;}
.has-text-align-center.carvo-eyebrow{justify-content:center;width:100%;}
.carvo-h2{font-size:clamp(28px,3.6vw,44px);line-height:1.15;letter-spacing:-.5px;margin:0 0 16px;color:#0f172a;}
.carvo-h2.light{color:#fff;}
.carvo-muted{color:#5b6472;line-height:1.75;}

/* ---------- Trust strip ---------- */
.carvo-trust .carvo-trust-grid{background:#fff;border:1px solid rgba(15,23,42,.08);border-radius:16px;box-shadow:0 10px 30px rgba(15,23,42,.06);padding:8px;}
.carvo-trust .carvo-trust-item{padding:22px 24px;border-right:1px solid rgba(15,23,42,.08);}
.carvo-trust .carvo-trust-item:last-child{border-right:0;}
.carvo-trust-icon{width:46px;height:46px;border-radius:12px;display:grid;place-items:center;background:#eef4fb;color:#0067b2;font-size:20px;margin-bottom:12px;}
.carvo-trust .carvo-trust-item h4{font-size:16px;margin:0 0 6px;color:#0f172a;}
.carvo-trust .carvo-trust-item p{font-size:14px;line-height:1.6;color:#5b6472;margin:0;}

/* ---------- About ---------- */
.carvo-about p{line-height:1.8;}
.carvo-checks{list-style:none;padding:0;margin:20px 0 0;display:grid;grid-template-columns:1fr 1fr;gap:12px;}
.carvo-checks li{position:relative;padding-left:32px;font-weight:600;color:#0f172a;}
.carvo-checks li::before{content:"\2713";position:absolute;left:0;top:0;width:22px;height:22px;border-radius:50%;background:#0f172a;color:#fff;font-size:12px;display:grid;place-items:center;}
.carvo-about-image{border-radius:18px;overflow:hidden;box-shadow:0 20px 50px rgba(15,23,42,.14);}
.carvo-about-image .wp-block-cover__inner-container{position:relative;height:100%;}
.carvo-about-tag{position:absolute;left:20px;right:20px;bottom:20px;margin:0;background:rgba(15,23,42,.92);color:#fff;border-radius:12px;padding:18px 20px;font-weight:800;letter-spacing:1px;}
.carvo-about-tag span{display:block;font-weight:500;font-size:12px;letter-spacing:1.5px;text-transform:uppercase;color:#b8c2d0;margin-top:4px;}

/* ---------- Why ---------- */
.carvo-why{background:#f5f7fb;}
.carvo-why-card{background:#fff;border:1px solid rgba(15,23,42,.08);border-radius:16px;padding:28px 24px;transition:transform .25s,box-shadow .25s;}
.carvo-why-card:hover{transform:translateY(-5px);box-shadow:0 16px 40px rgba(15,23,42,.10);}
.carvo-why-icon{width:52px;height:52px;border-radius:14px;display:grid;place-items:center;background:#0f172a;color:#ffc928;font-size:22px;margin-bottom:16px;}
.carvo-why-card h3{font-size:18px;margin:0 0 8px;color:#0f172a;}
.carvo-why-card p{font-size:14px;line-height:1.7;color:#5b6472;margin:0;}

/* ---------- CTA ---------- */
.carvo-cta{background:linear-gradient(110deg,#0f172a,#1e3a8a);color:#fff;}
.carvo-cta .carvo-cta-inner{gap:30px;}
.carvo-cta .carvo-cta-text{color:#c7d2e6;margin:0;line-height:1.7;}

/* ---------- Buttons used in the new sections ---------- */
.carvo-btn .wp-block-button__link{background:#0f172a !important;color:#fff !important;border-radius:8px !important;padding:14px 26px !important;font-weight:700 !important;border:0 !important;}
.carvo-btn .wp-block-button__link:hover{background:#0067b2 !important;color:#fff !important;}
.carvo-btn.white .wp-block-button__link{background:#ffc928 !important;color:#0f172a !important;}
.carvo-btn.white .wp-block-button__link:hover{background:#fff !important;color:#0f172a !important;}

/* ---------- Contact + form ---------- */
.carvo-contact-list{display:grid;gap:12px;margin-top:24px;}
.carvo-contact-item{display:flex;align-items:center;gap:14px;padding:16px 18px;background:#f5f7fb;border:1px solid rgba(15,23,42,.08);border-radius:12px;color:#0f172a;text-decoration:none;transition:.2s;}
a.carvo-contact-item:hover{border-color:#0067b2;background:#fff;}
.carvo-contact-icon{width:42px;height:42px;flex-shrink:0;border-radius:10px;display:grid;place-items:center;background:#0f172a;color:#ffc928;font-size:16px;}
.carvo-contact-item small{display:block;color:#5b6472;text-transform:uppercase;letter-spacing:1.2px;font-size:10px;margin-bottom:3px;}
.carvo-contact-item strong{font-size:14px;word-break:break-word;}
.carvo-form{background:#fff;border:1px solid rgba(15,23,42,.08);border-radius:16px;padding:30px;box-shadow:0 10px 30px rgba(15,23,42,.06);}
.carvo-form-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px;}
.carvo-form label{display:block;font-size:13px;font-weight:700;color:#0f172a;}
.carvo-form label.carvo-full{grid-column:1/-1;}
.carvo-form input,
.carvo-form textarea{display:block;width:100%;margin-top:6px;padding:12px 14px;border:1px solid rgba(15,23,42,.18);border-radius:8px;background:#fff;color:#0f172a;font:inherit;font-weight:400;outline:none;transition:.2s;}
.carvo-form input:focus,
.carvo-form textarea:focus{border-color:#0067b2;box-shadow:0 0 0 3px rgba(0,103,178,.12);}
.carvo-form input.is-invalid,
.carvo-form textarea.is-invalid{border-color:#e11d48;}
.carvo-form textarea{min-height:130px;resize:vertical;}
.carvo-hp{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden;}
.carvo-form .carvo-submit{display:inline-block;margin-top:16px;background:#0f172a !important;color:#fff !important;border:0 !important;border-radius:8px !important;padding:14px 28px !important;font-weight:700 !important;cursor:pointer;}
.carvo-form .carvo-submit:hover{background:#0067b2 !important;}
.carvo-form .carvo-submit[disabled]{opacity:.6;cursor:wait;}
.carvo-form-status{margin:12px 0 0;font-size:13px;font-weight:700;min-height:1em;color:#5b6472;}
.carvo-form-status.ok{color:#15803d;}
.carvo-form-status.error{color:#e11d48;}
.carvo-page-head .carvo-h2{margin-bottom:10px;}

/* ---------- Responsive for the new sections ---------- */
@media (max-width:1024px){
	.carvo-trust .carvo-trust-grid{flex-wrap:wrap !important;}
	.carvo-trust .carvo-trust-item{flex-basis:50% !important;border-right:0;}
	.carvo-why-grid{flex-wrap:wrap !important;}
	.carvo-why-grid .carvo-why-card{flex-basis:calc(50% - 10px) !important;}
}
@media (max-width:781px){
	.carvo-trust .carvo-trust-item{flex-basis:100% !important;}
	.carvo-why-grid .carvo-why-card{flex-basis:100% !important;}
	.carvo-checks{grid-template-columns:1fr;}
	.carvo-form-grid{grid-template-columns:1fr;}
	.carvo-form{padding:22px 18px;}
	.carvo-about .wp-block-columns,
	.carvo-contact .wp-block-columns{flex-wrap:wrap !important;}
	.carvo-about .wp-block-column,
	.carvo-contact .wp-block-column{flex-basis:100% !important;}
}

/* ---------- Checkout: hide WooCommerce's premature "no payment methods" notice ----------
   PHP adds .carvo-payment-pending on the checkout page; while it is set the notice stays
   collapsed and a shimmer placeholder shows instead. carvo.js drops the class once the
   gateways are in (or after 10s); the 12s animations reveal the notice on their own
   should the script never run (e.g. a genuine no-gateway case). */
body.carvo-payment-pending .wc-block-checkout__no-payment-methods-notice{
	overflow:hidden;padding:0!important;/* WC sets the padding !important, out of the keyframe's reach */
	animation:carvo-payment-reveal 1ms linear 12s both;
}
body.carvo-payment-pending .wc-block-checkout__payment-method:has(.wc-block-checkout__no-payment-methods-notice) .wc-block-components-checkout-step__content::after{
	content:"";display:block;height:56px;border:1px solid rgba(15,23,42,.1);border-radius:8px;
	background:linear-gradient(90deg,transparent 0%,rgba(15,23,42,.06) 50%,transparent 100%) 0 0/200% 100%;
	animation:carvo-shimmer 1.25s ease infinite,carvo-payment-placeholder-out 1ms linear 12s forwards;
}
@keyframes carvo-payment-reveal{from{max-height:0;opacity:0;margin:0;border-width:0;}to{max-height:40rem;opacity:1;}}
@keyframes carvo-payment-placeholder-out{to{height:0;border-width:0;opacity:0;}}
@keyframes carvo-shimmer{from{background-position:200% 0;}to{background-position:-200% 0;}}
