/* =======================================================================
   ZOL — Wholesale (shop owner side)
   Pentaflora-branded - uses forest green theme regardless of shop theme
   ======================================================================= */

/* All wholesale views use a Pentaflora green identity */
.wholesale-page {
    --ws-primary: #143823;       /* Pentaflora forest */
    --ws-on-primary: #FBF8EF;
    --ws-secondary: #1E5234;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--paper);
    padding-bottom: 80px;
}

.ws-header {
    background: var(--ws-primary);
    color: var(--ws-on-primary);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    position: sticky;
    top: 0;
    z-index: 20;
}
.ws-header .btn-back {
    background: rgba(255, 255, 255, 0.12);
    color: var(--ws-on-primary);
    position: relative; top: auto; left: auto;
}
.ws-header h2 {
    font-family: var(--font-display);
    font-size: 18px;
    margin: 0;
    color: currentColor;
    font-weight: 500;
    flex: 1;
}
.ws-header img.zol-mark {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    margin-right: 4px;
}

/* Catalog hero */
.ws-hero {
    background: var(--ws-primary);
    color: var(--ws-on-primary);
    padding: 24px 20px 32px;
    text-align: center;
}
.ws-hero h1 {
    font-family: var(--font-display);
    font-size: 28px;
    margin: 0 0 6px;
    font-weight: 500;
    color: currentColor;
}
.ws-hero p {
    margin: 0;
    color: rgba(255, 255, 255, 0.75);
    font-size: 14px;
}

/* Disabled banner */
.ws-disabled {
    background: rgba(215, 130, 61, 0.12);
    color: #8c4d20;
    padding: 14px 18px;
    margin: 16px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(215, 130, 61, 0.35);
    text-align: center;
}

/* Category nav */
.ws-cat-nav {
    background: #fff;
    padding: 10px 16px;
    overflow-x: auto;
    white-space: nowrap;
    border-bottom: 1px solid var(--paper-3);
    -webkit-overflow-scrolling: touch;
    position: sticky;
    top: 56px;
    z-index: 10;
}
.ws-cat-nav::-webkit-scrollbar { height: 0; }
.ws-cat-pill {
    display: inline-block;
    padding: 7px 14px;
    margin-right: 6px;
    border-radius: 999px;
    background: var(--paper);
    color: rgba(14, 31, 20, 0.7);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background-color 120ms ease;
    -webkit-tap-highlight-color: rgba(0,0,0,0.04);
}
.ws-cat-pill.is-active {
    background: var(--ws-primary);
    color: var(--ws-on-primary);
}

/* Product grid */
.ws-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
    padding: 16px;
}
.ws-card {
    background: #fff;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--paper-3);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    transition: transform 120ms ease, box-shadow 120ms ease;
}
.ws-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-soft); }
.ws-card * { pointer-events: none; }
.ws-card-photo {
    aspect-ratio: 1 / 1;
    background: var(--paper-2);
    overflow: hidden;
    position: relative;
}
.ws-card-photo img { width: 100%; height: 100%; object-fit: cover; }
.ws-card-photo .placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    color: rgba(14, 31, 20, 0.25);
}
.ws-card-sale-badge {
    position: absolute;
    top: 8px; left: 8px;
    background: #D7823D;
    color: #fff;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 999px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.ws-card-body {
    padding: 10px 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.ws-card-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--ink);
    margin: 0 0 6px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ws-card-price {
    margin-top: auto;
    font-family: var(--font-display);
    font-size: 17px;
    color: var(--ws-primary);
    font-weight: 500;
}
.ws-card-price .from {
    font-size: 11px;
    color: rgba(14, 31, 20, 0.55);
    font-family: var(--font-body);
    font-weight: 400;
    margin-right: 4px;
}
.ws-card-price .strike {
    font-size: 12px;
    color: rgba(14, 31, 20, 0.5);
    text-decoration: line-through;
    margin-right: 4px;
    font-family: var(--font-body);
    font-weight: 400;
}

/* Product detail */
.ws-pdp-photo {
    aspect-ratio: 1 / 1;
    background: var(--paper-2);
    width: 100%;
    overflow: hidden;
}
.ws-pdp-photo img { width: 100%; height: 100%; object-fit: cover; }
.ws-pdp-body {
    padding: 20px 16px;
}
.ws-pdp-name {
    font-family: var(--font-display);
    font-size: 26px;
    color: var(--ws-primary);
    margin: 0 0 4px;
    line-height: 1.15;
}
.ws-pdp-cat {
    font-size: 13px;
    color: rgba(14, 31, 20, 0.55);
    margin-bottom: 12px;
}
.ws-pdp-price {
    font-family: var(--font-display);
    font-size: 28px;
    color: var(--ws-primary);
    font-weight: 500;
    margin-bottom: 14px;
}
.ws-pdp-price .strike {
    font-size: 16px;
    color: rgba(14, 31, 20, 0.45);
    text-decoration: line-through;
    margin-right: 8px;
    font-weight: 400;
}
.ws-pdp-desc {
    color: rgba(14, 31, 20, 0.75);
    line-height: 1.55;
    margin-bottom: 24px;
    white-space: pre-wrap;
}
.ws-pdp-section {
    margin-bottom: 18px;
}
.ws-pdp-section h4 {
    font-size: 13px;
    color: rgba(14, 31, 20, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin: 0 0 8px;
}
.ws-variant-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.ws-variant-chip {
    padding: 10px 16px;
    border: 1px solid var(--paper-3);
    background: #fff;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    transition: border-color 120ms ease, background-color 120ms ease;
    -webkit-tap-highlight-color: rgba(0,0,0,0.04);
}
.ws-variant-chip * { pointer-events: none; }
.ws-variant-chip.is-selected {
    border-color: var(--ws-primary);
    background: rgba(20, 56, 35, 0.05);
    color: var(--ws-primary);
    font-weight: 500;
}
.ws-variant-chip .label { display: block; }
.ws-variant-chip .price {
    display: block;
    font-size: 12px;
    color: rgba(14, 31, 20, 0.55);
    margin-top: 2px;
}

.ws-qty {
    display: flex;
    align-items: center;
    gap: 12px;
}
.ws-qty button {
    width: 36px;
    height: 36px;
    border: 1px solid var(--paper-3);
    background: #fff;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    color: var(--ws-primary);
}
.ws-qty button:hover { background: var(--paper); }
.ws-qty span {
    min-width: 30px;
    text-align: center;
    font-weight: 500;
}

.ws-add-bar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: #fff;
    border-top: 1px solid var(--paper-3);
    padding: 14px 16px;
    display: flex;
    gap: 10px;
    z-index: 20;
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
}
.ws-add-bar .btn { flex: 1; }
.ws-btn-primary {
    background: var(--ws-primary);
    color: var(--ws-on-primary);
    border-color: var(--ws-primary);
}
.ws-btn-primary:hover { background: var(--ws-secondary); border-color: var(--ws-secondary); }

/* Cart bar */
.ws-cart-bar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--ws-primary);
    color: var(--ws-on-primary);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
    z-index: 30;
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
}
.ws-cart-bar[hidden] { display: none !important; }
.ws-cart-bar-left { display: flex; align-items: center; gap: 10px; }
.ws-cart-bar-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
}
.ws-cart-bar-total {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 500;
}

/* Cart drawer (full screen on mobile) */
.ws-cart-drawer { background: var(--paper); }
.ws-cart-list { flex: 1; overflow-y: auto; padding: 16px; }
.ws-cart-item {
    background: #fff;
    border: 1px solid var(--paper-3);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-bottom: 10px;
    display: grid;
    grid-template-columns: 60px 1fr auto;
    gap: 12px;
    align-items: center;
}
.ws-cart-item-photo {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--paper-2);
}
.ws-cart-item-photo img { width: 100%; height: 100%; object-fit: cover; }
.ws-cart-item-info { min-width: 0; }
.ws-cart-item-name {
    font-weight: 500;
    color: var(--ink);
    margin: 0 0 2px;
    font-size: 14px;
    line-height: 1.3;
}
.ws-cart-item-variant {
    font-size: 12px;
    color: rgba(14, 31, 20, 0.55);
    margin-bottom: 4px;
}
.ws-cart-item-price {
    font-size: 13px;
    color: rgba(14, 31, 20, 0.7);
}
.ws-cart-item-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}
.ws-cart-qty {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--paper-3);
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}
.ws-cart-qty button {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    font-size: 14px;
    cursor: pointer;
    color: var(--ws-primary);
}
.ws-cart-qty span {
    min-width: 26px;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
}
.ws-cart-item-remove {
    background: none;
    border: none;
    color: var(--error);
    font-size: 11px;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}

.ws-cart-empty {
    text-align: center;
    padding: 60px 20px;
    color: rgba(14, 31, 20, 0.5);
}
.ws-cart-summary {
    background: #fff;
    border-top: 1px solid var(--paper-3);
    padding: 16px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
}
.ws-summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}
.ws-summary-row.total {
    font-family: var(--font-display);
    font-size: 22px;
    color: var(--ws-primary);
    font-weight: 500;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--paper-3);
}
.ws-cart-summary .btn { width: 100%; margin-top: 12px; }

/* Checkout */
.ws-checkout-section {
    background: #fff;
    border: 1px solid var(--paper-3);
    border-radius: var(--radius-md);
    padding: 18px;
    margin: 14px 16px;
}
.ws-checkout-section h4 {
    font-family: var(--font-display);
    font-size: 16px;
    color: var(--ws-primary);
    margin: 0 0 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}
.ws-payment-terms-box {
    white-space: pre-wrap;
    font-family: var(--font-body);
    font-size: 13px;
    line-height: 1.55;
    background: var(--paper-2);
    border-radius: var(--radius-sm);
    padding: 14px;
    color: rgba(14, 31, 20, 0.85);
}
.ws-checkout-action-bar {
    position: sticky;
    bottom: 0;
    background: var(--paper);
    padding: 16px;
    border-top: 1px solid var(--paper-3);
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
}
.ws-checkout-action-bar .btn { width: 100%; }

/* Order success + my orders */
.ws-success-card {
    text-align: center;
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    margin: 16px;
    border: 2px solid var(--ws-primary);
}
.ws-success-card .icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    background: rgba(20, 56, 35, 0.08);
    color: var(--ws-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ws-success-card h2 {
    font-family: var(--font-display);
    font-size: 26px;
    color: var(--ws-primary);
    margin: 0 0 6px;
    font-weight: 500;
}
.ws-success-card p {
    color: rgba(14, 31, 20, 0.65);
    margin: 0 0 14px;
}
.ws-success-card .order-num {
    font-family: 'Menlo', monospace;
    font-weight: 600;
    color: var(--ws-primary);
    background: var(--paper-2);
    padding: 6px 14px;
    border-radius: 8px;
    display: inline-block;
    margin-bottom: 14px;
}
.ws-success-card .total {
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 500;
    color: var(--ws-primary);
    margin-bottom: 18px;
}

/* My wholesale orders list */
.ws-orders-list {
    padding: 16px;
}
.ws-order-card {
    background: #fff;
    border: 1px solid var(--paper-3);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: border-color 120ms ease;
}
.ws-order-card:hover { border-color: var(--ws-primary); }
.ws-order-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.ws-order-card-num {
    font-family: 'Menlo', monospace;
    font-weight: 500;
    color: var(--ws-primary);
}
.ws-order-status-pill {
    font-size: 11px;
    padding: 3px 9px;
    border-radius: 999px;
    font-weight: 500;
    background: var(--paper-2);
    color: rgba(14, 31, 20, 0.6);
}
.ws-order-status-pill.pending     { background: rgba(215, 130, 61, 0.12); color: var(--accent); }
.ws-order-status-pill.confirmed,
.ws-order-status-pill.preparing   { background: rgba(74, 124, 89, 0.15); color: var(--success); }
.ws-order-status-pill.dispatched  { background: rgba(20, 56, 35, 0.1);  color: var(--ws-primary); }
.ws-order-status-pill.delivered   { background: var(--paper-2); color: rgba(14,31,20,0.6); }
.ws-order-status-pill.cancelled   { background: rgba(181, 74, 61, 0.12); color: var(--error); }
.ws-order-card-meta {
    font-size: 13px;
    color: rgba(14, 31, 20, 0.6);
}
.ws-order-card-total {
    font-family: var(--font-display);
    color: var(--ws-primary);
    font-weight: 500;
    margin-top: 4px;
}

.ws-detail-section {
    background: #fff;
    border: 1px solid var(--paper-3);
    border-radius: var(--radius-md);
    padding: 16px;
    margin: 14px 16px;
}
.ws-detail-section h4 {
    font-size: 13px;
    color: rgba(14, 31, 20, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
    margin: 0 0 10px;
}
.ws-detail-line {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--paper-3);
    gap: 12px;
}
.ws-detail-line:last-child { border-bottom: none; }
.ws-detail-line-name { flex: 1; padding-right: 8px; }
.ws-detail-line-name .variant {
    font-size: 12px;
    color: rgba(14, 31, 20, 0.55);
}
.ws-detail-line-qty { color: rgba(14, 31, 20, 0.6); }
.ws-detail-line-total {
    font-weight: 500;
    color: var(--ink);
    min-width: 70px;
    text-align: right;
}
