/* R9 Polish 2 — two-iteration round (2026-10-06): home, product card, PDP, account, cart + side cart, checkout.
   CSS only, loaded last (handle r9-polish2). Kill switch R9P2_LIVE in mu-plugins/r9-polish2.php; ?r9p2=off (r9-test UA) for A/B.
   Never hides, covers or moves out of the DOM any tracking-contract hook (COORDINATION.md); content, prices, fields and gateways untouched.
   System: one action colour (brand red) for every add-to-cart / progress / selected state; ink for text and secondary controls;
   green only for savings and success. */
:root{--p2-red:#C8102E;--p2-red-700:#A50D26;--p2-red-50:#FDF1F3;--p2-ink:#16181D;--p2-text:#3d424a;--p2-muted:#5c616b;--p2-line:#E3E5E8;--p2-bg:#F3F4F6;--p2-green:#1E7E34}

/* ═══ 1. Product card (grids, carousels, rails) ═══ */
/* Add to cart: calm red outline instead of a wall of black slabs; fills red on press/hover; success stays green */
html body .wd-product:not(.wd-hover-small) .wd-add-btn>a.add_to_cart_button{background:#fff!important;color:var(--p2-red)!important;box-shadow:inset 0 0 0 1.5px var(--p2-red)!important;font-weight:700!important;transition:background-color .15s,color .15s}
@media (hover:hover){html body .wd-product:not(.wd-hover-small) .wd-add-btn>a.add_to_cart_button:hover{background:var(--p2-red)!important;color:#fff!important}}
html body .wd-product:not(.wd-hover-small) .wd-add-btn>a.add_to_cart_button:active{background:var(--p2-red)!important;color:#fff!important}
html body .wd-product:not(.wd-hover-small) .wd-add-btn>a.add_to_cart_button.loading{color:transparent!important;background:#fff!important}
html body .wd-product:not(.wd-hover-small) .wd-add-btn>a.add_to_cart_button.loading::before{border-color:var(--p2-red)!important;border-top-color:transparent!important}
html body .wd-product:not(.wd-hover-small) .wd-add-btn>a.add_to_cart_button.added,html body .wd-product:not(.wd-hover-small) .wd-add-btn>a.add_to_cart_button[data-r9-txt]{background:var(--p2-green)!important;color:#fff!important;box-shadow:none!important}
/* Instalments on phones: the two official logos on one line (the sentence stays for screen readers) */
@media (max-width:719px){
	html body .wd-product:not(.wd-hover-small),html body .r9g-rail .r9g-card{--r9-bnpl-h:20px;--r9-bnpl-img:18px}
	html body .wd-product:not(.wd-hover-small) .r9g-cardbnpl>span:first-child,html body .r9g-rail .r9g-card .r9g-cardbnpl>span:first-child{position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip:rect(0 0 0 0);white-space:nowrap;flex-basis:auto!important}
	html body .wd-product:not(.wd-hover-small) .r9g-cardbnpl,html body .r9g-rail .r9g-card .r9g-cardbnpl{position:relative}
}
/* equal logo heights everywhere (Tamara rendered ~30% smaller than Tabby) */
html body .wd-product .r9g-cardbnpl .r9g-cardbnpl__logos img[alt]{height:var(--r9-bnpl-img,18px)!important;width:auto!important}
html body .r9g-bnpl:not(.r9g-bnpl--pdp) .r9g-bnpl__logos img[alt],html body .cart-widget-side .r9g-bnpl--mini .r9g-bnpl__logos img[alt],html body tr.r9g-tr-bnpl .r9g-bnpl__logos img[alt]{height:18px!important;width:auto!important;max-height:none!important}

/* ═══ 2. Homepage ═══ */
/* Weekly deals: compact header on phones (title + badge, one-line timer, CTA) so products reach the first screen */
@media (max-width:767px){
	html body .r9g-week__head{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;grid-template-areas:"intro pct" "cd cd" "all all"!important;align-items:center;gap:10px 12px!important;padding:14px 14px 14px!important}
	html body .r9g-week__intro{grid-area:intro;min-width:0}
	html body .r9g-week__intro h2{font-size:20px!important;line-height:1.3!important;margin:0!important}
	html body .r9g-week__intro p{font-size:12.5px!important;line-height:1.5!important;margin:2px 0 0!important}
	html body .r9g-week__pct{grid-area:pct;width:64px!important;height:64px!important;min-width:0!important;margin:0!important}
	html body .r9g-week__pct b{font-size:19px!important;line-height:1!important}
	html body .r9g-week__pct small{font-size:11px!important;line-height:1.2!important;white-space:nowrap}
	html body .r9g-week__cd{grid-area:cd;display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:space-between!important;gap:8px!important;margin:0!important;padding:7px 8px 7px 10px!important;min-height:0!important}
	html body .r9g-week__lbl{margin:0!important;font-size:13px!important;white-space:nowrap;text-align:start}
	html body .r9g-week__cd .r9g-cd--big{width:auto!important;gap:4px!important;margin:0!important}
	html body .r9g-week__cd .r9g-cd--big .r9g-cd__u{min-width:48px!important;width:48px!important;height:46px!important;min-height:0!important;padding:0!important;justify-content:center}
	html body .r9g-week__cd .r9g-cd--big .r9g-cd__u b{font-size:20px!important;line-height:1.05!important}
	html body .r9g-week__cd .r9g-cd--big .r9g-cd__u i{font-size:11px!important;line-height:1.25!important}
	html body .r9g-week__all{grid-area:all;min-height:44px!important;margin:0!important}
}
/* Home banner slider: dots under the art, not on the products */
html body.home .wd-slider-pagin{position:static!important;margin-top:10px!important}
html body.home .wd-slider-pagin .wd-nav-pagin{background:none!important}
/* Shop-by-category tiles: a fixed two-line name box so every count sits on the same line */
html body.home .wd-cats-element .wd-cat .wd-entities-title{min-height:2.8em;display:flex;align-items:flex-start;justify-content:center;line-height:1.4!important}
/* Trust strip: tile content centred in equal tiles */
html body .r9-trust--strip>li{display:flex!important;flex-direction:column;justify-content:center}

/* «إكسسوارات داخلية» shortcuts: the store's white pill chips, title on the section-title scale */
html body.home .elementor-element-adaa617 .btn{min-height:44px!important;padding:0 16px!important;border:1px solid var(--p2-line)!important;border-radius:999px!important;background:#fff!important;color:var(--p2-ink)!important;font-weight:600!important;box-shadow:none!important}
@media (hover:hover){html body.home .elementor-element-adaa617 .btn:hover{border-color:var(--p2-ink)!important}}
@media (max-width:767px){html body.home .elementor-element-ae86de8 .title{font-size:22px!important;line-height:1.3!important}}

/* Banner CTAs: 44px targets */
html body.home .promo-banner .btn{min-height:44px!important;padding-inline:18px!important;display:inline-flex!important;align-items:center}
/* Listing pagination: active page in the action colour */
html body .woocommerce-pagination .page-numbers.current{background:var(--p2-red)!important;border-color:var(--p2-red)!important;color:#fff!important}

/* ═══ 3. Product page ═══ */
/* Tabby and Tamara read as one component: same frame, radius, padding; brand-neutral link colour */
html body.single-product #tabbyPromo{margin:0 0 10px!important}
html body.single-product #tabbyPromo a{color:var(--p2-ink)!important;text-decoration:underline;text-underline-offset:3px}
/* Desktop theme prev/next pager: quiet, aligned, 44px targets */
@media (min-width:1025px){html body.single-product .wd-products-nav{opacity:.7}html body.single-product .wd-products-nav .wd-product-nav-btn{width:32px;height:32px}}

/* Delivery-date tile in ink like every other fact (green stays for savings only); policy link quiet */
html body .r9v-tg [data-r9v-eta]{color:var(--p2-ink)!important}
html body .r9v-tg [data-r9v-eta-tile] strong{color:var(--p2-ink)!important}

/* ═══ 4. Account (login / register) ═══ */
html body .r9acc-head{display:flex!important;flex-direction:column;align-items:center;text-align:center;gap:4px!important}
@media (max-width:767px){html body .r9acc-head{flex-flow:row wrap!important;justify-content:center;column-gap:10px!important;row-gap:2px!important;margin-bottom:14px!important}html body .r9acc-head__ic{width:34px!important;height:34px!important}html body .r9acc-head__s{flex-basis:100%}html body .r9acc-card{padding-top:18px!important}html body .r9acc-head__t{font-size:21px!important}html body .r9acc-tabs{margin-bottom:16px!important}}
html body .r9acc-head__t,html body .r9acc-head__s{text-align:center!important;margin:0!important}
html body .r9acc-tabs a[aria-selected="true"]{color:var(--p2-ink)!important;font-weight:700!important}
html body .r9acc-tabs a[aria-selected="false"]{color:var(--p2-muted)!important}
html body .r9acc-tabs__thumb::after{content:"";position:absolute;bottom:5px;left:50%;width:28px;height:3px;margin-left:-14px;border-radius:2px;background:var(--p2-red)}
html body .r9acc-tabs__thumb{overflow:visible}
@media (min-width:1025px){html body .r9acc-side__in{justify-content:center!important}html body .r9acc-side__safe{margin-top:56px!important}}

/* ═══ 5. Side cart (drawer) ═══ */
/* Items area grows; totals + buttons sit at the bottom edge like a native sheet */
html body .cart-widget-side .widget_shopping_cart_content{display:flex!important;flex-direction:column!important;height:100%}
html body .cart-widget-side .shopping-cart-widget-body{flex:0 1 auto!important}
html body .cart-widget-side .shopping-cart-widget-footer{flex:0 0 auto!important;margin-top:auto!important;justify-content:flex-end;box-shadow:0 -10px 24px -18px rgba(22,24,29,.35);background:#fff}

/* ═══ 6. Cart page ═══ */
/* Free-shipping progress: brand red fill, green when reached (cart, side cart, checkout) */
html body .wd-free-progress-bar.wd-free-progress-bar .progress-area .progress-bar.progress-bar{background-image:none!important;background-color:var(--p2-red)!important}
html body .wd-free-progress-bar.wd-free-progress-bar .progress-area .progress-bar.progress-bar[style*="100%"]{background-color:var(--p2-green)!important}
html body .wd-free-progress-bar.wd-free-progress-bar .progress-msg .amount{color:var(--p2-red)!important;font-weight:700!important}
/* Coupon on phones: one row (field + button) instead of two stacked full-width controls */
@media (max-width:767px){
	html body.woocommerce-cart .coupon.wd-coupon-form{display:flex!important;flex-direction:row!important;flex-wrap:nowrap!important;gap:8px!important;align-items:stretch}
	html body.woocommerce-cart .coupon.wd-coupon-form .input-text{flex:1 1 0%!important;max-width:none!important;min-width:0;width:auto!important;margin:0!important}
	html body.woocommerce-cart .coupon.wd-coupon-form .button{flex:0 0 auto!important;width:auto!important;padding-inline:18px!important;margin:0!important}
}
/* Cart line item on phones: compact row (thumb | name, unit price, stepper + line total) instead of three labelled table rows */
@media (max-width:767px){
	html body.woocommerce-cart table.cart tr.cart_item{display:grid!important;grid-template-columns:84px minmax(0,1fr) auto;grid-template-areas:"thumb name remove" "thumb price price" "thumb qty sub";column-gap:12px;row-gap:8px;align-items:center;position:relative;width:100%!important;box-sizing:border-box;padding:16px 0!important;min-height:0!important}
	html body.woocommerce-cart table.cart tr.cart_item>td{border:0!important;padding:0!important;min-height:0!important}
	html body.woocommerce-cart table.cart tr.cart_item>td.product-thumbnail{grid-area:thumb;align-self:start;width:84px!important;max-width:84px;position:static!important;inset:auto!important;margin:0!important}
	html body.woocommerce-cart table.cart tr.cart_item>td.product-thumbnail img{width:84px!important;height:84px!important;object-fit:contain}
	html body.woocommerce-cart table.cart tr.cart_item>td.product-name{grid-area:name;align-self:start}
	html body.woocommerce-cart table.cart tr.cart_item>td.product-remove{grid-area:remove;position:static!important;align-self:start;width:auto!important;justify-content:center}
	html body.woocommerce-cart table.cart tr.cart_item>td.product-quantity .quantity{flex:none}
	html body.woocommerce-cart table.cart tr.cart_item>td.product-price{grid-area:price;justify-content:flex-start!important;gap:6px;font-size:13px;color:var(--p2-muted)}
	html body.woocommerce-cart table.cart tr.cart_item>td.product-price::before{font-size:12.5px!important;color:var(--p2-muted)!important;font-weight:500!important}
	html body.woocommerce-cart table.cart tr.cart_item>td.product-quantity{grid-area:qty;justify-content:flex-start!important}
	html body.woocommerce-cart table.cart tr.cart_item>td.product-subtotal{grid-area:sub;justify-content:flex-end!important;font-weight:700;color:var(--p2-ink)}
	html body.woocommerce-cart table.cart tr.cart_item>td.product-quantity::before{display:none!important}
	html body.woocommerce-cart table.cart tr.cart_item>td.product-subtotal{flex-direction:column!important;align-items:flex-end!important;gap:0!important}
	html body.woocommerce-cart table.cart tr.cart_item>td.product-subtotal::before{display:block!important;font-size:11.5px!important;font-weight:500!important;color:var(--p2-muted)!important;line-height:1.3}
}
/* Header cart badge clear of the icon */
html body .wd-header-cart .wd-cart-number{box-shadow:0 0 0 2px #fff}

/* ═══ 7. Checkout ═══ */
/* «عميل سابق؟» and «لديك قسيمة خصم؟»: slim one-line rows so the form starts higher */
html body.woocommerce-checkout .woocommerce-form-login-toggle .woocommerce-info,html body.woocommerce-checkout .woocommerce-form-coupon-toggle .woocommerce-info{display:flex!important;flex-wrap:wrap;align-items:center;column-gap:6px;row-gap:0;min-height:48px!important;padding:6px 12px!important;font-size:14px!important}
html body.woocommerce-checkout .woocommerce-form-login-toggle .woocommerce-info::before,html body.woocommerce-checkout .woocommerce-form-coupon-toggle .woocommerce-info::before{width:30px!important;height:30px!important;margin-inline-end:4px!important;flex:none}
html body.woocommerce-checkout .woocommerce-form-login-toggle .woocommerce-info::after,html body.woocommerce-checkout .woocommerce-form-coupon-toggle .woocommerce-info::after{margin-inline-start:auto!important}
html body.woocommerce-checkout .woocommerce-info .showlogin,html body.woocommerce-checkout .woocommerce-info .showcoupon{display:inline-flex!important;align-items:center;min-height:36px;font-size:13.5px!important}
/* Selected payment method: brand red outline with a light tint (the store's selected/active colour) */
html body.woocommerce-checkout #payment ul.payment_methods>li.wc_payment_method:has(input:checked){border-color:var(--p2-red)!important;box-shadow:0 0 0 1px var(--p2-red) inset!important;background:var(--p2-red-50)!important}
html body.woocommerce-checkout #payment ul.payment_methods>li.wc_payment_method:has(input:checked) .payment_box{background:#fff!important}
html body.woocommerce-checkout #payment input.input-radio{accent-color:var(--p2-red)!important}
/* Card brands accepted by the card gateway, shown under its title (same official logos as the product page) */
html body.woocommerce-checkout #payment li.payment_method_tap>label::after{content:"";display:block;width:178px;height:18px;margin-top:8px;background:url(/wp-content/mu-plugins/r9-design/pay/mada.svg) right 0 center/auto 16px no-repeat,url(/wp-content/mu-plugins/r9-design/pay/visa.svg) right 58px center/auto 13px no-repeat,url(/wp-content/mu-plugins/r9-design/pay/mastercard.svg) right 104px center/auto 17px no-repeat,url(/wp-content/mu-plugins/r9-design/pay/applepay.svg) right 140px center/auto 17px no-repeat}

/* ═══ 8. Quality floor ═══ */
@media (prefers-reduced-motion:reduce){html body .wd-product .wd-add-btn>a{transition:none!important}}
