:root{--primary:#2563eb;--secondary:#0f172a;--accent:#f97316;--bg:#f7f7fb;--text:#111827;--card-radius:22px;--btn-radius:16px}*{box-sizing:border-box}body{margin:0;font-family:Tahoma,Arial,sans-serif;direction:rtl;background:var(--bg);color:var(--text)}a{text-decoration:none;color:inherit}.container{max-width:1180px;margin:auto;padding:0 16px}.top{background:var(--secondary);color:white;padding:14px 0}.nav{display:flex;align-items:center;justify-content:space-between;gap:15px}.brand{font-weight:900;font-size:24px}.hero{padding:60px 0;background:linear-gradient(135deg,var(--primary),var(--secondary));color:white}.hero h1{font-size:44px;margin:0 0 10px}.btn{display:inline-flex;align-items:center;justify-content:center;background:var(--primary);color:white;border:0;border-radius:var(--btn-radius);padding:12px 22px;cursor:pointer;font-weight:800;transition:.2s;box-shadow:0 8px 18px #0001}.btn:hover{transform:translateY(-1px)}.btn:disabled{opacity:.7;cursor:not-allowed;transform:none}.btn.accent{background:var(--accent)}.btn.muted{background:#64748b}.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:22px;margin:24px 0}.card{background:white;border-radius:var(--card-radius);box-shadow:0 16px 35px #00000012;overflow:hidden;border:1px solid #ffffff70}.card img{width:100%;height:220px;object-fit:cover;background:#e5e7eb}.card .p{padding:18px}.card h3{font-size:22px;margin:0 0 10px}.price{color:var(--primary);font-weight:900;font-size:22px}.old{text-decoration:line-through;color:#888;margin-inline-start:8px}.badge{display:inline-flex;background:#fff3e8;color:#d35400;padding:6px 10px;border-radius:999px;font-weight:800;font-size:13px;margin-bottom:8px}.section-title{margin-top:35px;font-size:34px}.chips{display:flex;gap:10px;flex-wrap:wrap;margin:20px 0}.chip{padding:10px 18px;border-radius:999px;background:white;border:1px solid #ddd;cursor:pointer;font-weight:700}.chip.active{background:var(--secondary);color:white}.search{width:100%;padding:15px;border:1px solid #ddd;border-radius:16px;margin-top:20px}.footer{background:var(--footer-bg);color:var(--footer-text);padding:28px 0;margin-top:45px}.product-wrap{display:grid;grid-template-columns:1.05fr .95fr;gap:34px;margin-top:34px;align-items:start}.product-gallery{background:white;border-radius:var(--card-radius);padding:14px;box-shadow:0 16px 35px #00000012}.product-img{width:100%;border-radius:calc(var(--card-radius) - 6px);background:#e5e7eb;max-height:540px;min-height:390px;object-fit:cover}.thumbs{display:flex;gap:10px;flex-wrap:wrap;margin-top:12px}.thumbs img{width:78px;height:78px;object-fit:cover;border-radius:14px;border:2px solid #e5e7eb;cursor:pointer}.thumbs img.active{border-color:var(--accent)}.product-info{padding:10px}.product-info h1{font-size:40px;margin:10px 0}.product-desc{font-size:18px;line-height:1.8;color:#374151}.offer-box{background:var(--offer-bg);color:var(--offer-text);border:1px solid color-mix(in srgb,var(--offer-text) 22%,transparent);border-radius:var(--card-radius);padding:16px;margin:18px 0}.countdown{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-top:12px}.countdown div{background:white;border-radius:14px;text-align:center;padding:10px;font-weight:900}.countdown span{display:block;font-size:22px;color:var(--accent)}.form{background:white;border-radius:var(--card-radius);padding:22px;box-shadow:0 16px 35px #00000012}.form input,.form textarea,.form select,.admin-form input,.admin-form textarea,.admin-form select{width:100%;padding:13px;border:1px solid #ddd;border-radius:14px;margin:7px 0;background:white}.form textarea,.admin-form textarea{min-height:95px}.sticky-buy{position:sticky;top:12px;z-index:5;width:100%;font-size:18px;margin-bottom:14px}.float-buy{position:fixed;bottom:18px;right:18px;left:18px;display:none;z-index:20}.admin-layout{display:grid;grid-template-columns:250px 1fr;min-height:100vh}.sidebar{background:#0f172a;color:white;padding:18px;position:sticky;top:0;height:100vh}.sidebar a{display:block;padding:13px;border-radius:14px;margin:6px 0}.sidebar a:hover,.sidebar a.active{background:#1e293b}.main{padding:24px}.stats{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:14px}.stat{background:white;border-radius:var(--card-radius);padding:18px;box-shadow:0 8px 20px #0001}.stat b{font-size:28px;color:var(--primary)}.table{width:100%;border-collapse:collapse;background:white;border-radius:16px;overflow:hidden;margin-top:14px}.table th,.table td{padding:13px;border-bottom:1px solid #eee;text-align:right;vertical-align:middle}.modal{background:white;border-radius:var(--card-radius);padding:20px;margin:16px 0;box-shadow:0 10px 25px #0000000d}.row,.form-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px}.form-grid label{font-weight:800;font-size:13px;color:#334155}.hidden{display:none!important}.mini-img{width:56px;height:56px;object-fit:cover;border-radius:12px;background:#e5e7eb}.mini-btn{border:0;background:#e2e8f0;color:#111827;border-radius:12px;padding:8px 11px;cursor:pointer;font-weight:800}.mini-btn.danger{background:#fee2e2;color:#991b1b}.employee-row{display:grid;grid-template-columns:1fr 1fr auto auto;gap:10px;align-items:center;background:#f8fafc;border-radius:16px;padding:10px;margin:8px 0}.check{display:flex;gap:6px;align-items:center;white-space:nowrap}.hint{color:#64748b;font-size:13px}.theme-preview{background:linear-gradient(135deg,#f8fafc,#eef2ff);padding:18px;border-radius:22px}.admin-form h3{margin:18px 0 8px}.admin-form button{margin-top:8px}#toast{position:fixed;top:18px;left:22px;background:#16a34a;color:white;padding:12px 18px;border-radius:14px;box-shadow:0 10px 25px #0002;opacity:0;transform:translateY(-10px);transition:.2s;z-index:9999}#toast.show{opacity:1;transform:translateY(0)}@media(max-width:800px){.product-wrap,.admin-layout{grid-template-columns:1fr}.sidebar{position:relative;height:auto}.hero h1{font-size:30px}.float-buy{display:flex}.sticky-buy{position:static}.employee-row{grid-template-columns:1fr}.product-info h1{font-size:30px}.product-img{min-height:260px}.countdown{grid-template-columns:repeat(2,1fr)}}

#toast.err{background:#dc2626}
.file-help{font-size:12px;color:#64748b;margin-top:4px}.thumbs img{background:#e5e7eb}

/* Pro ShopMasr-inspired storefront */
.hidden{display:none!important}.shop-header{background:var(--header-bg);color:var(--header-text);box-shadow:0 8px 24px #0000000a;position:sticky;top:0;z-index:30}.shop-nav{display:flex;justify-content:space-between;align-items:center;padding:14px 16px}.brand-wrap{display:flex;align-items:center;gap:10px}.logo{width:var(--logo-w,42px);height:var(--logo-h,42px);object-fit:contain;border-radius:12px}.nav-actions{display:flex;gap:10px;align-items:center}.btn.ghost{background:#111;color:#fff}.shop-hero{padding:55px 0;background:radial-gradient(circle at top right,color-mix(in srgb,var(--primary) 22%,transparent),transparent 35%),linear-gradient(135deg,#fff,#f8fafc)}.hero-grid{display:grid;grid-template-columns:1.3fr .7fr;gap:25px;align-items:center}.hero-copy h1{font-size:50px;line-height:1.15;margin:14px 0;color:#07152d}.hero-copy p{font-size:19px;color:#475569;line-height:1.8}.hero-pill{display:inline-flex;background:#fff7ed;color:#c2410c;border:1px solid #fed7aa;padding:9px 14px;border-radius:999px;font-weight:900}.trust-row{display:flex;gap:10px;flex-wrap:wrap;margin:18px 0}.trust-row span{background:#fff;border:1px solid #e5e7eb;border-radius:999px;padding:10px 14px;font-weight:800}.hero-btn{font-size:19px;padding:15px 30px;background:#111}.hero-card{background:#111;color:#fff;border-radius:28px;padding:24px;box-shadow:0 24px 50px #0002}.hero-card b{font-size:25px}.hero-card .offer-box{background:transparent;border-color:#ffffff24;color:#fff}.hero-card .countdown div{background:#fff;color:#111}.home-categories{margin:35px 0}.home-categories h2{font-size:32px}.category-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:14px}.category-card{background:#fff;border:1px solid #e5e7eb;border-radius:22px;padding:14px;display:flex;flex-direction:column;gap:10px;align-items:center;cursor:pointer;font-weight:900;box-shadow:0 12px 30px #0000000a}.category-card img{width:100%;height:105px;object-fit:cover;border-radius:16px;background:#e5e7eb}.section-head{display:flex;gap:15px;align-items:center;justify-content:space-between}.section-head .search{max-width:360px;margin:0}.shop-grid .product-card{transition:.25s;position:relative}.shop-grid .product-card:hover{transform:translateY(-6px);box-shadow:0 28px 55px #00000018}.product-img-wrap{height:240px;background:#eef2f7;display:flex;align-items:center;justify-content:center}.product-img-wrap img{height:100%;object-fit:cover}.card-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:15px}.shop-footer a{display:block;color:var(--footer-text);margin:8px 0;opacity:.95}.footer-grid{display:grid;grid-template-columns:1.4fr 1fr 1fr;gap:25px}.policy-page{background:#fff;border-radius:26px;padding:30px;margin:35px 0;box-shadow:0 18px 40px #0000000c}.policy-page h1{font-size:36px}.policy-content{font-size:18px;line-height:2;color:#334155;white-space:pre-wrap}

/* Funnel / offer page */
.funnel-page{background:var(--product-page-bg);color:var(--product-page-text)}.offer-top{background:var(--header-bg);color:var(--header-text);box-shadow:0 8px 24px #0001}.offer-nav{display:flex;justify-content:space-between;align-items:center;padding:14px 16px}.funnel-wrap{padding-top:30px}.funnel-hero{display:grid;grid-template-columns:1fr 1fr;gap:30px;align-items:start}.funnel-gallery{position:sticky;top:90px}.funnel-info{background:var(--product-card-bg);color:var(--product-page-text);border-radius:30px;padding:24px;box-shadow:0 20px 50px #00000012}.big-price{margin:18px 0}.big-price #pPrice{font-size:34px;color:#111;font-weight:1000}.funnel-trust span{background:#f8fafc}.sales-strip{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin:25px 0}.sales-strip div{background:var(--sale-strip-bg);color:var(--sale-strip-text);border-radius:20px;padding:15px;text-align:center;font-weight:900}.order-zone{max-width:720px;margin:25px auto}.funnel-form{border:2px solid #111}.funnel-form h2{font-size:32px;margin:0 0 8px}.wide{width:100%;font-size:19px;padding:16px}.funnel-page .float-buy{background:#ff5a00;animation:pulse 1.4s infinite}@keyframes pulse{0%,100%{transform:scale(1)}50%{transform:scale(1.035)}}

/* Admin polish */
.sidebar{box-shadow:-10px 0 30px #00000010}.main h1{font-size:34px}.admin-form textarea[name="privacy"],.admin-form textarea[name="terms"],.admin-form textarea[name="returns"],.admin-form textarea[name="shipping"]{min-height:220px}.employees-list .employee-row{box-shadow:0 8px 18px #00000008}.table tr:hover{background:#f8fafc}
@media(max-width:850px){.hero-grid,.funnel-hero,.footer-grid{grid-template-columns:1fr}.hero-copy h1{font-size:34px}.section-head{display:block}.section-head .search{max-width:100%;margin-top:8px}.sales-strip{grid-template-columns:1fr}.funnel-gallery{position:static}.nav-actions{gap:6px}.nav-actions .btn{padding:10px 12px}.product-img-wrap{height:210px}}

.image-uploader{background:#f8fafc;border:1px dashed #cbd5e1;border-radius:18px;padding:12px}.extra-image-inputs{display:grid;gap:8px;margin-top:8px}.extra-image-row{display:grid;grid-template-columns:1fr auto;gap:8px;align-items:center;background:#fff;border:1px solid #e5e7eb;border-radius:14px;padding:8px}.funnel-page .shop-footer{margin-top:55px}.funnel-page .float-buy{box-shadow:0 12px 28px #f9731640}

/* Theme builder extended fixes */
.brand,.brand-wrap,.shop-header a,.offer-top a,.offer-top b{color:var(--header-text)}
.footer p,.footer h3,.footer h4{color:var(--footer-text)}
.product-card h3,.product-card p{color:var(--product-card-text)}
.product-desc,.funnel-info h1,.funnel-info p{color:var(--product-page-text)}
.logo{width:var(--logo-w)!important;height:var(--logo-h)!important;max-width:300px;max-height:180px;object-fit:contain!important;background:transparent!important}
.theme-fields label{background:#f8fafc;border:1px solid #e5e7eb;border-radius:16px;padding:10px}

/* v10 final polish: validation, footer position, responsive logo */
html,body{min-height:100%}body{min-height:100vh;display:flex;flex-direction:column}main,.funnel-wrap{flex:1}.admin-layout{flex:1}.shop-footer{margin-top:auto;background:var(--footer-bg);color:var(--footer-text)}
.form-error{background:#fee2e2;color:#991b1b;border:1px solid #fecaca;border-radius:14px;padding:12px 14px;margin:0 0 12px;font-weight:800;text-align:center}.field-error{border-color:#ef4444!important;box-shadow:0 0 0 3px #ef444422!important;background:#fff7f7!important}
.brand-wrap{min-width:0}.brand-wrap .brand,#brandName,[data-site-name]{font-weight:900;line-height:1.2}.brand-wrap .logo:not(.hidden)+.brand,.brand-wrap .logo:not(.hidden)+#brandName{display:inline-flex;align-items:center;min-height:var(--logo-h,42px)}
.logo{flex:0 0 auto}.shop-nav,.offer-nav{min-height:72px}.policy-page{margin-bottom:45px}
@media(max-width:650px){.shop-nav,.offer-nav{gap:10px;padding:10px 12px}.brand-wrap{gap:8px}.brand,.brand-wrap .brand,#brandName{font-size:18px}.logo{max-width:110px!important;max-height:70px!important}.nav-actions .btn,.offer-nav .btn{font-size:14px;padding:10px 12px}.footer-grid{text-align:center}.policy-page{padding:22px;margin:20px 0}.policy-page h1{font-size:28px}.funnel-form h2{font-size:26px}}


/* v11 fix: desktop product grid + custom validation UX */
.products-section{width:100%;}
.shop-grid{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:24px!important;align-items:stretch!important;justify-items:stretch!important;}
.shop-grid .product-card{width:100%!important;max-width:none!important;margin:0!important;}
.form-error:empty{display:none;}
.form-error:not(:empty){display:block;}
.funnel-form .btn.invalid-submit,.funnel-form .btn.btn-error{background:#dc2626!important;color:#fff!important;box-shadow:0 12px 26px #dc262644!important;}
.funnel-form input.field-error,.funnel-form textarea.field-error{border-color:#dc2626!important;background:#fff5f5!important;}
@media(max-width:950px){.shop-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;}}
@media(max-width:650px){.shop-grid{grid-template-columns:1fr!important;}.section-head{text-align:center}.chips{justify-content:center}.card-actions .btn{flex:1 1 140px}.funnel-form{border-width:2px;padding:18px}.funnel-form input,.funnel-form textarea{font-size:16px}}


/* v12: product full description under order form */
.product-description-section{max-width:920px;margin:28px auto 45px;background:var(--product-card-bg,#fff);color:var(--product-page-text,#111827);border-radius:var(--card-radius,22px);padding:26px;box-shadow:0 18px 45px #00000010;border:1px solid #e5e7eb;line-height:2;}
.product-description-section h2{font-size:30px;margin:0 0 14px;color:var(--product-page-text,#111827)}
.product-full-description{font-size:18px;color:var(--product-page-text,#111827);white-space:normal;overflow-wrap:anywhere;}
@media(max-width:650px){.product-description-section{margin:20px 0 35px;padding:20px;border-radius:20px}.product-description-section h2{font-size:24px}.product-full-description{font-size:16px}}

/* v14: Rich text editor for product descriptions and policies */
.rich-label{display:block;margin-top:12px;font-weight:800}.rich-editor-wrap{background:#fff;border:1px solid #dbe3ef;border-radius:18px;overflow:hidden;margin:8px 0 14px;box-shadow:0 10px 24px #00000008}.rich-toolbar{display:flex;flex-wrap:wrap;gap:6px;padding:9px;background:#f8fafc;border-bottom:1px solid #e5e7eb}.rich-toolbar button,.rich-toolbar label{border:1px solid #dbe3ef;background:#fff;border-radius:10px;padding:7px 10px;cursor:pointer;font-weight:800;font-size:13px;display:inline-flex;align-items:center;gap:5px}.rich-toolbar input[type=color]{width:30px;height:24px;border:0;padding:0;background:transparent}.rich-area{min-height:170px;padding:14px 16px;line-height:1.9;outline:none;font-size:16px;background:#fff}.rich-area:focus{box-shadow:inset 0 0 0 2px #2563eb22}.rich-area a,.product-full-description a,.policy-content a,.card-desc a{color:var(--primary,#2563eb);text-decoration:underline;font-weight:800}.rich-area ul,.rich-area ol,.product-full-description ul,.product-full-description ol,.policy-content ul,.policy-content ol{padding-inline-start:28px}.product-full-description h1,.product-full-description h2,.product-full-description h3,.policy-content h1,.policy-content h2,.policy-content h3{line-height:1.4;margin:16px 0 8px}.product-full-description img,.policy-content img{max-width:100%;border-radius:16px;height:auto}.card-desc{line-height:1.7;color:var(--product-card-text);max-height:96px;overflow:hidden}.card-desc p{margin:0 0 6px}.policy-content{white-space:normal}.admin-form textarea.rich-text{display:none!important}@media(max-width:650px){.rich-toolbar{gap:5px}.rich-toolbar button,.rich-toolbar label{font-size:12px;padding:7px 8px}.rich-area{min-height:150px;font-size:15px}}
.upload-status{display:block;margin-top:8px;font-size:13px;font-weight:800;color:#64748b}.upload-status.loading{color:#2563eb}.upload-status.ok{color:#16a34a}.upload-status.err{color:#dc2626}.uploaded-thumb{display:inline-flex;flex-direction:column;gap:6px;align-items:center;margin:4px}.uploaded-thumb img{width:82px;height:82px;object-fit:cover;border-radius:14px;border:2px solid #e5e7eb;background:#e5e7eb}.uploaded-thumb .mini-btn{font-size:12px;padding:6px 8px}
