/* ===============================
 * Ultra-modern notifyproduct modal
 * for {shopNotifyproductPlugin::displayProductButton($product)}
 * All classes prefixed with notifyproduct
 * =============================== */

:root {
    /* base sizes */
    --notifyproduct-radius-lg: 1rem; /* 16px */
    --notifyproduct-radius-md: 0.875rem; /* 14px */
    --notifyproduct-radius-full: 9999rem;

    --notifyproduct-spacing-xs: 0.25rem;  /* 4px */
    --notifyproduct-spacing-sm: 0.5rem;   /* 8px */
    --notifyproduct-spacing-md: 0.75rem;  /* 12px */
    --notifyproduct-spacing-lg: 1rem;     /* 16px */
    --notifyproduct-spacing-xl: 1.5rem;   /* 24px */

    --notifyproduct-font-xs: 0.75rem;   /* 12px */
    --notifyproduct-font-sm: 0.8125rem; /* 13px */
    --notifyproduct-font-md: 0.875rem;  /* 14px */
    --notifyproduct-font-lg: 1.125rem;  /* 18px */

    /* palette */
    --notifyproduct-color-bg: #ffffff;
    --notifyproduct-color-bg-soft: #f9fafb;
    --notifyproduct-color-bg-soft-strong: #eef2ff;
    --notifyproduct-color-surface-shadow: rgba(15, 23, 42, 0.25);
    --notifyproduct-color-border-subtle: rgba(148, 163, 184, 0.25);
    --notifyproduct-color-border-soft: #d1d5db;
    --notifyproduct-color-primary: #4f46e5;
    --notifyproduct-color-primary-soft: #6366f1;
    --notifyproduct-color-primary-soft-strong: #3730a3;
    --notifyproduct-color-primary-hover: #4338ca;
    --notifyproduct-color-primary-focus-ring: rgba(79, 70, 229, 0.2);
    --notifyproduct-color-primary-focus-ring-soft: rgba(79, 70, 229, 0.1);
    --notifyproduct-color-primary-chip-shadow: rgba(79, 70, 229, 0.35);
    --notifyproduct-color-text-main: #111827;
    --notifyproduct-color-text-strong: #0f172a;
    --notifyproduct-color-text-muted: #6b7280;
    --notifyproduct-color-text-extra-muted: #9ca3af;
    --notifyproduct-color-text-on-primary: #f9fafb;
    --notifyproduct-color-chip-muted: #374151;
    --notifyproduct-color-success: #16a34a;
    --notifyproduct-color-danger: #b91c1c;
    --notifyproduct-color-focus-danger-border: rgba(248, 113, 113, 0.9);
    --notifyproduct-color-focus-danger-shadow: rgba(248, 113, 113, 0.6);
    --notifyproduct-color-link: #2563eb;
    --notifyproduct-color-link-hover: #1d4ed8;
    --notifyproduct-color-link-underline: rgba(37, 99, 235, 0.55);
    --notifyproduct-color-link-underline-hover: rgba(29, 78, 216, 0.8);
    --notifyproduct-color-overlay: rgba(15, 23, 42, 0.55);
    --notifyproduct-color-overlay-strong: rgba(15, 23, 42, 0.65);
    --notifyproduct-color-close-bg: #f9fafb;
    --notifyproduct-color-close-border: rgba(148, 163, 184, 0.5);
    --notifyproduct-color-close-hover-bg: #111827;
    --notifyproduct-color-img-grad-1: #e5e7eb;
    --notifyproduct-color-img-grad-2: #cbd5f5;
    --notifyproduct-color-chip-muted-bg: #f9fafb;
    --notifyproduct-color-chip-muted-border: #d1d5db;
    --notifyproduct-color-chip-muted-hover-bg: #eef2ff;
    --notifyproduct-color-chip-muted-hover-border: #6366f1;
}

.notifyproduct-overlay {
    position: fixed;
    inset: 0;
    background: var(--notifyproduct-color-overlay-strong);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    z-index: 9990;
}

.notifyproduct-overlay_active {
    opacity: 1;
    visibility: visible;
}

.notifyproduct-overflow-lock {
    overflow: hidden;
}

.notifyproduct {
    position: fixed;
    height: 100%;
    top: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--notifyproduct-spacing-lg);
    background: var(--notifyproduct-color-overlay);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transform: translateY(1px) scale(1);
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 9999;
}

.notifyproduct_active {
    pointer-events: auto;
    opacity: 1;
    transform: translateY(0) scale(1);
}

.notifyproduct__panel {
    position: relative;
    width: 100%;
    max-width: 30rem; /* 480px */
    border-radius: var(--notifyproduct-radius-lg);
    background: var(--notifyproduct-color-bg);
    box-shadow:
        0 1.5rem 2.5rem var(--notifyproduct-color-surface-shadow),
        0 0 0 0.0625rem var(--notifyproduct-color-border-subtle);
    padding: var(--notifyproduct-spacing-xl) var(--notifyproduct-spacing-xl)
        1.25rem; /* 20px */
    transform: translateY(10px) scale(0.96);
}

.notifyproduct__panel,
.notifyproduct__content {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
        sans-serif;
}

.notifyproduct__title {
    margin: 0 0 12px;
    font-size: var(--notifyproduct-font-lg);
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--notifyproduct-color-text-strong);
}

.notifyproduct__subtitle {
    margin: 0 0 16px;
    font-size: var(--notifyproduct-font-sm);
    line-height: 1.5;
    color: var(--notifyproduct-color-text-muted);
}

.notifyproduct__close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    font-weight: 500;
    color: var(--notifyproduct-color-text-muted);
    background: var(--notifyproduct-color-close-bg);
    border: 1px solid var(--notifyproduct-color-close-border);
    transition: background 0.15s ease, color 0.15s ease,
        box-shadow 0.15s ease, transform 0.12s ease;
}

.notifyproduct__close:hover {
    background: var(--notifyproduct-color-close-hover-bg);
    color: var(--notifyproduct-color-text-on-primary);
    box-shadow: 0 0.5rem 1rem var(--notifyproduct-color-surface-shadow);
    transform: translateY(-1px);
}

.notifyproduct__product {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 14px;
    align-items: center;
    margin-bottom: 18px;
}

.notifyproduct__img {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    overflow: hidden;
    background: radial-gradient(
        circle at 0 0,
        var(--notifyproduct-color-img-grad-1),
        var(--notifyproduct-color-img-grad-2)
    );
    flex-shrink: 0;
}

.notifyproduct__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.notifyproduct__name {
    font-size: 14px;
    line-height: 1.4;
    color: var(--notifyproduct-color-text-main);
}

.notifyproduct__n {
    font-weight: 600;
}

.notifyproduct__variants {
    margin-top: 4px;
    font-size: 12px;
    color: var(--notifyproduct-color-text-muted);
}

.notifyproduct__form {
    margin-top: 8px;
}

.notifyproduct__row {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
}

.notifyproduct__inputs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.notifyproduct__input-wrapper {
    flex: 1 1 150px;
    min-width: 0;
}

.notifyproduct__actual {
    display: flex;
    flex-direction: column;
    gap: 0.375rem; /* 6px */
}

.notifyproduct__actual-label {
    font-size: 0.6875rem; /* 11px */
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--notifyproduct-color-text-extra-muted);
}

.notifyproduct__actual-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem; /* 6px */
}

.notifyproduct__actual-option {
    border: 0.0625rem solid var(--notifyproduct-color-chip-muted-border);
    border-radius: var(--notifyproduct-radius-full);
    padding: 0.25rem 0.625rem; /* 4px 10px */
    font-size: var(--notifyproduct-font-xs);
    line-height: 1.3;
    background: var(--notifyproduct-color-chip-muted-bg);
    color: var(--notifyproduct-color-chip-muted);
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease,
        color 0.15s ease, transform 0.08s ease;
}

.notifyproduct__actual-option:hover {
    background: var(--notifyproduct-color-chip-muted-hover-bg);
    border-color: var(--notifyproduct-color-chip-muted-hover-border);
    color: var(--notifyproduct-color-primary-soft-strong);
}

.notifyproduct__actual-option_selected {
    background: linear-gradient(
        135deg,
        var(--notifyproduct-color-primary),
        var(--notifyproduct-color-primary-soft)
    );
    border-color: transparent;
    color: var(--notifyproduct-color-text-on-primary);
    box-shadow: 0 0.375rem 0.75rem var(--notifyproduct-color-primary-chip-shadow);
}

.notifyproduct__input,
.notifyproduct__select {
    width: 100%;
    border-radius: var(--notifyproduct-radius-md);
    border: 0.0625rem solid var(--notifyproduct-color-border-soft);
    padding: 0.6875rem 0.875rem; /* 11px 14px */
    font-size: var(--notifyproduct-font-md);
    line-height: 1.4;
    color: var(--notifyproduct-color-text-main);
    background: var(--notifyproduct-color-bg-soft);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease,
        background-color 0.15s ease;
}

.notifyproduct__select {
    padding-right: 32px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--notifyproduct-color-text-extra-muted) 50%),
        linear-gradient(135deg, var(--notifyproduct-color-text-extra-muted) 50%, transparent 50%);
    background-position:
        calc(100% - 14px) 12px,
        calc(100% - 9px) 12px;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

.notifyproduct__input:focus,
.notifyproduct__select:focus {
    border-color: var(--notifyproduct-color-primary);
    box-shadow: 0 0 0 0.0625rem var(--notifyproduct-color-primary-focus-ring),
        0 0 0 0.25rem var(--notifyproduct-color-primary-focus-ring-soft);
    background-color: var(--notifyproduct-color-bg);
}

.notifyproduct__input::placeholder {
    color: var(--notifyproduct-color-text-extra-muted);
    font-size: 13px;
}

.notifyproduct__input_error {
    border-color: var(--notifyproduct-color-focus-danger-border);
    box-shadow: 0 0 0 0.0625rem var(--notifyproduct-color-focus-danger-shadow);
}

.notifyproduct__select ~ .notifyproduct__politika {
    margin-top: 10px;
}

.notifyproduct__politika {
    margin-top: 12px;
    font-size: 11px;
    line-height: 1.5;
    color: var(--notifyproduct-color-text-muted);
}

.notifyproduct__politika a {
    color: var(--notifyproduct-color-link);
    text-decoration: none;
    border-bottom: 1px dashed var(--notifyproduct-color-link-underline);
}

.notifyproduct__politika a:hover {
    color: var(--notifyproduct-color-link-hover);
    border-bottom-color: var(--notifyproduct-color-link-underline-hover);
}

.notifyproduct__politika_error {
    color: var(--notifyproduct-color-danger);
}

.notifyproduct__policyCheckbox {
    display: inline-block;
    margin-right: 6px;
}

.notifyproduct__actions {
    margin-top: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: flex-start;
}

button[type="submit"].notifyproduct__button,
button[type="button"].notifyproduct__button-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: none;
    padding: 0 18px;
    height: 36px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: background-color 0.15s ease, transform 0.1s ease,
        box-shadow 0.15s ease, color 0.15s ease;
}

button[type="submit"].notifyproduct__button {
    background: linear-gradient(
        135deg,
        var(--notifyproduct-color-primary),
        var(--notifyproduct-color-primary-soft)
    );
    color: var(--notifyproduct-color-text-on-primary);
    box-shadow: 0 0.75rem 1.25rem var(--notifyproduct-color-primary-chip-shadow);
}

button[type="submit"].notifyproduct__button:hover {
    background: linear-gradient(
        135deg,
        var(--notifyproduct-color-primary-hover),
        var(--notifyproduct-color-primary)
    );
    transform: translateY(-1px);
    box-shadow: 0 16px 28px rgba(79, 70, 229, 0.45);
}

button[type="submit"].notifyproduct__button:active {
    transform: translateY(0);
    box-shadow: 0 0.5rem 1rem var(--notifyproduct-color-primary-chip-shadow);
}

button[type="submit"].notifyproduct__button_loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

button[type="submit"].notifyproduct__button_loading::after {
    content: "";
    position: absolute;
    inset: 50% auto auto 50%;
    width: 16px;
    height: 16px;
    margin-left: -8px;
    margin-top: -8px;
    border-radius: 999px;
    border: 2px solid rgba(249, 250, 251, 0.65);
    border-top-color: #f9fafb;
    animation: notifyproduct-spin 0.6s linear infinite;
}

button[type="button"].notifyproduct__button-close {
    background: var(--notifyproduct-color-bg-soft);
    color: var(--notifyproduct-color-chip-muted);
    border: 0.0625rem solid var(--notifyproduct-color-border-soft);
}

button[type="button"].notifyproduct__button-close:hover {
    background: #e5e7eb;
}

.notifyproduct__thank,
.notifyproduct__error {
    margin-top: var(--notifyproduct-spacing-lg);
    padding: var(--notifyproduct-spacing-md);
    border-radius: var(--notifyproduct-radius-md);
    font-size: var(--notifyproduct-font-md);
    line-height: 1.5;
    display: none;
}

.notifyproduct__thank {
    background: rgba(22, 163, 74, 0.05);
    border: 0.0625rem solid rgba(22, 163, 74, 0.18);
    color: var(--notifyproduct-color-success);
}

.notifyproduct__thankText h3 {
    margin: 0 0 0.25rem;
    font-size: var(--notifyproduct-font-md);
    font-weight: 600;
}

.notifyproduct__thankText p {
    margin: 0;
    color: var(--notifyproduct-color-text-main);
}

.notifyproduct__error {
    background: rgba(185, 28, 28, 0.04);
    border: 0.0625rem solid rgba(185, 28, 28, 0.16);
    color: var(--notifyproduct-color-danger);
}

/* Встроенная форма (без popup) */

.notifyproductForm {
    width: 100%;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
        sans-serif;
}

.notifyproductForm * {
    box-sizing: border-box;
}

.notifyproductForm form {
    font-size: 0;
}

.notifyproductForm__select,
input[type="text"].notifyproductForm__input,
input[type="tel"].notifyproductForm__input {
    display: inline-block;
    width: 100%;
    font-size: 13px;
    margin: 0 0 6px;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    color: #111827;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease,
        background-color 0.15s ease;
}

.notifyproductForm__select:focus,
input[type="text"].notifyproductForm__input:focus,
input[type="tel"].notifyproductForm__input:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 1px rgba(79, 70, 229, 0.2);
    background-color: #ffffff;
}

button[type="submit"].notifyproductForm__button {
    display: block;
    width: 100%;
    font-size: 13px;
    margin: 4px 0 10px;
    padding: 7px 10px;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #f9fafb;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.1s ease,
        box-shadow 0.15s ease;
}

button[type="submit"].notifyproductForm__button:hover {
    background: linear-gradient(135deg, #4338ca, #4f46e5);
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(79, 70, 229, 0.35);
}

.notifyproductForm__antispam {
    display: none;
}

.notifyproductForm__input_error {
    border-color: rgba(248, 113, 113, 0.9);
    box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.6);
}

.notifyproductForm__thankText {
    font-size: 12px;
    display: none;
}

.notifyproductForm__thankText h3 {
    font-size: 12px;
    margin-bottom: 4px;
}

.notifyproductForm__thankText p {
    margin-bottom: 8px;
}

.notifyproductForm__policyCheckbox {
    display: inline-block;
    vertical-align: middle;
    margin-right: 4px;
}

.notifyproductForm__politika {
    font-size: 11px;
    line-height: 1.5;
    margin-bottom: 14px;
    color: #6b7280;
}

.notifyproductForm__politika a {
    color: #2563eb;
    text-decoration: none;
    border-bottom: 1px dashed rgba(37, 99, 235, 0.55);
}

.notifyproductForm__politika_error {
    color: #b91c1c;
}

@media (max-width: 640px) {
    .notifyproduct__panel {
        padding: 20px 16px 18px;
        border-radius: 14px;
    }

    .notifyproduct__product {
        grid-template-columns: auto 1fr;
        gap: 10px;
    }

    .notifyproduct__img {
        width: 56px;
        height: 56px;
    }

    .notifyproduct__title {
        font-size: 16px;
    }

    .notifyproduct__inputs {
        flex-direction: column;
    }
}

@keyframes notifyproduct-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes notifyproduct-panel-in {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.94);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes notifyproduct-panel-out {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(18px) scale(0.94);
    }
}

.notifyproduct_active .notifyproduct__panel {
    animation: notifyproduct-panel-in 0.26s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

.notifyproduct_closing .notifyproduct__panel {
    animation: notifyproduct-panel-out 0.2s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

/* Телефон: ровные цифры в маске (плагин Shop «Маска ввода») */
.notifyproduct .notifyproduct__input_phone,
.notifyproductForm .notifyproductForm__input_tel {
    font-variant-numeric: tabular-nums;
}