/* Trast Shop 1.4 — presentation layer only. Disable via theme=classic or rollback. */
.trast-modern {
 --cart-border:#eee5e9;--cart-bg:#fff;--cart-text:#241b21;
}
/* Cart: reserve a full text line for long Persian product names. */
.trast-modern .cart-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(240px,300px);gap:20px;align-items:start}
.trast-modern .cart-items{min-width:0;padding:clamp(14px,2vw,22px);background:var(--cart-bg)}
.trast-modern .cart-item--refined{display:grid;grid-template-columns:minmax(0,1fr);gap:13px;padding:17px 0;border-bottom:1px solid var(--cart-border);min-width:0;align-items:stretch}
.trast-modern .cart-item--refined:first-child{padding-block-start:4px}
.trast-modern .cart-item--refined .cart-item__identity{display:grid;grid-template-columns:clamp(64px,8vw,84px) minmax(0,1fr);gap:14px;min-width:0;align-items:center;direction:rtl}
.trast-modern .cart-item--refined .cart-item__photo{display:flex;align-items:center;justify-content:center;overflow:hidden;aspect-ratio:1;border-radius:14px;background:#faf8f9;border:1px solid #f1e9ed}
.trast-modern .cart-item--refined .cart-item__photo img{display:block;width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain;padding:7px;border-radius:inherit;mix-blend-mode:multiply}
.trast-modern .cart-item--refined .cart-item__photo .ui-icon{width:28px;height:28px;color:#bfb2b7}
.trast-modern .cart-item--refined .cart-item__details{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:4px;min-width:0;text-align:right}
.trast-modern .cart-item--refined .cart-item__name{font-size:clamp(.9rem,1.1vw,1.04rem);font-weight:850;line-height:1.9;min-width:0;max-width:100%;overflow-wrap:break-word;word-break:normal;color:var(--cart-text);text-decoration:none}
.trast-modern .cart-item--refined .cart-item__name:hover{color:#cd2a65}
.trast-modern .cart-item--refined :where(.cart-item__variant,.cart-item__unit-price){display:block;font-size:.76rem;color:#837780;line-height:1.75}
.trast-modern .cart-item--refined .cart-item__unit-price span{display:inline-block;unicode-bidi:isolate;white-space:nowrap}
.trast-modern .cart-item--refined .cart-item__controls{display:grid;grid-template-columns:minmax(90px,110px) minmax(0,1fr) auto;gap:12px;align-items:end;min-width:0;margin-inline-start:clamp(0px,7vw,98px)}
.trast-modern .cart-item--refined .cart-item__quantity{display:grid;gap:5px;min-width:0;color:#7e7379;font-size:.75rem}
.trast-modern .cart-item--refined .cart-item__quantity input{width:100%;min-width:0;height:43px;font-size:.93rem;text-align:center;border:1px solid #e8e0e4;border-radius:12px;background:#fff;margin:0;padding:0 7px;box-sizing:border-box}
.trast-modern .cart-item--refined .cart-item__price{display:flex;flex-direction:column;align-items:flex-start;gap:4px;min-width:0}
.trast-modern .cart-item--refined .cart-item__price small{color:#8e8288;font-size:.73rem}
.trast-modern .cart-item--refined .cart-item__price strong{font-size:clamp(.84rem,1.3vw,.98rem);color:#ca285e;font-weight:850;white-space:nowrap;line-height:1.65;display:inline-block}
.trast-modern .cart-item--refined .cart-item__remove{display:flex;align-items:center;justify-content:center;gap:5px;min-height:43px;padding:7px 10px;border:1px solid #f6e7ec;border-radius:11px;background:#fff8fa;color:#c42b59;white-space:nowrap;font-size:.77rem;font-weight:750;margin:0;transform:none!important}
.trast-modern .cart-item--refined .cart-item__remove:hover{background:#ffeef3;border-color:#edc5d2}
.trast-modern .cart-item--refined .cart-item__remove .ui-icon{width:17px;height:17px}
.trast-modern .cart-items>.btn{margin:18px 0 0!important;min-height:45px;display:inline-flex;align-items:center;gap:8px;padding-inline:17px;transform:none!important}
.trast-modern .order-summary{min-width:0;top:99px;background:#fff;padding:22px;border:1px solid var(--cart-border)}
.trast-modern .order-summary>div{display:flex;gap:8px;align-items:baseline;justify-content:space-between}
.trast-modern .order-summary>div b{white-space:nowrap;font-size:.93rem}
/* Cart/compare modals: one heading and one scrollable body. */
.trast-modern .commerce-modal[open]{width:min(960px,calc(100% - 32px));max-height:min(92dvh,920px);overflow:hidden;padding:0;border:1px solid #eadfe4;border-radius:22px;background:#fff;box-shadow:0 25px 88px #210e1e45}
.trast-modern .commerce-modal__header{min-height:67px;flex:0 0 auto;border-bottom:1px solid #f0e6eb;padding:13px 21px;background:#fff}
.trast-modern .commerce-modal [data-commerce-content]{overflow-y:auto;overflow-x:hidden;min-height:0;padding:20px 22px 25px;scrollbar-width:thin;scrollbar-color:#e1d6dc transparent;overscroll-behavior:contain}
.trast-modern .commerce-modal [data-commerce-content]::-webkit-scrollbar{width:6px}
.trast-modern .commerce-modal [data-commerce-content]::-webkit-scrollbar-thumb{background:#e1d6dc;border-radius:7px}
.trast-modern .commerce-modal [data-commerce-content] .shop-head{display:none!important}
.trast-modern .commerce-modal [data-commerce-content] .section{padding:0!important}
.trast-modern .commerce-modal [data-commerce-content] .section .container{width:100%!important;max-width:none!important;margin:0!important;padding:0!important}
.trast-modern .commerce-modal .cart-layout{grid-template-columns:minmax(0,1fr) minmax(205px,260px);gap:15px;align-items:start}
.trast-modern .commerce-modal .cart-items{padding:15px}
.trast-modern .commerce-modal .order-summary{position:static;top:auto;margin:0;padding:17px}
.trast-modern .commerce-modal .cart-item--refined .cart-item__controls{margin-inline-start:0;grid-template-columns:90px minmax(0,1fr) auto;gap:9px}
.trast-modern .commerce-modal .cart-item--refined .cart-item__identity{grid-template-columns:74px minmax(0,1fr);gap:12px}
.trast-modern .commerce-modal .cart-item--refined .cart-item__remove{padding-inline:7px}
.trast-modern .commerce-modal .section-head{margin-block:0 13px}
/* Consistent product purchase controls and product information geometry. */
.trast-modern .product-buy{align-items:end!important}
.trast-modern .product-buy .product-quantity{grid-template-rows:21px 50px;gap:6px}
.trast-modern .product-buy>.primary{align-self:end}
.trast-modern .product-gallery-panel{min-width:0}
.trast-modern .product-main-image{object-fit:contain!important}
/* Quiet section headers, stable interactions. */
.trast-modern .section-head :is(h2,h3){min-width:0;margin:0}
.trast-modern .section-head:has(>a)>a{align-self:center;line-height:1.5}
.trast-modern .product-card--modern:hover{transform:none!important}
@media(max-width:860px){
 .trast-modern .cart-layout{grid-template-columns:minmax(0,1fr)}
 .trast-modern .order-summary{position:static}
 .trast-modern .commerce-modal .cart-layout{grid-template-columns:minmax(0,1fr)}
 .trast-modern .commerce-modal .order-summary{margin-top:4px}
}
@media(max-width:760px){
 .trast-modern .commerce-modal[open]{width:calc(100% - 14px);max-height:calc(100dvh - 14px);border-radius:18px}
 .trast-modern .commerce-modal__header{min-height:55px;padding:10px 14px}
 .trast-modern .commerce-modal [data-commerce-content]{padding:13px 13px calc(18px + env(safe-area-inset-bottom,0px))}
 .trast-modern .commerce-modal .cart-item--refined{grid-template-columns:minmax(0,1fr);gap:12px}
 .trast-modern .commerce-modal .cart-item--refined .cart-item__identity{grid-template-columns:68px minmax(0,1fr)}
 .trast-modern .cart-item--refined .cart-item__controls{margin-inline-start:0;grid-template-columns:85px minmax(0,1fr) auto;gap:8px}
 .trast-modern .cart-item--refined .cart-item__name{font-size:.92rem;line-height:1.85}
 .trast-modern .cart-item--refined .cart-item__remove{padding:7px 8px}
 .trast-modern .cart-item--refined .cart-item__price strong{font-size:.87rem}
}
@media(max-width:375px){
 .trast-modern .cart-item--refined .cart-item__controls{grid-template-columns:76px minmax(0,1fr) auto;gap:6px}
 .trast-modern .cart-item--refined .cart-item__remove span{display:none}
 .trast-modern .cart-item--refined .cart-item__price strong{font-size:.79rem}
 .trast-modern .commerce-modal .cart-items{padding:12px}
}
@media(prefers-reduced-motion:reduce){.trast-modern .commerce-modal[open]{animation:none}}
