/**
 * Product Customization — frontend (live storefront UI)
 */

:root {
  --pcf-primary: var(--porto-primary-color, #0ea5e9);
  --pcf-primary-dark: var(--porto-primary-color-dark, #0284c7);
  --pcf-soft: #e0f2fe;
  --pcf-dark: #0f172a;
  --pcf-muted: #64748b;
  --pcf-border: #e2e8f0;
  --pcf-bg: #fff;
  --pcf-radius: 16px;
  --pcf-font: Roboto, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --pcf-shadow: 0 18px 50px rgba(15, 23, 42, .2);
}

/* —— Full-width customize CTA —— */
.pcf-entry,
#work-personalization-entry {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 1.5rem 0 1.75rem;
  padding: 0;
  border: 0;
  border-radius: var(--pcf-radius);
  background: linear-gradient(135deg, #0c4a6e 0%, var(--pcf-primary) 55%, #38bdf8 120%);
  box-shadow: 0 12px 28px rgba(14, 165, 233, .28);
  font-family: var(--pcf-font);
  overflow: hidden;
  position: relative;
}

.pcf-entry::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 90% 10%, rgba(255,255,255,.22), transparent 45%);
  pointer-events: none;
}

.pcf-entry__inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 1rem 1.25rem;
  padding: 1.25rem 1.35rem;
  flex-wrap: wrap;
}

.pcf-entry__icon {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.16);
  color: #fff;
  backdrop-filter: blur(4px);
}

.pcf-entry__copy {
  flex: 1 1 200px;
  min-width: 0;
  color: #fff;
}

.pcf-entry__title {
  display: block;
  font-size: .78rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  opacity: .85;
  margin-bottom: .2rem;
  font-weight: 700;
}

.pcf-entry__prompt {
  margin: 0;
  font-weight: 600;
  font-size: 1.02rem;
  line-height: 1.35;
  color: #fff;
}

.pcf-open-btn,
#work-personalization-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  min-height: 48px;
  padding: .85rem 1.4rem;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #0369a1;
  font-weight: 700;
  font-size: .95rem;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .16);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  font-family: inherit;
  white-space: nowrap;
}

.pcf-open-btn:hover,
#work-personalization-btn:hover {
  background: #f0f9ff;
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, .2);
  color: #0c4a6e;
}

.pcf-open-btn__icon {
  display: inline-flex;
}

@media (max-width: 560px) {
  .pcf-entry__inner { flex-direction: column; align-items: stretch; text-align: left; }
  .pcf-open-btn, #work-personalization-btn { width: 100%; }
}

/* —— Modal —— */
.pcf-modal[hidden] { display: none !important; }

.pcf-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  font-family: var(--pcf-font);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  box-sizing: border-box;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.pcf-modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .58);
  backdrop-filter: blur(3px);
}

.pcf-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(1000px, 100%);
  max-height: min(92vh, 900px);
  height: min(92vh, 900px);
  margin: auto;
  background: var(--pcf-bg);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--pcf-shadow);
  display: flex;
  flex-direction: column;
  animation: pcfIn .22s ease;
}

@keyframes pcfIn {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to { opacity: 1; transform: none; }
}

.pcf-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: #f1f5f9;
  color: var(--pcf-dark);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .15s;
}

.pcf-modal__close:hover { background: #e2e8f0; }

.pcf-modal__layout {
  display: grid;
  grid-template-columns: 290px 1fr;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.pcf-modal__aside {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-right: 1px solid var(--pcf-border);
  padding: 22px 18px;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
  overscroll-behavior: contain;
}

.pcf-modal__preview img {
  width: 100%;
  border-radius: 14px;
  display: block;
  background: #fff;
  border: 1px solid var(--pcf-border);
  aspect-ratio: 1;
  object-fit: cover;
}

.pcf-modal__summary { margin-top: 16px; }

.pcf-modal__summary h3 {
  margin: 0 0 10px;
  font-size: .92rem;
  color: var(--pcf-dark);
}

.pcf-modal__summary dl { margin: 0; }

.pcf-modal__summary dl > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--pcf-border);
  font-size: .84rem;
}

.pcf-modal__summary dt { color: var(--pcf-muted); margin: 0; }
.pcf-modal__summary dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
  color: var(--pcf-dark);
  max-width: 60%;
  word-break: break-word;
}

.pcf-sum-total dd { color: var(--pcf-primary-dark); font-size: .95rem; }

.pcf-modal__main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  padding: 0;
}

.pcf-modal__scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 24px 22px 12px;
}

.pcf-modal__header h2 {
  margin: 0 0 6px;
  font-size: 1.4rem;
  color: var(--pcf-dark);
  letter-spacing: -.02em;
  padding-right: 40px;
}

.pcf-modal__header p {
  margin: 0 0 18px;
  color: var(--pcf-muted);
  font-size: .92rem;
  line-height: 1.45;
}

.pcf-step {
  border: 1px solid var(--pcf-border);
  border-radius: 14px;
  margin-bottom: 10px;
  overflow: hidden;
  background: #fff;
}

.pcf-step__head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  border: 0;
  background: #f8fafc;
  font-weight: 650;
  cursor: pointer;
  text-align: left;
  color: var(--pcf-dark);
  font-family: inherit;
  font-size: .95rem;
}

.pcf-step__head span {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--pcf-primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .78rem;
  font-weight: 700;
}

.pcf-step__body { display: none; padding: 14px; }
.pcf-step.is-open .pcf-step__body { display: block; }

/* Methods with icons */
.pcf-methods {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.pcf-method {
  border: 1.5px solid var(--pcf-border);
  border-radius: 14px;
  background: #fff;
  padding: 16px 14px;
  cursor: pointer;
  color: var(--pcf-dark);
  transition: border-color .15s, background .15s, box-shadow .15s, transform .15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-family: inherit;
}

.pcf-method:hover {
  border-color: #bae6fd;
  transform: translateY(-1px);
}

.pcf-method.is-active {
  border-color: var(--pcf-primary);
  background: var(--pcf-soft);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, .15);
}

.pcf-method__icon {
  width: 44px;
  height: 44px;
  color: var(--pcf-primary-dark);
  display: grid;
  place-items: center;
}

.pcf-method__icon svg { width: 40px; height: 40px; }

.pcf-method__label {
  font-weight: 700;
  font-size: .95rem;
}

.pcf-method.is-active .pcf-method__icon,
.pcf-method.is-active .pcf-method__label {
  color: var(--pcf-primary-dark);
}

/* Places */
.pcf-loc {
  display: grid;
  gap: 8px;
  padding: 12px;
  margin-bottom: 10px;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid var(--pcf-border);
}

.pcf-loc__toggle {
  font-weight: 650;
  color: var(--pcf-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

.pcf-loc select,
#pcf-comments {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--pcf-border);
  border-radius: 10px;
  font: inherit;
  background: #fff;
  color: var(--pcf-dark);
}

.pcf-loc select:disabled { opacity: .5; }

.pcf-option-logo {
  display: none;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.pcf-option-logo.is-on { display: flex; }

.pcf-option-logo__label {
  font-size: .82rem;
  color: var(--pcf-muted);
  width: 100%;
}

.pcf-mini-upload {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.pcf-mini-upload__input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }

.pcf-mini-upload__btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1.5px dashed var(--pcf-primary);
  background: var(--pcf-soft);
  color: var(--pcf-primary-dark);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background .15s;
}

.pcf-mini-upload__btn:hover { background: #bae6fd; }

.pcf-mini-upload__thumb {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--pcf-border);
  background: #fff;
}

.pcf-mini-upload__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Color / size swatches */
.pcf-field { margin-bottom: 14px; }

.pcf-field__label {
  display: block;
  font-weight: 650;
  margin-bottom: 8px;
  color: var(--pcf-dark);
  font-size: .9rem;
}

.pcf-selected-label {
  color: var(--pcf-primary-dark);
  font-weight: 600;
  margin-left: 4px;
}

.pcf-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pcf-swatch {
  border: 1.5px solid var(--pcf-border);
  background: #fff;
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s, transform .12s;
  padding: 0;
}

.pcf-swatch--color {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 64px;
  padding: 10px 8px 8px;
}

.pcf-swatch__circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .08);
}

.pcf-swatch__circle.is-light {
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .18);
}

.pcf-swatch__name {
  font-size: .72rem;
  font-weight: 600;
  color: var(--pcf-dark);
  text-align: center;
  line-height: 1.2;
  max-width: 72px;
}

.pcf-swatch--size {
  padding: 0;
}

.pcf-swatch__chip {
  display: inline-flex;
  min-width: 44px;
  height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  font-weight: 700;
  font-size: .88rem;
  color: var(--pcf-dark);
}

.pcf-swatch.is-selected {
  border-color: var(--pcf-primary);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, .18);
  transform: translateY(-1px);
}

.pcf-swatch:hover { border-color: #7dd3fc; }

/* Main logo upload */
.pcf-upload { position: relative; }

.pcf-upload input[type=file] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

.pcf-upload__zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 22px 16px;
  border: 2px dashed #7dd3fc;
  border-radius: 14px;
  cursor: pointer;
  text-align: center;
  background: linear-gradient(180deg, #f0f9ff 0%, #fff 100%);
  color: var(--pcf-muted);
  transition: border-color .15s, background .15s;
}

.pcf-upload__zone:hover {
  border-color: var(--pcf-primary);
  background: var(--pcf-soft);
}

.pcf-upload__icon { color: var(--pcf-primary-dark); }

.pcf-upload__title {
  color: var(--pcf-dark);
  font-size: .92rem;
}

.pcf-upload__hint {
  font-style: normal;
  font-size: .78rem;
}

.pcf-logo-thumb {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--pcf-border);
  border-radius: 12px;
  background: #f8fafc;
}

.pcf-logo-thumb img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--pcf-border);
  display: block;
}

.pcf-logo-thumb__change {
  border: 0;
  background: var(--pcf-primary);
  color: #fff;
  border-radius: 999px;
  padding: 7px 14px;
  font-weight: 600;
  font-size: .82rem;
  cursor: pointer;
  font-family: inherit;
}

.pcf-logo-thumb__change:hover { background: var(--pcf-primary-dark); }

.pcf-cliche {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  font-size: .9rem;
  color: var(--pcf-dark);
}

.pcf-modal__notice {
  margin: 12px 0;
  padding: 11px 13px;
  background: var(--pcf-soft);
  border-radius: 10px;
  color: var(--pcf-primary-dark);
  font-size: .86rem;
  border-left: 3px solid var(--pcf-primary);
}

.pcf-modal__footer {
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 22px 16px;
  border-top: 1px solid var(--pcf-border);
  background: #fff;
  box-shadow: 0 -8px 20px rgba(15, 23, 42, .04);
}

.pcf-btn {
  border: 0;
  border-radius: 999px;
  padding: .75rem 1.25rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  font-size: .92rem;
}

.pcf-btn--ghost {
  background: #f1f5f9;
  color: var(--pcf-dark);
}

.pcf-btn--ghost:hover { background: #e2e8f0; }

.pcf-btn--primary {
  background: var(--pcf-primary);
  color: #fff;
  box-shadow: 0 8px 18px rgba(14, 165, 233, .28);
}

.pcf-btn--primary:hover { background: var(--pcf-primary-dark); }

body.pcf-modal-open { overflow: hidden; }

@media (max-width: 820px) {
  .pcf-modal {
    align-items: flex-start;
    padding: 8px;
  }

  .pcf-modal__dialog {
    height: min(96vh, 960px);
    max-height: 96vh;
    width: 100%;
  }

  .pcf-modal__layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(140px, 28%) 1fr;
  }

  .pcf-modal__aside {
    border-right: 0;
    border-bottom: 1px solid var(--pcf-border);
    max-height: none;
  }

  .pcf-methods { grid-template-columns: 1fr; }

  .pcf-modal__footer {
    flex-direction: column-reverse;
    position: sticky;
    bottom: 0;
  }

  .pcf-btn { width: 100%; }
}
