/* Shared Review & Share component — single source for catalog + product pages */
:root {
  --scm-review-btn: #4CAEDC;
  --scm-review-btn-hover: #3D8FB5;
}
.scm-review-share-trigger,
.scm-review-share-overlay,
.sharemodal {
  --btn: var(--scm-review-btn, #4CAEDC);
  --btn-hover: var(--scm-review-btn-hover, #3D8FB5);
}

.btn-review{
    display:flex;
    align-items:center;
    gap:8px;
    padding:11px 18px !important;
    background:var(--btn) !important;
    color:#FFFFFF !important;
    border:none !important;
    border-radius:999px !important;

    font-size:14px !important;
    font-weight:500 !important;
    cursor:pointer;
    white-space:nowrap;
  }
.btn-review:hover{background:var(--btn-hover) !important;}
.btn-review .count{
    background:#FFFFFF !important;
    color:var(--btn) !important;
    border-radius:20px !important;
    font-size:12px !important;
    font-weight:600 !important;
    padding:1px 7px !important;
    min-width:18px;
    text-align:center;
  }
.btn-review{order:2;}
.splash-app-root .btn-review{position:relative;}
/* Mobile category + Review & Share polish */
.splash-app-root .review-share-icon{
  width:16px;
  height:16px;
  flex:0 0 16px;
  display:block;
}
.splash-app-root .selbtn .review-share-icon{
    color:var(--btn) !important;
  }
.splash-app-root .selbtn .review-share-icon{
    width:18px !important;
    height:18px !important;
    color:#fff !important;
  }
.splash-app-root .selbtn .review-share-icon{
    width:16px !important;
    height:16px !important;
    flex:0 0 16px !important;
    color:currentColor !important;
  }

/* Overlay Base */
  .overlay{
    display:none;
    position:fixed;
    inset:0;
    background:rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index:100;
    align-items:center;
    justify-content:center;
    padding:20px;
    overflow-y:auto;
    box-sizing:border-box;
  }
  .overlay.open{display:flex;}

  /* Centered Share Modal */
  .sharemodal{
    width:540px;
    max-width:100%;
    background:#FFFFFF !important;
    border-radius:18px !important;
    padding:28px 28px 24px !important;
    box-shadow:0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
    position:relative;
    animation: popupScale 0.2s ease-out;
  }
  @keyframes popupScale {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
  }

  .share-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    margin-bottom:4px;
  }
  .share-title{
    font-family: 'Kanit', serif;
    font-size:22px !important;
    font-weight:500 !important;
    color:#0F172A !important;
  }
  .closebtn{
    background:none !important;
    border:none !important;
    cursor:pointer;
    padding:4px !important;
    color:#64748B !important;
  }
  .closebtn:hover{color:#0F172A !important;}
  .share-sub{
    font-size:13px !important;
    color:#64748B !important;
    margin:0 0 20px !important;
  }

  /* Inner Card Box for Selections */
  .share-card-box{
    border:1px solid #E2E8F0 !important;
    border-radius:12px !important;
    background:#FFFFFF !important;
    padding:16px !important;
    max-height:280px;
    overflow-y:auto;
    margin-bottom:20px;
  }
  .share-group-title{
    font-family: 'Kanit', serif;
    font-size:11px !important;
    letter-spacing:.06em !important;
    text-transform:uppercase !important;
    color:#64748B !important;
    margin-bottom:12px !important;
  }
  .share-item-row{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:12px;
    padding:10px 0;
    border-bottom:1px solid #F1F5F9;
  }
  .share-item-row:last-child{
    border-bottom:none;
  }
  .share-item-brand{
    font-size:13px !important;
    color:#64748B !important;
    margin-bottom: 0 !important;
  }
  .share-item-name{
    font-size:14px !important;
    font-weight:600 !important;
    color:#0F172A !important;
  }
  .share-item-sub{
    font-size:12px !important;
    color:#64748B !important;
    margin-top:2px !important;
  }
  .share-item-viewlink{
    color:var(--btn) !important;
    text-decoration:underline !important;
    cursor:pointer;
    margin-left:4px;
  }
  .share-item-remove{
    background:none !important;
    border:none !important;
    cursor:pointer;
    color:#94A3B8 !important;
    padding:4px !important;
  }
  .share-item-remove:hover{
    color:#EF4444 !important;
  }

  /* Modal Action Buttons */
  .share-actions-row{
    display:flex;
    align-items:center;
    gap:10px;
  }
  body .share-btn-primary{
    display:flex;
    align-items:center;
    gap:8px;
    padding:10px 18px !important;
    background:var(--btn) !important;
    color:#FFFFFF !important;
    border:none !important;
    border-radius:999px !important;

    font-size:14px !important;
    font-weight:500 !important;
    cursor:pointer;
    text-decoration:none !important;
  }
  .share-btn-primary:hover{background:var(--btn-hover) !important;}

  body .share-btn-secondary{
    display:flex;
    align-items:center;
    gap:8px;
    padding:10px 18px !important;
    background:#FFFFFF !important;
    color:#0F172A !important;
    border:1px solid #CBD5E1 !important;
    border-radius:999px !important;

    font-size:14px !important;
    font-weight:500 !important;
    cursor:pointer;
  }
  .share-btn-secondary:hover{background:#F8FAFC !important;}

  .share-btn-clear{
    background:none !important;
    border:none !important;
    color:#64748B !important;

    font-size:14px !important;
    cursor:pointer;
    margin-left:auto;
    text-decoration:none !important;
  }
  .share-btn-clear:hover{color:#0F172A !important; text-decoration:underline !important;}


/* Selection thumbnails */
.share-item-row{align-items:center;}
.share-item-thumb-wrap{width:64px;height:52px;flex:0 0 64px;border-radius:8px;overflow:hidden;background:#F8FAFC;border:1px solid #E2E8F0;}
.share-item-thumb{width:100%;height:100%;display:block;object-fit:cover;}
.share-item-thumb-fallback{display:grid;grid-template-columns:repeat(5,1fr);grid-template-rows:repeat(3,1fr);gap:1px;border:0;}
.share-item-thumb-fallback div{min-width:0;min-height:0;}
.share-item-thumb-empty{width:100%;height:100%;background:linear-gradient(135deg,#F1F5F9,#E2E8F0);}
.share-item-info{min-width:0;flex:1;}
.share-item-name{display:inline;}
.share-item-brand{line-height:1.35;}
.share-item-view{color:var(--btn);text-decoration:underline;cursor:pointer;}
.share-item-remove{display:flex;align-items:center;justify-content:center;flex:0 0 auto;}
.share-item-remove svg{display:block;}
.share-btn-primary svg,.share-btn-secondary svg,.mfgbtn svg,.productlinkbtn svg,.addbtn svg{flex:0 0 auto;}

/* Email to Designer modal */
.scm-email-overlay{position:fixed;inset:0;background:rgba(15,23,42,.58);display:none;align-items:center;justify-content:center;padding:20px;z-index:99999}
.scm-email-overlay.open{display:flex}
.scm-email-modal{position:relative;width:min(760px,100%);max-height:94vh;overflow:auto;background:#fff;border-radius:16px;padding:28px;box-shadow:0 24px 80px rgba(0,0,0,.22);font-family:inherit}
.scm-email-modal h2{margin:0 0 6px;font-size:25px;color:#111827}
.scm-email-intro{margin:0 0 20px;color:#64748b;font-size:14px}
body .scm-email-close{position:absolute;right:16px;top:12px;border:0;background:transparent !important;font-size:30px;line-height:1;cursor:pointer;color:#64748b !important;box-shadow: none;}
#designerEmailForm label{display:block;font-size:13px;font-weight:600;color:#334155;margin:0 0 13px}
#designerEmailForm input:not([name="website"]),#designerEmailForm textarea{display:block;width:100%;box-sizing:border-box;margin-top:6px;border:1px solid #cbd5e1;border-radius:9px;padding:11px 12px;font:inherit;font-size:14px;color:#0f172a;background:#fff}
#designerEmailForm input:not([name="website"]) {
  border-radius: 999px;
}
#designerEmailForm input:focus,#designerEmailForm textarea:focus{outline:none;border-color:#64748b;box-shadow:0 0 0 3px rgba(100,116,139,.12)}
.scm-email-selected{margin:16px 0;padding:14px;border-radius:10px;background:#f8fafc;border:1px solid #e2e8f0;color:#334155;font-size:13px}
.scm-email-selected>strong{display:block;margin-bottom:8px;color:#0f172a}
.scm-email-selected div div{padding:3px 0}
.scm-email-selected span{color:#64748b}
.scm-email-status{min-height:20px;margin:8px 0 12px;font-size:13px;color:#475569}
.scm-email-submit{width:100%;border:0;border-radius:9px;padding:12px 16px;background:var(--btn) !important;color:#fff;font-weight:700;cursor:pointer}
.scm-email-submit:disabled{opacity:.6;cursor:wait}
@media(max-width:700px){.scm-email-modal{width:100%;max-height:96vh;padding:20px 14px 14px;border-radius:12px}.scm-email-overlay{padding:8px}.scm-email-modal h2{padding-right:36px}.scm-email-grid{grid-template-columns:1fr!important}.scm-email-product-row img,.scm-email-product-placeholder{width:52px;height:52px}}

.scm-email-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}.scm-email-grid label,.scm-email-message{display:block;font-size:13px;font-weight:600;color:#334155;margin:0 0 14px}.scm-email-grid input,.scm-email-message textarea{display:block;width:100%;box-sizing:border-box;margin-top:6px;border:1px solid #cbd5e1;border-radius:8px;padding:11px 12px;font:inherit;font-size:14px;color:#0f172a;background:#fff}.scm-email-grid input:focus,.scm-email-message textarea:focus{outline:none;border-color:#64748b;box-shadow:0 0 0 3px rgba(100,116,139,.12)}.scm-email-selected{margin:4px 0 16px;padding:14px;border-radius:10px;background:#f8fafc;border:1px solid #e2e8f0;color:#334155;font-size:13px}.scm-email-selected>strong{display:block;margin-bottom:10px;color:#0f172a}.scm-email-product-row{display:flex;gap:12px;align-items:center;padding:9px 0;border-top:1px solid #e2e8f0}.scm-email-product-row:first-child{border-top:0}.scm-email-product-row img,.scm-email-product-placeholder{width:58px;height:58px;flex:0 0 58px;border-radius:8px;object-fit:cover;background:#e5e7eb}.scm-email-product-row strong{display:block;color:#0f172a}.scm-email-product-row span{display:block;margin-top:3px;color:#64748b;font-size:12px}.scm-email-status.success{color:#166534}


/* Sidebar Review & Share variant — exact catalog sidebar styling */
.selbtn{
    width:100%;
    display:flex;
    align-items:center;
    justify-content:space-between;
    /*padding:12px 16px !important;*/
    padding: 10px !important;
    border:none !important;
    border-radius:999px !important;
    background:var(--lightgray) !important;

    font-size:14px !important;
    font-weight:500 !important;
    color:var(--black) !important;
    cursor:pointer;
  }
.selbtn .count{
    background:var(--aqua-soft) !important;
    color:#fff !important;
    border-radius:20px !important;
    font-size:12px !important;
    font-weight:600 !important;
    padding:1px 8px !important;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
  }


/* Product-detail Review & Share placement.
   Keep the original sidebar button text alignment; only size/placement is adjusted here. */
.scm-product-info .scm-selection-review-bar {
  width:100%;
  min-width:0;
  margin:0;
}
.scm-product-info .scm-selection-review-bar .selbtn {
  width:100%;
  min-height:46px;
}

/* ================================================================
   SHARED REVIEW & SHARE + EMAIL DESIGNER — MOBILE
   ================================================================ */

@media (max-width:640px) {
  /* Review & Share modal stays centered on mobile. */
  .scm-review-share-overlay.overlay {
    padding:12px;
    align-items:center !important;
    justify-content:center !important;
  }

  .scm-review-share-overlay .sharemodal {
    width:min(100%, 540px);
    max-width:100%;
    max-height:min(88vh,88svh);
    overflow-y:auto;
    margin:auto;
    padding:20px 16px 16px !important;
    border-radius:16px !important;
  }

  .scm-review-share-overlay .share-actions-row {
    display:grid;
    grid-template-columns:1fr;
    gap:8px;
  }

  .scm-review-share-overlay .share-btn-primary,
  .scm-review-share-overlay .share-btn-secondary,
  .scm-review-share-overlay .share-btn-clear {
    width:100% !important;
    justify-content:center;
    margin-left:0 !important;
    text-align:center;
  }

  /* Email to Designer remains optimized for mobile. */
  .scm-email-overlay {
    align-items:center !important;
    justify-content:center !important;
    padding:12px !important;
  }

  .scm-email-modal {
    width:min(100%, 560px) !important;
    max-width:100% !important;
    max-height:min(92vh,92svh) !important;
    overflow-y:auto !important;
    border-radius:16px !important;
    padding:20px 16px 16px !important;
  }

  .scm-email-grid {
    grid-template-columns:1fr !important;
    gap:12px !important;
  }

  .scm-email-submit {
    width:100% !important;
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    min-height:48px !important;
  }

  .scm-email-actions,
  .scm-email-footer,
  .scm-email-modal-actions {
    display:grid !important;
    grid-template-columns:1fr !important;
    gap:8px !important;
  }

  .scm-email-actions > *,
  .scm-email-footer > *,
  .scm-email-modal-actions > * {
    width:100% !important;
  }
}

/* Mobile floating Review & Share */
.scm-mobile-review-float {
  display:none;
}

@media (max-width:640px) {
  body.scm-product-detail,
  body.scm-catalog-page {
    padding-bottom:86px;
  }

  body.scm-product-detail .scm-selection-review-bar,
  body.scm-catalog-page .scm-mobile-review-float {
    position:fixed !important;
    left:16px;
    right:16px;
    bottom:16px;
    z-index:9998;
    width:auto !important;
    margin:0 !important;
  }

  body.scm-product-detail .scm-selection-review-bar .selbtn,
  body.scm-catalog-page .scm-mobile-review-float .selbtn {
    width:100% !important;
    min-height:50px !important;
    padding:12px 16px !important;
    border-radius:999px !important;
    box-shadow:0 12px 30px rgba(15,23,42,.18);
  }

  body.scm-catalog-page .scm-mobile-review-float {
    display:block;
    transition:opacity .16s ease, transform .16s ease, visibility .16s ease;
  }

  body.scm-catalog-page aside.sidebar #sideReviewBtn {
    visibility:hidden;
    pointer-events:none;
  }

  body.scm-catalog-page.scm-product-modal-open .scm-mobile-review-float {
    opacity:0;
    visibility:hidden;
    pointer-events:none;
    transform:translateY(12px);
  }
}

@media (min-width:641px) {
  body.scm-product-detail .scm-selection-review-bar {
    position:static !important;
    left:auto !important;
    right:auto !important;
    bottom:auto !important;
    z-index:auto !important;
    width:100% !important;
    margin:0 !important;
  }
}

/* Global option tooltip portal */
.scm-option-tooltip {
  position:fixed;
  left:0;
  top:0;
  z-index:2147483000;
  max-width:min(240px, calc(100vw - 20px));
  padding:7px 10px;
  border-radius:7px;
  background:#0f172a;
  color:#fff;
  font-family:'DM Sans',sans-serif;
  font-size:11px;
  line-height:1.35;
  font-weight:500;
  text-align:center;
  white-space:normal;
  overflow-wrap:anywhere;
  pointer-events:none;
  opacity:0;
  visibility:hidden;
  transform:translateY(3px);
  box-shadow:0 6px 18px rgba(15,23,42,.22);
  transition:opacity .12s ease, transform .12s ease, visibility .12s ease;
}
.scm-option-tooltip.is-visible {
  opacity:1;
  visibility:visible;
  transform:translateY(0);
}

/* Prevent the old pseudo-element tooltip from competing with the portal tooltip. */
.splash-app-root [data-tooltip]::before,
.splash-app-root [data-tooltip]::after,
body.scm-product-detail #detailColorBlock [data-tooltip]::before,
body.scm-product-detail #detailColorBlock [data-tooltip]::after {
  content:none !important;
}

/* Do not let the floating Review & Share control overlap the catalog product modal. */
@media (max-width:640px) {
  body.scm-catalog-page.scm-product-modal-open .scm-mobile-review-float {
    opacity:0;
    visibility:hidden;
    pointer-events:none;
    transform:translateY(12px);
  }

  body.scm-catalog-page .scm-mobile-review-float {
    transition:opacity .16s ease, transform .16s ease, visibility .16s ease;
  }
}


/* Review & Share floating trigger is mobile-only. */
.scm-mobile-review-float {
  display:none;
}
@media (max-width:640px) {
  body.scm-catalog-page .scm-mobile-review-float {
    display:block;
  }
}
@media (min-width:641px) {
  body.scm-product-detail .scm-selection-review-bar {
    position:static !important;
    left:auto !important;
    right:auto !important;
    bottom:auto !important;
    z-index:auto !important;
    width:100% !important;
    margin:0 !important;
  }
}

/* Hidden spam honeypot for Email to Designer. */
.scm-email-hp {
  position:absolute !important;
  left:-10000px !important;
  width:1px !important;
  height:1px !important;
  overflow:hidden !important;
  opacity:0 !important;
  pointer-events:none !important;
  clip:rect(0 0 0 0) !important;
  clip-path:inset(50%) !important;
  white-space:nowrap !important;
}
.scm-email-hp input {
  width:1px !important;
  height:1px !important;
  padding:0 !important;
  border:0 !important;
}
