/* Storefront styles 4/4: product detail popup. */
  /* ---------- Product Detail Modal & Layout ---------- */
  .modal.pd-modal {
    width: min(1520px, 96vw, 100%);      /* wide, so many variants fit on 2-3 lines; 100% = inside the wrap's 16px gutter (phones) */
    max-height: calc(100vh - 32px);
    padding: 36px 40px;
    overflow-y: auto;
    position: relative;
    border-radius: 20px;
  }
  .pd-close{position:absolute;left:12px;bottom:12px;z-index:3;width:38px;height:38px;border-radius:50%;border:1px solid var(--border);
    background:color-mix(in srgb,var(--surface) 88%,transparent);color:var(--ink);display:grid;place-items:center;cursor:pointer;box-shadow:var(--shadow);backdrop-filter:blur(4px)}
  .pd-close:hover{background:var(--surface);color:var(--accent)}
  .pd-close svg{width:18px;height:18px}
  .productLayoutNew {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
    gap: 44px;
    align-items: stretch;
    width: 100%;
    margin-top: 8px;
  }
  @media (max-width: 768px) {
    .productLayoutNew {
      grid-template-columns: 1fr;
      gap: 18px;
    }
    .productPhotoContainer {
      flex: none;
      aspect-ratio: 1;
    }
    .modal.pd-modal { padding: 22px 18px; }
  }
  .layoutLeft {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    align-self: center;         /* the square photo is vertically centred against the info column */
    width: 100%;
  }
  .productPhotoContainer {
    width: 100%;
    flex: none;                 /* a fixed 1:1 square: no longer stretches with the height of the info column */
    aspect-ratio: 1 / 1;
    min-height: 0;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .productPhoto {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .productImageBox {
    width: 100%;
    height: 100%;
    position: relative;
  }
  .productImageItem {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    position: absolute;
    inset: 0;
    opacity: 1;
    transition: opacity 0.2s ease;
  }
  .productImageItemInactive {
    opacity: 0;
    pointer-events: none;
  }
  .productImage {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
  }
  #pdImageBox{background:var(--surface-2);border-radius:14px}
  .slideShow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
    flex-wrap: wrap;
  }
  .thumbPhotos .thumb {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    border: 2px solid var(--border);
    overflow: hidden;
    display: inline-block;
    cursor: pointer;
    transition: border-color 0.15s ease;
  }
  .thumbPhotos .thumb:hover, .thumbPhotos .thumb-selected {
    border-color: var(--accent);
  }
  .thumbPhotos .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .productHeaderNew .headerText {
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.25;
    color: var(--ink);
  }
  .product_code {
    font-family: var(--f-mono);
    font-size: 0.8rem;
    color: var(--faint);
    margin: 6px 0 12px;
  }
  .productPrice {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
    padding: 12px 14px;
    background: var(--surface-2);
    border-radius: 12px;
  }
  .mainPrice {
    font-family: var(--f-mono);
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--accent);
  }
  .oldPrice {
    font-family: var(--f-mono);
    font-size: 0.88rem;
    color: var(--faint);
    text-decoration: line-through;
  }
  .discountBox {
    background: #ff4757 !important;
    color: #fff !important;
    font-weight: 700;
    border-radius: 6px;
    font-size: 0.8rem;
    padding: 4px 8px;
  }
  .productDetail {
    width: 100%;
    border-collapse: collapse;
  }
  .productDetail td {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
  }
  .productDetail td.headTD {
    width: 120px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
    vertical-align: top;
  }
  .productDetail td.bodyTD {
    font-size: 0.9rem;
  }
  .sub_option_choices {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .sub_option_choices .choice {
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    padding: 5px 12px;
    font-size: 0.82rem;
    cursor: pointer;
    background: var(--surface);
    transition: all 0.12s ease;
  }
  .sub_option_choices .choice:hover {
    border-color: var(--accent);
  }
  .sub_option_choices .choice.active {
    background: var(--accent);
    color: var(--accent-ink);
    border-color: var(--accent);
    font-weight: 600;
  }
  /* out of stock: a plain grey box (no label) */
  .sub_option_choices .choice.disabled {
    background: var(--surface-2);
    border-color: var(--border-strong);
    color: var(--faint);
  }
  .sub_option_choices .choice.disabled:hover { filter: brightness(0.97); }
  .sub_option_choices .choice.disabled.active {
    background: #8b93a1;
    color: #fff;
    border-color: #8b93a1;
  }
  .quantityCover {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    overflow: hidden;
    background: var(--surface);
  }
  .quantityCover .decrease, .quantityCover .increase {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    user-select: none;
    background: var(--surface-2);
  }
  .quantityCover .decrease:hover, .quantityCover .increase:hover {
    background: var(--border);
  }
  .quantity_box {
    width: 44px;
    height: 34px;
    border: none;
    text-align: center;
    font-family: var(--f-mono);
    font-weight: 600;
    background: transparent;
    color: var(--ink);
  }
  .quantityContainer {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
  }
  .pd-viewcart-btn {
    height: 38px;
    flex: none;
    padding: 0 14px 0 12px;
    border-radius: 10px;
    border: 1.5px solid var(--border-strong);
    background: var(--surface);
    color: var(--ink);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font: inherit;
    font-size: .86rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .12s ease;
  }
  .pd-viewcart-btn svg { width: 17px; height: 17px; flex: none; }
  .pd-viewcart-btn:hover { background: var(--surface-2); }
  .pd-cart-btn {
    width: 44px;
    height: 38px;
    flex: none;
    border-radius: 10px;
    border: none;
    background: var(--accent);
    color: var(--accent-ink);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: transform 0.08s ease, filter 0.12s ease;
  }
  .pd-cart-btn svg { width: 19px; height: 23.75px; }
  .pd-cart-btn:hover:not(:disabled) { filter: brightness(1.08); }
  .pd-cart-btn:active:not(:disabled) { transform: scale(0.93); }
  .pd-cart-btn:disabled { background: var(--surface-2); color: var(--faint); cursor: not-allowed; }
  .pd-cart-btn.added { background: var(--good, #0f8a5f); }
  .card .thumb, .card h3 {
    cursor: pointer;
  }

/* admin quick-edit: unsaved edits bar in the product popup (js/product.js aeBarSync) */
.ae-savebar{position:sticky;bottom:0;z-index:5;display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:12px -4px 0;padding:10px 12px;border-radius:12px;background:var(--surface);border:2px solid var(--accent);box-shadow:0 -6px 18px rgba(0,0,0,.12);font-size:.86rem;font-weight:600}
.ae-savebar span{flex:1;min-width:150px}
.ae-savebar button{border:1px solid var(--border);background:var(--surface-2);color:var(--ink);border-radius:999px;padding:7px 14px;font:inherit;cursor:pointer}
.ae-savebar .ae-bar-save{background:var(--accent);border-color:var(--accent);color:#fff}
.ae-savebar button:disabled{opacity:.6;cursor:wait}

/* 2026-10-25 wishlist rows: the cart button is as small as the magnifier next to it */
.acct-wcart.pd-cart-btn{width:32px;height:32px;border-radius:8px}.acct-wcart.pd-cart-btn svg{width:16px;height:20px}
