/* ==========================================================================
   SmudFood — Fjern / Legg til rett
   Oppgave 2: placeholder-tile, Fjern-pill, demotert "Lage nå".

   Alt er scopet til .recipe_grocery_prepp #collection_menu (Endre-fanen).
   Spisedag-fanen bruker samme PHP-template og skal se ut som før.

   !important på bakgrunn, farge, border, padding, border-radius,
   font-weight, display og position — Elementor og style.css setter de samme
   egenskapene. IKKE på animation/transition.
   ========================================================================== */

/* ==========================================================================
   1. Kortet som ligger og venter på sletting
   ========================================================================== */

.recipe_grocery_prepp #collection_menu .inner_recipe_sec.smud-fjern-card-hidden {
    display: none !important;
}

/* ==========================================================================
   2. Placeholder-tile — samme slot-bredde som et middagskort
      (style.css:153 = 49%, :1013 = 100% under 1080px, :1681 = 48% i mobile_list)
   ========================================================================== */

.recipe_grocery_prepp #collection_menu .smud-fjern-tile {
    width: 49% !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: center !important;
    position: relative !important;
    padding: 32px 25px !important;
    margin-bottom: 30px !important;
    background: var(--smud-eggshell) !important;
    border: 2px dashed var(--smud-raspberry-40) !important;
    border-radius: 10px !important;
}

.recipe_grocery_prepp #collection_menu .smud-fjern-tile.is-committing {
    opacity: 0.45;
    pointer-events: none !important;
}

.recipe_grocery_prepp #collection_menu .smud-fjern-tile__badge {
    display: inline-block !important;
    position: relative !important;
    padding: 3px 10px !important;
    margin: 0 0 10px 0 !important;
    background: var(--smud-raspberry-20) !important;
    color: var(--smud-grape) !important;
    border: 0 !important;
    border-radius: var(--smud-radius-pill) !important;
    font-family: 'Josefin Sans', sans-serif;
    font-size: 12px !important;
    font-weight: 600 !important;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.5 !important;
}

.recipe_grocery_prepp #collection_menu .smud-fjern-tile__title {
    display: block !important;
    position: relative !important;
    padding: 0 !important;
    margin: 0 0 18px 0 !important;
    background: transparent !important;
    color: var(--smud-charcoal-60) !important;
    border: 0 !important;
    font-family: 'Josefin Sans', sans-serif;
    font-size: 18px !important;
    font-weight: 500 !important;
    line-height: 1.3 !important;
    text-decoration: line-through;
}

/* "+ Legg til ny her" — hovedhandlingen i tilen */
.recipe_grocery_prepp #collection_menu .smud-fjern-tile__add {
    display: inline-block !important;
    position: relative !important;
    padding: 0 !important;
    margin: 0 0 16px 0 !important;
    background: transparent !important;
    color: var(--smud-raspberry) !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    font-family: 'Josefin Sans', sans-serif;
    font-size: 20px !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
    text-align: left !important;
    cursor: pointer;
    transition: color 0.15s ease;
}

.recipe_grocery_prepp #collection_menu .smud-fjern-tile__add:hover,
.recipe_grocery_prepp #collection_menu .smud-fjern-tile__add:focus-visible {
    color: var(--smud-raspberry-80) !important;
    text-decoration: underline !important;
}

/* Angre-lenke med diskret nedtelling */
.recipe_grocery_prepp #collection_menu .smud-fjern-tile__undo {
    display: inline-flex !important;
    align-items: center !important;
    position: relative !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    color: var(--smud-charcoal-60) !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    font-family: 'Josefin Sans', sans-serif;
    font-size: 15px !important;
    font-weight: 500 !important;
    line-height: 1.4 !important;
    cursor: pointer;
    transition: color 0.15s ease;
}

.recipe_grocery_prepp #collection_menu .smud-fjern-tile__undo:hover,
.recipe_grocery_prepp #collection_menu .smud-fjern-tile__undo:focus-visible {
    color: var(--smud-grape) !important;
    text-decoration: underline !important;
}

.recipe_grocery_prepp #collection_menu .smud-fjern-tile__count {
    display: inline-block !important;
    position: relative !important;
    padding: 0 !important;
    margin: 0 0 0 6px !important;
    background: transparent !important;
    color: var(--smud-charcoal-40) !important;
    border: 0 !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    font-variant-numeric: tabular-nums;
}

.recipe_grocery_prepp #collection_menu .smud-fjern-tile__bar {
    display: block !important;
    position: relative !important;
    width: 46px !important;
    height: 3px !important;
    padding: 0 !important;
    margin: 0 0 0 10px !important;
    background: var(--smud-grape-20) !important;
    border: 0 !important;
    border-radius: var(--smud-radius-pill) !important;
    overflow: hidden;
}

.recipe_grocery_prepp #collection_menu .smud-fjern-tile__bar i {
    display: block !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: var(--smud-raspberry) !important;
    border: 0 !important;
    border-radius: var(--smud-radius-pill) !important;
    transform-origin: left center;
    animation: smud-fjern-countdown var(--smud-fjern-undo-duration, 6s) linear forwards;
}

/* Frosset tilstand: "+ Legg til ny her" er trykket, men panelet finnes ikke
   ennå (Oppgave 3). Nedtellingen skjules, Angre er fortsatt tilgjengelig. */
.recipe_grocery_prepp #collection_menu .smud-fjern-tile.is-frozen .smud-fjern-tile__bar,
.recipe_grocery_prepp #collection_menu .smud-fjern-tile.is-frozen .smud-fjern-tile__count {
    display: none !important;
}

.recipe_grocery_prepp #collection_menu .smud-fjern-tile.is-frozen .smud-fjern-tile__bar i {
    animation: none;
}

@keyframes smud-fjern-countdown {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

@media (prefers-reduced-motion: reduce) {
    .recipe_grocery_prepp #collection_menu .smud-fjern-tile__bar i {
        animation: none;
    }
}

/* ==========================================================================
   3. Fjern-knappen
      Mobil: uendret papirkurv-ikon (labelen skjules).
      Desktop: pill med ikon + "Fjern".
   ========================================================================== */

.recipe_grocery_prepp #collection_menu .recipe_remove .smud-fjern-btn__label {
    display: none !important;
}

@media only screen and (min-width: 1081px) {

    .recipe_grocery_prepp #collection_menu .grocery-prepp-right-recipe .recipe_remove,
    .recipe_grocery_prepp #collection_menu .recipe_remove {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        position: relative !important;
        width: auto !important;
        height: auto !important;
        padding: 9px 18px 9px 42px !important;
        background: #fff !important;
        color: var(--smud-grape) !important;
        border: 1px solid var(--smud-grape-20) !important;
        border-radius: var(--smud-radius-pill) !important;
        transition: border-color 0.15s ease, background-color 0.15s ease;
    }

    .recipe_grocery_prepp #collection_menu .recipe_remove:hover,
    .recipe_grocery_prepp #collection_menu .recipe_remove:focus-visible {
        background: var(--smud-raspberry-20) !important;
        border-color: var(--smud-raspberry-40) !important;
    }

    /* Papirkurv-ikonet ligger i :after (style.css:155) som en 50x50
       bakgrunn. Vi beholder bildet, men krymper og sentrerer det i pillen. */
    .recipe_grocery_prepp #collection_menu .recipe_remove:after {
        width: 22px !important;
        height: 22px !important;
        top: 50% !important;
        left: 14px !important;
        background-size: 22px 22px !important;
        background-repeat: no-repeat !important;
        background-position: center !important;
        transform: translateY(-50%);
    }

    .recipe_grocery_prepp #collection_menu .recipe_remove .smud-fjern-btn__label {
        display: inline-block !important;
        position: relative !important;
        padding: 0 !important;
        margin: 0 !important;
        background: transparent !important;
        color: inherit !important;
        border: 0 !important;
        font-family: 'Josefin Sans', sans-serif;
        font-size: 16px !important;
        font-weight: 600 !important;
        line-height: 1.2 !important;
        white-space: nowrap;
    }

}

/* ==========================================================================
   4. "Lage nå" fjernes helt fra Endre-fanen.

      Knappen er redundant: customization.php:1799 legger tittelen OG
      pil-SVG-en inne i samme <a href="$post_url">, og a.recipe_cook på
      linje 1833 peker på nøyaktig samme $post_url. Pilen i tittelen er
      dermed allerede veien til oppskriften, slik den har vært på mobil
      (der style.css:1438 har skjult knappen hele tiden).

      Scopet til #collection_menu, så Spisedag-fanen beholder knappen.
      Reverteres ved å bytte display til flex i regelen under.
   ========================================================================== */

.recipe_grocery_prepp #collection_menu .grocery-prepp-right-recipe .recipe_btn,
.recipe_grocery_prepp #collection_menu .recipe_bottom .recipe_btn {
    display: none !important;
}

/* ==========================================================================
   5. Placeholder i kompakt mobilvisning
   ========================================================================== */

@media only screen and (max-width: 1080px) {
    .recipe_grocery_prepp #collection_menu .smud-fjern-tile {
        width: 100% !important;
    }
}

@media only screen and (max-width: 767px) {
    .recipe_grocery_prepp #collection_menu .smud-fjern-tile {
        padding: 20px 16px !important;
    }

    /* mobile_list settes på #collection_menu selv (customization.php:1200,
       toggles av front.js:656) — ikke på en forelder. */
    .recipe_grocery_prepp #collection_menu.mobile_list .smud-fjern-tile {
        width: 48% !important;
        margin-bottom: 0 !important;
        padding: 14px 12px !important;
    }

    .recipe_grocery_prepp #collection_menu .smud-fjern-tile__title {
        font-size: 16px !important;
        margin-bottom: 14px !important;
    }

    .recipe_grocery_prepp #collection_menu .smud-fjern-tile__add {
        font-size: 17px !important;
        margin-bottom: 12px !important;
    }
}
