/**
KafeZare Woo Pages v2.0 (Fixed)
محصول / سبد خرید / تسویه‌حساب
*/

/* ── ظرف مشترک ── */
body.single-product .site-main,
body.woocommerce-cart .site-main,
body.woocommerce-checkout .site-main{background:#fbf6f0;padding:45px 0 90px}
body.single-product .woocommerce-wrapper .container{max-width:1240px}
body.woocommerce-cart .woocommerce,
body.woocommerce-checkout .woocommerce{max-width:1240px;margin:0 auto;padding:0 20px}

/* ── Breadcrumb ── */
body.single-product .breadcrumb{margin-bottom:20px;font-size:12px}
body.single-product .breadcrumb a{color:#6b3d21}
body.single-product .breadcrumb .current{color:#e91e4f;font-weight:700}

/* ═══ صفحه محصول ═══ */
body.single-product div.product{
display:grid;
grid-template-columns:minmax(0,1fr) minmax(0,1fr);
gap:40px;
background:#fff;border-radius:24px;padding:28px;
box-shadow:0 8px 25px rgba(49,29,15,.06);
position:relative;
}
/* جای دقیق هر بخش — جلوگیری از له‌شدگی */
body.single-product .woocommerce-product-gallery{grid-column:1;grid-row:1;min-width:0;position:relative}
body.single-product div.product .summary.entry-summary{grid-column:2;grid-row:1;min-width:0}
body.single-product .woocommerce-tabs{grid-column:1/-1;grid-row:2;width:100%}
body.single-product .related.products,
body.single-product .up-sells{grid-column:1/-1;grid-row:3;width:100%;min-width:0}

/* گالری + تعمیر FlexSlider */
body.single-product .woocommerce-product-gallery .flex-viewport{border-radius:20px;overflow:hidden;background:#f6eee6}
body.single-product .woocommerce-product-gallery__wrapper{margin:0;padding:0}
body.single-product .woocommerce-product-gallery__image{display:block;width:100%;border-radius:20px;overflow:hidden;background:#f6eee6}
body.single-product .woocommerce-product-gallery__image img{width:100%;height:auto;object-fit:cover;border-radius:20px}
body.single-product .flex-control-thumbs{display:flex;gap:10px;margin-top:12px;list-style:none;padding:0}
body.single-product .flex-control-thumbs li{flex:1;min-width:0}
body.single-product .flex-control-thumbs img{border-radius:12px;border:2px solid transparent;opacity:.7;cursor:pointer;width:100%;height:auto}
body.single-product .flex-control-thumbs .flex-active,
body.single-product .flex-control-thumbs img:hover{border-color:#e91e4f;opacity:1}
body.single-product .onsale{
position:absolute;top:14px;right:14px;z-index:5;padding:7px 14px;border-radius:999px;
background:linear-gradient(135deg,#e91e4f,#f44336)!important;color:#fff!important;font-size:12px;font-weight:900;
}

/* خلاصه محصول */
body.single-product .summary h1.product_title{font-size:26px;font-weight:900;color:#281810!important;margin:0 0 12px;line-height:1.6}
body.single-product .summary .price{font-size:26px;font-weight:900;color:#e91e4f!important}
body.single-product .summary .price del{color:#aaa!important;font-size:14px;font-weight:500;margin-left:8px}
body.single-product .woocommerce-product-details__short-description{
color:#756960!important;line-height:2.1;font-size:14px;border-top:1px dashed #eadfd4;padding-top:16px;margin-top:16px;
}
body.single-product .cart{display:flex;gap:12px;align-items:stretch;margin-top:22px;flex-wrap:wrap}
body.single-product .quantity{display:inline-flex;align-items:center;border:1px solid #eadfd4;border-radius:14px;overflow:hidden;background:#fff}
body.single-product .quantity .qty{width:52px;text-align:center;border:0;padding:12px 0;font-weight:900;font-size:15px;outline:0}
body.single-product .single_add_to_cart_button{flex:1;min-height:54px;border-radius:14px;font-size:16px;font-weight:900}
body.single-product .product_meta{margin-top:24px;display:flex;flex-direction:column;gap:10px;font-size:13px;color:#756960!important}
body.single-product .product_meta a{
display:inline-block;background:#fff0f4;padding:5px 14px;border-radius:999px;color:#e91e4f!important;font-size:12px;font-weight:800;margin:0 4px;
}

/* تب‌ها */
body.single-product .woocommerce-tabs{margin-top:10px}
body.single-product .woocommerce-tabs ul.tabs{display:flex;gap:8px;list-style:none;padding:0;margin:0;border:0;flex-wrap:wrap}
body.single-product .woocommerce-tabs ul.tabs li{margin:0;padding:0;border:0!important;background:transparent!important}
body.single-product .woocommerce-tabs ul.tabs li a{
display:block;padding:11px 22px;border-radius:12px;background:#fff;border:1px solid #eadfd4;color:#6b3d21!important;font-weight:800;font-size:13px;
}
body.single-product .woocommerce-tabs ul.tabs li.active a{background:#2C1810;color:#fff!important;border-color:#2C1810}
body.single-product .woocommerce-tabs .panel{
background:#fff;border:1px solid #eee5dc;border-radius:20px;padding:26px;margin-top:12px;color:#756960!important;line-height:2.1;font-size:14px;
}
body.single-product .woocommerce-tabs .panel h2{font-size:18px!important;font-weight:900;color:#281810!important}

/* محصولات مشابه — تعمیر کامل */
body.single-product .related.products>h2{text-align:center;font-size:24px;font-weight:900;color:#281810!important;margin-bottom:26px}
body.single-product .related.products ul.products{
display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:16px;padding:0;margin:0;float:none!important;
}
body.single-product .related.products li.product{
float:none!important;width:auto!important;min-width:0;
background:#fff;border:1px solid #eee5dc;border-radius:20px;overflow:hidden;list-style:none;box-shadow:0 8px 25px rgba(49,29,15,.05);transition:.3s;
}
body.single-product .related.products li.product:hover{transform:translateY(-6px)}
body.single-product .related.products li.product img{width:100%;aspect-ratio:1;object-fit:cover}
body.single-product .related.products .woocommerce-loop-product__title{font-size:13px;font-weight:800;color:#281810!important;padding:12px 14px 4px}
body.single-product .related.products .price{color:#e91e4f!important;font-weight:900;padding:0 14px}
body.single-product .related.products .button{margin:10px 14px 14px;width:calc(100% - 28px);min-height:42px;border-radius:12px;font-size:12px;font-weight:800}

/* ═══ سبد خرید ═══ */
body.woocommerce-cart .woocommerce{display:grid;grid-template-columns:minmax(0,1fr) 360px;gap:24px;align-items:start}
body.woocommerce-cart .woocommerce-cart-form{grid-column:1;min-width:0}
body.woocommerce-cart .cart_totals{grid-column:2;position:sticky;top:90px;min-width:0}
body.woocommerce-cart table.shop_table{width:100%;background:#fff;border-radius:20px;overflow:hidden;box-shadow:0 8px 25px rgba(49,29,15,.06);border:0;margin:0}
body.woocommerce-cart .shop_table thead{background:#2C1810}
body.woocommerce-cart .shop_table th{padding:15px 16px;color:#fff;font-size:13px;font-weight:700;border:0}
body.woocommerce-cart .shop_table td{padding:16px;vertical-align:middle;border:0;border-bottom:1px solid #f3eae1}
body.woocommerce-cart .shop_table td.product-thumbnail img{width:74px;height:74px;object-fit:cover;border-radius:14px}
body.woocommerce-cart .shop_table td.product-name a{font-weight:800;color:#281810!important;font-size:14px}
body.woocommerce-cart .shop_table .product-remove a{color:#ef4444!important;font-size:20px;font-weight:900}
body.woocommerce-cart .quantity{display:inline-flex;border:1px solid #eadfd4;border-radius:12px;overflow:hidden}
body.woocommerce-cart .quantity .qty{width:48px;text-align:center;border:0;padding:9px 0;font-weight:800;outline:0}
body.woocommerce-cart .coupon .input-text{padding:10px 14px;border:1px solid #eadfd4;border-radius:12px;width:150px;outline:0}
body.woocommerce-cart .coupon button,
body.woocommerce-cart button[name="update_cart"]{padding:10px 18px;border-radius:12px;background:#2C1810!important;color:#fff!important;font-weight:800;font-size:13px}
body.woocommerce-cart .cart_totals{background:#fff;border-radius:20px;padding:24px;box-shadow:0 8px 25px rgba(49,29,15,.06)}
body.woocommerce-cart .cart_totals h2{font-size:18px;font-weight:900;color:#281810!important}
body.woocommerce-cart .cart_totals table{width:100%;border:0;margin:14px 0}
body.woocommerce-cart .cart_totals td{padding:10px 4px;border:0;font-size:14px;color:#756960}
body.woocommerce-cart .cart_totals .order-total strong{color:#e91e4f!important;font-size:20px;font-weight:900}
body.woocommerce-cart .checkout-button{display:flex;width:100%;min-height:56px;align-items:center;justify-content:center;border-radius:16px;font-size:16px;font-weight:900}

/* ═══ تسویه‌حساب ═══ */
body.woocommerce-checkout form.checkout{display:grid;grid-template-columns:minmax(0,1fr) 400px;gap:24px;align-items:start}
body.woocommerce-checkout #customer_details{grid-column:1;grid-row:1/span 3;min-width:0}
body.woocommerce-checkout #order_review_heading{grid-column:2;grid-row:1;font-size:18px;font-weight:900;color:#281810!important;margin:0 0 12px}
body.woocommerce-checkout #order_review{grid-column:2;grid-row:2;position:sticky;top:90px;min-width:0}
body.woocommerce-checkout .woocommerce-billing-fields,
body.woocommerce-checkout .woocommerce-shipping-fields{background:#fff;border-radius:20px;padding:22px;box-shadow:0 8px 25px rgba(49,29,15,.06);margin-bottom:20px}
body.woocommerce-checkout .form-row{margin-bottom:14px}
body.woocommerce-checkout .form-row label{display:block;font-size:13px;font-weight:800;color:#3a2115!important;margin-bottom:6px}
body.woocommerce-checkout .input-text,
body.woocommerce-checkout select,
body.woocommerce-checkout textarea{width:100%;padding:12px 14px;border:1px solid #eadfd4;border-radius:12px;background:#fff;font-size:14px;outline:0;transition:.2s}
body.woocommerce-checkout .input-text:focus,
body.woocommerce-checkout select:focus{border-color:#e91e4f;box-shadow:0 0 0 3px rgba(233,30,79,.12)}
body.woocommerce-checkout #order_review{background:#fff;border-radius:20px;padding:22px;box-shadow:0 8px 25px rgba(49,29,15,.06)}
body.woocommerce-checkout #order_review table{width:100%;border:0;margin:0}
body.woocommerce-checkout #order_review td,
body.woocommerce-checkout #order_review th{padding:10px 4px;border:0;border-bottom:1px solid #f3eae1;font-size:13px;color:#756960}
body.woocommerce-checkout #order_review .product-name{font-weight:800;color:#281810}
body.woocommerce-checkout #order_review .order-total strong{color:#e91e4f!important;font-size:19px;font-weight:900}
body.woocommerce-checkout .wc_payment_methods{list-style:none;padding:0;margin:16px 0 0;display:flex;flex-direction:column;gap:10px}
body.woocommerce-checkout .wc_payment_methods li{border:1px solid #eadfd4;border-radius:14px;padding:13px 15px;background:#fff}
body.woocommerce-checkout .wc_payment_methods input[type="radio"]{accent-color:#e91e4f;margin-left:8px}
body.woocommerce-checkout .wc_payment_methods label{font-weight:900;color:#281810!important;font-size:14px}
body.woocommerce-checkout .payment_box{background:#fbf6f0;border-radius:10px;padding:10px 12px;font-size:12px;color:#756960;margin-top:8px;line-height:1.9}
body.woocommerce-checkout #place_order{width:100%;min-height:58px;border-radius:16px;font-size:17px;font-weight:900}
body.woocommerce-checkout .kz-trust-note{margin-top:14px;text-align:center;font-size:12px;color:#15803d;background:#f0fdf4;border:1px solid #bbf7d0;border-radius:12px;padding:10px 12px;line-height:1.9}

/* پیام‌ها */
body.woocommerce-cart .woocommerce-message,
body.woocommerce-checkout .woocommerce-message,
body.woocommerce-cart .woocommerce-info,
body.woocommerce-checkout .woocommerce-info{border-radius:14px;background:#fff;border:1px solid #eadfd4;border-right:4px solid #22c55e;padding:14px 18px;font-size:13px}

/* ═══ واکنش‌گرا ═══ */
@media(max-width:1024px){
body.single-product div.product{grid-template-columns:1fr}
body.single-product .woocommerce-product-gallery,
body.single-product div.product .summary,
body.single-product .woocommerce-tabs,
body.single-product .related.products{grid-column:1;grid-row:auto}
body.single-product .related.products ul.products{grid-template-columns:repeat(2,minmax(0,1fr))!important}
body.woocommerce-cart .woocommerce{grid-template-columns:1fr}
body.woocommerce-cart .cart_totals{grid-column:1;position:static}
body.woocommerce-checkout form.checkout{grid-template-columns:1fr}
body.woocommerce-checkout #customer_details,
body.woocommerce-checkout #order_review_heading,
body.woocommerce-checkout #order_review{grid-column:1;grid-row:auto;position:static}
}
@media(max-width:640px){
body.single-product .site-main,
body.woocommerce-cart .site-main,
body.woocommerce-checkout .site-main{padding:25px 0 60px}
body.single-product div.product{padding:16px;border-radius:18px}
body.single-product .summary h1.product_title{font-size:19px}
body.woocommerce-cart .shop_table thead{display:none}
body.woocommerce-cart .shop_table,
body.woocommerce-cart .shop_table tbody,
body.woocommerce-cart .shop_table tr,
body.woocommerce-cart .shop_table td{display:block;width:100%}
body.woocommerce-cart .shop_table tr{position:relative;background:#fff;border-radius:16px;margin-bottom:14px;padding:14px;box-shadow:0 8px 25px rgba(49,29,15,.06)}
body.woocommerce-cart .shop_table td{border:0;padding:6px 0;display:flex;justify-content:space-between;align-items:center}
body.woocommerce-cart .shop_table td::before{content:attr(data-title);font-size:12px;font-weight:800;color:#756960}
body.woocommerce-cart .shop_table td.product-thumbnail{justify-content:center}
body.woocommerce-cart .shop_table td.product-thumbnail::before{display:none}
body.woocommerce-cart .shop_table td.product-remove{position:absolute;top:8px;left:8px;width:auto}
body.woocommerce-cart .shop_table td.product-remove::before{display:none}
}
@media(prefers-reduced-motion:reduce){
body.single-product *,body.woocommerce-cart *,body.woocommerce-checkout *{transition:none!important;animation:none!important}
}