/* =====================================================================
   Social Cart — design fixes (audit items 5-9)
   Owner: Hossam Ellamaay. Written 1 Dec 2026.
   Load this file LAST, after every theme stylesheet (single custom file).
   Nothing here edits a vendor file, so a theme/app upgrade cannot revert it.
   Every rule is scoped to a selector verified on the live site.
   ===================================================================== */

/* ---- 6. Storefront Sort By / Filter By: make them look like dropdowns ----
   Live DOM:
   <div class="flex-middle gap-2"><i class="bi bi-sort-up-alt"></i><span>Sort By:</span></div>
   <div class="dropdown product-view-sort-by"><button class="border-0 bg-transparent
        dropdown-toggle text-dark p-0 custom-pe-3">...</button></div>
   The button is styled border-0 bg-transparent p-0, so it reads as plain text. */
.product-view-sort-by > button,
.product-view-filter-by > button,
.dropdown.product-view-sort-by > .dropdown-toggle,
.dropdown[class*="product-view-filter"] > .dropdown-toggle {
  border: 1px solid #d6dbe6 !important;
  background: #ffffff !important;
  border-radius: 8px !important;
  padding: .35rem .7rem !important;
  color: #12182b !important;
  font-weight: 500;
}
.product-view-sort-by > button:hover,
.product-view-sort-by > button:focus,
.dropdown[class*="product-view-filter"] > .dropdown-toggle:hover,
.dropdown[class*="product-view-filter"] > .dropdown-toggle:focus {
  border-color: #0C1955 !important;
  box-shadow: 0 0 0 3px rgba(12, 25, 85, .08);
}
/* the caret must be visible against the new white field */
.product-view-sort-by > button::after,
.dropdown[class*="product-view-filter"] > .dropdown-toggle::after {
  border-top-color: #0C1955 !important; margin-left: .45rem; vertical-align: .18em;
}

/* ---- 7. Admin search boxes: remove the stray grey circle ----
   Live DOM: <div class="input-group input-group-custom input-group-merge">
               <div class="input-group-prepend"><div class="input-group-text">
                 <i class="tio-search"></i>...
   The prepend is rendering as a floating circle above the field. */
.input-group-custom .input-group-prepend .input-group-text,
.input-group-custom .input-group-text {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  position: static !important;
  width: auto !important; height: auto !important;
  padding: 0 .5rem !important;
}
.input-group-custom .input-group-text i { font-size: 16px; color: #6b7280; }

/* ---- 8. Shipping Orders / Shipping Accounts Export + Import: same metrics as the Orders page
   Export (a.btn.btn-outline-primary: 1px solid rgb(20,85,172), radius 5px, 10px 20px, 40px high).
   Scoped to the Excel-icon outline buttons only; Orders itself is untouched. ---- */
.btn.btn-outline--primary:has(> img.excel){
  border:1px solid rgb(20,85,172)!important; border-radius:5px!important; background:#fff!important;
  color:rgb(20,85,172)!important; padding:10px 20px!important; height:40px!important;
  font:600 14px/14px Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif!important;
  display:inline-flex; align-items:center;
}
.btn.btn-outline--primary:has(> img.excel):hover{ background:rgb(20,85,172)!important; color:#fff!important; }

/* ---- 5. In-house product list only (identified by its status form in the rows).
   Measured: eight equal 133px columns made the name wrap word by word and pushed
   the delete action to a second line. Give the name and action columns room. ---- */
table:has(.admin-product-status-form){table-layout:fixed!important;width:100%!important}
table:has(.admin-product-status-form)>thead>tr>th:nth-child(1),table:has(.admin-product-status-form)>tbody>tr>:nth-child(1){width:5%!important}
table:has(.admin-product-status-form)>thead>tr>th:nth-child(2),table:has(.admin-product-status-form)>tbody>tr>:nth-child(2){width:29%!important;min-width:260px;white-space:normal!important;text-align:left}
table:has(.admin-product-status-form)>thead>tr>th:nth-child(3),table:has(.admin-product-status-form)>tbody>tr>:nth-child(3){width:10%!important}
table:has(.admin-product-status-form)>thead>tr>th:nth-child(4),table:has(.admin-product-status-form)>tbody>tr>:nth-child(4){width:12%!important}
table:has(.admin-product-status-form)>thead>tr>th:nth-child(5),table:has(.admin-product-status-form)>tbody>tr>:nth-child(5){width:7%!important}
table:has(.admin-product-status-form)>thead>tr>th:nth-child(6),table:has(.admin-product-status-form)>tbody>tr>:nth-child(6){width:13%!important}
table:has(.admin-product-status-form)>thead>tr>th:nth-child(7),table:has(.admin-product-status-form)>tbody>tr>:nth-child(7){width:9%!important}
table:has(.admin-product-status-form)>thead>tr>th:nth-child(8),table:has(.admin-product-status-form)>tbody>tr>:nth-child(8){width:15%!important}
table:has(.admin-product-status-form) td:nth-child(8) .d-flex{flex-wrap:nowrap!important;white-space:nowrap!important}

/* ---- 9. Policy / content pages: readable hero title (live markup confirmed:
   div.page-title.overlay > h1.absolute-white). Scrim only, image untouched. ---- */
.page-title.overlay{position:relative}
.page-title.overlay::before{content:"";position:absolute;inset:0;background:linear-gradient(180deg,rgba(12,25,85,.62),rgba(12,25,85,.42));z-index:1}
.page-title.overlay>*{position:relative;z-index:2}
.page-title.overlay h1{text-shadow:0 2px 10px rgba(0,0,0,.45)}

/* ---- SEO1: CLS. The in-page search box is resized by JS (custom.js adds
   sc-search-like-home after load). Same final geometry set up front so the
   product grid does not jump. Mirrors the rules custom.js injects. ---- */
@media(min-width:992px){
main .search-box-2{width:100%;max-width:420px}
main .search-box-2>.d-flex{height:42px;background:#fff;border:1px solid #e2e5eb;border-radius:10px;overflow:hidden;align-items:center;flex-direction:row-reverse}
main .search-box-2 .select-wrap{min-width:0;flex:1;border:0!important;border-radius:0!important;height:100%;box-shadow:none!important}
main .search-box-2 input[type=search]{width:100%;min-width:0;height:100%}
/* the Sort/Filter blocks start in this row and custom.js moves them into the toolbar after load; keep them out of the row until then so its height does not collapse */
main .d-flex:has(>.search-box-2)>.border.rounded{display:none}
/* reserve the toolbar height it has once custom.js moves Sort/Filter into it */
main div:has(>.product-view-option){min-height:62px}
}
