/* ==========================================================================
   VPR Fashion 8.5 — Desktop header, catalog popup, variation picker
   ========================================================================== */

/* ---------- Desktop header: two clean rows instead of a crowded single row ---------- */
@media (min-width: 1081px) {
  .site-header .header-inner {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center;
    justify-content: space-between;
    min-height: 0;
    padding-top: 11px;
    gap: 10px 20px;
  }
  .site-header .site-logo {
    order: 1;
    flex: 0 1 auto;
    min-width: 0;
    max-width: min(48%, 500px);
  }
  .site-header .site-logo img {
    height: 44px;
    max-width: 150px;
    object-fit: contain;
  }
  .site-header .site-logo .logo-text {
    min-width: 0;
  }
  .site-header .site-logo .logo-text b {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 1.05rem;
  }
  .site-header .header-inner > .header-actions {
    order: 2;
    display: flex !important;
    flex: 0 0 auto;
    margin-inline-start: auto;
  }
  .site-header .header-search {
    display: flex !important;
  }
  .site-header .header-search input,
  .site-header .header-search input:focus {
    width: clamp(220px, 23vw, 330px);
  }
  .site-header .main-nav {
    order: 3;
    flex: 1 0 100% !important;
    width: 100%;
    min-width: 0;
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 7px 0 8px;
    border-top: 1px solid rgba(234, 223, 224, .72);
    overflow: visible;
  }
  .site-header .main-nav > ul {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center;
    justify-content: center;
    gap: 3px !important;
    width: auto;
    max-width: calc(100% - 190px);
    overflow: visible;
  }
  .site-header .main-nav > ul > li {
    flex: 0 0 auto !important;
    min-width: auto !important;
  }
  .site-header .main-nav > ul > li > a {
    display: flex !important;
    align-items: center;
    gap: 4px;
    min-height: 38px;
    padding: 7px 11px !important;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: nowrap !important;
    word-break: keep-all;
    font-size: 13.5px !important;
    line-height: 1.4;
  }
  .site-header .main-nav > ul > li > a svg {
    width: 13px;
    height: 13px;
  }
}

@media (min-width: 1081px) and (max-width: 1200px) {
  .site-header .site-logo .logo-text span {
    display: none;
  }
  .site-header .header-search input,
  .site-header .header-search input:focus {
    width: 210px;
  }
  .site-header .main-nav {
    gap: 7px;
  }
  .site-header .main-nav > ul > li > a {
    padding-inline: 8px !important;
    font-size: 12.5px !important;
  }
}

/* ---------- Always-clickable desktop catalog menu ---------- */
.vpr-catalog-menu {
  position: relative;
  flex: 0 0 auto;
}
.vpr-catalog-toggle {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--vpr-primary, #1f1b24), #403748);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
  white-space: nowrap;
  box-shadow: 0 5px 14px rgba(31, 27, 36, .16);
}
.vpr-catalog-toggle svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  flex: 0 0 auto;
}
.vpr-catalog-toggle .vpr-catalog-chevron {
  width: 13px;
  height: 13px;
  opacity: .75;
  transition: transform .2s ease;
}
.vpr-catalog-menu.open .vpr-catalog-chevron {
  transform: rotate(180deg);
}
.vpr-catalog-popup {
  position: absolute;
  top: calc(100% + 10px);
  inset-inline-start: 0;
  z-index: 1005;
  width: min(920px, calc(100vw - 48px));
  max-height: min(68vh, 620px);
  padding: 18px;
  overflow: auto;
  border: 1px solid #eadfe0;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(31, 27, 36, .18);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px) scale(.985);
  transform-origin: top right;
  transition: opacity .18s ease, visibility .18s ease, transform .18s ease;
}
.vpr-catalog-menu.open .vpr-catalog-popup {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}
.vpr-catalog-popup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 3px 13px;
  margin-bottom: 14px;
  border-bottom: 1px solid #eee7ea;
}
.vpr-catalog-popup-head strong {
  color: var(--vpr-primary, #1f1b24);
  font-size: 15px;
}
.vpr-catalog-popup-head a {
  color: var(--vpr-accent, #c99b6b);
  font-size: 12px;
  font-weight: 800;
}
.vpr-catalog-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.vpr-catalog-group {
  min-width: 0;
  padding: 12px;
  border: 1px solid #f0e9ec;
  border-radius: 13px;
  background: #fdfbfc;
}
.vpr-catalog-parent {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 7px;
  color: var(--vpr-primary, #1f1b24);
  font-size: 13px;
  font-weight: 900;
}
.vpr-catalog-parent img {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  object-fit: cover;
  background: #f3edef;
}
.vpr-catalog-group ul {
  display: grid !important;
  gap: 1px !important;
  max-width: none !important;
}
.vpr-catalog-group li,
.vpr-catalog-group li::marker {
  list-style: none !important;
  content: "";
}
.vpr-catalog-group li a {
  display: block;
  padding: 5px 7px;
  border-radius: 7px;
  color: #625762;
  font-size: 11.5px;
  line-height: 1.6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vpr-catalog-group li a:hover {
  background: #f5eef1;
  color: var(--vpr-primary, #1f1b24);
}

/* WP dropdowns also open on click, not only hover. */
@media (min-width: 1081px) {
  .site-header .main-nav li.vpr-submenu-open > .sub-menu,
  .site-header .main-nav li.vpr-submenu-open > .mega-menu {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }
  .site-header .main-nav li.vpr-submenu-open > .sub-menu {
    transform: translateY(0) !important;
  }
  .site-header .main-nav li.vpr-submenu-open > .mega-menu {
    transform: translateX(50%) translateY(0) !important;
  }
}

/* ---------- Mobile catalog accordion ---------- */
.vpr-mobile-catalog {
  margin-bottom: 12px;
  border: 1px solid var(--vpr-line, #eadfe0);
  border-radius: 13px;
  overflow: hidden;
  background: #fff;
}
.vpr-mobile-catalog-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border: 0;
  background: #f8f3f5;
  color: var(--vpr-primary, #1f1b24);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}
.vpr-mobile-catalog-toggle svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  transition: transform .2s;
}
.vpr-mobile-catalog.open .vpr-mobile-catalog-toggle svg {
  transform: rotate(180deg);
}
.vpr-mobile-catalog-list {
  max-height: 0;
  overflow: hidden;
  transition: max-height .25s ease;
}
.vpr-mobile-catalog.open .vpr-mobile-catalog-list {
  max-height: 52vh;
  overflow-y: auto;
}
.vpr-mobile-catalog-list a {
  display: block;
  padding: 9px 14px;
  border-top: 1px solid #f1eaed;
  color: #554b55;
  font-size: 12px;
}
.vpr-mobile-catalog-list a strong {
  color: var(--vpr-primary, #1f1b24);
  font-size: 12.5px;
}
.vpr-mobile-catalog-list .vpr-mobile-child {
  padding-inline-start: 28px;
  color: #766a75;
}

/* ---------- Consistent add buttons on product cards ---------- */
.vpr-variable-add {
  font-family: inherit;
  cursor: pointer;
}
.vpr-variable-add .vpr-add-icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}
.wc-card-body .vpr-variable-add {
  width: 100%;
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: auto;
}
.product-actions .vpr-variable-add {
  color: #fff;
}
.vpr-loop-unavailable {
  opacity: .58;
  cursor: not-allowed;
}

/* ---------- Variation picker modal ---------- */
body.vpr-variation-open {
  overflow: hidden !important;
}
.vpr-variation-modal[hidden] {
  display: none !important;
}
.vpr-variation-modal {
  position: fixed;
  inset: 0;
  z-index: 100120;
  display: grid;
  place-items: center;
  padding: 22px;
  direction: rtl;
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease;
}
.vpr-variation-modal.open {
  opacity: 1;
  visibility: visible;
}
.vpr-variation-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: rgba(16, 12, 17, .62);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
.vpr-variation-dialog {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  max-height: min(88vh, 760px);
  max-height: min(88dvh, 760px);
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 30px 90px rgba(17, 11, 18, .28);
  transform: translateY(14px) scale(.985);
  transition: transform .2s ease;
}
.vpr-variation-modal.open .vpr-variation-dialog {
  transform: translateY(0) scale(1);
}
.vpr-variation-handle {
  display: none;
}
.vpr-variation-close {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 4;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid #eadfe0;
  border-radius: 50%;
  background: #fff;
  color: var(--vpr-primary, #1f1b24);
  box-shadow: 0 5px 16px rgba(31, 27, 36, .1);
}
.vpr-variation-close svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}
.vpr-variation-close:focus-visible,
.vpr-picker-option:focus-visible,
.vpr-picker-add:focus-visible {
  outline: 3px solid rgba(201, 155, 107, .55);
  outline-offset: 2px;
}
.vpr-variation-content {
  padding: 24px;
}
.vpr-variation-loading {
  min-height: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: #6d626d;
  font-size: 13px;
}
.vpr-picker-spinner {
  width: 38px;
  height: 38px;
  border: 3px solid #eee6e9;
  border-top-color: var(--vpr-primary, #1f1b24);
  border-radius: 50%;
  animation: vprPickerSpin .75s linear infinite;
}
@keyframes vprPickerSpin { to { transform: rotate(360deg); } }

.vpr-picker-product {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 0 0 20px;
  margin-bottom: 19px;
  border-bottom: 1px solid #eee7ea;
}
.vpr-picker-image {
  width: 116px;
  height: 142px;
  border-radius: 15px;
  object-fit: cover;
  background: #f5f0f2;
}
.vpr-picker-product-info {
  min-width: 0;
}
.vpr-picker-product-info h2 {
  padding-left: 42px;
  margin-bottom: 8px;
  color: var(--vpr-primary, #1f1b24);
  font-size: 19px;
  line-height: 1.6;
}
.vpr-picker-taxonomies {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
}
.vpr-picker-taxonomies span {
  padding: 3px 8px;
  border-radius: 99px;
  background: #f4eef1;
  color: #766a75;
  font-size: 10px;
  line-height: 1.5;
}
.vpr-picker-price {
  color: var(--vpr-primary, #1f1b24);
  font-size: 16px;
  font-weight: 900;
}
.vpr-picker-price del {
  margin-inline-end: 5px;
  opacity: .48;
  font-size: .82em;
}
.vpr-picker-price ins {
  text-decoration: none;
}
.vpr-picker-attribute {
  min-width: 0;
  padding: 0;
  margin: 0 0 17px;
  border: 0;
}
.vpr-picker-attribute legend {
  display: block;
  width: 100%;
  margin-bottom: 9px;
  color: #2f2830;
  font-size: 13px;
  font-weight: 900;
}
.vpr-picker-attribute legend small {
  color: var(--vpr-accent, #c99b6b);
  font-size: 11px;
  font-weight: 700;
}
.vpr-picker-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.vpr-picker-option {
  min-width: 48px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border: 1.5px solid #ddd3d8;
  border-radius: 11px;
  background: #fff;
  color: #453b44;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
  transition: border-color .16s ease, background .16s ease, color .16s ease, opacity .16s ease;
}
.vpr-picker-option:hover:not(:disabled) {
  border-color: var(--vpr-primary, #1f1b24);
}
.vpr-picker-option.selected {
  border-color: var(--vpr-primary, #1f1b24);
  background: var(--vpr-primary, #1f1b24);
  color: #fff;
  box-shadow: 0 5px 14px rgba(31, 27, 36, .18);
}
.vpr-picker-option.unavailable,
.vpr-picker-option:disabled {
  opacity: .35;
  cursor: not-allowed;
  text-decoration: line-through;
  box-shadow: none;
}
.vpr-picker-status {
  min-height: 38px;
  display: flex;
  align-items: center;
  padding: 9px 12px;
  margin: 4px 0 14px;
  border-radius: 10px;
  background: #f8f4f6;
  color: #756a74;
  font-size: 11.5px;
  line-height: 1.7;
}
.vpr-picker-status.is-available {
  background: #edf8f1;
  color: #277044;
}
.vpr-picker-status.is-error {
  background: #fff0f0;
  color: #a52c2c;
}
.vpr-picker-footer {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
}
.vpr-picker-quantity {
  display: grid;
  grid-template-columns: 38px 1fr 38px;
  border: 1.5px solid #ddd3d8;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.vpr-picker-quantity button,
.vpr-picker-quantity input {
  min-width: 0;
  height: 48px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #332c34;
  text-align: center;
  font: inherit;
  font-weight: 800;
}
.vpr-picker-quantity button {
  font-size: 18px;
}
.vpr-picker-quantity button:hover {
  background: #f5f0f2;
}
.vpr-picker-quantity input {
  width: 100%;
  border-inline: 1px solid #eee6e9;
  appearance: textfield;
}
.vpr-picker-quantity input::-webkit-inner-spin-button { display: none; }
.vpr-picker-add {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--vpr-primary, #1f1b24), #463b4c);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 8px 20px rgba(31, 27, 36, .2);
  transition: opacity .18s, transform .18s, box-shadow .18s;
}
.vpr-picker-add:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 11px 25px rgba(31, 27, 36, .25);
}
.vpr-picker-add:disabled {
  opacity: .42;
  cursor: not-allowed;
  box-shadow: none;
}
.vpr-picker-add.loading svg {
  animation: vprPickerSpin .8s linear infinite;
}
.vpr-picker-add svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}
.vpr-picker-product-link {
  display: block;
  width: max-content;
  max-width: 100%;
  margin: 12px auto 0;
  color: var(--vpr-primary, #1f1b24);
  border-bottom: 1px dashed var(--vpr-accent, #c99b6b);
  font-size: 11.5px;
  font-weight: 800;
  text-align: center;
}
.vpr-picker-error {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.vpr-picker-error > span {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  border-radius: 50%;
  background: #fff0f0;
  color: #b32f2f;
  font-size: 24px;
  font-weight: 900;
}
.vpr-picker-error h2 { font-size: 18px; }
.vpr-picker-error p { color: #756a74; font-size: 13px; }

@media (max-width: 640px) {
  .vpr-variation-modal {
    place-items: end center;
    padding: 0;
  }
  .vpr-variation-dialog {
    width: 100%;
    max-height: 90vh;
    max-height: 90dvh;
    border-radius: 22px 22px 0 0;
    transform: translateY(100%);
  }
  .vpr-variation-modal.open .vpr-variation-dialog {
    transform: translateY(0);
  }
  .vpr-variation-handle {
    display: block;
    width: 44px;
    height: 4px;
    margin: 9px auto 0;
    border-radius: 99px;
    background: #d9cfd4;
  }
  .vpr-variation-close {
    top: 12px;
    left: 12px;
    width: 38px;
    height: 38px;
  }
  .vpr-variation-content {
    padding: 16px;
  }
  .vpr-picker-product {
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 12px;
    padding-bottom: 14px;
    margin-bottom: 15px;
  }
  .vpr-picker-image {
    width: 84px;
    height: 104px;
    border-radius: 12px;
  }
  .vpr-picker-product-info h2 {
    padding-left: 36px;
    font-size: 15px;
    line-height: 1.65;
  }
  .vpr-picker-price { font-size: 14px; }
  .vpr-picker-option {
    min-height: 40px;
    padding: 7px 12px;
    font-size: 11.5px;
  }
  .vpr-picker-footer {
    grid-template-columns: 108px minmax(0, 1fr);
  }
  .vpr-picker-quantity {
    grid-template-columns: 34px 1fr 34px;
  }
  .vpr-picker-quantity button,
  .vpr-picker-quantity input,
  .vpr-picker-add {
    height: 46px;
    min-height: 46px;
  }
  .vpr-picker-add {
    padding-inline: 10px;
    font-size: 11.5px;
  }
}

@media (max-width: 370px) {
  .vpr-picker-footer {
    grid-template-columns: 1fr;
  }
  .vpr-picker-quantity {
    width: 124px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .vpr-variation-modal,
  .vpr-variation-dialog,
  .vpr-picker-option,
  .vpr-picker-add,
  .vpr-catalog-popup {
    transition: none !important;
  }
}
