/* HiveTactix Product Upload Form - Brand Styling */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');

* {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

:root {
    --hpbm-teal: #32101B;
    --hpbm-pink: #A02238;
    --hpbm-dark: #1a1a1a;
    --hpbm-light: #f8f8f8;
    --hpbm-border: #e0e0e0;
    --hpbm-text: #333;
    --hpbm-text-light: #666;
}

.hpbm-form-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
    background: var(--hpbm-light);
}

.hpbm-form-container h2 {
    margin: 0 0 40px 0;
    font-size: 36px;
    font-weight: 700;
    color: var(--hpbm-dark);
    letter-spacing: -0.5px;
}

.hpbm-form-wrapper {
    background: white;
    border-radius: 8px;
    padding: 40px;
    margin-bottom: 40px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.hpbm-form {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.hpbm-form-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hpbm-form-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--hpbm-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hpbm-form-group label .hpbm-required {
    color: var(--hpbm-pink);
}

.hpbm-form-group input[type="text"],
.hpbm-form-group textarea,
.hpbm-form-group select {
    padding: 14px 16px;
    border: 1px solid var(--hpbm-border);
    border-radius: 6px;
    font-size: 14px;
    font-family: 'Montserrat', inherit;
    background: white;
    transition: all 0.3s ease;
}

.hpbm-form-group input[type="text"]::placeholder,
.hpbm-form-group textarea::placeholder {
    color: #aaa;
}

.hpbm-form-group input[type="text"]:focus,
.hpbm-form-group textarea:focus,
.hpbm-form-group select:focus {
    outline: none;
    border-color: var(--hpbm-teal);
    box-shadow: 0 0 0 3px rgba(48, 120, 132, 0.08);
    background: white;
}

.hpbm-form-group textarea {
    resize: vertical;
    min-height: 100px;
    font-size: 14px;
}

/* Variations Section */
#hpbm-variations-container {
    background: #fafafa;
    border: 1px solid var(--hpbm-border);
    border-radius: 6px;
    padding: 16px;
    min-height: 50px;
}

.hpbm-variation-row {
    display: grid;
    grid-template-columns: 1fr 140px auto;
    gap: 12px;
    margin-bottom: 12px;
    align-items: flex-end;
}

.hpbm-variation-row:last-child {
    margin-bottom: 0;
}

.hpbm-variation-row input {
    padding: 12px 14px;
    border: 1px solid var(--hpbm-border);
    border-radius: 6px;
    font-size: 13px;
    font-family: 'Montserrat', inherit;
}

.hpbm-variation-row input:focus {
    outline: none;
    border-color: var(--hpbm-teal);
    box-shadow: 0 0 0 3px rgba(48, 120, 132, 0.08);
}

.hpbm-variation-row button {
    padding: 10px 14px;
    font-size: 12px;
}

/* Buttons */
.button,
.hpbm-form button[type="submit"],
#hpbm-add-variation-btn,
#hpbm-finalize-btn {
    padding: 14px 28px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Montserrat', inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hpbm-form button[type="submit"],
#hpbm-add-variation-btn {
    background: var(--hpbm-teal);
    color: white;
    align-self: flex-start;
}

.hpbm-form button[type="submit"]:hover,
#hpbm-add-variation-btn:hover {
    background: #265a6a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(48, 120, 132, 0.2);
}

#hpbm-add-variation-btn {
    padding: 10px 16px;
    font-size: 12px;
    align-self: flex-start;
    background: #f0f0f0;
    color: var(--hpbm-dark);
    border: 1px solid var(--hpbm-border);
    margin-top: 8px;
}

#hpbm-add-variation-btn:hover {
    background: #e8e8e8;
    box-shadow: none;
}

.hpbm-remove-variation,
.hpbm-remove-product,
.hpbm-delete-var {
    background: #f5f5f5;
    color: var(--hpbm-text);
    border: 1px solid var(--hpbm-border);
    padding: 8px 12px;
    font-size: 11px;
}

.hpbm-remove-variation:hover,
.hpbm-remove-product:hover,
.hpbm-delete-var:hover {
    background: #e8e8e8;
    border-color: #ccc;
}

/* Products List Section */
.hpbm-products-list-wrapper {
    background: white;
    border-radius: 8px;
    padding: 40px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
}

.hpbm-products-list-wrapper h3 {
    margin: 0 0 30px 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--hpbm-dark);
}

#hpbm-product-count {
    color: var(--hpbm-teal);
    font-weight: 700;
}

/* Product Cards */
.hpbm-product-card {
    background: #fafafa;
    border-left: 4px solid var(--hpbm-teal);
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.hpbm-product-card:last-child {
    margin-bottom: 0;
}

.hpbm-product-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.hpbm-product-header strong {
    font-size: 16px;
    font-weight: 700;
    color: var(--hpbm-dark);
    flex: 1;
}

.hpbm-product-type {
    background: var(--hpbm-teal);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    flex-shrink: 0;
}

.hpbm-product-meta {
    margin: 0;
    color: var(--hpbm-text-light);
    font-size: 13px;
    line-height: 1.6;
}

.hpbm-product-meta strong {
    color: var(--hpbm-dark);
    font-weight: 600;
}

.hpbm-variations-display {
    background: white;
    padding: 12px;
    border-radius: 4px;
    font-size: 13px;
    border: 1px solid var(--hpbm-border);
}

.hpbm-variations-display strong {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--hpbm-dark);
}

.hpbm-variation-badge {
    display: inline-block;
    background: var(--hpbm-pink);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    margin-right: 8px;
    margin-bottom: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.hpbm-remove-product {
    align-self: flex-start;
    margin-top: 4px;
}

/* Empty State */
.hpbm-products-list-wrapper > p {
    color: #999;
    font-size: 14px;
    margin: 0;
    padding: 20px 0;
}

/* Finalize Section */
#hpbm-finalize-section {
    background: linear-gradient(135deg, var(--hpbm-teal) 0%, #1a0810 100%);
    color: white;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    margin-top: 30px;
}

#hpbm-finalize-section p {
    margin: 0 0 20px 0;
    font-size: 15px;
    line-height: 1.6;
    opacity: 0.95;
}

#hpbm-finalize-btn {
    background: var(--hpbm-pink);
    color: white;
    align-self: center;
    margin-top: 10px;
}

#hpbm-finalize-btn:hover {
    background: #d76a7d;
    box-shadow: 0 4px 12px rgba(228, 132, 143, 0.3);
}

/* Success Notice */
.notice {
    margin: 20px 0;
    padding: 16px 20px;
    border-left: 4px solid var(--hpbm-pink);
    background: #fef9fa;
    border-radius: 4px;
    font-size: 14px;
}

.notice p {
    margin: 0;
    color: var(--hpbm-dark);
}

/* Responsive */
@media (max-width: 768px) {
    .hpbm-form-container {
        padding: 20px;
    }

    .hpbm-form-wrapper,
    .hpbm-products-list-wrapper {
        padding: 24px;
    }

    .hpbm-form-container h2 {
        font-size: 28px;
        margin-bottom: 24px;
    }

    .hpbm-variation-row {
        grid-template-columns: 1fr;
    }

    .hpbm-variation-row input[type="number"] {
        grid-column: auto;
    }

    .hpbm-variation-row button {
        grid-column: auto;
    }

    .hpbm-product-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .hpbm-product-type {
        align-self: flex-start;
    }

    #hpbm-finalize-section {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .hpbm-form-container h2 {
        font-size: 24px;
    }

    .hpbm-form-wrapper,
    .hpbm-products-list-wrapper {
        padding: 16px;
    }

    .hpbm-form-group {
        gap: 8px;
    }

    .button,
    .hpbm-form button[type="submit"] {
        width: 100%;
        padding: 12px 20px;
    }
}

/* ---------------------------------------------------------------------------
   v1.1 additions: new button classes, feedback states, price + hints
   --------------------------------------------------------------------------- */

.hpbm-intro {
    color: var(--hpbm-text-light);
    margin: -24px 0 32px 0;
    font-size: 15px;
    line-height: 1.6;
}

.hpbm-hint {
    font-weight: 400;
    font-size: 12px;
    color: var(--hpbm-text-light);
}

/* Primary action buttons (submit / finalize already styled by ID; this
   covers the generic class so nothing renders unstyled). */
.hpbm-btn-primary {
    display: inline-block;
    background: var(--hpbm-teal);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 14px 28px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
}
.hpbm-btn-primary:hover { background: #4a1a2a; }
.hpbm-btn-primary:active { transform: translateY(1px); }
.hpbm-btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.hpbm-btn-secondary {
    display: inline-block;
    background: #fff;
    color: var(--hpbm-teal);
    border: 1px solid var(--hpbm-teal);
    border-radius: 6px;
    padding: 10px 18px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}
.hpbm-btn-secondary:hover { background: rgba(48, 120, 132, 0.08); }

.hpbm-btn-small {
    display: inline-block;
    background: #fff;
    color: var(--hpbm-text);
    border: 1px solid var(--hpbm-border);
    border-radius: 4px;
    padding: 6px 12px;
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
}
.hpbm-btn-small:hover {
    border-color: var(--hpbm-pink);
    color: var(--hpbm-pink);
}

/* Inline submit feedback */
.hpbm-form-status {
    display: inline-block;
    margin-left: 14px;
    font-size: 14px;
    font-weight: 600;
    vertical-align: middle;
}
.hpbm-form-status.is-working { color: var(--hpbm-text-light); }
.hpbm-form-status.is-success { color: var(--hpbm-teal); }
.hpbm-form-status.is-error   { color: #c0392b; }

.hpbm-field-error {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: #c0392b;
}

.hpbm-empty {
    color: var(--hpbm-text-light);
    font-style: italic;
}

/* Finalized / status notices */
.hpbm-notice {
    border-radius: 6px;
    padding: 16px 20px;
    margin-bottom: 24px;
    font-size: 15px;
    font-weight: 500;
}
.hpbm-notice-success {
    background: rgba(48, 120, 132, 0.1);
    color: var(--hpbm-teal);
    border-left: 4px solid var(--hpbm-teal);
}

/* ---------------------------------------------------------------------------
   v1.2 additions: batch name, category dropdowns, size dropdowns, edit actions
   --------------------------------------------------------------------------- */

.hpbm-batchname-wrapper {
    background: #fff;
    border-radius: 8px;
    padding: 24px 40px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-top: 3px solid var(--hpbm-teal);
}
#hpbm-batch-name {
    font-size: 18px;
    font-weight: 600;
}

/* Two-up rows for category / sub-category */
.hpbm-form-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}
.hpbm-form-row .hpbm-form-group {
    flex: 1;
    min-width: 220px;
}

/* Selects styled to match inputs */
.hpbm-form select,
#hpbm-category,
#hpbm-subcategory {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--hpbm-border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 15px;
    background: #fff;
    color: var(--hpbm-text);
}
.hpbm-form select:focus {
    border-color: var(--hpbm-teal);
    outline: none;
}
.hpbm-other-input {
    margin-top: 8px;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--hpbm-border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 15px;
}

/* Variation rows: size dropdown + optional "other" + price + remove */
.hpbm-variation-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.hpbm-variation-size-select {
    flex: 1;
    min-width: 160px;
    padding: 10px 12px;
    border: 1px solid var(--hpbm-border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    background: #fff;
}
.hpbm-variation-size-other {
    flex: 1;
    min-width: 140px;
    padding: 10px 12px;
    border: 1px solid var(--hpbm-border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
}
.hpbm-variation-row input[name="price"] {
    width: 110px;
    padding: 10px 12px;
    border: 1px solid var(--hpbm-border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
}

/* Edit / remove buttons under each saved product */
.hpbm-product-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

#hpbm-cancel-edit-btn {
    margin-left: 8px;
}

/* Batch name save status */
#hpbm-batchname-status {
    margin-left: 0;
    margin-top: 6px;
    display: block;
}

/* v1.4: info notice (login prompt) */
.hpbm-notice-info {
    background: rgba(50, 16, 27, 0.06);
    color: var(--hpbm-teal);
    border-left: 4px solid var(--hpbm-teal);
}
.hpbm-notice-info .hpbm-btn-primary { margin-top: 10px; text-decoration: none; }
