/* Scoped to the default and speedyfood product views only. No global font overrides. */
body.product-page.theme-default .product-crumbs{display:flex;align-items:center;gap:7px;flex-wrap:wrap;margin:0 0 3px;padding:2px 4px;color:var(--theme-muted,#6b7280);font-size:11.5px;line-height:1.9;text-align:right}
.product-crumbs a{color:var(--theme-primary,#475569);text-decoration:none}.product-crumbs a:hover{text-decoration:underline}.product-crumbs span[aria-hidden]{font-size:19px;color:#a1a1aa}.product-crumbs span[aria-current]{max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.product-buybar-wrap{min-width:0;position:relative;z-index:11}
.product-buybar-card{background:var(--theme-surface,#fff);border:1px solid var(--theme-border,#e5e7eb);border-radius:18px;padding:17px;box-shadow:0 12px 32px rgba(15,23,42,.055);font-family:var(--theme-font_family,sahan-vazir,sans-serif);direction:rtl;text-align:right}
.product-buybar-title{font-size:12px;color:var(--theme-muted,#64748b);line-height:1.9;margin-bottom:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.product-buybar-main{display:flex;flex-direction:column;gap:11px}.product-buybar-price{min-height:30px;color:var(--theme-text,#111827);font-size:18px;font-weight:800;line-height:1.8;text-align:left;font-variant-numeric:tabular-nums;direction:rtl}
.product-buybar-price:empty{visibility:hidden}.product-buybar-action{min-width:0}.product-buybar-action #productPurchaseBox{margin:0!important;width:100%}.product-buybar-action #btn_add_to_cart,.product-buybar-action #btn_contact_for_price,.product-buybar-action #lbl_product_unavailable{width:100%;min-height:48px;padding:10px 12px!important;margin:0!important;display:flex;align-items:center;justify-content:center;text-align:center;border-radius:12px;font-size:13px;font-weight:700;line-height:1.7;white-space:normal}
.product-buybar-action #btn_add_to_cart.is-waiting-variation{opacity:1;cursor:pointer}
body.product-page.theme-default #left_panel.product-cart-side{display:none!important}
body.product-page.theme-default .product-buybar-wrap{display:block;padding:8px 9px 0;align-self:start}
body.product-page.theme-default .product-buybar-card{position:sticky;top:14px}
body.product-page.theme-speedyfood .product-buybar-wrap{display:none}
.product-pay-options{display:grid;gap:8px;margin-top:13px}
.product-pay-option{display:flex;align-items:center;gap:9px;border:1px solid #e5e7eb;background:#fbfcfd;padding:9px 10px;border-radius:12px;font-size:11.5px;line-height:1.8;color:#475569}
.product-pay-option img{width:34px;height:34px;object-fit:contain;border-radius:9px;flex:none}
.product-pay-option strong{display:block;font-size:12px;color:#172b4d}
.product-pay-option.is-snappay{border-color:#c7e6ff;background:#f0f8ff}.product-pay-option.is-torobpay{border-color:#c7e7b8;background:#f5fbea}
.product-added-overlay[hidden]{display:none!important}.product-added-overlay{position:fixed;inset:0;z-index:10020;display:flex;align-items:center;justify-content:center;background:rgba(15,23,42,.46);backdrop-filter:blur(8px);padding:18px}
.product-added-dialog{width:min(100%,390px);border:1px solid rgba(255,255,255,.8);border-radius:25px;background:#fff;box-shadow:0 25px 70px rgba(15,23,42,.2);text-align:center;padding:28px 22px 22px;font-family:var(--theme-font_family,sahan-vazir,sans-serif);color:#171b24}
.product-added-icon{margin:0 auto 13px;width:60px;height:60px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:#e9f8f1;color:#159665;font-size:30px;font-weight:800}
.product-added-dialog h2{font-size:18px;font-weight:800;line-height:1.8;margin:0 0 8px}.product-added-name{margin:0 auto 17px;line-height:2;max-height:80px;overflow:hidden;font-size:13px;color:#475569}
.product-added-buttons{display:flex;flex-direction:column;gap:9px}.product-added-buttons button{min-height:45px;border-radius:13px;font-family:inherit;font-size:13px;font-weight:800;border:0;cursor:pointer}.product-added-primary{background:var(--theme-primary,#334681);color:#fff}.product-added-secondary{background:#f3f5f8;color:#344256}
@media(max-width:990px){
 body.product-page.theme-default,body.product-page.theme-speedyfood{padding-bottom:calc(110px + var(--product-buybar-bottom,0px) + env(safe-area-inset-bottom,0px))!important}
 body.product-page.theme-default .product-main-panel,body.product-page.theme-speedyfood .product-main-panel{width:100%;max-width:100%;flex:0 0 100%}
 body.product-page.theme-default .product-buybar-wrap,body.product-page.theme-speedyfood .product-buybar-wrap{display:block!important;position:fixed!important;right:0;left:0;bottom:var(--product-buybar-bottom,0px);width:100%!important;max-width:100%!important;margin:0!important;padding:0!important;z-index:1400}
 body.product-page.theme-default:has(.spb-mobile-nav-off) .product-buybar-wrap{bottom:0}
 body.product-page.theme-default .product-buybar-card,body.product-page.theme-speedyfood .product-buybar-card{border-radius:18px 18px 0 0!important;position:static!important;border-bottom:0;padding:10px 13px calc(10px + env(safe-area-inset-bottom,0px));box-shadow:0 -8px 25px rgba(15,23,42,.09)}
 body.product-page.theme-default .product-buybar-title,body.product-page.theme-speedyfood .product-buybar-title{display:none}
 body.product-page.theme-default .product-buybar-main,body.product-page.theme-speedyfood .product-buybar-main{display:flex;flex-direction:row-reverse;align-items:center;gap:11px}
 body.product-page.theme-default .product-buybar-price,body.product-page.theme-speedyfood .product-buybar-price{flex:1;min-width:0;white-space:nowrap;font-size:14px;text-align:right}
 body.product-page.theme-default .product-buybar-action,body.product-page.theme-speedyfood .product-buybar-action{flex:0 0 60%;min-width:0}
 body.product-page.theme-default .product-buybar-action #btn_add_to_cart,body.product-page.theme-speedyfood .product-buybar-action #btn_add_to_cart{min-height:45px;font-size:12.5px}
 body.product-page.theme-default .product-pay-options{display:none}
 body.product-page.theme-default #lbl_added_message{display:none!important}
}
/* The speedyfood bar's own cart indicator occupies the page bottom: hide only on product pages. */
@media(max-width:990px){body.product-page.theme-speedyfood .food-mobile-cart-bar{display:none!important}body.product-page.theme-speedyfood .product-buybar-wrap{bottom:0}}
@media(min-width:991px){body.product-page.theme-default #right_panel{flex:0 0 75%;max-width:75%}}

/* The default theme uses the new success dialog instead of the old inline notice. */
body.product-page.theme-default #lbl_added_message{display:none!important}

/* Product purchase refinement — isolated to product pages and existing themes. */
body.product-page.theme-default .product-crumbs{
    flex-wrap:nowrap;white-space:nowrap;overflow-x:auto;overflow-y:hidden;
    scrollbar-width:none;-ms-overflow-style:none;max-width:100%;min-width:0;
    -webkit-overflow-scrolling:touch;gap:7px;padding:3px 2px 2px;
}
body.product-page.theme-default .product-crumbs::-webkit-scrollbar{display:none}
body.product-page.theme-default .product-crumbs a{flex:none;white-space:nowrap}
body.product-page.theme-default .product-crumb-chevron{
    flex:0 0 11px;width:11px;height:11px;overflow:visible;
    fill:none;stroke:#9ca3af;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;
}
/* The old cart DOM is required by the header's slide-out drawer, but must never
   occupy a product-page column, even when legacy responsive JS adds inline display:block. */
body.product-page.theme-default #left_panel{display:none!important;flex:none!important;width:0!important;max-width:0!important;min-width:0!important;overflow:hidden!important}
body.product-page.theme-default .product-price-area{display:none!important}
body.product-page.theme-default .product-buybar-card,
body.product-page.theme-speedyfood .product-buybar-card{border-radius:12px}
body.product-page.theme-default .product-buybar-main,
body.product-page.theme-speedyfood .product-buybar-main{display:flex;flex-direction:row-reverse;align-items:center;gap:10px}
body.product-page.theme-default .product-buybar-action,
body.product-page.theme-speedyfood .product-buybar-action{flex:0 0 49%;max-width:49%;min-width:0}
body.product-page.theme-default .product-buybar-price,
body.product-page.theme-speedyfood .product-buybar-price{
    flex:1;display:flex;flex-direction:column;align-items:flex-end;justify-content:center;
    min-width:0;min-height:48px;gap:3px;line-height:1.4;text-align:left;direction:rtl;
}
.product-buybar-price:empty{visibility:hidden}
.product-buybar-original{display:flex;align-items:center;justify-content:flex-end;gap:6px;white-space:nowrap;max-width:100%;direction:rtl}
.product-buybar-before{color:#9ca3af;font-size:clamp(10px,.94vw,13px);font-weight:500;line-height:1.5}
.product-buybar-discount.off_label{
    font-family:inherit;background:#e3324f;color:#fff;flex:none;border-radius:6px;
    padding:2px 5px;margin:0;font-size:11px;line-height:1.65;font-weight:800;
}
.product-buybar-current{display:inline-flex;align-items:baseline;justify-content:flex-end;gap:4px;row-gap:0;flex-wrap:wrap;max-width:100%;direction:rtl}
.product-buybar-value{font-size:clamp(12px,1.25vw,21px);line-height:1.3;font-weight:900;letter-spacing:-.25px;white-space:nowrap}
.product-buybar-currency{font-size:clamp(10px,.8vw,12px);color:#5c6572;font-weight:500}
body.product-page.theme-default .product-buybar-action #btn_add_to_cart,
body.product-page.theme-speedyfood .product-buybar-action #btn_add_to_cart{border-radius:8px!important}
@media(max-width:990px){
 body.product-page.theme-default .product-buybar-card,
 body.product-page.theme-speedyfood .product-buybar-card{
     border-radius:0!important;padding:9px 14px calc(9px + env(safe-area-inset-bottom,0px));
 }
 body.product-page.theme-default .product-buybar-action,
 body.product-page.theme-speedyfood .product-buybar-action{flex:0 0 49%;max-width:49%}
 body.product-page.theme-default .product-buybar-price,
 body.product-page.theme-speedyfood .product-buybar-price{font-size:15px;text-align:left;white-space:normal}
 .product-buybar-value{font-size:clamp(16px,4.8vw,23px)}
 .product-buybar-currency{font-size:11px}
 .product-buybar-before{font-size:12px}
 /* The large preview gets priority over navigation arrows and gallery chrome. */
 body.product-page.theme-default #myGallery{margin-inline:0}
 body.product-page.theme-default #myGallery .pg-gallery{padding:3px;box-shadow:none;border-radius:0}
 body.product-page.theme-default #myGallery .pg-view{height:min(88vw,440px);max-height:64vh;min-height:265px}
 body.product-page.theme-default #myGallery .pg-view img,
 body.product-page.theme-default #myGallery .pg-view video{max-height:100%;max-width:100%;object-fit:contain}
 body.product-page.theme-default #myGallery .pg-main .pg-nav,
 body.product-page.theme-default #myGallery .pg-modal .pg-modal-nav{display:none!important}
 body.product-page.theme-default #myGallery .pg-thumbs{margin-top:8px}
}

/* Desktop: price on its own line, followed by the full-width buy button.
   Mobile keeps the earlier side-by-side layout, scoped to the two themes. */
@media(min-width:991px){
 body.product-page.theme-default .product-buybar-main{
     flex-direction:column;align-items:stretch;gap:11px;
 }
 body.product-page.theme-default .product-buybar-price,
 body.product-page.theme-default .product-buybar-action{
     flex:none;width:100%;max-width:100%;
 }
}
/* Slightly quieter discount badge across desktop and mobile. */
.product-buybar-discount.off_label{
 font-size:8.5px;padding:0 3px;line-height:1.45;border-radius:4px;
}


/* Scoped follow-up: subtler discount marker, standalone installment card and gallery. */
body.product-page.theme-default .product-buybar-discount.off_label,
body.product-page.theme-speedyfood .product-buybar-discount.off_label {
    font-size:7.25px;
    line-height:1.35;
    padding:0 2px;
    border-radius:3px;
}
/* Restore the light, minimal success surface; keep the existing modal behavior. */
body.product-page.theme-default .product-added-dialog {
    position:relative;
    background:#fff;
    border-color:rgba(229,231,235,.95);
}
body.product-page.theme-default .product-added-close {
    position:absolute;top:12px;right:12px;
    width:30px;height:30px;padding:0;
    display:inline-flex;align-items:center;justify-content:center;
    border:1px solid #e8ebef;border-radius:50%;
    background:#f8f9fb;color:#64748b;cursor:pointer;
    font:inherit;line-height:1;z-index:1;
}
body.product-page.theme-default .product-added-close:hover {background:#eef1f5;color:#334155}
body.product-page.theme-default .product-added-close:focus-visible {outline:2px solid #334155;outline-offset:2px}
/* Payment suggestions live in their own card under, not within, the buy card. */
body.product-page.theme-default .product-pay-options {
    margin-top:10px;
    padding:12px;
    background:var(--theme-surface,#fff);
    border:1px solid var(--theme-border,#e5e7eb);
    border-radius:12px;
    box-shadow:0 10px 25px rgba(15,23,42,.045);
}
body.product-page.theme-default .product-pay-options:empty { display:none; }
@media(min-width:991px) {
    body.product-page.theme-default .product-buybar-action #btn_add_to_cart {
        font-size:15px!important;
    }
}
/* Black fullscreen gallery; keep its controls readable. */
body.product-page.theme-default #myGallery .pg-modal {
    background:rgba(0,0,0,.96)!important;
}
body.product-page.theme-default #myGallery .pg-close { color:#fff!important; }
body.product-page.theme-default #myGallery .pg-modal-nav {
    color:#fff!important;
    background:rgba(30,30,30,.72)!important;
    border:1px solid rgba(255,255,255,.22)!important;
}
body.product-page.theme-default #myGallery .pg-modal-nav:hover {
    background:rgba(60,60,60,.9)!important;
}
@media(max-width:768px) {
    /* Remove former 58px side gutters in gallery fullscreen; preserve image aspect. */
    body.product-page.theme-default #myGallery .pg-modal-inner {
        padding:0 8px!important;
        box-sizing:border-box!important;
    }
    body.product-page.theme-default #myGallery .pg-modal img,
    body.product-page.theme-default #myGallery .pg-modal video {
        width:auto!important;
        height:auto!important;
        max-width:calc(100vw - 16px)!important;
        max-height:88dvh!important;
        object-fit:contain!important;
    }
    /* Keep each media element's real aspect ratio. With width/height both at 100%,
       object-fit:contain letterboxes the pixels *inside* the rounded element, so
       its visible photo corners remain square on mobile. */
    body.product-page.theme-default #myGallery .pg-view img,
    body.product-page.theme-default #myGallery .pg-view video {
        display:block;
        width:auto!important;
        height:auto!important;
        max-width:100%!important;
        max-height:100%!important;
        object-fit:contain!important;
        border-radius:10px!important;
        -webkit-clip-path:inset(0 round 10px);
        clip-path:inset(0 round 10px);
    }
}


/* Reduce space between the struck-through price and discounted price. */
body.product-page.theme-default .product-buybar-price,
body.product-page.theme-speedyfood .product-buybar-price {gap:0!important}
body.product-page.theme-default .product-buybar-original,
body.product-page.theme-speedyfood .product-buybar-original {line-height:1.18}
body.product-page.theme-default .product-buybar-before,
body.product-page.theme-speedyfood .product-buybar-before {line-height:1.2}
body.product-page.theme-default .product-buybar-value,
body.product-page.theme-speedyfood .product-buybar-value {line-height:1.18}
/* Approx. 20% smaller than the large reference badge (not the tiny intermediate version). */
body.product-page.theme-default .product-buybar-discount.off_label,
body.product-page.theme-speedyfood .product-buybar-discount.off_label {
    display:inline-flex;align-items:center;justify-content:center;
    font-size:14px!important;
    line-height:1.3!important;
    padding:2px 5px!important;
    border-radius:5px!important;
}
/* Fullscreen gallery must sit over the fixed buy bar on mobiles. The parent
   gallery has its own stacking context, so promoting only .pg-modal is not enough. */
body.product-page.theme-default.pg-modal-open #right_panel {position:relative;z-index:2000000!important}
body.product-page.theme-default.pg-modal-open #myGallery {z-index:2000001!important}
body.product-page.theme-default.pg-modal-open .product-buybar-wrap {z-index:1400!important}
@media(max-width:990px){
    body.product-page.theme-default #right_panel > .container {padding-inline:5px!important}
    body.product-page.theme-default #myGallery .pg-gallery {padding-inline:2px!important}
    /* Clip the entire main-preview viewport, not just the replaced image:
       switching thumbnails keeps the same rounded corners as desktop. */
    body.product-page.theme-default #myGallery .pg-gallery .pg-view {
        width:100%!important;
        border-radius:10px!important;
        overflow:hidden!important;
    }
    body.product-page.theme-default #myGallery .pg-gallery .pg-view img,
    body.product-page.theme-default #myGallery .pg-gallery .pg-view video {
        border-radius:10px!important;
        display:block;
    }
}

/* Match the unavailable label to the buy button without changing its size. */
@media (min-width:991px) {
    body.product-page.theme-default .product-buybar-action #lbl_product_unavailable {
        font-size:15px!important;
    }
}
@media (max-width:990px) {
    body.product-page.theme-default .product-buybar-action #lbl_product_unavailable,
    body.product-page.theme-speedyfood .product-buybar-action #lbl_product_unavailable {
        font-size:12.5px!important;
    }
}

/* Reduce only the space ABOVE the default-theme product breadcrumb (mobile + desktop).
   Preserve the previously adjusted breadcrumb-to-gallery spacing. */
body.product-page.theme-default .product-page-container { margin-top:3px; }
body.product-page.theme-default #right_panel > .container.p-2 { padding-top:3px!important; }
body.product-page.theme-default .product-crumbs { padding-top:0; }
