/* Smart Discounts — promotion bar on the website. Scoped to .uavsd-bar; resets the theme's
   button and link styles that would otherwise leak in (Elementor, WooCommerce). */

.uavsd-bar {
    position: relative;
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 8px 48px;
    background: var(--uavsd-bar-bg, #0078d4);
    color: var(--uavsd-bar-fg, #ffffff);
    font-size: 14px;
    line-height: 1.45;
    text-align: center;
}

.uavsd-bar *,
.uavsd-bar *::before,
.uavsd-bar *::after {
    box-sizing: border-box;
}

.uavsd-bar__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px 18px;
    max-width: 1400px;
    margin: 0 auto;
}

.uavsd-bar__msg {
    font-weight: 500;
}

.uavsd-bar__msg strong,
.uavsd-bar__msg b {
    font-weight: 700;
}

.uavsd-bar__code {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 2px;
    padding: 2px 3px 2px 10px;
    border: 1.5px dashed currentColor;
    border-radius: 6px;
    white-space: nowrap;
    vertical-align: middle;
}

.uavsd-bar__code strong {
    font-weight: 800;
    letter-spacing: 0.06em;
}

.uavsd-bar .uavsd-bar__copy {
    -webkit-appearance: none;
    appearance: none;
    display: inline-block;
    width: auto;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 3px 9px;
    border: 0;
    border-radius: 4px;
    background: var(--uavsd-bar-fg, #ffffff);
    box-shadow: none;
    color: var(--uavsd-bar-bg, #0078d4);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0;
    text-transform: none;
    cursor: pointer;
}

.uavsd-bar .uavsd-bar__copy:hover,
.uavsd-bar .uavsd-bar__copy:focus {
    background: var(--uavsd-bar-fg, #ffffff);
    color: var(--uavsd-bar-bg, #0078d4);
    opacity: 0.88;
}

.uavsd-bar__count {
    white-space: nowrap;
}

.uavsd-bar__count[hidden] {
    display: none;
}

.uavsd-bar__count b {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.uavsd-bar a.uavsd-bar__link,
.uavsd-bar a.uavsd-bar__link:visited,
.uavsd-bar a.uavsd-bar__link:hover {
    color: inherit;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
    white-space: nowrap;
}

.uavsd-bar .uavsd-bar__close {
    -webkit-appearance: none;
    appearance: none;
    position: absolute;
    top: 50%;
    right: 8px;
    width: 32px;
    height: 32px;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    box-shadow: none;
    color: inherit;
    font: inherit;
    font-size: 22px;
    line-height: 1;
    opacity: 0.8;
    transform: translateY(-50%);
    cursor: pointer;
}

.uavsd-bar .uavsd-bar__close:hover,
.uavsd-bar .uavsd-bar__close:focus {
    background: rgba(127, 127, 127, 0.22);
    color: inherit;
    opacity: 1;
}

.uavsd-bar button:focus-visible,
.uavsd-bar a:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

@media (max-width: 600px) {
    .uavsd-bar {
        padding: 7px 40px 7px 12px;
        font-size: 13px;
    }

    .uavsd-bar__inner {
        gap: 4px 12px;
    }
}

/* Several codes: the codes in the bar open the offers window. */

.uavsd-bar .uavsd-bar__codelink {
    -webkit-appearance: none;
    appearance: none;
    display: inline;
    width: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
    color: inherit;
    font: inherit;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-transform: none;
    cursor: pointer;
}

.uavsd-bar .uavsd-bar__codelink:hover,
.uavsd-bar .uavsd-bar__codelink:focus {
    background: none;
    color: inherit;
    opacity: 0.85;
}

.uavsd-bar__msg-apply {
    font-size: 12.5px;
    font-weight: 600;
}

.uavsd-bar__msg-apply[hidden] {
    display: none;
}

/* Offers window ----------------------------------------------------------------- */

.uavsd-offers {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 18, 25, 0.55);
    font-size: 15px;
    line-height: 1.45;
}

.uavsd-offers[hidden] {
    display: none;
}

.uavsd-offers *,
.uavsd-offers *::before,
.uavsd-offers *::after {
    box-sizing: border-box;
}

html.uavsd-offers-open {
    overflow: hidden;
}

.uavsd-offers__box {
    position: relative;
    width: 100%;
    max-width: 480px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    padding: 28px 24px 22px;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3);
    color: #1b1f27;
    text-align: center;
}

.uavsd-offers .uavsd-offers__x {
    -webkit-appearance: none;
    appearance: none;
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    box-shadow: none;
    color: #4b5563;
    font: inherit;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

.uavsd-offers .uavsd-offers__x:hover,
.uavsd-offers .uavsd-offers__x:focus {
    background: #f3f4f6;
    color: #1b1f27;
}

.uavsd-offers .uavsd-offers__title {
    margin: 4px 32px 6px;
    padding: 0;
    color: #1b1f27;
    font-family: inherit;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0;
    text-transform: none;
}

.uavsd-offers__intro {
    margin: 0 0 16px;
    color: #4b5563;
}

.uavsd-offers .uavsd-offers__list {
    display: grid;
    gap: 10px;
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
    text-align: left;
}

.uavsd-offers .uavsd-offers__card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 12px;
    align-items: center;
    margin: 0;
    padding: 14px 16px;
    border: 1px solid #e4e7ef;
    border-radius: 10px;
    background: #ffffff;
}

.uavsd-offers__text strong {
    display: block;
    color: #1b1f27;
    font-size: 18px;
    font-weight: 700;
}

.uavsd-offers__text span {
    display: block;
    color: #4b5563;
    font-size: 14px;
}

.uavsd-offers__act {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.uavsd-offers .uavsd-offers__code {
    padding: 0;
    background: none;
    color: var(--uavsd-bar-bg, #0078d4);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.08em;
}

.uavsd-offers__msg {
    grid-column: 1 / -1;
    margin: 0;
    font-size: 13px;
}

.uavsd-offers__msg:empty {
    display: none;
}

.uavsd-offers__msg[data-status="applied"] {
    color: #047857;
    font-weight: 600;
}

.uavsd-offers__msg[data-status="saved"] {
    color: #4b5563;
}

.uavsd-offers__msg[data-status="error"] {
    color: #b91c1c;
}

.uavsd-offers__note {
    margin: 14px 0 0;
    color: #6b7280;
    font-size: 12.5px;
    text-align: left;
}

/* Admin preview: shown in place, not over the page. */
.uavsd-offers.is-preview {
    position: static;
    padding: 16px;
    background: rgba(15, 18, 25, 0.35);
    border-radius: 8px;
}

.uavsd-offers.is-preview .uavsd-offers__box {
    max-height: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

@media (max-width: 480px) {
    .uavsd-offers__box {
        padding: 24px 16px 18px;
    }

    .uavsd-offers .uavsd-offers__title {
        font-size: 22px;
    }
}

/* Offer card on product pages: a coupon-style ticket. Left: the big discount; right: gift icon,
   title, text, badge and the code with Copy / Apply. Colours follow --uavsd-ticket-bg. */

.uavsd-ticket {
    position: relative;
    display: block;
    /* Stacks by its own width (narrow product column or phone), see @container below. */
    container-type: inline-size;
    /* Never squeezed by a flex or shrink-to-fit parent (container-type ignores content width). */
    flex: 1 1 100%;
    align-self: stretch;
    width: 100%;
    min-width: min(100%, 280px);
    max-width: 600px;
    box-sizing: border-box;
    margin: 10px 0 14px;
    border-radius: 12px;
    /* No background: the halves have their own, and the notches must show the page. */
    background: transparent;
    color: var(--uavsd-ticket-fg, #ffffff);
    /* box-shadow is only drawn outside the card, so the notches stay see-through. */
    box-shadow: 0 10px 22px -12px rgba(0, 0, 0, 0.5);
    font-size: 14px;
    line-height: 1.35;
    text-align: left;
}

.uavsd-ticket *,
.uavsd-ticket *::before,
.uavsd-ticket *::after {
    box-sizing: border-box;
}

.uavsd-ticket__in {
    display: flex;
    align-items: stretch;
}

.uavsd-ticket__left {
    display: flex;
    flex: 0 0 36%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 12px 12px;
    border-radius: 12px 0 0 12px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--uavsd-ticket-bg, #0078d4) 82%, #ffffff), var(--uavsd-ticket-bg, #0078d4));
    text-align: center;
    /* Half notches on the tear line, see-through on any page background. */
    -webkit-mask: radial-gradient(circle at 100% 0, transparent 8px, #000 8.5px) top / 100% 51% no-repeat, radial-gradient(circle at 100% 100%, transparent 8px, #000 8.5px) bottom / 100% 51% no-repeat;
    mask: radial-gradient(circle at 100% 0, transparent 8px, #000 8.5px) top / 100% 51% no-repeat, radial-gradient(circle at 100% 100%, transparent 8px, #000 8.5px) bottom / 100% 51% no-repeat;
}

.uavsd-ticket__big {
    display: block;
    font-size: clamp(20px, 2.2vw, 28px);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -0.01em;
}

.uavsd-ticket__small {
    display: block;
    font-size: 13px;
    font-weight: 600;
}

/* Dashed tear line with two notches (masks on both halves). */
.uavsd-ticket__right {
    position: relative;
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 10px 14px 10px 18px;
    border-left: 2px dashed color-mix(in srgb, var(--uavsd-ticket-fg, #ffffff) 70%, transparent);
    border-radius: 0 12px 12px 0;
    background: linear-gradient(135deg, var(--uavsd-ticket-bg, #0078d4), color-mix(in srgb, var(--uavsd-ticket-bg, #0078d4) 55%, #000000));
    -webkit-mask: radial-gradient(circle at 0 0, transparent 8px, #000 8.5px) top / 100% 51% no-repeat, radial-gradient(circle at 0 100%, transparent 8px, #000 8.5px) bottom / 100% 51% no-repeat;
    mask: radial-gradient(circle at 0 0, transparent 8px, #000 8.5px) top / 100% 51% no-repeat, radial-gradient(circle at 0 100%, transparent 8px, #000 8.5px) bottom / 100% 51% no-repeat;
}

.uavsd-ticket__icon {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #ffffff;
    color: var(--uavsd-ticket-bg, #0078d4);
    box-shadow: 0 0 0 3px color-mix(in srgb, #ffffff 25%, transparent);
}

.uavsd-ticket__body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    min-width: 0;
}

.uavsd-ticket__title {
    display: block;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.15;
}

.uavsd-ticket__text {
    display: block;
    font-size: 13px;
    opacity: 0.92;
}

.uavsd-ticket__badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 999px;
    background: linear-gradient(90deg, #fbf3a0, #c8f5c6);
    color: #17331a;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.5;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.uavsd-ticket__code {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
    padding: 3px 3px 3px 10px;
    border: 1.5px dashed currentColor;
    border-radius: 8px;
}

.uavsd-ticket__code strong {
    color: inherit;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.06em;
}

/* Icon buttons (Copy / Apply) of the bar, the offers window and the card. ":not(#uavsd-x)"
   adds ID weight, and !important: the bar and the card can sit inside Elementor widgets whose
   button rules (ID selectors, sometimes !important) set padding, height and width that must
   not reach these buttons. Size and colours per place via --uavsd-ibtn-* below. */
button.uavsd-ibtn:not(#uavsd-x),
button.uavsd-ibtn:not(#uavsd-x):hover,
button.uavsd-ibtn:not(#uavsd-x):focus,
button.uavsd-ibtn:not(#uavsd-x):active {
    position: relative !important;
    display: inline-flex !important;
    flex: 0 0 auto !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    width: var(--uavsd-ibtn-size, 28px) !important;
    height: var(--uavsd-ibtn-size, 28px) !important;
    min-width: var(--uavsd-ibtn-size, 28px) !important;
    max-width: var(--uavsd-ibtn-size, 28px) !important;
    min-height: var(--uavsd-ibtn-size, 28px) !important;
    max-height: var(--uavsd-ibtn-size, 28px) !important;
    margin: 0 !important;
    padding: 0 !important;
    border: var(--uavsd-ibtn-border, 0) !important;
    border-radius: var(--uavsd-ibtn-radius, 6px) !important;
    background: var(--uavsd-ibtn-bg, #ffffff) !important;
    color: var(--uavsd-ibtn-fg, #0078d4) !important;
    box-shadow: none !important;
    font-size: 0 !important;
    line-height: 0 !important;
    text-indent: 0 !important;
    cursor: pointer;
    transition: opacity 0.15s ease, transform 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

button.uavsd-ibtn:not(#uavsd-x):hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

button.uavsd-ibtn:disabled {
    opacity: 0.6;
    cursor: wait;
}

.uavsd-ibtn__ico,
.uavsd-ibtn__ok {
    display: inline-flex;
    pointer-events: none;
}

.uavsd-ibtn svg {
    display: block;
    width: var(--uavsd-ibtn-icon, 16px);
    height: var(--uavsd-ibtn-icon, 16px);
}

/* Tick after Copy (is-done) or a successful Apply (is-applied). */
.uavsd-ibtn__ok,
.uavsd-ibtn.is-done .uavsd-ibtn__ico,
.uavsd-ibtn.is-applied .uavsd-ibtn__ico {
    display: none;
}

.uavsd-ibtn.is-done .uavsd-ibtn__ok,
.uavsd-ibtn.is-applied .uavsd-ibtn__ok {
    display: inline-flex;
}

.uavsd-ibtn:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Card: light square on the card colour. */
.uavsd-ticket {
    --uavsd-ibtn-bg: var(--uavsd-ticket-fg, #ffffff);
    --uavsd-ibtn-fg: var(--uavsd-ticket-bg, #0078d4);
}

/* Bar: small light square inside the dashed code box. */
.uavsd-bar {
    --uavsd-ibtn-size: 24px;
    --uavsd-ibtn-icon: 14px;
    --uavsd-ibtn-radius: 4px;
    --uavsd-ibtn-bg: var(--uavsd-bar-fg, #ffffff);
    --uavsd-ibtn-fg: var(--uavsd-bar-bg, #0078d4);
}

.uavsd-bar .uavsd-bar__ibtn + .uavsd-bar__ibtn {
    margin-left: -2px !important;
}

/* Offers window: outlined square in the bar colour, filled on hover and once applied. */
.uavsd-offers {
    --uavsd-ibtn-size: 44px;
    --uavsd-ibtn-icon: 22px;
    --uavsd-ibtn-radius: 10px;
    --uavsd-ibtn-border: 2px solid var(--uavsd-bar-bg, #0078d4);
    --uavsd-ibtn-bg: #ffffff;
    --uavsd-ibtn-fg: var(--uavsd-bar-bg, #0078d4);
}

.uavsd-offers button.uavsd-offers__apply:not(#uavsd-x):hover,
.uavsd-offers button.uavsd-offers__apply:not(#uavsd-x):focus-visible,
.uavsd-offers button.uavsd-offers__apply.is-applied:not(#uavsd-x) {
    background: var(--uavsd-bar-bg, #0078d4) !important;
    color: var(--uavsd-bar-fg, #ffffff) !important;
    opacity: 1;
}

.uavsd-ticket__msg {
    display: block;
    font-size: 13px;
    font-weight: 600;
}

.uavsd-ticket__msg[hidden] {
    display: none;
}

@container (max-width: 480px) {
    .uavsd-ticket__in {
        flex-direction: column;
    }

    .uavsd-ticket__left {
        flex-basis: auto;
        border-radius: 12px 12px 0 0;
        -webkit-mask: radial-gradient(circle at 0 100%, transparent 8px, #000 8.5px) left / 51% 100% no-repeat, radial-gradient(circle at 100% 100%, transparent 8px, #000 8.5px) right / 51% 100% no-repeat;
        mask: radial-gradient(circle at 0 100%, transparent 8px, #000 8.5px) left / 51% 100% no-repeat, radial-gradient(circle at 100% 100%, transparent 8px, #000 8.5px) right / 51% 100% no-repeat;
    }

    .uavsd-ticket__right {
        padding: 10px 14px;
        border-top: 2px dashed color-mix(in srgb, var(--uavsd-ticket-fg, #ffffff) 70%, transparent);
        border-left: 0;
        border-radius: 0 0 12px 12px;
        -webkit-mask: radial-gradient(circle at 0 0, transparent 8px, #000 8.5px) left / 51% 100% no-repeat, radial-gradient(circle at 100% 0, transparent 8px, #000 8.5px) right / 51% 100% no-repeat;
        mask: radial-gradient(circle at 0 0, transparent 8px, #000 8.5px) left / 51% 100% no-repeat, radial-gradient(circle at 100% 0, transparent 8px, #000 8.5px) right / 51% 100% no-repeat;
    }
}

/* Notification after Apply on the offer card: bottom of the screen, fades out. */
.uavsd-toast {
    position: fixed;
    z-index: 999999;
    bottom: 24px;
    left: 50%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
    max-width: min(92vw, 520px);
    box-sizing: border-box;
    padding: 12px 18px;
    border-radius: 10px;
    background: #1b1f27;
    color: #ffffff;
    box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.45);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, 12px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s;
    pointer-events: none;
}

.uavsd-toast.is-shown {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: auto;
}

.uavsd-toast[data-status="applied"] {
    background: #15803d;
}

.uavsd-toast[data-status="error"] {
    background: #b91c1c;
}

.uavsd-toast a,
.uavsd-toast a:visited,
.uavsd-toast a:hover {
    color: #ffffff;
    font-weight: 700;
    text-decoration: underline;
    white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
    .uavsd-toast,
    .uavsd-toast.is-shown {
        transition: none;
    }
}
