/* =========================================================
   Windejsi Wholesale – Frontend Styles
   Designed to match the Windejsi.cz dark design system.
   Uses .wdj-* class conventions from the child theme / landing page.
   ========================================================= */

/* ---- Portal wrapper ---- */

.wh-portal {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #e4e4e7;
    -webkit-font-smoothing: antialiased;
}

/* =========================================================
   State A – Logged out
   ========================================================= */

.wh-portal--logged-out {
    text-align: center;
    padding: 64px 20px;
}

.wh-portal--logged-out .wh-portal__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: rgba(253, 218, 71, 0.1);
    border: 1px solid rgba(253, 218, 71, 0.2);
    color: #FDDA47;
    font-size: 24px;
    margin-bottom: 24px;
}

.wh-portal--logged-out h2 {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 12px;
}

.wh-portal--logged-out p {
    font-size: 16px;
    color: #a1a1aa;
    max-width: 460px;
    margin: 0 auto 32px;
    line-height: 1.7;
}

.wh-portal__btn-group {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* =========================================================
   State B pending – application waiting
   ========================================================= */

.wh-portal--pending {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 28px;
    background: rgba(253, 218, 71, 0.06);
    border: 1px solid rgba(253, 218, 71, 0.18);
    border-radius: 14px;
}

.wh-portal--pending .wh-pending__icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(253, 218, 71, 0.12);
    border: 1px solid rgba(253, 218, 71, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FDDA47;
    font-size: 18px;
}

.wh-portal--pending p {
    margin: 0;
    font-size: 15px;
    color: #e4e4e7;
    line-height: 1.6;
}

/* =========================================================
   State B form – registration form
   ========================================================= */

.wh-portal--form {
    max-width: 560px;
}

.wh-portal--form .wh-form__header {
    margin-bottom: 32px;
}

.wh-portal--form .wh-form__header h2 {
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    margin: 12px 0 8px;
    letter-spacing: -0.01em;
}

.wh-portal--form .wh-form__header p {
    font-size: 15px;
    color: #a1a1aa;
    margin: 0;
    line-height: 1.6;
}

/* Error list */
.wh-form__errors {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 24px;
}

.wh-form__errors li {
    list-style: none;
    font-size: 14px;
    color: #fca5a5;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wh-form__errors li::before {
    content: "✕";
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
    color: #f87171;
}

/* Success message */
.wh-form__success {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 24px;
    font-size: 14px;
    color: #4ade80;
}

.wh-form__success::before {
    content: "✓";
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
}

/* Form card */
.wh-application-form {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 16px;
    padding: 32px;
}

/* Form rows */
.wh-form__row {
    margin-bottom: 20px;
}

.wh-form__row:last-of-type {
    margin-bottom: 0;
}

.wh-form__row label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #a1a1aa;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.wh-form__row label .required-star {
    color: #FDDA47;
    margin-left: 2px;
}

.wh-form__row input,
.wh-form__row select {
    width: 100%;
    padding: 11px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    font-size: 15px;
    color: #e4e4e7;
    font-family: inherit;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}

.wh-form__row select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23a1a1aa' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

.wh-form__row input::placeholder {
    color: #52525b;
}

.wh-form__row input:focus,
.wh-form__row select:focus {
    outline: none;
    border-color: rgba(253, 218, 71, 0.5);
    background: rgba(253, 218, 71, 0.04);
    box-shadow: 0 0 0 3px rgba(253, 218, 71, 0.08);
    color: #fff;
}

.wh-form__row select option {
    background: #1a1a1a;
    color: #e4e4e7;
}

.wh-form__hint {
    font-size: 12px;
    color: #52525b;
    margin-top: 5px;
}

.wh-form__row--2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.wh-form__submit {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.wh-form__submit .wdj-btn {
    width: 100%;
    text-align: center;
    font-size: 15px;
    padding: 13px 24px;
}

/* =========================================================
   State C – Wholesale catalog
   ========================================================= */

.wh-catalog {
    width: 100%;
}

.wh-catalog__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.wh-catalog__header-left h2 {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    margin: 8px 0 0;
    letter-spacing: -0.01em;
}

.wh-catalog__header-left p {
    font-size: 14px;
    color: #71717a;
    margin: 4px 0 0;
}

/* Sort control */
.wh-catalog__sort {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.wh-catalog__sort-label {
    font-size: 13px;
    color: #71717a;
    white-space: nowrap;
}

.wh-sort-select {
    padding: 8px 36px 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23a1a1aa' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #e4e4e7;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 0.2s ease;
}

.wh-sort-select:focus {
    outline: none;
    border-color: rgba(253, 218, 71, 0.4);
}

.wh-sort-select option {
    background: #1a1a1a;
    color: #e4e4e7;
}

/* Table */
.wh-catalog__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    color: #e4e4e7;
}

.wh-catalog__table thead tr {
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.wh-catalog__table thead th {
    text-align: left;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #71717a;
    white-space: nowrap;
}

.wh-catalog__table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.15s ease;
}

.wh-catalog__table tbody tr:last-child {
    border-bottom: none;
}

.wh-catalog__table tbody tr:hover {
    background: rgba(255, 255, 255, 0.025);
}

.wh-catalog__table td {
    padding: 14px 16px;
    vertical-align: middle;
}

/* Product name */
.wh-product-name {
    font-weight: 500;
    color: #e4e4e7;
}

.wh-product-name a {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s ease;
}

.wh-product-name a:hover {
    color: #FDDA47;
}

/* Price */
.wh-price del {
    color: #52525b;
    font-size: 12px;
    margin-right: 6px;
    text-decoration: line-through;
}

.wh-price ins {
    text-decoration: none;
    font-weight: 700;
    color: #FDDA47;
    font-size: 15px;
}

/* Stock */
.wh-stock--instock {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #4ade80;
    font-size: 12px;
    font-weight: 600;
}

.wh-stock--instock::before {
    content: "";
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4ade80;
    flex-shrink: 0;
}

.wh-stock--outofstock {
    color: #71717a;
    font-size: 12px;
}

/* Quantity input */
.wh-qty {
    width: 68px;
    padding: 7px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #e4e4e7;
    font-size: 14px;
    text-align: center;
    font-family: inherit;
    transition: border-color 0.2s ease;
    -moz-appearance: textfield;
}

.wh-qty::-webkit-outer-spin-button,
.wh-qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.wh-qty:focus {
    outline: none;
    border-color: rgba(253, 218, 71, 0.4);
}

/* Add to cart button */
.wh-atc-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px !important;
    white-space: nowrap;
    transition: transform 0.15s ease, opacity 0.15s ease, background 0.2s ease !important;
    background: rgba(253, 218, 71, 0.1) !important;
    border: 1px solid rgba(253, 218, 71, 0.25) !important;
    color: #FDDA47 !important;
    text-decoration: none;
    box-shadow: none !important;
}

.wh-atc-btn:hover {
    background: rgba(253, 218, 71, 0.18) !important;
    border-color: rgba(253, 218, 71, 0.45) !important;
    color: #FDDA47 !important;
    transform: translateY(-1px);
}

.wh-atc-btn:disabled,
.wh-atc-btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.wh-atc-btn--added {
    background: rgba(34, 197, 94, 0.12) !important;
    border-color: rgba(34, 197, 94, 0.3) !important;
    color: #4ade80 !important;
}

/* Variation link */
.wh-atc-btn--variation {
    background: rgba(255, 255, 255, 0.04) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #a1a1aa !important;
}

.wh-atc-btn--variation:hover {
    background: rgba(255, 255, 255, 0.07) !important;
    color: #e4e4e7 !important;
}

/* Bulk add button */
.wh-bulk-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 10px !important;
    white-space: nowrap;
    background: linear-gradient(135deg, #FDDA47, #f59e0b) !important;
    border: none !important;
    color: #0b0b0c !important;
    box-shadow: 0 4px 16px rgba(253, 218, 71, 0.2) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

.wh-bulk-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(253, 218, 71, 0.3) !important;
    color: #0b0b0c !important;
}

.wh-bulk-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Empty state */
.wh-catalog__empty {
    padding: 48px 20px;
    text-align: center;
    color: #71717a;
    font-size: 15px;
}

/* =========================================================
   Toast notification
   ========================================================= */

.wh-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    z-index: 99999;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    max-width: 340px;
}

.wh-toast--visible {
    opacity: 1;
    transform: translateY(0);
}

.wh-toast--success {
    background: rgba(20, 20, 22, 0.95);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #4ade80;
}

.wh-toast--error {
    background: rgba(20, 20, 22, 0.95);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 768px) {
    .wh-form__row--2col {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .wh-application-form {
        padding: 20px;
    }

    .wh-catalog__header {
        flex-direction: column;
        align-items: flex-start;
    }

    .wh-bulk-btn {
        width: 100%;
        justify-content: center;
    }

    .wh-catalog__table thead {
        display: none;
    }

    .wh-catalog__table tbody tr {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0;
        padding: 14px 0;
    }

    .wh-catalog__table td {
        padding: 4px 12px;
    }

    .wh-catalog__table td::before {
        content: attr(data-label);
        display: block;
        font-size: 11px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: #52525b;
        margin-bottom: 3px;
    }

    .wh-portal--logged-out {
        padding: 40px 16px;
    }
}

@media (max-width: 480px) {
    .wh-portal__btn-group {
        flex-direction: column;
        align-items: stretch;
    }

    .wh-portal__btn-group .wdj-btn {
        text-align: center;
        width: 100%;
    }

    .wh-catalog__table tbody tr {
        grid-template-columns: 1fr;
    }
}
