/* =========================================================
   RibbonLine Woo Sidebar Manager v1.3.0
   SmartMag exact sidebar removal + safe sibling removal
========================================================= */

body.rln-woo-sidebar-off {
  --rln-wsm-content-max: 1280px;
}

/* ---------------------------------------------------------
   01. SmartMag 정확 구조 제거
   첨부 캡처 기준:
   .main.ts-contain.c.right-sidebar > .ts-row
   ├─ div.col-8.main-content
   └─ aside.col-4.main-sidebar.has-sep
--------------------------------------------------------- */
body.rln-woo-sidebar-off.rln-wsm-smartmag-exact .main.ts-contain.right-sidebar > .ts-row > aside.col-4.main-sidebar.has-sep,
body.rln-woo-sidebar-off.rln-wsm-smartmag-exact .main.ts-contain.right-sidebar > .ts-row > aside.col-4.main-sidebar,
body.rln-woo-sidebar-off.rln-wsm-smartmag-exact .main.ts-contain.right-sidebar > .ts-row > aside.main-sidebar.has-sep,
body.rln-woo-sidebar-off.rln-wsm-smartmag-exact .main.ts-contain.right-sidebar > .ts-row > aside.main-sidebar,
body.rln-woo-sidebar-off.rln-wsm-smartmag-exact .main.ts-contain.right-sidebar > .ts-row > .rln-wsm-hidden-sidebar {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  width: 0 !important;
  max-width: 0 !important;
  min-width: 0 !important;
  flex: 0 0 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
}

body.rln-woo-sidebar-off.rln-wsm-smartmag-exact .main.ts-contain.right-sidebar > .ts-row > .col-8.main-content,
body.rln-woo-sidebar-off.rln-wsm-smartmag-exact .main.ts-contain.right-sidebar > .ts-row > .main-content {
  width: 100% !important;
  max-width: 100% !important;
  flex: 0 0 100% !important;
  float: none !important;
  clear: both !important;
  padding-right: 0 !important;
  padding-left: 0 !important;
  border-right: 0 !important;
  border-left: 0 !important;
  box-sizing: border-box !important;
}

body.rln-woo-sidebar-off.rln-wsm-smartmag-exact .main.ts-contain.right-sidebar > .ts-row {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

body.rln-woo-sidebar-off.rln-wsm-smartmag-exact .main.ts-contain.right-sidebar {
  max-width: var(--rln-wsm-content-max) !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* ---------------------------------------------------------
   02. JS가 정확히 판별한 사이드바 제거
--------------------------------------------------------- */
body.rln-woo-sidebar-off .rln-wsm-hidden-sidebar {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  width: 0 !important;
  max-width: 0 !important;
  min-width: 0 !important;
  height: 0 !important;
  max-height: 0 !important;
  flex: 0 0 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
}

body.rln-woo-sidebar-off .rln-wsm-main-full {
  width: 100% !important;
  max-width: 100% !important;
  flex: 0 0 100% !important;
  float: none !important;
  clear: both !important;
  box-sizing: border-box !important;
  border-right: 0 !important;
  border-left: 0 !important;
  box-shadow: none !important;
}

body.rln-woo-sidebar-off .rln-wsm-layout-full {
  grid-template-columns: 1fr !important;
}

body.rln-woo-sidebar-off .rln-wsm-woo-wrap {
  width: 100% !important;
  max-width: var(--rln-wsm-content-max) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box !important;
}

body.rln-woo-sidebar-off.woocommerce-shop .woocommerce,
body.rln-woo-sidebar-off.post-type-archive-product .woocommerce,
body.rln-woo-sidebar-off.tax-product_cat .woocommerce,
body.rln-woo-sidebar-off.tax-product_tag .woocommerce,
body.rln-woo-sidebar-off .rln-wsm-woo-wrap .woocommerce {
  width: 100% !important;
  max-width: var(--rln-wsm-content-max) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 20px !important;
  padding-right: 20px !important;
  box-sizing: border-box !important;
}

/* 직접 모드: WooCommerce 형제 사이드바만 제거. 전역 widget-area, col-4 제거는 하지 않음 */
body.rln-woo-sidebar-off.rln-wsm-strategy-direct .woocommerce ~ aside,
body.rln-woo-sidebar-off.rln-wsm-strategy-direct .woocommerce ~ .sidebar,
body.rln-woo-sidebar-off.rln-wsm-strategy-direct .woocommerce ~ .main-sidebar,
body.rln-woo-sidebar-off.rln-wsm-strategy-direct .woocommerce ~ .right-sidebar,
body.rln-woo-sidebar-off.rln-wsm-strategy-direct .woocommerce ~ .secondary-sidebar,
body.rln-woo-sidebar-off.rln-wsm-strategy-direct .woocommerce ~ .ts-sidebar,
body.rln-woo-sidebar-off.rln-wsm-strategy-direct .woocommerce ~ .bunyad-sidebar {
  display: none !important;
}

body.rln-woo-sidebar-off .main-wrap,
body.rln-woo-sidebar-off .site-content,
body.rln-woo-sidebar-off .content-wrap {
  overflow: visible !important;
}

@media (max-width: 768px) {
  body.rln-woo-sidebar-off.woocommerce-shop .woocommerce,
  body.rln-woo-sidebar-off.post-type-archive-product .woocommerce,
  body.rln-woo-sidebar-off.tax-product_cat .woocommerce,
  body.rln-woo-sidebar-off.tax-product_tag .woocommerce,
  body.rln-woo-sidebar-off .rln-wsm-woo-wrap .woocommerce {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }
}
