/**
 * The confirmation when something is put in the cart (Ajax_Cart_Controller, ajax-cart.js, templates/cart/added.php) –
 * Svartzonker's, in the mini cart's look: white, the dark ink, the red, the light pink tiles, Poppins and the headings'
 * font, the checkout's green. A sheet from the bottom on phones, a card at the bottom right on larger screens. Rules
 * start at .gf-added: they win over the kit's and the theme's button and link styles.
 */

.gf-added-region {
    --gf-added-ink: var(--e-global-color-secondary, #1a1a1a);
    --gf-added-text: #4d4d4d;
    --gf-added-muted: var(--e-global-color-primary, #696969);
    --gf-added-brand: var(--e-global-color-d49ac81, #97040d);
    --gf-added-brand-strong: var(--e-global-color-332724a, #7f040c);
    --gf-added-tile: color-mix(in srgb, var(--e-global-color-cfa1f76, #f2d6d6) 38%, #fff);
    --gf-added-line: #ececec;
    --gf-added-go: #189704;
    --gf-added-go-strong: #137a03;
    --gf-added-font: var(--e-global-typography-text-font-family, "Poppins"), system-ui, sans-serif;
    --gf-added-heading: var(--e-global-typography-primary-font-family, "NeueHaasDisplay-Mediu"), var(--e-global-typography-text-font-family, "Poppins"), system-ui, sans-serif;

    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 2147483631; /* above CookieYes, the chat widget and Elementor's menus */
    visibility: hidden;
    transform: translateY(110%);
    transition: transform 0.3s ease, visibility 0.3s;
}

.gf-added-region.is-visible {
    visibility: visible;
    transform: none;
}

.gf-added {
    display: grid;
    gap: 14px;
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    border-radius: 16px 16px 0 0;
    background: #fff;
    box-shadow: 0 -12px 40px rgb(0 0 0 / 0.18);
    font-family: var(--gf-added-font);
    font-size: 14px;
    line-height: 1.4;
    color: var(--gf-added-text);
}

.gf-added *,
.gf-added *::before,
.gf-added *::after {
    box-sizing: border-box;
}

.gf-added p {
    margin: 0;
}

.gf-added svg {
    display: block;
    width: 1em;
    height: 1em;
}

/* Head: ✓ what happened, close */
.gf-added-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.gf-added .gf-added-title {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--gf-added-heading);
    font-size: 19px;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--gf-added-ink);
}

.gf-added-tick {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--gf-added-go);
    font-size: 15px;
    color: #fff;
}

.gf-added.is-error .gf-added-title {
    color: var(--gf-added-brand);
}

.gf-added .gf-added-close,
.gf-added .gf-added-close:is(:hover, :focus, :active) {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 36px;
    height: 36px;
    margin: -6px -6px -6px 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    box-shadow: none;
    font-size: 20px;
    color: var(--gf-added-brand);
    cursor: pointer;
}

.gf-added .gf-added-close:hover {
    background: var(--gf-added-tile);
}

/* What was added: the picture on a light pink tile, the name, the variant, quantity × the price per piece */
.gf-added .gf-added-items {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.gf-added .gf-added-item {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    margin: 0;
}

.gf-added-image {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    padding: 5px;
    border-radius: 6px;
    background: var(--gf-added-tile);
}

.gf-added .gf-added-image img {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    object-fit: contain;
    mix-blend-mode: multiply;
}

/* (several – a package: smaller) */
.gf-added .gf-added-items.is-many .gf-added-item {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 12px;
}

.gf-added .gf-added-items.is-many .gf-added-image {
    width: 48px;
    height: 48px;
    padding: 4px;
}

.gf-added-text {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.gf-added-name {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    font-size: 14.5px;
    font-weight: 400;
    line-height: 1.3;
    color: var(--gf-added-ink);
}

.gf-added-detail {
    font-size: 13px;
    color: var(--gf-added-muted);
}

.gf-added-price {
    font-size: 14px;
    font-weight: 600;
    color: var(--gf-added-ink);
}

.gf-added-price :is(del, .amount) {
    font-weight: inherit;
}

.gf-added-price del {
    font-weight: 400;
    color: var(--gf-added-muted);
}

.gf-added-price ins {
    text-decoration: none;
}

.gf-added-saving {
    font-size: 13px;
    font-weight: 500;
    color: var(--gf-added-go);
}

.gf-added .gf-added-more {
    font-size: 13px;
    color: var(--gf-added-muted);
}

/* A package's discount */
.gf-added .gf-added-discount {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--gf-added-go);
}

.gf-added-discount strong {
    font-weight: 600;
    white-space: nowrap;
}

/* The way to free shipping (the mini cart's) */
.gf-added-free {
    display: grid;
    gap: 8px;
}

.gf-added .gf-added-free-text {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13.5px;
    color: var(--gf-added-ink);
}

.gf-added-free-text svg {
    flex: 0 0 auto;
    font-size: 20px;
    color: var(--gf-added-brand);
}

.gf-added-free-text strong {
    font-weight: 600;
    color: var(--gf-added-brand);
}

.gf-added-free.is-reached .gf-added-free-text {
    font-weight: 500;
    color: var(--gf-added-go);
}

.gf-added-free.is-reached .gf-added-free-text svg {
    color: var(--gf-added-go);
}

.gf-added-free-bar {
    display: block;
    height: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: #e8e8e8;
}

.gf-added-free-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--gf-added-brand);
}

.gf-added-free.is-reached .gf-added-free-bar span {
    background: var(--gf-added-go);
}

/* What the cart holds now */
.gf-added .gf-added-cart {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px 12px;
    padding-top: 12px;
    border-top: 1px solid var(--gf-added-line);
    font-size: 14px;
    color: var(--gf-added-muted);
}

.gf-added-cart strong {
    font-family: var(--gf-added-heading);
    font-size: 18px;
    font-weight: 500;
    white-space: nowrap;
    color: var(--gf-added-ink);
}

.gf-added-cart strong .amount {
    font-weight: inherit;
}

/* Visa varukorgen · Till kassan (the mini cart's green) */
.gf-added-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.gf-added-actions.is-one {
    grid-template-columns: minmax(0, 1fr);
}

.gf-added .gf-added-button {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    margin: 0;
    padding: 0 12px;
    border: 1.5px solid transparent;
    border-radius: 5px;
    font-family: var(--gf-added-font);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.1;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.gf-added .gf-added-button.is-cart,
.gf-added .gf-added-button.is-cart:is(:focus, :active) {
    border-color: var(--gf-added-ink);
    background: #fff;
    color: var(--gf-added-ink);
}

.gf-added .gf-added-button.is-cart:hover {
    border-color: var(--gf-added-brand);
    background: var(--gf-added-tile);
    color: var(--gf-added-brand-strong);
}

.gf-added .gf-added-button.is-checkout,
.gf-added .gf-added-button.is-checkout:is(:focus, :active) {
    background: var(--gf-added-go);
    color: #fff;
}

.gf-added .gf-added-button.is-checkout:hover {
    background: var(--gf-added-go-strong);
    color: #fff;
}

.gf-added :is(.gf-added-button, .gf-added-close):focus-visible {
    outline: 2px solid var(--gf-added-brand);
    outline-offset: 2px;
}

.gf-added .gf-added-errors {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 14.5px;
    color: var(--gf-added-ink);
}

/* While adding: the buy button waits */
form.cart.is-adding .single_add_to_cart_button {
    opacity: 0.6;
    cursor: progress;
    pointer-events: none;
}

/* WooCommerce's "Visa varukorg" beside a product list's button after adding: the confirmation (or the mini cart) says it */
a.added_to_cart.wc-forward {
    display: none !important;
}

/* Larger screens: a card at the bottom right */
@media (min-width: 768px) {
    .gf-added-region {
        right: 24px;
        bottom: 24px;
        left: auto;
        width: 400px;
        opacity: 0;
        transform: translateY(16px);
        transition: transform 0.25s ease, opacity 0.25s ease, visibility 0.25s;
    }

    .gf-added-region.is-visible {
        opacity: 1;
    }

    .gf-added {
        gap: 16px;
        padding: 20px;
        border-radius: 12px;
        box-shadow: 0 16px 48px rgb(0 0 0 / 0.18), 0 2px 8px rgb(0 0 0 / 0.06);
    }
}

@media (prefers-reduced-motion: reduce) {
    .gf-added-region,
    .gf-added .gf-added-button {
        transition: none;
    }
}
