/* Product page — wholesale order UI (moved out of product.php). */
/* Wholesale Order UI Styles — restyled to the T-Form brand system */
.wo-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.7rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    margin-bottom: 1.75rem;
}
.wo-title {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--black);
}
.wo-title i { color: var(--brand-red); }
.wo-colour-selector {
    background: var(--background);
    padding: 1.1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    border: 1px solid var(--border);
}
.wo-colour-selector .field { margin-bottom: 0; }
.wo-colour-selector .field label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--charcoal);
    margin-bottom: 0.35rem;
}
.wo-colour-selector select {
    width: 100%;
    padding: 0.7rem 0.85rem;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    background: var(--white);
    min-height: 46px;
    transition: 0.15s;
}
.wo-colour-selector select:focus {
    outline: none;
    border-color: var(--brand-red);
    box-shadow: 0 0 0 3px var(--brand-red-tint);
}
.wo-colour-preview {
    width: 34px;
    height: 34px;
    border-radius: 6px;
    flex-shrink: 0;
    background: var(--background);
    border: 1px dashed var(--border);
    transition: 0.15s;
}
.wo-size-grid { margin-top: 1rem; }
.wo-size-grid .wo-size-label {
    font-weight: 700;
    font-size: 0.92rem;
    margin-bottom: 0.75rem;
    color: var(--black);
}
.wo-size-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 0.5rem;
}
.wo-size-row:last-child { border-bottom: none; }
.wo-size-row .size-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 120px;
    flex-wrap: wrap;
}
.wo-size-row .size-info .size-name {
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--black);
}
.wo-size-row .size-info .extra-badge {
    background: var(--warning-tint);
    color: var(--warning);
    padding: 0 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.68rem;
    font-weight: 700;
}
.wo-size-row .size-info .price-tag {
    font-size: 0.8rem;
    color: var(--muted);
    font-weight: 400;
}
.wo-qty-control { display: flex; align-items: center; gap: 0.5rem; }
.wo-qty-control button {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border-strong);
    background: var(--white);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.15s;
    color: var(--black);
    display: flex;
    align-items: center;
    justify-content: center;
}
.wo-qty-control button:hover { background: var(--background); border-color: var(--black); }
.wo-qty-control input {
    width: 68px;
    text-align: center;
    padding: 0.5rem;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.95rem;
    background: var(--white);
    color: var(--black);
}
.wo-qty-control input::placeholder { color: var(--muted-light); font-weight: 400; }
.wo-qty-control input:focus {
    outline: none;
    border-color: var(--brand-red);
    box-shadow: 0 0 0 3px var(--brand-red-tint);
}
.wo-qty-control input.error { border-color: #B91C1C; background: var(--brand-red-tint); }
.wo-add-btn {
    margin-top: 1rem;
    padding: 0.75rem 1.6rem;
    background: var(--brand-red);
    border: 1px solid var(--brand-red);
    color: var(--white);
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.92rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: 0.15s;
    min-height: 44px;
}
.wo-add-btn:hover { background: var(--brand-red-dark); border-color: var(--brand-red-dark); }
.wo-add-btn i { font-size: 1rem; }

/* Bulk Order Button */
.btn-bulk {
    background: var(--black);
    border: 1px solid var(--black);
    color: var(--white);
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.88rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: 0.15s;
    white-space: nowrap;
    min-height: 44px;
}
.btn-bulk:hover { background: var(--charcoal); }
.btn-bulk i { font-size: 0.9rem; }

/* View-only Colours / Sizes block on the product info card */
.pinfo-section { margin-top: 1rem; }
.pinfo-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}
.pinfo-section-title .label {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--charcoal);
}
.pinfo-section-title .label i { color: var(--brand-red); }
.pinfo-view-all-btn {
    background: none;
    border: none;
    color: var(--brand-red);
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0;
}
.pinfo-view-all-btn:hover { text-decoration: underline; }
.pinfo-colour-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.pinfo-colour-dot {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid var(--border-strong);
    cursor: default;
}
.pinfo-size-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pinfo-size-chip {
    background: var(--background);
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    padding: 0.3rem 0.7rem;
    font-weight: 700;
    font-size: 0.82rem;
    color: var(--black);
}
.all-colours-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    max-height: 340px;
    overflow-y: auto;
}
.all-colours-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.7rem;
    width: calc(50% - 0.3rem);
    box-sizing: border-box;
}
.all-colours-item .swatch {
    width: 24px;
    height: 24px;
    border-radius: 5px;
    border: 1px solid var(--border-strong);
    flex-shrink: 0;
}
.all-colours-item .name { font-weight: 600; font-size: 0.85rem; color: var(--black); }
.all-colours-item .code { font-size: 0.78rem; color: var(--muted); }

/* Order Table */
.order-table-wrap { overflow-x: auto; margin-top: 0.25rem; }
.order-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.order-table th {
    text-align: left;
    padding: 0.7rem 0.4rem;
    border-bottom: 2px solid var(--border-strong);
    font-weight: 700;
    color: var(--muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.order-table td { padding: 0.7rem 0.4rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.order-table .swatch-sm {
    width: 22px; height: 22px; border-radius: 5px;
    border: 1px solid var(--border-strong); display: inline-block; flex-shrink: 0;
}
.order-table .total-row { font-weight: 700; background: var(--background); border-top: 2px solid var(--border-strong); }
.summary-box {
    background: var(--background);
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
    border: 1px solid var(--border);
}
.extra-charge-badge {
    background: var(--warning-tint);
    color: var(--warning);
    padding: 0.1rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.68rem;
    font-weight: 700;
    margin-left: 0.25rem;
    white-space: nowrap;
}

/* Bulk-order modal */
.modal { border-radius: var(--radius-lg); padding: 1.5rem; max-width: 580px; }
.modal .swatch-sm {
    width: 22px; height: 22px; border-radius: 5px;
    border: 1px solid var(--border-strong); display: inline-block; flex-shrink: 0;
}
/* Shared searchable colour dropdown (used by both the single Select Colour
   field and the Bulk Order modal, so both look and behave the same) */
.bulk-colour-dropdown { position: relative; }
.bulk-colour-dropdown input {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    background: var(--white);
    transition: 0.15s;
    min-height: 46px;
}
.bulk-colour-dropdown input:focus {
    outline: none;
    border-color: var(--brand-red);
    box-shadow: 0 0 0 3px var(--brand-red-tint);
}
.bulk-colour-dropdown .dropdown-list {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--white);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    max-height: 220px;
    overflow-y: auto;
    z-index: 10;
    display: none;
    box-shadow: var(--shadow-lg);
    margin-top: 4px;
}
.bulk-colour-dropdown .dropdown-list.show { display: block; }
.bulk-colour-dropdown .dropdown-item {
    padding: 0.65rem 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border-bottom: 1px solid var(--background);
    min-height: 44px;
    font-size: 0.88rem;
}
.bulk-colour-dropdown .dropdown-item:hover { background: var(--background); }
.bulk-colour-dropdown .dropdown-item.colour-in-order { opacity: 0.5; pointer-events: none; }
.selected-colours { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.selected-colour-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--background);
    padding: 0.3rem 0.7rem 0.3rem 0.55rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-size: 0.82rem;
}
.selected-colour-chip .remove-chip { cursor: pointer; color: var(--muted-light); font-size: 0.8rem; }
.selected-colour-chip .remove-chip:hover { color: var(--brand-red); }

/* Responsive */
@media (max-width: 700px) {
    .wo-card { padding: 1.1rem; }
    .wo-colour-selector { padding: 1.1rem; }
    .wo-qty-control input { width: 52px; padding: 0.4rem; }
    .wo-qty-control button { width: 32px; height: 32px; font-size: 1rem; }
    .wo-size-row { padding: 0.5rem 0; }
    .modal { margin: 0.75rem; padding: 1rem; }
    .order-table { font-size: 0.72rem; }
    .order-table th, .order-table td { padding: 0.3rem 0.2rem; }
    .wo-size-row .size-info { min-width: 80px; }
    .all-colours-item { width: 100%; }
}

/* ---- Product gallery: one consistent, never-collapsing frame ---- */
.pgallery-main {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    max-height: 640px;
    border-radius: var(--radius-md);
    background: var(--background);
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    margin: 0 auto;
}
.pgallery-main img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pgallery-main .ph { font-size: 3rem; color: var(--muted-light); }
.pgallery-thumbs { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.pgallery-thumb {
    width: 64px; height: 64px; border-radius: 8px; overflow: hidden; cursor: pointer;
    border: 2px solid transparent; background: var(--background); padding: 0; flex: 0 0 auto;
}
.pgallery-thumb.is-active, .pgallery-thumb:hover { border-color: var(--brand-red); }
.pgallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.chart-thumb { display:block; width:110px; height:110px; border-radius:var(--radius-sm); overflow:hidden; border:1px solid var(--border); background: var(--background); }
.chart-thumb img { width:100%; height:100%; object-fit:cover; }
@media (max-width: 700px) {
    .pgallery-main { max-height: 520px; }
    .pgallery-thumb { width: 56px; height: 56px; }
}

/* ---- Out of stock panel ---- */
.stock-panel { border: 1.5px solid #f2c4c4; background: var(--brand-red-tint); border-radius: var(--radius-md); padding: 1.1rem 1.25rem; margin: 0.8rem 0 1rem; }
.stock-panel h3 { font-size: 1rem; color: #B91C1C; display:flex; align-items:center; gap:0.5rem; margin-bottom: 0.3rem; }
.stock-panel .reason { color: #7f1d1d; font-size: 0.92rem; margin-bottom: 0.8rem; }
.stock-panel .notify-row { display:flex; gap: 0.6rem; flex-wrap: wrap; align-items: stretch; }
.stock-panel .notify-row input[type=email] { flex: 1 1 220px; padding: 0.7rem 0.9rem; border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm); font-size: 0.92rem; min-height: 44px; }
.stock-panel .notify-done { color: var(--success); font-weight: 600; font-size: 0.92rem; display:flex; align-items:center; gap:0.5rem; }

/* ---- Bulk modal: tabs, size chips ---- */
.bulk-tabs { display:flex; gap: 0.4rem; background: var(--background); padding: 0.3rem; border-radius: var(--radius-sm); margin: 0.6rem 0 1rem; }
.bulk-tab { flex: 1; border: none; background: transparent; padding: 0.6rem 0.5rem; border-radius: 6px; font-weight: 700; font-size: 0.85rem; cursor: pointer; color: var(--muted); }
.bulk-tab.is-active { background: var(--white); color: var(--black); box-shadow: var(--shadow-sm); }
.bulk-pane { display: none; }
.bulk-pane.is-active { display: block; }
.bulk-step-label { font-weight: 700; font-size: 0.85rem; color: var(--charcoal); margin: 0.9rem 0 0.4rem; display:flex; align-items:center; gap:0.5rem; }
.bulk-step-label .n { width: 22px; height: 22px; border-radius: 50%; background: var(--black); color: #fff; font-size: 0.72rem; display:inline-flex; align-items:center; justify-content:center; }
.size-chip-row { display:flex; flex-wrap:wrap; gap: 0.5rem; }
.size-chip { border: 1.5px solid var(--border-strong); background: var(--white); border-radius: var(--radius-sm); padding: 0.55rem 1rem; font-weight: 800; font-size: 0.9rem; cursor: pointer; min-width: 56px; min-height: 44px; }
.size-chip:hover { border-color: var(--black); }
.size-chip.is-selected { border-color: var(--brand-red); background: var(--brand-red-tint); color: var(--brand-red-dark); }
.bulk-select-all { background:none; border:none; color: var(--brand-red); font-weight:700; font-size:0.8rem; cursor:pointer; padding:0; }
.bulk-summary { background: var(--background); border-radius: var(--radius-sm); padding: 0.7rem 0.9rem; font-size: 0.88rem; margin-top: 0.9rem; color: var(--charcoal); }
.bulk-success { background: var(--success-tint); color: var(--success); border-left: 4px solid var(--success); padding: 0.6rem 0.9rem; border-radius: var(--radius-sm); font-size: 0.88rem; font-weight: 600; margin-top: 0.8rem; }
.dropdown-item .tag-in { margin-left:auto; font-size:0.72rem; color: var(--success); font-weight:700; }

/* Box products: sub names have no colour swatch */
#orderForm.is-box .swatch-sm { display: none; }
