/* Ganjeh Kala smart notices — compact, non-blocking confirmation system. */
.gk-notice-container {
    position: fixed;
    top: calc(var(--gk-admin-offset, 0px) + 18px);
    left: 50%;
    z-index: 1000000;
    display: flex;
    width: min(92vw, 420px);
    transform: translateX(-50%);
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.gk-notice-item {
    --gk-notice-accent: var(--gk-primary, #3342fd);
    position: relative;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) 30px;
    align-items: start;
    gap: 11px;
    width: 100%;
    padding: 13px 13px 12px;
    overflow: hidden;
    direction: rtl;
    color: #111827;
    border: 1px solid rgba(148, 163, 184, .24);
    border-radius: 14px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 16px 42px rgba(15, 23, 42, .13), inset 0 1px 0 rgba(255, 255, 255, .84);
    -webkit-backdrop-filter: blur(14px) saturate(112%);
    backdrop-filter: blur(14px) saturate(112%);
    animation: gkNoticeIn .24s cubic-bezier(.2, .78, .28, 1);
    pointer-events: auto;
}

.gk-notice-item.is-success { --gk-notice-accent: #169b62; }
.gk-notice-item.is-error { --gk-notice-accent: #c83b48; }
.gk-notice-item.is-info { --gk-notice-accent: var(--gk-primary, #3342fd); }

.gk-notice-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    color: var(--gk-notice-accent);
    border: 1px solid color-mix(in srgb, var(--gk-notice-accent) 18%, transparent);
    border-radius: 11px;
    background: color-mix(in srgb, var(--gk-notice-accent) 7%, #fff);
}

.gk-notice-icon svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.gk-notice-content {
    min-width: 0;
    padding-top: 1px;
    color: #4b5563;
    font-size: 12px;
    line-height: 1.75;
}

.gk-notice-title {
    display: block;
    margin: 0 0 2px;
    color: #111827;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.55;
}

.gk-notice-body {
    overflow-wrap: anywhere;
}

.gk-notice-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin: -2px -2px 0 0;
    padding: 0;
    color: #7b8492;
    border: 0;
    border-radius: 9px;
    background: transparent;
    cursor: pointer;
    transition: background-color .18s ease, color .18s ease;
}

.gk-notice-close:hover,
.gk-notice-close:focus-visible {
    color: #111827;
    background: #f3f4f6;
    outline: none;
}

.gk-notice-close svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
}

.gk-notice-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 9px;
}

.gk-notice-btn {
    display: inline-flex;
    min-height: 33px;
    align-items: center;
    justify-content: center;
    padding: 6px 11px;
    border: 1px solid transparent;
    border-radius: 9px;
    font-size: 11.5px;
    font-weight: 750;
    line-height: 1.4;
    text-decoration: none;
    transition: border-color .18s ease, background-color .18s ease, color .18s ease;
}

.gk-btn-cart {
    color: #fff;
    background: var(--gk-primary, #3342fd);
}

.gk-btn-cart:hover,
.gk-btn-cart:focus-visible {
    color: #fff;
    background: color-mix(in srgb, var(--gk-primary, #3342fd) 90%, #000);
}

.gk-btn-outline {
    color: #374151;
    border-color: #e2e6ec;
    background: #fff;
}

.gk-btn-outline:hover,
.gk-btn-outline:focus-visible {
    color: #111827;
    border-color: #cfd5dd;
    background: #f7f8fa;
}

.gk-notice-progress {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 2px;
    overflow: hidden;
    background: rgba(148, 163, 184, .12);
}

.gk-notice-progress span {
    display: block;
    width: 100%;
    height: 100%;
    transform-origin: right center;
    background: color-mix(in srgb, var(--gk-notice-accent) 72%, transparent);
    animation: gkNoticeProgress var(--gk-notice-duration, 5s) linear forwards;
}

.gk-notice-item.is-paused .gk-notice-progress span { animation-play-state: paused; }

.gk-notice-hide {
    pointer-events: none;
    animation: gkNoticeOut .22s ease forwards;
}

@keyframes gkNoticeIn {
    from { opacity: 0; transform: translateY(-10px) scale(.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes gkNoticeOut {
    to { opacity: 0; transform: translateY(-8px) scale(.985); }
}

@keyframes gkNoticeProgress {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

@media (max-width: 767px) {
    .gk-notice-container {
        top: auto;
        bottom: calc(env(safe-area-inset-bottom, 0px) + 76px);
        width: calc(100% - 20px);
        max-width: 430px;
    }

    body.gk-native-mobile-buy-active .gk-notice-container {
        bottom: calc(env(safe-area-inset-bottom, 0px) + 88px);
    }

    .gk-notice-item {
        grid-template-columns: 36px minmax(0, 1fr) 30px;
        gap: 10px;
        padding: 12px;
        border-radius: 13px;
    }

    .gk-notice-icon {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
    }

    .gk-notice-title { font-size: 12.5px; }
    .gk-notice-content { font-size: 11.5px; line-height: 1.7; }
    .gk-notice-actions { gap: 6px; }
    .gk-notice-btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
    .gk-notice-item,
    .gk-notice-hide,
    .gk-notice-progress span {
        animation: none !important;
    }
}
