:root{ --psps-red:#e33636; }

html.psps-lock{ overflow:hidden; }

.psps-modal{ position:fixed; inset:0; z-index:999999; display:none; }
.psps-modal.psps-open{ display:block; }

.psps-backdrop{ position:absolute; inset:0; background:rgba(0,0,0,.45); }

.psps-panel{ position:relative; width:min(1180px, 96vw); height:min(92vh, 940px); margin:4vh auto; background:#fff; border-radius:18px; overflow:hidden; box-shadow:0 20px 60px rgba(0,0,0,.35); display:flex; flex-direction:column; }

.psps-banner{ flex:0 0 auto; border-bottom:1px solid rgba(0,0,0,.06); padding:10px 14px; }
.psps-banner-link{ display:block; text-decoration:none; }
.psps-banner img{ width:100%; height:auto; max-height:120px; object-fit:contain; display:block; }

.psps-topbar{ display:flex; gap:14px; align-items:center; padding:14px 14px; border-bottom:1px solid rgba(0,0,0,.06); }

.psps-logo img{ height:44px; width:auto; max-width:400px; display:block; object-fit:contain; }
.psps-logo--text{ font-weight:800; color:#111; text-decoration:none; font-size:18px; }

.psps-search{ position:relative; flex:1 1 auto; }
#psps-input{ width:100%; height:46px; border-radius:12px; border:2px solid rgba(0,0,0,.08); padding:0 14px; font-size:16px; outline:none; transition:.15s; }
#psps-input:focus{ border-color:var(--psps-red); box-shadow:0 0 0 3px rgba(227,54,54,.12); }

.psps-actions{ display:flex; align-items:normal; gap:10px; }
.psps-close{ width:44px; height:44px; border-radius:14px; border:1px solid rgba(0,0,0,.08); background:#f6f7f8; cursor:pointer; font-size:18px; font-weight:900; line-height:1; display:inline-flex; align-items:center; justify-content:center; }
.psps-close:hover{ border-color:rgba(0,0,0,.2); }

.psps-cart{ position:relative; display:inline-flex; align-items:center; justify-content:center; width:44px; height:44px; border-radius:14px; border:1px solid rgba(0,0,0,.08); text-decoration:none; color:#111; background:#f6f7f8; }
.psps-cart-icon{ font-size:18px; }
.psps-cart-count{ position:absolute; top:-7px; right:-7px; background:var(--psps-red); color:#fff; font-size:12px; min-width:20px; height:20px; border-radius:999px; display:flex; align-items:center; justify-content:center; padding:0 6px; }

.psps-body{ padding:16px 16px 18px; overflow:auto; }

.psps-section{ margin-bottom:18px; }
.psps-section-title{ font-weight:800; color:#111; font-size:14px; display:flex; align-items:baseline; gap:8px; margin-bottom:10px; }
.psps-results-count{ font-weight:700; color:rgba(0,0,0,.5); }

.psps-grid{ display:grid; grid-template-columns:repeat(6, minmax(0,1fr)); gap:10px; }

.psps-card{ display:flex; flex-direction:column; gap:8px; padding:10px; border:1px solid rgba(0,0,0,.08); border-radius:14px; text-decoration:none; color:#111; background:#fff; transition:.12s; }
.psps-card:hover{ border-color:rgba(0,0,0,.16); transform:translateY(-1px); }

.psps-thumb{ position:relative; aspect-ratio:1/1; border-radius:12px; overflow:hidden; background:rgba(0,0,0,.03); }
.psps-thumb img{ width:100%; height:100%; object-fit:contain; display:block; }

.psps-name{ font-size:13px; line-height:1.25; font-weight:700; min-height:32px; }
.psps-price{ font-size:13px; font-weight:800; color:var(--psps-red); }

.psps-badge{ position:absolute; left:8px; bottom:8px; background:#111; color:#fff; font-size:11px; font-weight:800; padding:4px 8px; border-radius:999px; opacity:.9; }
.psps-card.psps-out{ opacity:.7; }

.psps-loadmore-wrap{ display:flex; justify-content:center; margin-top:12px; }
.psps-loadmore{ border:0; background:var(--psps-red); color:#fff; font-weight:900; border-radius:12px; padding:10px 14px; cursor:pointer; }
.psps-loadmore:hover{ filter:brightness(.96); }

.psps-empty{ padding:18px 0; text-align:center; color:rgba(0,0,0,.65); font-weight:700; }

/* Suggestions */
.psps-suggestions{ position:absolute; top:50px; left:0; right:0; background:#fff; border:1px solid rgba(0,0,0,.10); border-radius:14px; overflow:hidden; box-shadow:0 14px 40px rgba(0,0,0,.18); }
.psps-suggest-item{ display:block; padding:10px 12px; text-decoration:none; color:#111; font-weight:700; font-size:14px; }
.psps-suggest-item:hover{ background:rgba(227,54,54,.06); }

@media (max-width: 1024px){
  .psps-grid{ grid-template-columns:repeat(4, minmax(0,1fr)); }
}
@media (max-width: 640px){
  .psps-panel{ height:92vh; margin:4vh auto; border-radius:16px; }
  /* Mobile header layout like reference: logo centered, actions to the right, search full width under */
  .psps-topbar{
    display:grid;
    grid-template-columns:0px 1fr auto;
    grid-template-rows:auto auto;
    grid-template-areas:
      "spacer brand actions"
      "search  search search";
    gap:10px;
  }
  .psps-topbar::before{ content:""; grid-area:spacer; width:44px; height:44px; }
  .psps-brand{ grid-area:brand; min-width:0; display:flex; justify-content:center;margin-bottom: 20px; }
  .psps-actions{ grid-area:actions; justify-content:flex-end; }
  .psps-search{ grid-area:search; }
  .psps-grid{ grid-template-columns:repeat(2, minmax(0,1fr)); }
  #psps-input{ font-size:15px; }
  .psps-logo{ display:block; max-width:min(50vw, 240px); }
  .psps-logo img{ height:36px; max-width:100%; width:auto; }

  /* Buttons: more polished */
  .psps-cart,
  .psps-close{
    width:46px;
    height:46px;
    border-radius:16px;
    background:#fff;
    border:1px solid rgba(0,0,0,.10);
    box-shadow:0 6px 18px rgba(0,0,0,.08);
  }
  .psps-cart-icon{ font-size:18px; }
  .psps-close{ font-size:19px; }
  .psps-banner{ padding:8px 12px; }
  .psps-banner img{ max-height:90px; }
}
