/* H6 Smart Shipping & Payment Control - settings screen. Shares its look with the other H6 plugins. */

.h6sspc-wrap{max-width:1180px}
.h6sspc-wrap h1{margin-bottom:16px}

/* Summary --------------------------------------------------------------- */
.h6sspc-status-card{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:18px;align-items:center;background:#fff;border:1px solid #dcdcde;border-radius:12px;box-shadow:0 1px 2px rgba(0,0,0,.04);padding:22px 24px;margin:0 0 4px}
.h6sspc-status-card.is-enabled{border-color:#b8e6bf;background:#f6fff7}
.h6sspc-status-card.is-disabled{background:#fcfcfc}
.h6sspc-status-icon{display:flex;align-items:center;justify-content:center;width:46px;height:46px;border-radius:50%;background:#f0f0f1;color:#50575e;font-size:22px}
.is-enabled .h6sspc-status-icon{background:#dff6e3;color:#0a5c22}
.h6sspc-status-copy strong{display:block;font-size:17px;line-height:1.35}
.h6sspc-status-copy p{margin:4px 0 0;color:#3c434a;font-size:14px;line-height:1.55}
.h6sspc-status-links{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-top:10px!important;color:#8c8f94}
.h6sspc-status-links a,.h6sspc-status-links .button-link{font-weight:600;text-decoration:none}
.h6sspc-status-links a:hover,.h6sspc-status-links .button-link:hover{text-decoration:underline}

.h6sspc-switch{display:inline-flex;align-items:center;gap:10px;cursor:pointer}
.h6sspc-switch input[type=checkbox]{position:absolute;opacity:0;pointer-events:none}
.h6sspc-switch-ui{position:relative;display:inline-block;flex:0 0 44px;width:44px;height:24px;border-radius:999px;background:#8c8f94;transition:background .18s ease}
.h6sspc-switch-ui:before{content:"";position:absolute;top:3px;left:3px;width:18px;height:18px;border-radius:50%;background:#fff;transition:transform .18s ease;box-shadow:0 1px 2px rgba(0,0,0,.2)}
.h6sspc-switch input:checked + .h6sspc-switch-ui{background:#2271b1}
.h6sspc-switch input:checked + .h6sspc-switch-ui:before{transform:translateX(20px)}
.h6sspc-switch input:focus-visible + .h6sspc-switch-ui{outline:2px solid #2271b1;outline-offset:2px}
.h6sspc-switch-text{font-weight:600;color:#1d2327}

/* Tabs joined to one panel ---------------------------------------------- */
.h6sspc-tabs{display:flex;flex-wrap:wrap;gap:4px;margin:28px 0 0;padding:0 0 0 12px;position:relative;z-index:1}
.h6sspc-tab{appearance:none;min-height:44px;margin:0 0 -1px;padding:11px 20px;border:1px solid transparent;border-bottom:0;border-radius:10px 10px 0 0;background:transparent;color:#50575e;font-weight:600;font-size:14px;cursor:pointer}
.h6sspc-tab:hover{color:#1d2327;background:rgba(255,255,255,.6)}
.h6sspc-tab.is-active{background:#fff;border-color:#dcdcde;color:#1d2327}
.h6sspc-tab:focus-visible{outline:2px solid #2271b1;outline-offset:-2px}
.h6sspc-tab-panel{background:#fff;border:1px solid #dcdcde;border-radius:12px;box-shadow:0 1px 2px rgba(0,0,0,.04);margin:0 0 20px;padding:28px 32px}
.h6sspc-tab-panel[hidden]{display:none}
.h6sspc-panel-head{display:flex;justify-content:space-between;align-items:flex-start;gap:20px;margin:0 0 20px}
.h6sspc-panel-head h2{margin:0 0 6px;font-size:17px}
.h6sspc-panel-head p{margin:0;color:#646970;line-height:1.55;max-width:760px}
.h6sspc-empty-state{padding:28px;text-align:center;color:#646970;border:1px dashed #c3c4c7;border-radius:10px}
.h6sspc-empty-state strong{display:block;color:#1d2327;margin-bottom:4px}
.h6sspc-empty-state p{margin:0}
.h6sspc-filter-empty{color:#646970}
.h6sspc-wrap [hidden]{display:none!important}

/* Rule list ------------------------------------------------------------- */
#h6sspc-rules-body{border:1px solid #e0e0e0;border-radius:10px;overflow:hidden}
#h6sspc-rules-body:empty{display:none}
.h6sspc-rule-card{background:#fff;border-top:1px solid #f0f0f1}
.h6sspc-rule-card:first-child{border-top:0}
.h6sspc-rule-card.is-hidden-by-filter{display:none}
.h6sspc-rule-card.is-editing{background:#fbfcfd;box-shadow:inset 3px 0 0 #2271b1}
.h6sspc-rule-card.is-off .h6sspc-rule-text{opacity:.55}
.h6sspc-card-placeholder{height:62px;background:#f0f6fc;border-top:1px dashed #72aee6}
.h6sspc-rule-head{display:grid;grid-template-columns:auto minmax(0,1fr) auto auto auto;gap:14px;align-items:center;padding:13px 16px}
.h6sspc-handle{width:14px;height:22px;cursor:grab;background:radial-gradient(circle,#a7aaad 1.5px,transparent 1.6px) 0 0/7px 6px;opacity:.8}
.h6sspc-rule-text{min-width:0}
.h6sspc-rule-title{display:block;font-size:14px;line-height:1.45;color:#1d2327}
.h6sspc-rule-sentence{display:block;color:#646970;font-size:12.5px;line-height:1.5;margin-top:2px}
.h6sspc-rule-unsaved{display:inline-block;margin-top:4px;color:#8a4b00;font-size:12px;font-weight:600}
.h6sspc-tags{display:flex;flex-wrap:wrap;gap:6px;justify-content:flex-end}
.h6sspc-tag{display:inline-block;padding:2px 9px;border-radius:999px;background:#f0f0f1;color:#3c434a;font-size:12px;line-height:18px;white-space:nowrap}
.h6sspc-tag.is-shipping{background:#e7f1fa;color:#135e96}
.h6sspc-tag.is-payment{background:#f3eefc;color:#5b2d99}
.h6sspc-tag.is-fee{background:#e6f4ea;color:#0a5c22}
.h6sspc-tag.is-warning{background:#fcf0e3;color:#8a4b00}

.h6sspc-toggle{display:inline-flex;align-items:center;gap:8px;cursor:pointer;min-width:64px}
.h6sspc-toggle input[type=checkbox]{position:absolute;opacity:0;pointer-events:none}
.h6sspc-toggle-ui{position:relative;display:inline-block;width:34px;height:20px;border-radius:999px;background:#8c8f94;transition:background .18s ease}
.h6sspc-toggle-ui:before{content:"";position:absolute;top:3px;left:3px;width:14px;height:14px;border-radius:50%;background:#fff;transition:transform .18s ease}
.h6sspc-toggle input:checked + .h6sspc-toggle-ui{background:#2271b1}
.h6sspc-toggle input:checked + .h6sspc-toggle-ui:before{transform:translateX(14px)}
.h6sspc-toggle input:focus-visible + .h6sspc-toggle-ui{outline:2px solid #2271b1;outline-offset:2px}
.h6sspc-toggle-text{font-size:13px;color:#3c434a}

/* Rule editor ----------------------------------------------------------- */
.h6sspc-rule-body{padding:4px 20px 18px 44px}
.h6sspc-control{display:flex;flex-direction:column;gap:6px;max-width:520px;margin:4px 0 18px}
.h6sspc-control-label,.h6sspc-then-fields label:not(.h6sspc-inline-check){display:block;font-weight:600;color:#1d2327;font-size:13px;margin:12px 0 6px}
.h6sspc-rule-columns{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(0,1fr);gap:28px}
.h6sspc-rule-columns h3{margin:0 0 8px;font-size:14px}
.h6sspc-match-line{margin:0 0 12px;color:#3c434a}
.h6sspc-match-line select{margin:0 4px}
.h6sspc-every-order{margin:0 0 12px;color:#646970;font-style:italic}
.h6sspc-conditions{display:flex;flex-direction:column;gap:8px;margin-bottom:12px}
.h6sspc-condition{display:grid;grid-template-columns:minmax(200px,.9fr) minmax(0,2fr) auto;gap:10px;align-items:start;padding:10px 12px;background:#fff;border:1px solid #e0e0e0;border-radius:8px}
.h6sspc-condition.is-incomplete{border-color:#dba617;background:#fffbf0}
.h6sspc-incomplete-note{display:none;margin:8px 0 0;color:#8a4b00;font-size:12.5px}
.h6sspc-condition.is-incomplete .h6sspc-incomplete-note{display:block}
.h6sspc-vg{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.h6sspc-vg .description{flex-basis:100%;margin:0;font-size:12px}
.h6sspc-vg input.regular-text{width:100%;max-width:none;flex:1 1 220px}
.h6sspc-vg input.small-text{width:110px}
.h6sspc-vg select.h6sspc-multi{flex:1 1 220px;min-width:0}
.h6sspc-words{color:#646970}
.h6sspc-remove-condition{font-size:20px;line-height:1;color:#8c8f94;text-decoration:none!important;padding:4px}
.h6sspc-remove-condition:hover{color:#b32d2e}
.h6sspcpro-schedule{flex-basis:100%;display:flex;flex-direction:column;gap:8px}
.h6sspcpro-schedule-days{display:flex;flex-wrap:wrap;gap:4px 12px}
.h6sspcpro-schedule-times,.h6sspcpro-schedule-dates{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.h6sspc-action-type{width:100%;max-width:420px}
.h6sspc-then-fields input.regular-text{width:100%;max-width:420px}
.h6sspc-then-fields .description{font-size:12px}
.h6sspcpro-caps{display:flex;flex-wrap:wrap;gap:8px 12px;align-items:center}
.h6sspcpro-caps label{margin:0!important;font-weight:400!important}
.h6sspc-inline-check{display:inline-flex;align-items:center;gap:8px;margin-top:12px}
.h6sspcpro-message-field{margin-top:18px;padding-top:6px;border-top:1px solid #f0f0f1}
.h6sspc-rule-footer{display:flex;align-items:center;gap:16px;margin-top:18px;padding-top:16px;border-top:1px solid #f0f0f1}
.h6sspc-rule-footer .button-link-delete{margin-left:auto}

/* Save bar */
.h6sspc-save-bar{position:sticky;bottom:0;z-index:5;display:flex;align-items:center;gap:14px;margin:0 0 20px;padding:14px 20px;background:rgba(255,255,255,.96);border:1px solid #dcdcde;border-radius:12px;box-shadow:0 -2px 8px rgba(0,0,0,.04)}
.h6sspc-unsaved{color:#8a4b00;font-weight:600}

/* Try it out */
.h6sspcpro-tester-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px 18px;margin-bottom:16px}
.h6sspcpro-tester-grid label{display:flex;flex-direction:column;gap:6px;font-weight:600;font-size:13px;color:#1d2327}
.h6sspcpro-tester-grid label.is-wide{grid-column:span 3}
.h6sspcpro-tester-grid input,.h6sspcpro-tester-grid select{width:100%;max-width:100%;font-weight:400}
.h6sspcpro-tester-results{margin-top:20px;display:flex;flex-direction:column;gap:10px}
.h6sspcpro-test-row{padding:14px 16px;border:1px solid #e0e0e0;border-radius:10px;background:#fff}
.h6sspcpro-test-row.is-match{border-color:#b8e6bf;background:#f6fff7}
.h6sspcpro-test-row.is-nomatch{color:#50575e}
.h6sspcpro-test-head{display:flex;flex-wrap:wrap;gap:8px;align-items:baseline}
.h6sspcpro-test-badge{padding:1px 8px;border-radius:999px;background:#f0f0f1;font-size:12px}
.is-match .h6sspcpro-test-badge{background:#dff6e3;color:#0a5c22}
.h6sspcpro-test-trace{margin:8px 0 0 2px}
.h6sspcpro-test-trace li{margin:2px 0}
.h6sspcpro-test-effect{margin:8px 0 0}

.h6sspc-wrap .select2-container{width:100%!important;min-width:0}

@media (max-width:960px){
  .h6sspc-rule-head{grid-template-columns:auto minmax(0,1fr) auto}
  .h6sspc-tags{grid-column:2/-1;justify-content:flex-start}
  .h6sspc-rule-body{padding-left:20px}
  .h6sspc-rule-columns,.h6sspc-condition{grid-template-columns:1fr}
  .h6sspcpro-tester-grid{grid-template-columns:1fr}
  .h6sspcpro-tester-grid label.is-wide{grid-column:auto}
  .h6sspc-tab-panel{padding:22px 18px}
  .h6sspc-panel-head{flex-direction:column}
  .h6sspc-status-card{grid-template-columns:auto minmax(0,1fr)}
  .h6sspc-status-toggle{grid-column:1/-1}
}
