/**
 * Digiwood 1.9.0 — header, mobile navigation, reviews and cart rebuild.
 */

/* Parent-theme surfaces must never sit on top of the child storefront. */
body.digiwood-enabled .cart-widget-side,
body.digiwood-enabled .login-form-side,
body.digiwood-enabled .mobile-nav:not(.dw-mobile-drawer),
body.digiwood-enabled .wd-search-full-screen,
body.digiwood-enabled .wd-promo-popup,
body.digiwood-enabled .wd-close-side,
body.digiwood-enabled .wd-toolbar,
body.digiwood-enabled .woodmart-toolbar,
body.digiwood-enabled .wd-header-nav,
body.digiwood-enabled .whb-header,
body.digiwood-enabled .wd-header-mobile-nav,
body.digiwood-enabled .wd-side-hidden,
body.digiwood-enabled .wd-overlay { display: none !important; visibility: hidden !important; pointer-events: none !important; }
body.digiwood-enabled,
body.digiwood-enabled.dw-drawer-open,
body.digiwood-enabled.wd-opened,
body.digiwood-enabled.woodmart-opened,
body.digiwood-enabled.wd-side-opened { overflow-x: clip !important; }

/* Header — one stable row, no inherited WoodMart controls. */
.dw-ui-v190 .dw-header { position: relative; z-index: 12000; isolation: isolate; }
.dw-ui-v190 .dw-header__main {
  width: min(calc(100% - 32px), 1680px);
  min-height: 72px;
  margin-inline: auto;
  padding: 10px 0;
  grid-template-columns: minmax(132px, 160px) minmax(300px, 820px) minmax(194px, max-content);
  gap: clamp(16px, 2vw, 32px);
  justify-content: space-between;
}
.dw-ui-v190 .dw-header__logo { min-width: 0; }
.dw-ui-v190 .dw-header__logo .custom-logo { display: block; max-width: 150px; max-height: 46px; object-fit: contain; }
.dw-ui-v190 .dw-header__actions {
  display: grid;
  grid-template-columns: minmax(138px, auto) 1px 46px;
  align-items: center;
  gap: 12px;
  min-width: 194px;
}
.dw-ui-v190 .dw-account-link {
  justify-content: center;
  min-width: 138px;
  height: 42px;
  padding: 0 13px;
  border: 1px solid #e0e0e2;
  border-radius: 8px;
  background: #fff;
  color: #3f4064;
  line-height: 1;
}
.dw-ui-v190 .dw-account-link .dw-icon { flex: 0 0 22px; width: 22px; height: 22px; }
.dw-ui-v190 .dw-account-link strong { overflow: hidden; font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.dw-ui-v190 .dw-action-divider { display: block; width: 1px; height: 28px; margin: 0; background: #e0e0e2; }
.dw-ui-v190 .dw-cart-link {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  color: #3f4064;
}
.dw-ui-v190 .dw-cart-link:hover { background: #f5f5f5; }
.dw-ui-v190 .dw-cart-link .dw-icon { width: 25px; height: 25px; }
.dw-ui-v190 .dw-cart-link b { inset-inline-end: -2px; inset-block-end: -1px; right: auto; bottom: auto; }
.dw-ui-v190 .dw-mobile-menu-toggle { display: none !important; }

/* Search — contained and distortion-proof. */
.dw-ui-v190 .dw-search {
  width: 100%;
  max-width: 820px;
  min-width: 0;
  height: 46px;
  align-self: center;
  z-index: 12020;
}
.dw-ui-v190 .dw-search input {
  display: block;
  width: 100%;
  min-width: 0;
  height: 46px;
  margin: 0;
  padding-inline: 48px 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #f0f0f1;
  box-shadow: none;
  color: #3f4064;
  font-size: 12px;
  line-height: 46px;
}
.dw-ui-v190 .dw-search input:focus { border-color: #19bfd3; background: #fff; box-shadow: 0 4px 18px rgba(35,37,78,.08); }
.dw-ui-v190 .dw-search__icon { inset-inline-start: 15px; width: 23px; height: 23px; color: #767790; }
.dw-ui-v190 .dw-search__close { inset-inline-end: 8px; top: 7px; }
.dw-ui-v190 .dw-search-results {
  top: 54px;
  inset-inline: 0;
  width: 100%;
  min-width: 0;
  max-height: min(68vh, 600px);
  margin: 0;
  padding: 0;
  overflow: auto;
  border: 1px solid #e0e0e2;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(35,37,78,.16);
}
.dw-ui-v190 .dw-search-suggestions,
.dw-ui-v190 .dw-search-products-head,
.dw-ui-v190 .dw-search-category-results { padding-inline: 18px; }
.dw-ui-v190 .dw-search-results__grid { padding: 8px 12px 14px; }
.dw-ui-v190 .dw-search-result { min-width: 0; border-radius: 8px; }

/* Desktop navigation button is inside the navigation row and always clickable. */
.dw-ui-v190 .dw-header__nav-wrap { position: relative; z-index: 12010; background: #fff; }
.dw-ui-v190 .dw-header__nav { width: min(calc(100% - 32px), 1680px); margin-inline: auto; }
.dw-ui-v190 .dw-mega { flex: 0 0 auto; }
.dw-ui-v190 .dw-mega__toggle { position: relative; min-width: 160px; padding-inline: 0 18px; }
.dw-ui-v190 .dw-mega__panel { z-index: 12030; }

/* Mobile drawer: submenu indicators belong on the right in RTL. */
.dw-ui-v190 .dw-mobile-drawer .menu-item-has-children { position: relative; }
.dw-ui-v190 .dw-mobile-drawer .menu-item-has-children > a { padding-inline-start: 42px; }
.dw-ui-v190 .dw-mobile-drawer .dw-mobile-submenu-toggle {
  position: absolute;
  inset-inline-start: 0;
  inset-inline-end: auto;
  inset-block-start: 5px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #767790;
  cursor: pointer;
}
.dw-ui-v190 .dw-mobile-drawer .dw-mobile-submenu-toggle .dw-icon { width: 17px; height: 17px; transform: rotate(90deg); transition: transform .2s ease; }
.dw-ui-v190 .dw-mobile-drawer .menu-item-has-children.is-submenu-open > .dw-mobile-submenu-toggle .dw-icon { transform: rotate(-90deg); }
.dw-ui-v190 .dw-mobile-drawer .sub-menu { display: none; margin: 0 14px 8px 0; padding: 0 12px 0 0; border-inline-start: 0; border-inline-end: 2px solid #f0f0f1; }
.dw-ui-v190 .dw-mobile-drawer .menu-item-has-children.is-submenu-open > .sub-menu { display: block; }
.dw-ui-v190 .dw-mobile-drawer > ul > li > a {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
}
.dw-ui-v190 .dw-mobile-drawer > ul > li > a > .dw-icon { order: -1; flex: 0 0 17px; width: 17px; height: 17px; transform: rotate(180deg); }

/* Product page: hide every legacy product surface that may be injected later. */
body.dw-product-v180 .product-tabs-wrapper,
body.dw-product-v180 .woocommerce-tabs:not(.dw-v180-section),
body.dw-product-v180 .wd-products-nav,
body.dw-product-v180 .wd-sticky-btn,
body.dw-product-v180 .wd-product-nav,
body.dw-product-v180 .wd-compare-btn,
body.dw-product-v180 .wd-wishlist-btn,
body.dw-product-v180 .product-share,
body.dw-product-v180 .wd-social-icons,
body.dw-product-v180 .summary-inner > :not(.dw-v180-product),
body.dw-product-v180 .product-image-summary:not(.dw-v180-product-hero) { display: none !important; }
body.dw-product-v180 .dw-commerce-page.dw-container { width: min(calc(100% - 32px), 1720px) !important; }
body.dw-product-v180 .dw-v180-product-hero { grid-template-columns: minmax(350px, 430px) minmax(420px, 1fr) minmax(330px, 380px) !important; }
body.dw-product-v180 .dw-v180-info { width: 100% !important; min-width: 420px !important; }
body.dw-product-v180 .dw-v180-purchase { width: 100% !important; }

/* Review form — Persian, compact and usable. */
.dw-ui-v190 .dw-v180-reviews #respond,
.dw-ui-v190 #review_form_wrapper {
  max-width: 880px;
  margin-top: 24px;
  padding: 22px;
  border: 1px solid #e0e0e2;
  border-radius: 12px;
  background: #f7f7f8;
}
.dw-ui-v190 .dw-v180-reviews .comment-form,
.dw-ui-v190 #review_form_wrapper .comment-form { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.dw-ui-v190 .dw-v180-reviews .comment-form > p,
.dw-ui-v190 #review_form_wrapper .comment-form > p { min-width: 0; margin: 0; }
.dw-ui-v190 .dw-v180-reviews .comment-form-rating,
.dw-ui-v190 .dw-v180-reviews .comment-form-comment,
.dw-ui-v190 .dw-v180-reviews .comment-notes,
.dw-ui-v190 .dw-v180-reviews .logged-in-as,
.dw-ui-v190 .dw-v180-reviews .comment-form-cookies-consent,
.dw-ui-v190 .dw-v180-reviews .form-submit,
.dw-ui-v190 #review_form_wrapper .comment-form-rating,
.dw-ui-v190 #review_form_wrapper .comment-form-comment,
.dw-ui-v190 #review_form_wrapper .comment-notes,
.dw-ui-v190 #review_form_wrapper .comment-form-cookies-consent,
.dw-ui-v190 #review_form_wrapper .form-submit { grid-column: 1 / -1; }
.dw-ui-v190 .dw-v180-reviews input:not([type="checkbox"]):not([type="radio"]),
.dw-ui-v190 .dw-v180-reviews select,
.dw-ui-v190 .dw-v180-reviews textarea,
.dw-ui-v190 #review_form_wrapper input:not([type="checkbox"]):not([type="radio"]),
.dw-ui-v190 #review_form_wrapper select,
.dw-ui-v190 #review_form_wrapper textarea {
  width: 100% !important;
  min-height: 46px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #d7d7da;
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
}
.dw-ui-v190 .comment-form-cookies-consent {
  display: flex !important;
  align-items: flex-start;
  gap: 9px;
  padding-top: 2px;
}
.dw-ui-v190 .comment-form-cookies-consent input[type="checkbox"] {
  flex: 0 0 18px !important;
  width: 18px !important;
  min-width: 18px !important;
  max-width: 18px !important;
  height: 18px !important;
  min-height: 18px !important;
  margin: 2px 0 0 !important;
  padding: 0 !important;
  border: 1px solid #a1a3a8;
  border-radius: 4px;
  accent-color: #ef4056;
}
.dw-ui-v190 .comment-form-cookies-consent label { margin: 0 !important; color: #62666d; font-size: 11px; line-height: 1.9; }
.dw-ui-v190 .form-submit input[type="submit"] { width: auto !important; min-width: 150px !important; min-height: 46px; padding: 0 22px; border: 0 !important; border-radius: 8px; background: #ef4056 !important; color: #fff !important; font-weight: 800; }

/* Mobile purchase bar adds directly instead of navigating or scrolling. */
.dw-ui-v190 .dw-v180-mobile-buybar button.is-loading { position: relative; color: transparent; pointer-events: none; }
.dw-ui-v190 .dw-v180-mobile-buybar button.is-loading::after { content: ""; position: absolute; inset: 50% auto auto 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border: 2px solid rgba(255,255,255,.42); border-top-color: #fff; border-radius: 50%; animation: dw-v190-spin .75s linear infinite; }
.dw-ui-v190 .dw-v180-mobile-buybar button.is-success { background: #00a049; }
@keyframes dw-v190-spin { to { transform: rotate(360deg); } }

/* Cart page — independent of WoodMart tables and sidebars. */
body.dw-cart-v190 .dw-page-shell { width: min(calc(100% - 32px), 1440px) !important; max-width: none !important; padding: 0 0 64px !important; }
body.dw-cart-v190 .dw-page-shell > .dw-page-breadcrumbs { display: none !important; }
body.dw-cart-v190 .dw-content-page--commerce,
body.dw-cart-v190 .dw-content-page--commerce .entry-content { width: 100%; min-width: 0; margin: 0; padding: 0; }
body.dw-cart-v190 .woocommerce { width: 100%; }
.dw-v190-cart-shell { width: 100%; padding-top: 14px; }
.dw-v190-cart-breadcrumb { display: flex; align-items: center; gap: 7px; padding: 8px 2px 18px; color: #767790; font-size: 11px; }
.dw-v190-cart-breadcrumb strong { color: #424750; }
.dw-v190-cart-layout { display: grid; grid-template-columns: minmax(0,1fr) minmax(300px,360px); gap: 24px; align-items: start; }
.dw-v190-cart-items { min-width: 0; border: 1px solid #e0e0e2; border-radius: 12px; background: #fff; overflow: hidden; }
.dw-v190-cart-items__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 22px 15px; border-bottom: 1px solid #f0f0f1; }
.dw-v190-cart-items__head > div { min-width: 0; }
.dw-v190-cart-items__head h1 { display: inline; margin: 0; color: #23254e; font-size: 20px; }
.dw-v190-cart-items__head span { margin-inline-start: 8px; color: #767790; font-size: 11px; }
.dw-v190-cart-items__head a { flex: 0 0 auto; color: #19bfd3; font-size: 11px; font-weight: 700; }
.dw-v190-cart-list { padding: 0 22px; }
.dw-v190-cart-item { display: grid; grid-template-columns: 150px minmax(0,1fr) minmax(150px,auto); gap: 20px; align-items: start; padding: 22px 0; border-bottom: 1px solid #f0f0f1; }
.dw-v190-cart-item:last-child { border-bottom: 0; }
.dw-v190-cart-item__media { display: grid; place-items: center; min-height: 145px; }
.dw-v190-cart-item__media img { display: block; width: 140px; height: 140px; object-fit: contain; }
.dw-v190-cart-item__body { min-width: 0; }
.dw-v190-cart-item__title > a { display: block; color: #3f4064; font-size: 13px; font-weight: 700; line-height: 2; }
.dw-v190-cart-item__title .variation { margin: 6px 0 0; color: #767790; font-size: 10px; }
.dw-v190-cart-item__meta { display: grid; gap: 8px; margin: 14px 0; padding: 0; list-style: none; }
.dw-v190-cart-item__meta li { display: flex; align-items: center; gap: 7px; color: #62666d; font-size: 10px; }
.dw-v190-cart-item__meta .dw-icon { flex: 0 0 17px; width: 17px; height: 17px; color: #767790; }
.dw-v190-cart-item__actions { display: flex; align-items: center; gap: 14px; }
.dw-v190-cart-item__quantity .quantity { display: grid !important; grid-template-columns: 34px 44px 34px; align-items: center; width: 112px !important; min-width: 112px; min-height: 40px; overflow: hidden; border: 1px solid #e0e0e2; border-radius: 8px; background: #fff; }
.dw-v190-cart-item__quantity .quantity input.qty { width: 44px !important; min-width: 0 !important; height: 38px !important; padding: 0 !important; border: 0 !important; text-align: center; box-shadow: none !important; }
.dw-v190-cart-item__quantity .quantity .minus,
.dw-v190-cart-item__quantity .quantity .plus { display: grid !important; place-items: center; width: 34px !important; min-width: 34px !important; height: 38px !important; padding: 0 !important; border: 0 !important; background: transparent !important; color: #ef4056 !important; font-size: 20px !important; }
.dw-v190-cart-item__remove { display: inline-flex !important; align-items: center; gap: 5px; width: auto !important; height: auto !important; color: #767790 !important; font-size: 10px; }
.dw-v190-cart-item__remove::before,
.dw-v190-cart-item__remove::after { display: none !important; }
.dw-v190-cart-item__remove .dw-icon { width: 17px; height: 17px; }
.dw-v190-cart-item__price { min-width: 0; text-align: left; direction: rtl; }
.dw-v190-cart-item__price small,
.dw-v190-cart-item__price span,
.dw-v190-cart-item__price strong { display: block; }
.dw-v190-cart-item__price small { color: #a1a3a8; font-size: 9px; }
.dw-v190-cart-item__price span { margin-top: 5px; color: #767790; font-size: 11px; }
.dw-v190-cart-item__price strong { margin-top: 10px; color: #23254e; font-size: 15px; }
.dw-v190-cart-tools { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; padding: 18px 22px; border-top: 1px solid #f0f0f1; background: #fafafa; }
.dw-v190-cart-coupon { flex: 1 1 460px; max-width: 520px; }
.dw-v190-cart-coupon > label { display: block; margin-bottom: 7px; color: #62666d; font-size: 10px; }
.dw-v190-cart-coupon > div { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
.dw-v190-cart-coupon input { min-width: 0; height: 44px; padding: 0 12px; border: 1px solid #d7d7da; border-radius: 8px; background: #fff; }
.dw-v190-cart-coupon button,
.dw-v190-cart-update { min-width: 104px !important; min-height: 44px !important; padding: 0 16px !important; border: 1px solid #d7d7da !important; border-radius: 8px !important; background: #fff !important; color: #3f4064 !important; font-size: 11px !important; }
.dw-v190-cart-summary { position: sticky; top: 92px; padding: 20px; border: 1px solid #e0e0e2; border-radius: 12px; background: #fff; }
.dw-v190-cart-summary h2 { margin: 0 0 16px; color: #23254e; font-size: 17px; }
.dw-v190-cart-summary > div { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 11px 0; color: #62666d; font-size: 11px; }
.dw-v190-cart-summary > div strong { color: #424750; text-align: left; }
.dw-v190-cart-summary > div.is-discount strong { color: #00a049; }
.dw-v190-cart-summary__total { margin-top: 5px; padding-top: 16px !important; border-top: 1px solid #e0e0e2; }
.dw-v190-cart-summary__total span,
.dw-v190-cart-summary__total strong { color: #23254e !important; font-size: 14px; font-weight: 800; }
.dw-v190-cart-summary .checkout-button { display: flex !important; align-items: center; justify-content: center; width: 100% !important; min-height: 50px !important; margin: 14px 0 0 !important; padding: 0 16px !important; border: 0 !important; border-radius: 8px !important; background: #ef4056 !important; color: #fff !important; font-size: 12px !important; font-weight: 800 !important; }
.dw-v190-cart-summary > p { display: flex; align-items: flex-start; gap: 7px; margin: 13px 0 0; color: #767790; font-size: 9px; line-height: 1.8; }
.dw-v190-cart-summary > p .dw-icon { flex: 0 0 17px; width: 17px; height: 17px; color: #00a049; }
body.dw-cart-v190 .cart-collaterals,
body.dw-cart-v190 .cross-sells,
body.dw-cart-v190 .cart_totals { display: none !important; }

@media (max-width: 1100px) {
  .dw-ui-v190 .dw-header__main { grid-template-columns: 130px minmax(260px,1fr) minmax(176px,max-content); gap: 14px; }
  .dw-ui-v190 .dw-account-link { min-width: 122px; padding-inline: 10px; }
  body.dw-product-v180 .dw-v180-product-hero { grid-template-columns: minmax(330px,42%) minmax(0,1fr) !important; }
  body.dw-product-v180 .dw-v180-info { min-width: 0 !important; }
  .dw-v190-cart-layout { grid-template-columns: minmax(0,1fr) 310px; }
  .dw-v190-cart-item { grid-template-columns: 125px minmax(0,1fr); }
  .dw-v190-cart-item__media img { width: 120px; height: 120px; }
  .dw-v190-cart-item__price { grid-column: 2; display: flex; align-items: center; gap: 10px; text-align: right; }
  .dw-v190-cart-item__price small { display: none; }
  .dw-v190-cart-item__price span,
  .dw-v190-cart-item__price strong { margin: 0; }
}

@media (max-width: 900px) {
  .dw-ui-v190 .dw-header { position: sticky; top: 0; }
  .dw-ui-v190 .dw-header__main {
    width: 100%;
    min-height: 116px;
    padding: 8px 12px 10px;
    grid-template-columns: 42px minmax(0,1fr) 44px;
    grid-template-rows: 46px 46px;
    gap: 8px 10px;
  }
  .dw-ui-v190 .dw-mobile-menu-toggle { display: grid !important; place-items: center; grid-column: 1; grid-row: 1; width: 42px; height: 42px; margin: 0; padding: 0; border: 0; background: transparent; }
  .dw-ui-v190 .dw-header__logo { grid-column: 2; grid-row: 1; justify-content: center; }
  .dw-ui-v190 .dw-header__actions { grid-column: 3; grid-row: 1; display: block; min-width: 0; }
  .dw-ui-v190 .dw-header__actions .dw-account-link,
  .dw-ui-v190 .dw-header__actions .dw-action-divider { display: none !important; }
  .dw-ui-v190 .dw-cart-link { width: 42px; height: 42px; }
  .dw-ui-v190 .dw-search { grid-column: 1 / -1; grid-row: 2; width: 100%; max-width: none; height: 46px; margin: 0; }
  .dw-ui-v190 .dw-search-results { position: fixed; top: 116px; right: 10px; left: 10px; width: auto; max-height: calc(100dvh - 180px); }
  .dw-ui-v190 .dw-header__nav-wrap { display: none !important; }
  .dw-ui-v190 .dw-mobile-drawer { z-index: 13010; }
  .dw-ui-v190 .dw-drawer-backdrop { z-index: 13000; }
  body.dw-product-v180 .dw-commerce-page.dw-container { width: calc(100% - 20px) !important; }
  body.dw-product-v180 .dw-v180-product-hero { display: block !important; }
  body.dw-product-v180 .dw-v180-info { min-width: 0 !important; }
  .dw-v190-cart-layout { grid-template-columns: 1fr; }
  .dw-v190-cart-summary { position: static; }
}

@media (max-width: 620px) {
  body.dw-cart-v190 .dw-page-shell { width: calc(100% - 20px) !important; padding-bottom: 92px !important; }
  .dw-v190-cart-items { border-radius: 10px; }
  .dw-v190-cart-items__head { padding: 16px; }
  .dw-v190-cart-list { padding: 0 14px; }
  .dw-v190-cart-item { grid-template-columns: 92px minmax(0,1fr); gap: 12px; padding: 16px 0; }
  .dw-v190-cart-item__media { min-height: 92px; }
  .dw-v190-cart-item__media img { width: 88px; height: 88px; }
  .dw-v190-cart-item__title > a { font-size: 11px; }
  .dw-v190-cart-item__meta { margin-block: 10px; }
  .dw-v190-cart-item__actions { justify-content: space-between; }
  .dw-v190-cart-item__price { grid-column: 1 / -1; justify-content: flex-end; padding-inline-start: 104px; }
  .dw-v190-cart-tools { align-items: stretch; flex-direction: column; padding: 14px; }
  .dw-v190-cart-coupon { width: 100%; max-width: none; }
  .dw-v190-cart-update { width: 100% !important; }
  .dw-ui-v190 .dw-v180-reviews .comment-form,
  .dw-ui-v190 #review_form_wrapper .comment-form { grid-template-columns: 1fr; }
  .dw-ui-v190 .dw-v180-reviews .comment-form > p,
  .dw-ui-v190 #review_form_wrapper .comment-form > p { grid-column: 1 / -1; }
  .dw-ui-v190 .dw-v180-reviews #respond,
  .dw-ui-v190 #review_form_wrapper { padding: 16px; }
}

/* Quantity controls generated by the shared Digiwood normalizer. */
.dw-v190-cart-item__quantity .quantity .dw-quantity-step {
  display: grid !important;
  place-items: center;
  width: 34px !important;
  min-width: 34px !important;
  height: 38px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: #ef4056 !important;
  font-size: 20px !important;
  line-height: 1 !important;
}
