/*
Theme Name: ازمزرعه شاپ
Theme URI: https://example.com
Description: قالب فارسی (راست‌چین) سازگار با ووکامرس، تبدیل‌شده از نسخه HTML فروشگاه ازمزرعه شاپ.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Author: ازمزرعه شاپ
Text Domain: azmazraeh
Tags: e-commerce, rtl-language-support, woocommerce
*/

:root{--g:#245b3b;--g2:#39754f;--cream:#faf8f1;--ink:#243229;--muted:#68756b;--line:#e0e7dd;--gold:#e3b64f;--red:#b42318}
*{box-sizing:border-box}body{margin:0;background:var(--cream);color:var(--ink);font-family:Tahoma,Arial,sans-serif}button,input,select,textarea{font:inherit}button{cursor:pointer}button:disabled{opacity:.45;cursor:not-allowed}
.top{background:#173d2a;color:white;padding:9px 4%;display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap;font-size:12px}
header{position:sticky;top:0;z-index:5;background:white;border-bottom:1px solid var(--line);padding:14px 4%;display:flex;align-items:center;gap:14px;justify-content:space-between}.brand{display:flex;gap:9px;align-items:center;color:var(--g);font-size:23px;font-weight:900;white-space:nowrap}.logo{background:var(--g);color:#fff;width:39px;height:39px;border-radius:12px;display:grid;place-items:center}.search{display:flex;flex:1;max-width:470px}.search input{min-width:0;width:100%;padding:11px;border:1px solid var(--line);border-radius:0 10px 10px 0}.search button{border:0;background:var(--g);color:white;padding:0 14px;border-radius:10px 0 0 10px}.head-actions{display:flex;gap:7px}.btn{border:1px solid var(--line);border-radius:10px;background:white;color:var(--g);padding:10px 12px;font-weight:bold}.btn.primary{background:var(--g);border-color:var(--g);color:white}.btn.gold{background:var(--gold);border-color:var(--gold);color:#30240b}
.hero{max-width:1200px;width:92%;margin:22px auto;border-radius:22px;min-height:270px;overflow:hidden;background:linear-gradient(90deg,rgba(19,57,37,.96),rgba(19,57,37,.38)),url('https://images.unsplash.com/photo-1542838132-92c53300491e?auto=format&fit=crop&w=1800&q=85') center/cover;display:flex;align-items:center;color:white}.hero-copy{padding:32px 5%;max-width:650px}.hero h1{font-size:clamp(26px,4vw,42px);line-height:1.5;margin:0 0 8px}.hero p{line-height:2;color:#edf4e9}.tag{display:inline-block;background:#f2d58d;color:#493a17;border-radius:25px;padding:6px 12px;font-size:12px;font-weight:bold}
.section{max-width:1200px;width:92%;margin:28px auto}.section-head{display:flex;justify-content:space-between;align-items:end;gap:12px;flex-wrap:wrap;margin-bottom:15px}.section h2{margin:0;font-size:22px}.muted{font-size:12px;color:var(--muted);line-height:1.9;margin-top:5px}
.categories{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}.cat{height:175px;border:0;padding:0;position:relative;overflow:hidden;border-radius:16px;background:#dce5d8;text-align:right}.cat img{width:100%;height:100%;object-fit:cover;display:block;transition:transform .2s}.cat:hover img{transform:scale(1.04)}.cat:after{content:"";position:absolute;inset:30% 0 0;background:linear-gradient(transparent,rgba(0,0,0,.78))}.cat span{position:absolute;z-index:1;bottom:13px;right:14px;color:white;font-weight:bold;font-size:17px}.cat.active{outline:3px solid var(--gold);outline-offset:2px}
.products{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:15px}.card{background:white;border:1px solid var(--line);border-radius:16px;overflow:hidden;display:flex;flex-direction:column}.card img{width:100%;height:185px;object-fit:cover;background:#e7eee4}.cardbody{padding:13px;display:flex;flex-direction:column;flex:1}.card h3{font-size:15px;margin:0 0 7px}.desc{font-size:12px;color:var(--muted);line-height:1.8;min-height:34px}.price-row{display:flex;justify-content:space-between;gap:6px;align-items:center;margin:9px 0}.price{font-size:16px;font-weight:bold;color:var(--g)}.stock{font-size:11px;color:var(--muted)}.stock.low{color:#b45309}.buyrow{display:flex;gap:8px;align-items:center;margin-top:auto}.stepper{display:flex;align-items:center;border:1px solid var(--line);border-radius:9px;overflow:hidden;height:39px}.stepper button{border:0;background:#f0f5ed;color:var(--g);height:100%;width:31px;font-weight:bold;font-size:18px}.stepper output{min-width:25px;text-align:center;font-size:13px}.buyrow .add{flex:1;border:0;background:var(--g);color:white;border-radius:9px;height:39px;font-weight:bold}
.empty{padding:30px;text-align:center;background:white;border:1px dashed var(--line);border-radius:14px;color:var(--muted)}.notice{padding:12px;border-radius:11px;background:#fff6dc;border:1px solid #f0dfac;font-size:12px;line-height:1.9;margin-top:15px}
footer{margin-top:38px;background:#173d2a;color:#e6eee6;padding:25px 4%;line-height:2;font-size:12px}.footinner{max-width:1200px;margin:auto;display:flex;justify-content:space-between;gap:18px;flex-wrap:wrap}
dialog{border:0;border-radius:17px;width:min(680px,95%);padding:0;box-shadow:0 20px 80px #0005}dialog::backdrop{background:#13251ddd}.modalhead{padding:15px 18px;background:#f0f5ed;display:flex;justify-content:space-between;align-items:center}.modalbody{padding:18px;max-height:78vh;overflow:auto}.x{border:0;background:transparent;font-size:25px}.formgrid{display:grid;grid-template-columns:1fr 1fr;gap:11px}.field{display:flex;flex-direction:column;gap:6px}.field.full{grid-column:1/-1}.field label{font-size:12px;font-weight:bold}.field input,.field select,.field textarea{width:100%;min-width:0;border:1px solid var(--line);border-radius:9px;padding:11px;background:white}.field textarea{min-height:72px}.line{display:flex;justify-content:space-between;gap:12px;border-bottom:1px solid var(--line);padding:11px 0;line-height:1.8}.total{font-weight:bold;font-size:18px;display:flex;justify-content:space-between;margin:15px 0}.message{font-size:12px;line-height:1.9;margin-top:10px}.success{color:#166534}.error{color:var(--red)}.hidden{display:none!important}
.pagebox{max-width:900px;width:92%;margin:26px auto;background:white;border:1px solid var(--line);border-radius:18px;padding:22px}.pagebox h2{margin-top:0}.receipt-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.receipt-cell{background:#f6f8f3;padding:11px;border-radius:10px;line-height:1.9;font-size:13px}.receipt-cell.full{grid-column:1/-1}.receipt-items{width:100%;border-collapse:collapse;margin-top:15px}.receipt-items th,.receipt-items td{border-bottom:1px solid var(--line);padding:10px;text-align:right;font-size:13px}.tracking-input{display:flex;gap:8px;max-width:600px}.tracking-input input{flex:1;min-width:0;padding:12px;border:1px solid var(--line);border-radius:9px}
@media(max-width:850px){.categories,.products{grid-template-columns:repeat(2,minmax(0,1fr))}.cat{height:145px}header{flex-wrap:wrap}.search{order:3;max-width:none;flex-basis:100%}.hero{min-height:230px}.card img{height:155px}}
@media(max-width:450px){.head-actions{width:100%;justify-content:space-between}.head-actions .btn{flex:1;padding:9px 5px}.products{gap:9px}.card img{height:120px}.cardbody{padding:9px}.buyrow{flex-wrap:wrap}.buyrow .add{width:100%;flex:auto}.formgrid,.receipt-grid{grid-template-columns:1fr}.field.full,.receipt-cell.full{grid-column:auto}.tracking-input{flex-direction:column}}

/* پیام‌های شناور شکیل فروشگاه */
.toast-host{position:fixed;z-index:10000;top:18px;left:18px;right:18px;display:flex;justify-content:center;pointer-events:none}
.toast{pointer-events:auto;display:flex;align-items:center;gap:11px;max-width:min(460px,100%);padding:13px 17px;border:1px solid #cfe4d2;border-radius:15px;background:rgba(255,255,255,.97);box-shadow:0 12px 35px #173d2a26;color:#204d32;font-size:13px;line-height:1.8;animation:toastIn .24s ease-out}
.toast-icon{width:30px;height:30px;flex:0 0 30px;border-radius:50%;display:grid;place-items:center;background:#e4f4e7;color:#17643a;font-weight:bold;font-size:17px}
.toast.error{border-color:#f1d0cd;color:#922b23}.toast.error .toast-icon{background:#fff0ee;color:#b42318}
.toast.hide{animation:toastOut .22s ease-in forwards}
@keyframes toastIn{from{opacity:0;transform:translateY(-9px)}to{opacity:1;transform:translateY(0)}}@keyframes toastOut{to{opacity:0;transform:translateY(-8px)}}
@media(max-width:480px){.toast-host{top:10px;left:10px;right:10px}.toast{width:100%;font-size:12px}}

/* ادغام پنل مدیریت در انتهای همین صفحه */
.brand{border:0;background:transparent;padding:0;color:inherit;text-align:right;cursor:pointer;font:inherit}
.admin-embed-section{max-width:1300px;width:94%;margin:34px auto 22px;padding-top:24px;border-top:1px solid var(--line,#dfe6dc)}
.admin-embed-section h2{margin:0 0 8px;font-size:20px}
.admin-embed-section>p{font-size:12px;line-height:1.9;color:var(--muted,#647267);margin:0 0 14px}
.admin-embed-frame{display:block;width:100%;height:620px;border:1px solid #dfe6dc;border-radius:14px;background:#f4f6f1;overflow:hidden}

.pagebox{max-width:1100px;margin:24px auto;padding:20px;background:#fff;border:1px solid var(--line);border-radius:16px}.pagebox.hidden{display:none}.section{margin:24px 0}.card{cursor:pointer}#footerContactNumbers{font-size:12px;line-height:1.8}footer a{color:inherit}

/* Responsive layout: desktop and mobile */
html{scroll-behavior:smooth}body{min-width:320px}img{max-width:100%}
@media(min-width:1200px){header{padding-left:max(4%,calc((100% - 1440px)/2));padding-right:max(4%,calc((100% - 1440px)/2))}.hero,.section,.pagebox,.footinner{max-width:1440px}.products{grid-template-columns:repeat(4,minmax(0,1fr));gap:20px}.categories{gap:18px}.card img{height:210px}.pagebox{padding:28px}.admin-embed-section{max-width:1440px}}
@media(min-width:1500px){.products{grid-template-columns:repeat(5,minmax(0,1fr))}.hero{min-height:320px}.section h2{font-size:25px}}
@media(max-width:850px){header{gap:10px;padding:11px 3%;flex-wrap:wrap}.brand{font-size:20px}.search{order:3;flex:1 0 100%;max-width:none}.head-actions{flex-wrap:wrap}.head-actions .btn{white-space:nowrap}.hero,.section,.pagebox{width:94%}.products{grid-template-columns:repeat(2,minmax(0,1fr))}.categories{grid-template-columns:repeat(2,minmax(0,1fr))}.pagebox{padding:16px}.admin-embed-frame{height:760px}}
@media(max-width:520px){.top{padding:8px 3%;font-size:11px}header{padding:9px 3%;gap:8px}.brand{font-size:18px}.logo{width:34px;height:34px}.head-actions{width:100%;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}.head-actions .btn{padding:9px 5px;font-size:11px}.hero{width:94%;min-height:210px;margin:14px auto;border-radius:15px}.hero-copy{padding:22px 6%}.hero p{font-size:12px}.section{margin:20px auto}.section h2{font-size:18px}.categories{gap:9px}.cat{height:125px}.cat span{font-size:14px;right:10px;bottom:10px}.products{gap:9px}.card{border-radius:12px}.card img{height:125px}.cardbody{padding:9px}.card h3{font-size:13px}.desc{font-size:11px}.price{font-size:13px}.buyrow{gap:5px;flex-wrap:wrap}.stepper{height:35px}.buyrow .add{width:100%;flex:1 0 100%;height:35px;font-size:12px}.pagebox{padding:12px;margin:15px auto;border-radius:13px}.pagebox h2{font-size:18px}.receipt-grid,.formgrid{grid-template-columns:1fr}.field.full,.receipt-cell.full{grid-column:auto}.tracking-input{flex-direction:column}.detail-toolbar{gap:8px}footer{padding:20px 4%}.footinner{display:grid;grid-template-columns:1fr;gap:10px}.admin-embed-section{width:96%;margin-top:22px}.admin-embed-frame{height:820px;border-radius:10px}}
@media(hover:none){.cat:hover img{transform:none}}

.detail-toolbar{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}.detail-cart{border:0;background:transparent;font-size:25px;cursor:pointer;color:var(--g);display:flex;flex-direction:column;align-items:center;line-height:1}.detail-cart small{font-size:11px;margin-top:2px}.detail-gallery{display:flex;gap:8px;overflow:auto;align-items:center}.detail-gallery img{width:92px!important;height:86px!important;object-fit:cover;border-radius:9px;flex:0 0 auto}.detail-specs{margin-top:10px}.detail-specs summary{cursor:pointer;font-weight:700;padding:10px;border:1px solid var(--line);border-radius:10px;background:var(--soft,#f7f8f5)}#productQuestionForm{margin-top:10px}
/* ---------- سازگاری با وردپرس و ووکامرس ---------- */
a{color:var(--g)}a.btn,a.brand{text-decoration:none;display:inline-flex;align-items:center}
.screen-reader-text{position:absolute;left:-9999px}
.azm-main{max-width:1200px;width:92%;margin:24px auto}
.pagebox{max-width:1200px;width:92%;margin:24px auto;background:#fff;border:1px solid var(--line);border-radius:16px;padding:22px}
.woocommerce-notices-wrapper{max-width:1200px;margin:10px auto}
.hidden{display:none!important}
.azm-cart-count{display:inline}
/* شبکه محصولات */
.woocommerce ul.products,ul.products{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr));gap:15px;margin:0;padding:0;list-style:none}
.woocommerce ul.products::before,.woocommerce ul.products::after{display:none!important}
.woocommerce ul.products li.product{width:auto!important;float:none!important;margin:0!important;padding:0}
.woocommerce ul.products li.product.card a img{margin:0;height:185px;width:100%;object-fit:cover}
.card .price{color:var(--g);font-weight:bold;font-size:16px}.card h3 a{color:var(--ink);text-decoration:none}
.buyrow .button{flex:1;text-align:center}
/* دکمه‌ها */
.woocommerce a.button,.woocommerce button.button,.woocommerce input.button,.woocommerce #respond input#submit,.woocommerce a.button.alt,.woocommerce button.button.alt,.woocommerce input.button.alt{background:var(--g);color:#fff;border-radius:9px;font-weight:bold;padding:11px 14px}
.woocommerce a.button:hover,.woocommerce button.button:hover,.woocommerce a.button.alt:hover,.woocommerce button.button.alt:hover{background:var(--g2);color:#fff}
.woocommerce span.onsale{background:var(--gold);color:#30240b}
.woocommerce div.product p.price,.woocommerce div.product span.price{color:var(--g);font-weight:bold}
.woocommerce-message,.woocommerce-info{border-top-color:var(--g)}.woocommerce-message::before,.woocommerce-info::before{color:var(--g)}
.woocommerce table.shop_table{border-radius:12px;border-color:var(--line)}
.woocommerce form .form-row input.input-text,.woocommerce form .form-row textarea,.select2-container .select2-selection{border:1px solid var(--line);border-radius:9px;padding:10px}
.stock.low{color:#b45309}
@media(max-width:850px){.woocommerce ul.products,ul.products{grid-template-columns:repeat(2,minmax(0,1fr))!important}}
