/**
 * Med4All Vendor Module - Vendor-specific CSS
 */

/* Vendor login - Forgot Your Password on new line below Sign In button */
.login-container .actions-toolbar {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.login-container .actions-toolbar .primary {
    margin-bottom: 0.5rem;
}
.login-container .actions-toolbar .action-remind-wrap {
    display: block;
    width: 100%;
    margin-top: 0.5rem;
    clear: both;
}

/* Hide Recently Ordered block on vendor products page - Very aggressive selectors */
body.vendor-account-products .block-dashboard-orders,
body.vendor-account-products .block.block-dashboard-orders,
body.vendor-account-products .customer_account_dashboard_top,
body.vendor-account-products .block-reorder,
body.vendor-account-products [data-block="reorder"],
body.vendor-account-products .block.block-reorder,
body.vendor-account-products .block-dashboard-recent,
body.vendor-account-products .block.block-dashboard-recent,
body.vendor-account-products [name="Recently Ordered"],
body.vendor-account-products .block.block-order-recent,
body.vendor-account-products .block-order-recent,
body.vendor-account-products .sales-order-recent,
body.vendor-account-products .block-sales-order-recent,
body.vendor-account-products main h2,
body.vendor-account-products main > div > div > h2,
body.vendor-account-products main > div > div > div > h2 {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 0 !important;
    opacity: 0 !important;
}

/* Hide the entire container that holds Recently Ordered - target by structure and role */
body.vendor-account-products main > div > div[role="generic"]:last-child,
body.vendor-account-products main > div > div:last-child,
body.vendor-account-products main > div > div:has(> div > h2),
body.vendor-account-products main > div > div:has([name="Recently Ordered"]) {
    display: none !important;
}

/* Hide Compare Products block on vendor pages - Multiple selectors for maximum coverage */
.block-compare,
[data-role="compare-products-sidebar"],
.catalog.compare.sidebar,
div.block.block-compare,
.sidebar-additional .block-compare,
.sidebar-additional [data-role="compare-products-sidebar"],
.sidebar-additional .block-compare,
.sidebar .block-compare,
.sidebar-additional div[data-role="compare-products-sidebar"],
div[data-role="compare-products-sidebar"],
.block.block-compare,
#block-compare-heading,
.block-compare * {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 0 !important;
    opacity: 0 !important;
}

/* Vendor Products Filters */
.vendor-products-filters {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f5f5f5;
    border-radius: 4px;
}

.vendor-filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.vendor-filter-form .filter-group {
    flex: 1;
    min-width: 150px;
}

.vendor-filter-form .filter-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.vendor-filter-form .filter-group input,
.vendor-filter-form .filter-group select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

.vendor-filter-form .filter-actions {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
}

.vendor-filter-form .filter-actions .action {
    padding: 0.5rem 1.5rem;
    border-radius: 4px;
    text-decoration: none;
    display: inline-block;
    font-weight: 600;
}

.vendor-filter-form .filter-actions .action.primary {
    background: #1979c3;
    color: #fff;
    border: none;
}

.vendor-filter-form .filter-actions .action.primary:hover {
    background: #1565a0;
}

.vendor-filter-form .filter-actions .action.secondary {
    background: #fff;
    color: #1979c3;
    border: 1px solid #1979c3;
}

.vendor-filter-form .filter-actions .action.secondary:hover {
    background: #f5f5f5;
}

/* Vendor Products Table */
.vendor-products .table-wrapper {
    margin-top: 2rem;
    overflow-x: auto;
}

.vendor-products table {
    width: 100%;
    border-collapse: collapse;
}

.vendor-products table th {
    background: #f5f5f5;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #ddd;
}

.vendor-products table td {
    padding: 1rem;
    border-bottom: 1px solid #eee;
}

.vendor-products table .status.enabled {
    color: #008000;
    font-weight: 600;
}

.vendor-products table .status.disabled {
    color: #cc0000;
    font-weight: 600;
}

.vendor-products table .col.actions {
    white-space: nowrap;
}

.vendor-products table .col.actions .action {
    margin-right: 1rem;
    text-decoration: none;
}

.vendor-products table .col.actions .action.edit {
    color: #1979c3;
}

.vendor-products table .col.actions .action.delete {
    color: #cc0000;
}

/* Vendor Orders list - action buttons aligned like B2B order requests */
.vendor-orders table {
    width: 100%;
    border-collapse: collapse;
}

.vendor-orders table th {
    background: #f5f5f5;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #ddd;
}

.vendor-orders table td {
    padding: 1rem;
    border-bottom: 1px solid #eee;
}

.vendor-orders table .col.actions {
    white-space: normal;
    text-align: right;
    vertical-align: middle;
}

/* Unified supplier order actions (list + detail): same footprint, aligned text */
.supplier-order-actions--inline {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: flex-end;
    gap: 0.5rem;
    max-width: 100%;
}

.supplier-order-view .section-actions .supplier-order-actions--toolbar.actions-toolbar {
    width: 100%;
    padding: 0;
    margin: 0;
}

.supplier-order-view .supplier-order-actions--toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.supplier-order-view .supplier-order-actions--toolbar .supplier-order-action {
    flex: 0 0 auto;
}

a.supplier-order-action,
a.supplier-order-action:visited {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-height: 4rem;
    min-width: 9.5rem;
    padding: 0 1.4rem;
    font-size: 1.4rem;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
    border-radius: 4px;
    border-style: solid;
    border-width: 1px;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

a.supplier-order-action span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: inherit;
    font-weight: inherit;
    line-height: 1.25;
}

/* Primary — filled */
a.supplier-order-action.action.primary {
    background: #1979c3;
    border-color: #1979c3;
    color: #fff;
}

a.supplier-order-action.action.primary:hover {
    background: #1565a0;
    border-color: #1565a0;
    color: #fff;
}

/* Secondary — outline brand */
a.supplier-order-action.action.secondary {
    background: #fff;
    border-color: #1979c3;
    color: #1979c3;
}

a.supplier-order-action.action.secondary:hover {
    background: #f0f8ff;
    border-color: #1565a0;
    color: #1565a0;
}

/* Tertiary — neutral outline (View, Back) — same size as primary/secondary */
a.supplier-order-action.action.tertiary {
    background: #fff;
    border-color: #c2c2c2;
    color: #333;
}

a.supplier-order-action.action.tertiary:hover {
    background: #f5f5f5;
    border-color: #999;
    color: #000;
}

/*
 * Supplier order detail: undo Luma/actions-toolbar rules that misalign .action.secondary
 * (margin-top on secondary links, inline-block, theme font-size on .action).
 */
.supplier-order-view .section-actions .supplier-order-actions--toolbar.actions-toolbar a.supplier-order-action,
.supplier-order-view .section-actions .supplier-order-actions--toolbar.actions-toolbar a.supplier-order-action:visited {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    vertical-align: middle;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.4rem !important;
    font-weight: 600 !important;
    line-height: 1.25 !important;
}

.supplier-order-view .section-actions .supplier-order-actions--toolbar.actions-toolbar a.supplier-order-action span {
    font-size: 1.4rem !important;
    font-weight: 600 !important;
    line-height: 1.25 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Orders list: same typography / vertical centering for secondary (Cancel) vs theme .action rules */
.vendor-orders .supplier-order-actions--inline a.supplier-order-action span {
    font-size: inherit;
    font-weight: inherit;
    line-height: 1.25;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.supplier-order-cancellation-reason {
    display: block;
    margin-top: 0.35rem;
    font-size: 90%;
    line-height: 1.35;
}

.supplier-order-cancellation-reason .label {
    font-weight: 600;
    margin-right: 0.25rem;
}

/* Pagination toolbar (Magento Theme pager) — supplier/account/orders */
.toolbar-supplier-orders.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e0e0e0;
}

.toolbar-supplier-orders.toolbar.bottom {
    margin-top: 1rem;
    margin-bottom: 0;
    padding-top: 1rem;
    border-bottom: none;
    border-top: 1px solid #e0e0e0;
}

.toolbar-supplier-orders .pager {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.toolbar-supplier-orders .pager .toolbar-amount {
    margin: 0;
}

.toolbar-supplier-orders .pager .limiter {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.toolbar-supplier-orders .pager .pages {
    margin: 0.25rem 0;
}

/* Supplier Order view sections */
.supplier-order-view .section {
    margin-bottom: 1.5rem;
    border-radius: 4px;
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
}

.supplier-order-view .section-inner {
    padding: 1.5rem;
}

.supplier-order-view .supplier-order-header .meta {
    margin-top: 1rem;
}

.supplier-order-view .meta-row {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
    border-bottom: 1px solid #e0e0e0;
}

.supplier-order-view .meta-row:last-child {
    border-bottom: none;
}

.supplier-order-view .meta-row .label {
    font-weight: 600;
    color: #555;
}

.supplier-order-view .meta-row .value {
    color: #222;
}

.supplier-order-view .section-title {
    margin-bottom: 1rem;
}

.supplier-order-view .section-actions .actions-toolbar .action.secondary {
    background: #fff;
    color: #1979c3;
    padding: 0.4rem 1.2rem;
    border-radius: 4px;
    border: 1px solid #1979c3;
    text-decoration: none;
}

.supplier-order-view .section-actions .actions-toolbar .action.secondary:hover {
    background: #f5f5f5;
}

/* Hide Search and Shopping Cart for vendor users - CSS fallback */
/* Note: Blocks are removed via plugin, but this ensures they're hidden if they somehow render */
body.vendor-user .block-search,
body.vendor-user .top.search,
body.vendor-user #search,
body.vendor-user .minicart-wrapper,
body.vendor-user .minicart,
body.vendor-user [data-block="minicart"] {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 0 !important;
    opacity: 0 !important;
}

/* Supplier session: hide guest auth links in header panel ("Sign In", "Create Business Account"). */
body.vendor-user .header.panel > .header.links > li.authorization-link,
body.vendor-user .header.panel > .header.links > li.customer-register-link,
body.vendor-user .header.panel > .header.links > li > a[href*="customer/account/login"],
body.vendor-user .header.panel > .header.links > li > a[href*="customer/account/create"] {
    display: none !important;
}

/* Supplier partial ship form — alternating row backgrounds */
.supplier-ship-form .supplier-ship-lines tbody tr:nth-child(odd) {
    background-color: #fff;
}
.supplier-ship-form .supplier-ship-lines tbody tr:nth-child(even) {
    background-color: #f3f3f3;
}
.supplier-ship-form .supplier-ship-lines tbody tr:hover {
    background-color: #e8f4fc;
}

/* Supplier order view — Ship-to + Initiator side-by-side cards */
.supplier-order-view .section-customer .customer-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: stretch;
}
.supplier-order-view .section-customer .customer-card {
    flex: 1 1 280px;
    min-width: 240px;
    background: #f8f9fa;
    border: 1px solid #e6e6e6;
    border-radius: 4px;
    padding: 16px 20px;
}
.supplier-order-view .section-customer .customer-card .card-title {
    margin: 0 0 12px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}
.supplier-order-view .section-customer .customer-card address.card-body {
    font-style: normal;
    line-height: 1.45;
}
.supplier-order-view .section-customer .customer-card dl.card-body {
    margin: 0;
    display: grid;
    grid-template-columns: max-content 1fr;
    column-gap: 12px;
    row-gap: 6px;
}
.supplier-order-view .section-customer .customer-card dl.card-body dt {
    font-weight: 600;
    color: #555;
}
.supplier-order-view .section-customer .customer-card dl.card-body dd {
    margin: 0;
}
.supplier-order-view .section-customer .customer-card a {
    color: #1a4480;
    text-decoration: none;
}
.supplier-order-view .section-customer .customer-card a:hover {
    text-decoration: underline;
}
@media (max-width: 640px) {
    .supplier-order-view .section-customer .customer-grid {
        flex-direction: column;
    }
}
