/* ==========================================================================
   Vendor Pay - Product Page Vendor Block
   ========================================================================== */

.wavp-vendor-block {
    margin: 1.75rem 0;
    direction: rtl;
}

.wavp-vendor-block * {
    box-sizing: border-box;
}

.wavp-section {
    margin-bottom: 2rem;
}

.wavp-section__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0 0.5rem;
}

.wavp-section__title {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    color: #1f2937;
    font-size: 1.08rem;
    font-weight: 800;
    line-height: 1.5;
}

.wavp-section__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    color: #6b7280;
}

.wavp-section__icon svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.wavp-section__count {
    color: #6b7280;
    font-size: 0.86rem;
    font-weight: 500;
    white-space: nowrap;
}

.wavp-vendor-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.wavp-card {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    overflow: hidden;
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.wavp-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 10px 20px -14px rgba(15, 23, 42, 0.34);
    transform: translateY(-1px);
}

.wavp-card--selected {
    border-width: 2px;
    border-color: rgba(var(--wavp-primary-color-rgb, 38, 194, 196), 0.45);
    box-shadow: 0 10px 22px -16px rgba(var(--wavp-primary-color-rgb, 38, 194, 196), 0.42);
}

.wavp-card__highlight {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 0.38rem;
    background: var(--wavp-primary-color, #26c2c4);
}

.wavp-card__body {
    flex: 1 1 auto;
    min-width: 0;
}

.wavp-card__header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.wavp-card__name {
    color: #111827;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.5;
}

.wavp-card__label {
    display: inline-flex;
    align-items: center;
    min-height: 1.45rem;
    padding: 0.1rem 0.55rem;
    border: 1px solid #e0e7ff;
    border-radius: 0.38rem;
    background: #eef2ff;
    color: #4f46e5;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1.4;
}

.wavp-card__label--best {
    border-color: #bfdbfe;
    background: #dbeafe;
    color: #1d4ed8;
}

.wavp-card__label--selected {
    border-color: transparent;
    background: #f3f4f6;
    color: #4b5563;
}

.wavp-card__desc {
    margin: 0 0 0.45rem;
    color: #6b7280;
    font-size: 0.78rem;
    line-height: 1.7;
}

.wavp-card__desc p{
    font-size: 0.78rem;
}

.wavp-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.75rem;
    margin-top: 0.5rem;
}

.wavp-card__meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: #6b7280;
    font-size: 0.78rem;
    line-height: 1.5;
}

.wavp-card__meta-item svg {
    width: 1rem;
    height: 1rem;
    flex: 0 0 auto;
}

.wavp-card__meta-item--stock svg {
    color: #10b981;
}

.wavp-card__meta-item--stock {
    color: #059669;
    font-weight: 600;
}

.wavp-card__meta-item--shipping svg {
    color: #9ca3af;
}

.wavp-card__meta-item--perf {
    color: #6b7280;
}

.wavp-card__aside {
    display: flex;
    flex: 0 0 12rem;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 0.65rem;
    text-align: left;
}

.wavp-card__price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.1rem;
}

.wavp-card__discount-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.wavp-card__discount-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.4rem;
    border-radius: 0.25rem;
    background: #fee2e2;
    color: #dc2626;
    font-size: 0.7rem;
    font-weight: 800;
}

.wavp-card__regular-price {
    color: #9ca3af;
    font-size: 0.86rem;
    text-decoration: line-through;
    white-space: nowrap;
}

.wavp-card__final-price {
    color: #111827;
    font-size: 1.25rem;
    font-weight: 900;
    letter-spacing: 0;
    white-space: nowrap;
}

.wavp-add-to-cart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    width: auto;
    min-width: 10.75rem;
    min-height: 2.65rem;
    padding: 0.55rem 1.5rem;
    border: 1px solid transparent;
    border-radius: 0.75rem;
    font-size: 0.86rem;
    font-weight: 800;
    line-height: 1.4;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.wavp-add-to-cart svg {
    width: 1.2rem;
    height: 1.2rem;
    flex: 0 0 auto;
}

.wavp-add-to-cart--primary {
    border-color: var(--wavp-primary-color, #26c2c4);
    background: var(--wavp-primary-color, #26c2c4);
    color: #fff;
    box-shadow: 0 8px 18px -12px rgba(var(--wavp-primary-color-rgb, 38, 194, 196), 0.7);
}

.wavp-add-to-cart--primary:hover,
.wavp-add-to-cart--primary:focus {
    border-color: var(--wavp-primary-color-hover, #1fa4a6);
    background: var(--wavp-primary-color-hover, #1fa4a6);
    color: #fff;
}

.wavp-add-to-cart--outline {
    border-color: var(--wavp-primary-color, #26c2c4);
    background: #fff;
    color: var(--wavp-primary-color, #26c2c4);
}

.wavp-add-to-cart--outline:hover,
.wavp-add-to-cart--outline:focus {
    background: var(--wavp-primary-color, #26c2c4);
    color: #fff;
}

.wavp-add-to-cart.is-loading {
    cursor: wait;
    opacity: 0.72;
}

@media (max-width: 768px) {
    .wavp-card {
        align-items: stretch;
        flex-direction: column;
        padding: 1rem;
    }

    .wavp-card__aside {
        width: 100%;
        flex: 0 0 auto;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        padding-top: 1rem;
        border-top: 1px solid #f3f4f6;
    }

    .wavp-card__price {
        align-items: flex-end;
    }

    .wavp-add-to-cart {
        width: min(48%, 12rem);
        min-width: 0;
    }
}

@media (max-width: 480px) {
    .wavp-section__header {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.25rem;
    }

    .wavp-card__aside {
        flex-direction: row;
        align-items: center;
    }

    .wavp-card__price {
        align-items: flex-end;
    }

    .wavp-add-to-cart {
        width: 50%;
    }
}

/* --- Vendor change modal --- */
.wavp-vendor-modal {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: none;
    align-items: flex-end;
    justify-content: center;
}

.wavp-vendor-modal.is-visible {
    display: flex;
}

.wavp-vendor-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.62);
    backdrop-filter: blur(2px);
}

.wavp-vendor-modal__dialog {
    position: relative;
    z-index: 1;
    display: flex;
    width: 100%;
    max-height: 90vh;
    flex-direction: column;
    overflow: hidden;
    border-radius: 1.5rem 1.5rem 0 0;
    background: #fff;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.22);
    direction: rtl;
    animation: wavp-modal-slide-up 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@media (min-width: 768px) {
    .wavp-vendor-modal {
        align-items: center;
        padding: 1rem;
    }

    .wavp-vendor-modal__dialog {
        width: min(672px, 100%);
        border-radius: 1rem;
        animation-name: wavp-modal-in;
        animation-duration: 0.2s;
    }
}

@keyframes wavp-modal-slide-up {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

@keyframes wavp-modal-in {
    from {
        opacity: 0;
        transform: scale(0.96);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.wavp-vendor-modal__handle {
    display: flex;
    justify-content: center;
    padding: 0.75rem 0 0.25rem;
}

.wavp-vendor-modal__handle span {
    display: block;
    width: 3rem;
    height: 0.38rem;
    border-radius: 999px;
    background: #e5e7eb;
}

@media (min-width: 768px) {
    .wavp-vendor-modal__handle {
        display: none;
    }
}

.wavp-vendor-modal__header {
    position: relative;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f3f4f6;
}

.wavp-vendor-modal__title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.wavp-vendor-modal__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 999px;
    background: #eff6ff;
    color: #3b82f6;
}

.wavp-vendor-modal__icon svg,
.wavp-vendor-modal__arrow svg,
.wavp-vendor-modal__delta svg,
.wavp-vendor-modal__primary svg {
    width: 1.25rem;
    height: 1.25rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.wavp-vendor-modal__title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 900;
    color: #1f2937;
}

.wavp-vendor-modal__close {
    position: absolute;
    top: 0.85rem;
    inset-inline-end: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.wavp-vendor-modal__close:hover,
.wavp-vendor-modal__close:focus {
    background: #f3f4f6;
    color: #4b5563;
}

.wavp-vendor-modal__close svg {
    width: 1.25rem;
    height: 1.25rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.wavp-vendor-modal__lead {
    margin: 0;
    padding-inline-start: 3.25rem;
    color: #6b7280;
    font-size: 0.9rem;
    line-height: 1.6;
}

.wavp-vendor-modal__lead strong {
    color: #374151;
    font-weight: 800;
}

.wavp-vendor-modal__body {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 1.5rem;
    overflow-y: auto;
    background: rgba(249, 250, 251, 0.7);
}

.wavp-vendor-modal__message,
.wavp-vendor-modal__hint {
    margin: 0;
    color: #334155;
    line-height: 1.7;
}

.wavp-vendor-modal__grid {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.wavp-vendor-modal__card {
    position: relative;
    padding: 1.25rem;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.wavp-vendor-modal__card--new {
    border-width: 2px;
    border-color: var(--wavp-primary-color, #26c2c4);
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.wavp-vendor-modal__badge {
    position: absolute;
    top: 0;
    inset-inline-start: 1rem;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: 0.38rem;
    background: #e5e7eb;
    color: #4b5563;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.4;
}

.wavp-vendor-modal__badge--new {
    background: var(--wavp-primary-color, #26c2c4);
    color: #fff;
}

.wavp-vendor-modal__details {
    margin: 0;
    padding-top: 0.5rem;
}

.wavp-vendor-modal__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.8rem;
}

.wavp-vendor-modal__row:last-child {
    margin-bottom: 0;
}

.wavp-vendor-modal__row dt {
    color: #6b7280;
    font-size: 0.84rem;
    font-weight: 500;
}

.wavp-vendor-modal__row dd {
    margin: 0;
    color: #1f2937;
    font-size: 0.88rem;
    font-weight: 700;
    text-align: end;
}

.wavp-vendor-modal__vendor-value {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.wavp-vendor-modal__vendor-name {
    color: #111827;
}

.wavp-vendor-modal__label {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.62rem;
    border-radius: 0.38rem;
    background: #eef2ff;
    color: #4f46e5;
    font-size: 0.75rem;
    font-weight: 800;
}

.wavp-vendor-modal__label--new {
    background: #eff6ff;
    color: #2563eb;
}

.wavp-vendor-modal__label--inline {
    white-space: nowrap;
}

.wavp-vendor-modal__row--total {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e5e7eb;
}

.wavp-vendor-modal__row--total dt {
    color: #374151;
    font-weight: 800;
}

.wavp-vendor-modal__total {
    white-space: nowrap;
}

.wavp-vendor-modal__total--current {
    color: #6b7280;
    font-size: 1.12rem;
    text-decoration: line-through;
}

.wavp-vendor-modal__total--new {
    color: var(--wavp-primary-color, #26c2c4);
    font-size: 1.25rem;
}

.wavp-vendor-modal__arrow {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 0.5rem;
    margin: -0.25rem 0;
    color: #d1d5db;
}

.wavp-vendor-modal__arrow svg {
    width: 2rem;
    height: 2rem;
    padding: 0.38rem;
    border: 1px solid #f3f4f6;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.wavp-vendor-modal__delta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.25rem;
    padding: 0.88rem;
    border: 1px solid #d1fae5;
    border-radius: 0.875rem;
    background: #ecfdf5;
    color: #047857;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.7;
}

.wavp-vendor-modal__delta svg {
    flex: 0 0 auto;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0.3rem;
    border-radius: 999px;
    background: #d1fae5;
}

.wavp-vendor-modal__delta--increase {
    border-color: #fed7aa;
    background: #fff7ed;
    color: #c2410c;
}

.wavp-vendor-modal__delta--increase svg {
    background: #fde68a;
    color: #b45309;
    transform: rotate(180deg);
}

.wavp-vendor-modal__delta--decrease {
    border-color: #bbf7d0;
    background: #ecfdf5;
    color: #047857;
}

.wavp-vendor-modal__delta--decrease svg {
    background: #d1fae5;
    color: #047857;
    transform: scaleX(-1);
}

.wavp-vendor-modal__delta-text {
    line-height: 1.8;
}

.wavp-vendor-modal__hint {
    margin-top: 1rem;
}

.wavp-vendor-modal__subtitle {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 800;
    color: #0f172a;
}

.wavp-vendor-modal__list {
    margin: 0;
    padding-inline-start: 1.25rem;
    color: #0f172a;
}

.wavp-vendor-modal__footer {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    border-top: 1px solid #f3f4f6;
    background: #fff;
}

.wavp-vendor-modal__primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--wavp-primary-color, #26c2c4);

}

.wavp-vendor-modal__footer .btn {
    min-height: 3rem;
    border-radius: 0.75rem;
    font-size: 0.88rem;
    font-weight: 800;
}

.wavp-vendor-notice {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    z-index: 1060;
    display: flex;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.wavp-vendor-notice.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.wavp-vendor-notice__text {
    max-width: 760px;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    background: #0f172a;
    color: #fff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.22);
}

.wavp-vendor-notice--success .wavp-vendor-notice__text {
    background: #166534;
}

.wavp-vendor-notice--error .wavp-vendor-notice__text {
    background: #991b1b;
}

body.wavp-vendor-modal-open {
    overflow: hidden;
}

@media (max-width: 768px) {
    .wavp-vendor-modal__lead {
        padding-inline-start: 0;
    }

    .wavp-vendor-modal__footer .btn {
        width: 100%;
    }

    .wavp-vendor-modal__arrow {
        padding: 10px;
    }

    .wavp-vendor-modal__arrow svg {
        transform: rotate(-90deg);
    }

}

@media (min-width: 768px) {
    .wavp-vendor-modal__header {
        padding: 1.25rem 1.5rem;
    }

    .wavp-vendor-modal__body {
        padding: 1.5rem;
    }

    .wavp-vendor-modal__grid {
        display: flex;
        flex-direction: row;
        align-items: stretch;
    }

    .wavp-vendor-modal__card {
        flex: 1 1 0;
    }

    .wavp-vendor-modal__arrow {
        width: auto;
        height: auto;
        margin: 0 -0.5rem;
        border: 0;
        background: transparent;
        box-shadow: none;
        align-self: center;
    }

    .wavp-vendor-modal__arrow svg {
        transform: rotate(180deg);
    }

    .wavp-vendor-modal__footer {
        flex-direction: row-reverse;
        justify-content: flex-start;
        padding: 1.25rem;
        border-radius: 0 0 1rem 1rem;
    }
}
