.dk-so-rating-box {
  display: inline-flex !important;
  align-items: baseline;
  gap: 3px;
  width: auto !important;
  height: auto !important;
  line-height: 1;
  white-space: nowrap;
}

.dk-so-rating-box .dk-so-rating-value { color: inherit; font-size: 18px; font-weight: 700; }
.dk-so-rating-box .dk-so-rating-icon { position: static; width: auto; height: auto; color: #f7b500; font-size: 14px; line-height: 1; }
.dk-so-rating-box .dk-so-rating-scale { color: inherit; font-size: 13px; opacity: 0.75; }
.dk-so-rating-box .dk-so-rating-empty { color: inherit; font-size: 14px; font-weight: 600; }

.stock.dk-so-out-of-stock,
.stock.dk-so-out-of-stock > * { color: #dc3545 !important; }
.stock.dk-so-out-of-stock { font-weight: 600; }

#product #button-cart:disabled,
#product .btn-checkout:disabled,
#product [data-dk-so-disabled="true"] {
  opacity: 0.55 !important;
  cursor: not-allowed !important;
  filter: grayscale(0.2);
  box-shadow: none !important;
}
#product [data-dk-so-disabled="true"] { pointer-events: none !important; }

.dk-so-custom-tab-body { max-width: 100%; overflow-x: auto; overflow-wrap: anywhere; }
.dk-so-custom-tab-body img,
.dk-so-custom-tab-body video,
.dk-so-custom-tab-body iframe { max-width: 100%; }
.dk-so-custom-tab-body img,
.dk-so-custom-tab-body video { height: auto; }

/* Keep extension actions visually subordinate to SO Entry's native Add to Cart / Buy Now controls. */
.dk-so-purchase-extras {
  display: block !important;
  flex: 0 0 100% !important;
  width: 100% !important;
  max-width: 100%;
  clear: both;
  margin: 14px 0 0 !important;
  padding: 0;
  box-sizing: border-box;
}

.dk-so-action-section { display: block; width: 100%; }
.dk-so-action-section + .dk-so-action-section { margin-top: 14px; }

/* Notify is the primary extension action when local stock is unavailable. */
.dk-so-notify-section {
  padding-top: 12px;
  border-top: 1px solid rgba(0,0,0,.08);
}
.dk-so-notify-section .dk-so-notify-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 150px;
  min-height: 40px;
  padding: 8px 18px;
}

/* External marketplaces are intentionally compact secondary actions. */
.dk-so-buy-section { margin-top: 0; }
.dk-so-buy-heading {
  margin: 0 0 6px;
  color: inherit;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.35;
  opacity: .62;
}
.dk-so-buy-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  width: 100%;
}
.dk-so-buy-option {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px;
  width: auto !important;
  min-width: 0 !important;
  max-width: max-content;
  min-height: 32px;
  padding: 5px 9px !important;
  flex: 0 0 auto !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  line-height: 1.3 !important;
  color: inherit !important;
  background: transparent !important;
  border-color: rgba(0,0,0,.16) !important;
  box-shadow: none !important;
  white-space: nowrap;
}
.dk-so-buy-option:hover,
.dk-so-buy-option:focus {
  color: inherit !important;
  background: rgba(0,0,0,.035) !important;
  border-color: rgba(0,0,0,.24) !important;
  box-shadow: none !important;
}
.dk-so-buy-title { font: inherit; line-height: inherit; }
.dk-so-buy-logo {
  display: block;
  max-height: 16px;
  max-width: 72px;
  width: auto;
  height: auto;
  object-fit: contain;
  flex: 0 0 auto;
}

/* Self-contained notification dialog; does not depend on SO Entry's Bootstrap modal stack. */
body.dk-so-notify-open { overflow: hidden !important; }
.dk-so-notify-layer[hidden] { display: none !important; }
.dk-so-notify-layer {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}
.dk-so-notify-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 20, 28, .48);
  -webkit-backdrop-filter: blur(1.5px);
  backdrop-filter: blur(1.5px);
}
.dk-so-notify-dialog {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  max-height: calc(100dvh - 40px);
  overflow: auto;
  background: #fff;
  color: #222;
  border-radius: 14px;
  box-shadow: 0 18px 60px rgba(0,0,0,.22);
  -webkit-overflow-scrolling: touch;
}
.dk-so-notify-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px 10px;
}
.dk-so-notify-title { margin: 0; font-size: 18px; line-height: 1.3; font-weight: 700; }
.dk-so-notify-x {
  appearance: none;
  border: 0;
  background: transparent;
  color: #666;
  font-size: 28px;
  line-height: 1;
  padding: 0 2px;
  cursor: pointer;
}
.dk-so-notify-body { padding: 2px 18px 6px; }
.dk-so-notify-help { margin: 0 0 14px; color: #666; font-size: 13px; line-height: 1.5; }
.dk-so-field { margin-bottom: 12px; }
.dk-so-field label { display: block; margin-bottom: 5px; font-size: 13px; font-weight: 600; }
.dk-so-field .form-control { min-height: 40px; }
.dk-so-notify-message .alert { margin: 10px 0 0; padding: 9px 11px; font-size: 13px; }
.dk-so-notify-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px 16px;
  border-top: 1px solid rgba(0,0,0,.07);
}
.dk-so-notify-footer .btn { min-width: 92px; }

@media (max-width: 767.98px) {
  .producttab .tabsslider .nav-tabs {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }
  .producttab .tabsslider .nav-tabs > li { flex: 0 0 auto; width: auto !important; }
  .producttab .tabsslider.vertical-tabs .tab-content,
  .producttab .tabsslider.horizontal-tabs .tab-content { width: 100% !important; }
  .dk-so-custom-tab-body { padding-top: 4px; }

  .dk-so-purchase-extras {
    margin-top: 14px !important;
    padding-top: 0;
  }
  .dk-so-action-section + .dk-so-action-section { margin-top: 14px; }
  .dk-so-notify-section .dk-so-notify-button {
    width: 100% !important;
    min-width: 0;
    min-height: 44px;
  }
  .dk-so-buy-heading { margin-bottom: 5px; font-size: 11px; }
  #product .dk-so-purchase-extras .dk-so-buy-options,
  .product-info #product .dk-so-purchase-extras .dk-so-buy-options,
  .product-view #product .dk-so-purchase-extras .dk-so-buy-options {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 6px !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    white-space: nowrap !important;
    padding: 1px 0 3px !important;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  #product .dk-so-buy-options::-webkit-scrollbar { display: none; }
  #product .dk-so-purchase-extras .dk-so-buy-options > .dk-so-buy-option,
  #product .dk-so-purchase-extras .dk-so-buy-options > a.dk-so-buy-option,
  .product-info #product .dk-so-buy-options > a.dk-so-buy-option,
  .product-view #product .dk-so-buy-options > a.dk-so-buy-option {
    display: inline-flex !important;
    float: none !important;
    width: auto !important;
    min-width: max-content !important;
    max-width: max-content !important;
    min-height: 30px !important;
    margin: 0 !important;
    padding: 5px 8px !important;
    flex: 0 0 auto !important;
    align-self: center !important;
    white-space: nowrap !important;
    font-size: 11px !important;
    line-height: 1.25 !important;
  }
  .dk-so-buy-logo { max-height: 15px; max-width: 64px; }

  .dk-so-notify-layer {
    align-items: flex-end;
    padding: 12px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
  .dk-so-notify-dialog {
    width: 100%;
    max-height: min(78dvh, 560px);
    border-radius: 14px;
  }
  .dk-so-notify-header { padding: 14px 16px 9px; }
  .dk-so-notify-body { padding: 2px 16px 5px; }
  .dk-so-notify-footer {
    padding: 11px 16px 14px;
    padding-bottom: max(14px, env(safe-area-inset-bottom));
  }
  .dk-so-notify-footer .btn { flex: 1 1 0; min-width: 0; }
}

@media (max-width: 380px) {
  .dk-so-notify-layer { padding-left: 8px; padding-right: 8px; }
  .dk-so-notify-footer { flex-direction: column-reverse; }
  .dk-so-notify-footer .btn { width: 100%; }
}
