/* Create Custom Offer Modal
   Shared by every page that renders brand/cart/createOffer.html (creator profile,
   campaign applicants). Keep it here, not in a page stylesheet, so the modal looks
   the same wherever it is opened. */

.create-offer-input {
    width: calc(100% - var(--space-2-5));
}

select.create-offer-input {
    width: 100%;
}

/* .package-content-type-select is also a profile-edit class, and profile/edit.css bolds it there.
   The modal is rendered on pages that load that stylesheet, so state the weight it should have. */
.offer-modal-left .package-content-type-select {
    font-weight: var(--font-weight-normal);
}

/* Sized with flex basis, not width: pages that also load profile/edit.css (campaign
   applicants) get `select { width: 100% !important }` from it, which would otherwise push
   the unit select onto its own line. */
.duration-inputs {
    display: flex;
    gap: var(--space-1);
}

.create-offer-duration-input {
    flex: 1 1 auto;
    min-width: 0;
}

.create-offer-duration-unit-input {
    flex: 0 0 30%;
}

.input-section {
    margin-bottom: var(--space-8);
}

.offer-bottom-txt {
    font-size: var(--font-size-xs);
    margin-top: var(--space-2);
    margin-bottom: var(--space-5);
}

/* Modal Two-Column Layout */

.modal:has(.offer-modal-columns) {
    justify-content: center;
}

/* !important is load-bearing: showModal() writes the holder's width as an INLINE style
   (`showModal(data.html, 'initial')` on applicants, and hideModal() stamps 500px on every close),
   and no selector specificity beats an inline style. Without it the modal collapses to min-width. */
.modal-content-holder:has(.offer-modal-columns) {
    width: 900px !important;
    max-width: 95vw;
    padding: var(--space-0);
    border-radius: var(--radius-xl);
    margin: var(--space-5) auto;
}

.add-offer-form {
    margin: var(--space-0);
    padding: var(--space-0);
    width: 100%;
    height: 100%;
}

.offer-modal-columns {
    display: flex;
    gap: var(--space-0);
    width: 100%;
    min-height: 500px;
    border-radius: var(--radius-xl);
    position: relative;
}

.offer-close-btn {
    position: absolute;
    top: var(--space-5);
    right: var(--space-5);
    z-index: var(--ds-z-raised);
}

.offer-close-btn .close-modal-img {
    background-color: var(--color-bg-primary);
}

.offer-modal-left {
    flex: 1;
    padding: var(--space-6) var(--space-10) var(--space-8);
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-xl) 0 0 var(--radius-xl);
    background-color: var(--color-bg-primary);
}

.offer-modal-header {
    padding: var(--space-6) var(--space-12);
}

.offer-modal-title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-default);
    text-align: center;
}

.offer-modal-left .add-to-cart-btn {
    width: 100%;
    margin-top: auto;
}

.offer-modal-right {
    flex: 1;
    padding: var(--space-8) var(--space-10);
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
    background: var(--offer-modal-steps-bg);
    margin: var(--space-0);
    border-radius: 0 var(--radius-xl) var(--radius-xl) 0;
    justify-content: center;
}

/* Workflow Steps */
.offer-workflow-step {
    display: flex;
    gap: var(--space-4);
    align-items: center;
}

.offer-step-number {
    width: var(--size-8);
    height: var(--size-8);
    border-radius: var(--radius-full);
    border: var(--border-width-1) solid var(--color-text-inverse);
    color: var(--color-text-inverse);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    flex-shrink: 0;
}

.offer-step-icon {
    width: var(--size-8);
    height: var(--size-8);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.offer-step-icon svg {
    width: var(--size-6);
    height: var(--size-6);
    color: var(--color-text-inverse);
}

.offer-step-content {
    flex: 1;
}

.offer-step-title {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-inverse);
    margin-bottom: var(--space-1);
}

.offer-step-description {
    font-size: var(--font-size-sm);
    color: var(--offer-modal-steps-text-subtle);
    line-height: var(--line-height-normal);
}

/* Mobile Responsive Styles */
@media (max-width: 800px) {
    .modal:has(.offer-modal-columns) {
        justify-content: flex-start;
    }

    .modal-content-holder:has(.offer-modal-columns) {
        width: 90vw;
        margin: var(--space-5) auto;
    }

    .offer-modal-columns {
        flex-direction: column;
        gap: var(--space-0);
        min-height: auto;
    }

    .offer-modal-left {
        padding: var(--space-0) var(--space-5) var(--space-5);
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    }

    .offer-modal-right {
        padding: var(--space-10) var(--space-5);
        border-radius: 0 0 var(--radius-xl) var(--radius-xl);
        background: var(--offer-modal-steps-bg-stacked);
        justify-content: flex-start;
    }

    .offer-workflow-step {
        gap: var(--space-3);
    }

    .offer-step-number,
    .offer-step-icon {
        width: var(--space-7);
        height: var(--space-7);
    }

    .offer-step-number {
        font-size: var(--font-size-sm);
    }

    .offer-step-icon svg {
        width: var(--size-5);
        height: var(--size-5);
    }

    .offer-modal-header {
        padding: var(--space-6) var(--space-5);
    }

    .offer-modal-left .create-offer-input,
    .offer-modal-left .create-offer-duration-input,
    .offer-modal-left .create-offer-duration-unit-input,
    .offer-modal-left .requirement-title {
        font-size: var(--font-size-sm);
    }

    .offer-step-description {
        font-size: var(--font-size-xs);
    }
}