/* Photo search interface and popup-scoped result cards. */
#il-photo-search[hidden], #il-photo-search [hidden] { display: none !important; }
#il-photo-search { position: fixed; inset: 0; z-index: 12000; overflow: auto; padding: 26px; background: rgba(19,21,22,.68); overscroll-behavior: contain; font-family: Arial, sans-serif; color: #171819; text-align: left; font-size: 14px; line-height: 1.4; }
#il-photo-search .ilps-dialog { width: min(1320px,100%); margin: 0 auto; padding: 24px; border-radius: 18px; background: #fff; box-shadow: 0 18px 80px #0004; min-height: 240px; }
#il-photo-search .ilps-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
#il-photo-search .ilps-heading h2 { margin: 0 0 3px; font-size: 30px; line-height: 1.15; font-weight: 750; color: #111; }
#il-photo-search .ilps-subtitle { color: #828282; margin: 0; font-size: 16px; }
#il-photo-search .ilps-heading-actions { display: flex; align-items: center; gap: 18px; }
#il-photo-search .ilps-button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 42px; padding: 10px 16px; border: 1px solid #c8c9cb; border-radius: 10px; background: #fff; color: #151515; font: 600 14px/1.3 Arial,sans-serif; cursor: pointer; white-space: normal; }
#il-photo-search .ilps-button:hover { border-color: #8c8d90; background: #f7f7f7; }
#il-photo-search .ilps-button-primary { background: #ffbd24; border-color: #ffbd24; }
#il-photo-search .ilps-button-primary:hover { background: #ffca4c; border-color: #ffca4c; }
#il-photo-search .ilps-button:disabled { opacity: .55; cursor: wait; }
#il-photo-search .ilps-close { width: 32px; height: 38px; padding: 0; border: 0; background: transparent; font: 36px/1 Arial,sans-serif; cursor: pointer; color: #1c1d1f; }
#il-photo-search button:focus-visible { outline: 3px solid #3569c8; outline-offset: 3px; }
#il-photo-search .ilps-upload-zone { border: 2px dashed #d8dadd; border-radius: 14px; text-align: center; padding: 58px 20px; background: #fafafa; }
#il-photo-search .ilps-upload-zone h3 { margin: 14px 0 8px; font-size: 24px; }
#il-photo-search .ilps-upload-zone p { margin: 6px 0 18px; color: #73767b; }
#il-photo-search .ilps-upload-symbol { display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 64px; line-height: 1; color: #f3ac15; }
#il-photo-search .ilps-file-hint { font-size: 12px; margin-top: 15px !important; }
#il-photo-search .ilps-stage { position: relative; height: clamp(300px, 35vw, 460px); width: 100%; border-radius: 12px; overflow: hidden; background: #edf2f6; }
#il-photo-search .ilps-stage .cropper-container { background: #edf2f6; }
#il-photo-search .ilps-stage .cropper-modal { background-color: #d7e0e8; opacity: .3; }
#il-photo-search .ilps-image { display: block; max-width: 100%; max-height: 100%; margin: auto; }
#il-photo-search .ilps-stage-top { position: absolute; top: 14px; left: 18px; right: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; pointer-events: none; z-index: 4; }
#il-photo-search .ilps-stage-top > div { display: flex; align-items: center; gap: 16px; pointer-events: auto; }
#il-photo-search .ilps-filename { max-width: 35%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #435160; background: rgba(255,255,255,.92); border-radius: 8px; padding: 6px 10px; font-size: 14px; }
#il-photo-search .ilps-reset { color: #435160; background: rgba(255,255,255,.92); padding: 10px; border: 1px solid #d8e0e7; border-radius: 8px; font: 600 13px Arial,sans-serif; cursor: pointer; }
#il-photo-search .ilps-stage-help { position: absolute; bottom: 14px; left: 14px; padding: 10px 12px; background: rgba(255,255,255,.92); color: #435160; border-radius: 7px; pointer-events: none; z-index: 4; font-size: 12px; }
#il-photo-search .ilps-boxes { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
#il-photo-search .ilps-object-box { position: absolute; min-width: 1px; min-height: 1px; border: 2px dashed #ffc127; background: transparent; padding: 0; cursor: pointer; pointer-events: auto; }
#il-photo-search .ilps-object-box > span { position: absolute; top: -13px; left: 8px; display: grid; place-items: center; background: #ffc127; border-radius: 50%; width: 24px; height: 24px; font-weight: 700; color: #161616; }
#il-photo-search .ilps-stage .cropper-view-box { outline: 2px solid #ffc127; outline-color: #ffc127; }
#il-photo-search .ilps-stage .cropper-line { background-color: #ffbe24; opacity: .85; }
#il-photo-search .ilps-stage .cropper-point { background: #fff; border: 2px solid #f4b322; width: 10px; height: 10px; opacity: 1; }
#il-photo-search .ilps-stage .cropper-point.point-e { right: -5px; } #il-photo-search .ilps-stage .cropper-point.point-w { left: -5px; }
#il-photo-search .ilps-stage .cropper-point.point-s { bottom: -5px; } #il-photo-search .ilps-stage .cropper-point.point-n { top: -5px; }
#il-photo-search .ilps-stage .cropper-point.point-ne { right: -5px; top: -5px; } #il-photo-search .ilps-stage .cropper-point.point-nw { left: -5px; top: -5px; }
#il-photo-search .ilps-stage .cropper-point.point-se { right: -5px; bottom: -5px; } #il-photo-search .ilps-stage .cropper-point.point-sw { left: -5px; bottom: -5px; }
#il-photo-search .ilps-selection-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 17px 0 13px; }
#il-photo-search .ilps-selection-heading h3 { margin: 0; font-size: 21px; font-weight: 700; }
#il-photo-search .ilps-selection-heading > span { color: #8a8a8a; font-size: 13px; }
#il-photo-search .ilps-choices { display: flex; gap: 16px; overflow-x: auto; padding: 3px 3px 8px; scrollbar-width: thin; }
#il-photo-search .ilps-choice { flex: 1 0 150px; min-width: 0; max-width: 220px; display: flex; flex-direction: column; background: #fff; border: 1px solid #dfe0e2; border-radius: 9px; padding: 0; overflow: hidden; color: #18191b; cursor: pointer; font: 600 13px/1.3 Arial,sans-serif; text-align: left; }
#il-photo-search .ilps-choice > canvas { width: 100%; height: 96px; object-fit: cover; display: block; }
#il-photo-search .ilps-choice > span:last-child { padding: 10px 11px; display: flex; align-items: center; min-height: 37px; }
#il-photo-search .ilps-choice[aria-pressed="true"] { border: 2px solid #f7b51e; background: #fff2d5; }
#il-photo-search .ilps-choice[aria-pressed="true"] > span:last-child::after { content: '✓'; margin-left: auto; border-radius: 50%; background: #ffbe24; padding: 1px 5px; }
#il-photo-search .ilps-choice-fragment { position: relative; min-height: 135px; }
#il-photo-search .ilps-choice-fragment > canvas { height: 135px; }
#il-photo-search .ilps-choice-fragment[aria-pressed="true"]::after { content: '✓'; position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #ffbe24; color: #18191b; }
#il-photo-search .ilps-choice-custom { border-style: dashed; align-items: center; justify-content: center; min-height: 135px; }
#il-photo-search .ilps-choice-plus { font-size: 40px; font-weight: 300; line-height: 1; margin-top: 14px; color: #696b70; }
#il-photo-search .ilps-search-actions { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin: 10px 0 0; }
#il-photo-search .ilps-selection-name { font-size: 13px; color: #75777d; }
#il-photo-search .ilps-live { min-height: 19px; color: #72757c; font-size: 13px; margin: 10px 0; }
#il-photo-search .ilps-error { padding: 12px 14px; border: 1px solid #efb2a5; border-radius: 8px; color: #9d291b; background: #fff3ef; margin: 12px 0; }
#il-photo-search .ilps-results { border-top: 1px solid #e9e9ea; padding-top: 18px; margin-top: 14px; }
#il-photo-search .ilps-result-meta { color: #85858a; text-align: right; font-size: 13px; margin-bottom: 12px; }
#il-photo-search.ilps-dragging .ilps-dialog { outline: 4px solid #ffbe24; outline-offset: -5px; }
@media(max-width: 700px) {
  #il-photo-search { padding: 10px; }
  #il-photo-search .ilps-dialog { padding: 15px; border-radius: 13px; }
  #il-photo-search .ilps-heading { gap: 8px; }
  #il-photo-search .ilps-heading h2 { font-size: 24px; }
  #il-photo-search .ilps-subtitle { font-size: 13px; }
  #il-photo-search .ilps-heading-actions { gap: 8px; }
  #il-photo-search .ilps-upload { font-size: 0; min-width: 38px; padding: 9px; }
  #il-photo-search .ilps-upload::before { content: '↑'; font-size: 21px; }
  #il-photo-search .ilps-upload > span { display: none; }
  #il-photo-search .ilps-stage { height: 300px; }
  #il-photo-search .ilps-stage-top { top: 9px; left: 10px; right: 8px; align-items: flex-start; }
  #il-photo-search .ilps-stage-top > div { gap: 4px; }
  #il-photo-search .ilps-stage-top .ilps-button { font-size: 11px; padding: 8px; min-height: 36px; }
  #il-photo-search .ilps-filename { max-width: 30%; font-size: 11px; }
  #il-photo-search .ilps-reset { font-size: 11px; padding: 9px 5px; }
  #il-photo-search .ilps-stage-help { left: 8px; bottom: 8px; font-size: 10px; max-width: calc(100% - 16px); }
  #il-photo-search .ilps-selection-heading { display: block; margin-top: 14px; }
  #il-photo-search .ilps-selection-heading h3 { font-size: 19px; }
  #il-photo-search .ilps-selection-heading > span { font-size: 11px; }
  #il-photo-search .ilps-choices { gap: 10px; }
  #il-photo-search .ilps-choice { flex-basis: 139px; }
  #il-photo-search .ilps-search-actions .ilps-button { min-width: 138px; }
  #il-photo-search .ilps-selection-name { font-size: 11px; }
  #il-photo-search .ilps-upload-zone { padding: 42px 15px; }
  #il-photo-search .ilps-upload-zone h3 { font-size: 21px; }
}
@media(prefers-reduced-motion: reduce) { #il-photo-search * { scroll-behavior: auto !important; } }

/* Mobile header: text search and photo action share the same row. */
@media(max-width:767px) {
  header.header-container > .container > .d-flex { flex-wrap: wrap; column-gap: 10px; }
  header.header-container > .container > .d-flex > #logo { flex: 0 0 100%; }
  header.header-container > .container > .d-flex > .search_cont { flex: 1 1 0%; min-width: 0; width: auto; }
  header.header-container > .container > .d-flex > .header-user-block { flex: 0 0 auto; width: auto; max-width: none; }
  header.header-container .search_cont > .c-o-search, header.header-container #search .input-lg { min-width: 0; }
  header.header-container .header-search-button { flex: 0 0 auto; }
}

/* Result cards must size from their contents, never from catalogue fixed heights. */
#il-photo-search .ilps-result-cards { display:grid; grid-template-columns:repeat(auto-fill,minmax(190px,1fr)); grid-auto-rows:1fr; gap:18px; width:100%; }
#il-photo-search .ilps-results .row { display:block; margin:0; }
#il-photo-search .ilps-result-cards > .product-layout { float:none; width:auto; min-width:0; padding:0; margin:0; display:flex; }
#il-photo-search .ilps-result-cards .product-thumb { display:flex; flex-direction:column; width:100%; height:auto; min-height:0; margin:0; border-radius:14px; overflow:hidden; background:#fafafa; }
#il-photo-search .ilps-result-cards .name { display:flex; align-items:center; justify-content:center; flex:0 0 auto; height:84px; min-height:84px; padding:10px 12px; box-sizing:border-box; margin:0; font-size:14px; line-height:1.4; text-align:center; }
#il-photo-search .ilps-result-cards .name a { height:auto; min-height:0; width:100%; line-height:1.4; font-size:inherit; display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:3; overflow:hidden; max-height:4.2em; color:#4b4b4b; }
#il-photo-search .ilps-result-cards .image { position:relative; flex:0 0 auto; width:100%; height:auto; aspect-ratio:1; margin:0; overflow:hidden; }
#il-photo-search .ilps-result-cards .image > a { display:block; width:100%; height:100%; }
#il-photo-search .ilps-result-cards .image > a > img { display:block; width:100%; height:100%; max-height:none; object-fit:contain; }
#il-photo-search .ilps-result-cards .stiker_attr img { width:20px; height:20px; max-width:20px; object-fit:contain; }
#il-photo-search .ilps-result-cards .caption { display:flex; flex:1 0 auto; flex-direction:column; justify-content:flex-end; height:auto; min-height:0; padding:12px; margin:0; }
#il-photo-search .ilps-result-cards .buy-box { display:grid; grid-template-columns:minmax(0,1fr) auto; grid-template-rows:auto 1fr; align-items:end; gap:8px; width:100%; height:auto; padding:0; margin:0; }
#il-photo-search .ilps-result-cards .dimensions { grid-column:1/-1; position:static; display:block; width:auto; height:auto; min-height:32px; margin:0; font-size:11px; line-height:16px; white-space:normal; }
#il-photo-search .ilps-result-cards .price { position:static; width:auto; height:auto; min-height:58px; margin:0; padding:0; }
#il-photo-search .ilps-result-cards .product_price { display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 8px; margin:0; }
#il-photo-search .ilps-result-cards .price-new { font-size:18px; line-height:24px; white-space:nowrap; }
#il-photo-search .ilps-result-cards .price-old { font-size:12px; line-height:18px; white-space:nowrap; }
#il-photo-search .ilps-result-cards .stock-category { position:static; display:block; width:auto; height:auto; margin:4px 0 0; font-size:12px; line-height:17px; white-space:normal; }
#il-photo-search .ilps-result-cards .button-group { position:static; inset:auto; display:flex; align-self:end; justify-content:center; width:40px; height:40px; margin:0 0 2px; padding:0; opacity:1; visibility:visible; transform:none; }
#il-photo-search .ilps-result-cards .button-group > button { position:static; width:40px; height:40px; min-height:40px; padding:0; margin:0; border-radius:10px; display:flex; align-items:center; justify-content:center; }
@media(max-width:600px) {
 #il-photo-search .ilps-result-cards { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
 #il-photo-search .ilps-result-cards .name { padding:8px; height:74px; min-height:74px; font-size:12px; }
 #il-photo-search .ilps-result-cards .stiker_attr img { width:20px; height:20px; max-width:20px; object-fit:contain; }
#il-photo-search .ilps-result-cards .caption { padding:9px; }
 #il-photo-search .ilps-result-cards .buy-box { grid-template-columns:minmax(0,1fr) 34px; gap:6px; }
 #il-photo-search .ilps-result-cards .price-new { font-size:16px; }
 #il-photo-search .ilps-result-cards .button-group,#il-photo-search .ilps-result-cards .button-group > button { width:34px; height:36px; min-height:36px; }
}

#il-photo-search .ilps-result-cards .button-group:has(> button.tomorrow) { width:76px; }
#il-photo-search .ilps-result-cards .button-group > button.tomorrow { width:76px; gap:4px; padding:0 6px; font-size:12px; white-space:nowrap; }
@media(max-width:600px) {
 #il-photo-search .ilps-result-cards .buy-box { grid-template-columns:minmax(0,1fr); }
 #il-photo-search .ilps-result-cards .price,#il-photo-search .ilps-result-cards .button-group { grid-column:1/-1; }
 #il-photo-search .ilps-result-cards .button-group { justify-self:end; }
}
