*{box-sizing:border-box}body{margin:0;background:#f7f5ef;color:#182827;font:1rem/1.6 system-ui,sans-serif}header{display:flex;justify-content:space-between;background:#183934;padding:1rem max(1rem,calc((100vw - 1050px)/2));color:white}header a{color:inherit}main{max-width:1082px;margin:auto;padding:1rem}h1,h2{line-height:1.25}a{color:inherit}label{display:block;margin-top:1rem}.controls{display:flex;flex-wrap:wrap;gap:.65rem;margin:.65rem 0;align-items:center}button,input{font:inherit;border:1px solid #497069;border-radius:.5rem;padding:.45rem .75rem}button{cursor:pointer;background:#fff;color:#183934}input{width:min(100%,24rem)}.gallery{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,17rem),1fr));gap:1rem;margin-block:1.5rem}.gallery article{padding:1.35rem;border:1px solid #cfded7;border-radius:1rem;background:#e4efe9;overflow-wrap:anywhere}.gallery .offer{background:#fbebb9}.gallery .custom{background:#eae5fa}.offer-copy{white-space:pre-wrap}dialog{border:0;border-radius:1rem;max-width:calc(100% - 2rem)}dialog::backdrop{background:#0009}canvas{display:block;max-width:100%;height:auto;margin:auto}[hidden]{display:none!important}
.gallery .custom.forest{background:#d8efdb}.gallery .custom.ocean{background:#dbeefa}.gallery .custom.center{text-align:center}.gallery .custom.right{text-align:right}select,textarea{font:inherit;border:1px solid #497069;border-radius:.5rem;padding:.45rem .75rem;width:min(100%,30rem)}summary{cursor:pointer}li form{display:inline-block;margin:.35rem}#preview:has(h2:empty):has(p:empty){display:none}.flyer,#sheet{display:block;width:100%;height:auto}#visual{min-width:0;margin:1rem 0}#sheet{max-width:650px}#items fieldset{margin:1rem 0}

.product-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:clamp(8px,2vw,20px)}.product-card{min-width:0;background:white;border:1px solid #d4dfda;border-radius:12px;padding:clamp(8px,2vw,16px);overflow-wrap:anywhere}.product-card img{width:100%;height:auto;aspect-ratio:16/11;object-fit:contain}.product-card strong{display:block;font-size:clamp(1.2rem,4vw,2rem);color:#205a40;line-height:1.25}.product-card p,.product-card h3{margin:.3rem 0}.product-card del{color:#606965}@media(min-width:768px){.product-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}
/* Continuous supermarket flyer, scoped to the active shop catalogue. */
main:has(#catalogue){max-width:64rem;padding:0 .46rem 1rem}main:has(#catalogue)>h1{display:none}#catalogue{margin:0 0 .8rem;color:#151c2d;background:repeating-linear-gradient(125deg,#ffc62e 0 13px,#ffbd1b 13px 26px);border:3px solid #162543;border-radius:14px;overflow:clip;font-family:Arial,'Noto Sans Tamil',sans-serif;box-sizing:border-box}#catalogue *{box-sizing:border-box}.flyer-head{position:relative;display:flex;align-items:center;justify-content:space-between;gap:.5rem;padding:.85rem .7rem;color:white;background:linear-gradient(108deg,#101e38 55%,#253e60);border-bottom:5px solid #ffbf19}.flyer-head h2{font-size:clamp(1.08rem,4vw,2rem);line-height:1.25;margin:.15rem 0;color:white}.flyer-brand{min-width:0}.flyer-brand img{display:block;max-width:90px;max-height:48px;object-fit:contain;background:white;border-radius:4px}.flyer-town{font-size:.8rem;color:#ffdd6a}.flyer-ribbon{padding:.45rem .55rem;background:#ac101a;color:#fff6ba;border:2px solid #fff3bf;border-radius:.7rem .25rem;font-weight:800;font-size:clamp(.8rem,3vw,1.05rem);line-height:1.2;text-align:center;transform:rotate(-4deg);max-width:40%}.flyer-period{padding:.35rem .7rem;background:#ffdb67;font-size:.77rem;margin:0;font-weight:700}.flyer-tools{display:flex;align-items:end;gap:.45rem;padding:.4rem .45rem;background:#fff4cf}.flyer-tools label{margin:0;min-width:0;flex:1;font-size:.69rem;color:#273345}.flyer-tools input,.flyer-tools select{display:block;width:100%;min-width:0;padding:.3rem;font-size:16px;background:#fffdf5}.flyer-tools #item-count{margin:0;align-self:center;font-weight:800;font-size:.8rem}#catalogue .product-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px;padding:4px}#catalogue .product-card{position:relative;min-width:0;padding:6px;display:flex;flex-direction:column;background:linear-gradient(145deg,#fffde8,#ffedb8);border:1px solid #e9a121;border-radius:8px;overflow-wrap:normal;word-break:normal}#catalogue .product-card[hidden]{display:none}#catalogue .product-card img{display:block;width:100%;height:clamp(70px,21vw,125px);object-fit:contain;mix-blend-mode:multiply}#catalogue .product-card h3{font-size:clamp(.8rem,3.2vw,1.04rem);line-height:1.32;margin:.28rem 0 .13rem;color:#14213b;white-space:normal;overflow-wrap:break-word;word-break:normal}#catalogue .product-card p{margin:.1rem 0;font-size:.75rem;line-height:1.3}#catalogue .product-card del{font-size:.73rem;color:#544a40;margin-top:auto;padding:.16rem 0}#catalogue .product-card strong{display:block;align-self:flex-start;padding:.22rem .42rem;background:#af101c;border-radius:7px 3px;color:#ffef67;font-weight:900;font-size:clamp(.94rem,3.7vw,1.38rem);line-height:1.18}#catalogue .product-card p:last-child{font-size:.7rem;color:#6b170b;font-weight:700}.flyer-discount{position:absolute;right:5px;top:5px;border-radius:1rem;background:#172a47;color:white;font-weight:800;font-size:.7rem;padding:3px 6px;border:1px solid gold}@media(min-width:760px){#catalogue .product-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:7px;padding:7px}}.flyer-discount{z-index:1}
.theme-grocery{--dark:#162543;--accent:#b31821}
.theme-textile{--dark:#512048;--accent:#963a65}
.theme-jewellery{--dark:#31271e;--accent:#815c18}
.theme-food{--dark:#313d24;--accent:#984826}
.theme-electronics{--dark:#132d4e;--accent:#176075}
.theme-fashion{--dark:#352a47;--accent:#9a3350}
.theme-furniture{--dark:#39342e;--accent:#795438}
.theme-beauty{--dark:#512744;--accent:#914664}
.theme-hardware{--dark:#28303a;--accent:#874325}
.theme-other{--dark:#203c42;--accent:#326047}
.variant-1{--paper:#e6f2dc}.variant-2{--paper:#fae8ef}.variant-3{--paper:#e4effb}.variant-custom.tone-forest{--dark:#204537;--accent:#235b40;--paper:#e1efda}.variant-custom.tone-ocean{--dark:#143550;--accent:#1a5678;--paper:#e0effa}.variant-custom.tone-gold{--dark:#3b3023;--accent:#785514;--paper:#ffefba}.variant-custom.tone-ruby{--dark:#502739;--accent:#943347;--paper:#fbe9eb}#catalogue:not(.theme-grocery.variant-0) .flyer-head,.business-swatch{background:var(--dark);color:white}#catalogue:not(.theme-grocery.variant-0) .product-card{background:linear-gradient(135deg,#fffaf0,var(--paper,#ffe9c1));border-color:var(--accent)}#catalogue:not(.theme-grocery.variant-0) .product-card strong,#catalogue:not(.theme-grocery.variant-0) .flyer-ribbon{background:var(--accent);color:white}.business-swatch{border-left:14px solid var(--accent);padding:1.2rem;margin:.6rem 0;font-weight:bold}.variant-1 .flyer-ribbon{transform:none;border-radius:30px}.variant-2 .flyer-ribbon{border-style:double;border-width:4px}.variant-3 .flyer-ribbon{transform:none;border-radius:2px}#catalogue-admin input[type=checkbox]{width:auto}
@media(max-width:640px){
 .shop-advert-page{-webkit-text-size-adjust:100%;text-size-adjust:100%;padding-inline:.55rem;font-size:.9375rem;line-height:1.55;min-width:0}
 .shop-advert-page h1{font-size:1.25rem;line-height:1.4}
 .shop-advert-page .gallery{grid-template-columns:minmax(0,1fr);gap:.75rem}
 .shop-advert-page .gallery article{min-width:0;padding:.8rem;overflow-wrap:break-word;word-break:normal}
 .shop-advert-page .gallery h2{font-size:1.0625rem;line-height:1.45}
 .shop-advert-page .controls{flex-wrap:wrap;gap:.45rem}
 .shop-advert-page button,.shop-advert-page .controls a{font-size:.875rem;line-height:1.4;max-width:100%;white-space:normal;min-height:2.75rem}
 .shop-advert-page input,.shop-advert-page select{min-width:0;max-width:100%}
 .shop-advert-page #catalogue .product-card h3{font-size:.875rem;line-height:1.4;word-break:normal;overflow-wrap:break-word}
}

.product-order { display: flex; flex-wrap: wrap; gap: .5rem; }
.product-order button:disabled { opacity: .55; }
@media (max-width: 640px) {
  #designer input, #designer select, #designer textarea { font-size: 16px; min-width: 0; max-width: 100%; }
  #designer canvas { display: block; max-width: 100%; height: auto; }
  .product-order button { min-height: 44px; }
}
