/* ============================================
   GRAFLINE CART POPUP & IMPROVEMENTS
   ============================================ */

/* Added to Cart Popup Modal */
.gsc-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.gsc-popup-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

.gsc-popup-modal {
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-align: center;
}

.gsc-popup-overlay.is-active .gsc-popup-modal {
    transform: scale(1) translateY(0);
}

.gsc-popup-icon {
    width: 64px;
    height: 64px;
    background: #22c55e;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
}

.gsc-popup-icon svg {
    width: 32px;
    height: 32px;
    color: #fff;
}

.gsc-popup-title {
    font-size: 1.375rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 0.5rem;
}

.gsc-popup-message {
    color: #666;
    margin: 0 0 1.5rem;
    font-size: 0.9375rem;
    line-height: 1.5;
}

.gsc-popup-actions {
    display: flex;
    gap: 0.75rem;
    flex-direction: column;
}

@media (min-width: 480px) {
    .gsc-popup-actions {
        flex-direction: row;
        justify-content: center;
    }
}

.gsc-popup-btn {
    padding: 0.875rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.gsc-popup-btn--primary {
    background: #d42a2a;
    color: #fff;
}

.gsc-popup-btn--primary:hover {
    background: #b82020;
    transform: translateY(-1px);
}

.gsc-popup-btn--secondary {
    background: #f3f4f6;
    color: #374151;
}

.gsc-popup-btn--secondary:hover {
    background: #e5e7eb;
}

/* Heart/Favorite Button on Products */
.grafline-wishlist-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    background: #fff;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    z-index: 5;
}

.grafline-wishlist-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.grafline-wishlist-btn svg {
    width: 20px;
    height: 20px;
    color: #9ca3af;
    transition: color 0.2s ease;
    fill: none;
    display: block;
}

.grafline-wishlist-btn.is-active svg {
    color: #ef4444;
    fill: #ef4444;
}

/* Fallback glyph if SVG is not visible in some contexts */
.grafline-wishlist-btn::before {
    content: "\2661";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
    color: #9ca3af;
    pointer-events: none;
}

.grafline-wishlist-btn.is-active::before {
    content: "\2665";
    color: #ef4444;
}

/* Product grid cards: frosted glass — gray heart by default, red when favorited */
.grafline-product-card .grafline-wishlist-btn {
    border: 1px solid rgba(255, 255, 255, 0.42);
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(18px) saturate(185%);
    -webkit-backdrop-filter: blur(18px) saturate(185%);
    z-index: 12;
    box-shadow:
        0 4px 22px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.55);
    color: #6b7280;
    isolation: isolate;
}

.grafline-product-card .grafline-wishlist-btn:hover {
    background: rgba(255, 255, 255, 0.26);
    border-color: rgba(255, 255, 255, 0.58);
    color: #4b5563;
}

.grafline-product-card .grafline-wishlist-btn::before {
    content: none;
}

.grafline-product-card .grafline-wishlist-btn .grafline-wishlist-btn__svg {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    display: block;
    color: inherit;
    opacity: 1;
    visibility: visible;
    pointer-events: none;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.14));
}

.grafline-product-card .grafline-wishlist-btn .grafline-wishlist-btn__path {
    stroke: currentColor !important;
    stroke-width: 2.25px !important;
    fill: none !important;
    vector-effect: non-scaling-stroke;
}

.grafline-product-card .grafline-wishlist-btn.is-active {
    background: rgba(220, 38, 38, 0.16);
    border-color: rgba(220, 38, 38, 0.42);
    color: #dc2626;
    box-shadow:
        0 4px 20px rgba(220, 38, 38, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.grafline-product-card .grafline-wishlist-btn.is-active:hover {
    background: rgba(220, 38, 38, 0.24);
    border-color: rgba(220, 38, 38, 0.5);
    color: #b91c1c;
}

.grafline-product-card .grafline-wishlist-btn.is-active .grafline-wishlist-btn__svg {
    filter: drop-shadow(0 1px 2px rgba(220, 38, 38, 0.28));
}

.grafline-product-card .grafline-wishlist-btn.is-active .grafline-wishlist-btn__path {
    fill: currentColor !important;
    stroke: none !important;
}

/* “Akcija” badge also sits top-right — nudge heart down so both stay visible */
.grafline-product-card:has(.grafline-product-card__sale) .grafline-wishlist-btn {
    top: 3.15rem;
}

/* Single-product page: solid outline control on white summary (frosted card style was invisible here) */
.grafline-single-product .grafline-wishlist-btn--inline {
    position: static;
    top: auto;
    right: auto;
    margin-left: 0;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    min-width: 48px;
    min-height: 48px;
    max-width: 48px;
    max-height: 48px;
    order: 0;
    z-index: 1;
    box-sizing: border-box;
    border: 2px solid #d1d5db;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    color: #111827;
    isolation: isolate;
    border-radius: 50%;
}

.grafline-single-product .grafline-wishlist-btn--inline:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    color: #030712;
    transform: scale(1.04);
}

.grafline-single-product .grafline-wishlist-btn--inline:focus-visible {
    outline: 2px solid var(--grafline-primary, #ff2a13);
    outline-offset: 2px;
}

.grafline-single-product .grafline-wishlist-btn--inline::before {
    content: none;
}

.grafline-single-product .grafline-wishlist-btn--inline .grafline-wishlist-btn__svg,
.grafline-single-product .grafline-wishlist-btn--inline svg {
    width: 24px !important;
    height: 24px !important;
    display: block;
    color: inherit !important;
    fill: none !important;
    pointer-events: none;
    filter: none;
}

.grafline-single-product .grafline-wishlist-btn--inline .grafline-wishlist-btn__path,
.grafline-single-product .grafline-wishlist-btn--inline svg path {
    stroke: currentColor !important;
    stroke-width: 2px !important;
    fill: none !important;
}

.grafline-single-product .grafline-wishlist-btn--inline.is-active {
    background: #fef2f2;
    border-color: #f87171;
    color: #dc2626;
    box-shadow: 0 1px 3px rgba(220, 38, 38, 0.2);
}

.grafline-single-product .grafline-wishlist-btn--inline.is-active:hover {
    background: #fee2e2;
    border-color: #ef4444;
    color: #b91c1c;
}

.grafline-single-product .grafline-wishlist-btn--inline.is-active .grafline-wishlist-btn__svg,
.grafline-single-product .grafline-wishlist-btn--inline.is-active svg {
    filter: none;
}

.grafline-single-product .grafline-wishlist-btn--inline.is-active .grafline-wishlist-btn__path,
.grafline-single-product .grafline-wishlist-btn--inline.is-active svg path {
    fill: currentColor !important;
    stroke: none !important;
}

/* Price Range Filter */
.grafline-price-filter {
    padding: 1rem 0;
}

.grafline-price-filter__inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.grafline-price-filter__input {
    width: 80px;
    padding: 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.875rem;
}

.grafline-price-filter__separator {
    color: #9ca3af;
}

.grafline-price-filter__slider {
    margin: 1rem 0;
}

.grafline-price-filter__btn {
    width: 100%;
    padding: 0.625rem;
    background: #d42a2a;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.grafline-price-filter__btn:hover {
    background: #b82020;
}

/* Cart loading state */
.gsc-atc-btn.is-loading {
    position: relative;
    color: transparent !important;
}

.gsc-atc-btn.is-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: gsc-spin 0.8s linear infinite;
}

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

/* Enhanced mini-cart animation */
.site-header__cart-count {
    animation: gsc-cart-pulse 0.3s ease;
}

@keyframes gsc-cart-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Shop “Priljubljeni” view (?favorites=1) — empty state */
.grafline-favorites-empty-notice {
    margin: 1rem 0 1.25rem;
    padding: 1rem 1.1rem;
    font-size: 0.9375rem;
    line-height: 1.45;
    color: #4b5563;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
}
