/* ==========================================================================
   Ketology Recipe — recipe.css
   ========================================================================== */


/* ------------------------------------------------------------------
   Recipe controls (servings + units)
   ------------------------------------------------------------------ */
.keto-recipe-controls {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 32px;
    flex-wrap: wrap;
}

.keto-recipe-controls__group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.keto-recipe-controls__group--units {
    flex: none;
}

.keto-recipe-controls__label {
    font-size: 14px;
    font-weight: 400;
    line-height: 1.6;
    letter-spacing: -0.03em;
    color: var(--e-global-color-text);
    padding: 0 8px;
}

/* Servings stepper */
.keto-stepper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.keto-stepper-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 9999px !important;
    border: 1px solid var(--e-global-color-58606c7) !important;
    background: transparent !important;
    background-color: transparent !important;
    color: var(--e-global-color-primary) !important;
    cursor: pointer;
    padding: 6px !important;
    transition: opacity 0.2s ease;
    font-size: inherit !important;
    font-weight: inherit !important;
    letter-spacing: normal !important;
    box-shadow: none !important;
}

.keto-stepper-btn:hover {
    opacity: 0.6;
}

.keto-stepper-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

.keto-stepper-value {
    font-size: 20px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: -0.03em;
    color: var(--e-global-color-primary);
    min-width: 20px;
    text-align: center;
}

/* Units select */
.keto-units-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.keto-units-select {
    appearance: none;
    -webkit-appearance: none;
    width: 97px;
    height: 28px;
    box-sizing: border-box;
    border-radius: 9999px;
    border: 1px solid var(--e-global-color-58606c7);
    background: transparent;
    padding: 0 28px 0 12px;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.6;
    letter-spacing: -0.03em;
    color: var(--e-global-color-primary);
    cursor: pointer;
}

.keto-units-chevron {
    position: absolute;
    right: 12px;
    pointer-events: none;
    color: var(--e-global-color-primary);
}


/* ------------------------------------------------------------------
   Ingredients list
   ------------------------------------------------------------------ */
.keto-ingredients {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.keto-ingredient {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 16px 0;
    border-bottom: 1px solid var(--e-global-color-58606c7);
}

.keto-ingredient:last-child {
    border-bottom: none;
}

.method-title {
    display: block;
    padding-top: 32px;
    margin: 0 !important;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--e-global-color-accent);
}

.keto-ingredients > span:first-child .method-title,
.method-title:first-child {
    padding-top: 0;
}

/* Remove the border from the ingredient row that sits just before a method-title */
.keto-ingredient:has(+ span > .method-title),
.keto-ingredient:has(+ .method-title) {
    border-bottom: none;
}

.keto-ingredient__amount {
    flex-shrink: 0;
    width: 80px;
    font-size: 20px;
    font-weight: 500;
    line-height: 1.6;
    letter-spacing: -0.03em;
    color: var(--e-global-color-primary);
    text-align: center;
}

.keto-ingredient__unit {
    font-size: 18px;
    font-weight: 400;
    margin-left: 4px;
    color: var(--e-global-color-text);
}

.keto-ingredient__name {
    font-size: 20px;
    font-weight: 400;
    line-height: 1.6;
    letter-spacing: -0.03em;
    color: var(--e-global-color-text);
}


/* ------------------------------------------------------------------
   Method / instructions
   ------------------------------------------------------------------ */
.keto-method {
    display: flex;
    flex-direction: column;
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
}

.keto-method__step {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 36px 0;
    border-bottom: 1px solid var(--e-global-color-58606c7);
}

.keto-method__step:first-child {
    padding-top: 0;
}

.keto-method__step:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.keto-method__number {
    flex-shrink: 0;
    width: 48px;
    font-size: 24px;
    font-weight: 500;
    line-height: 1.6;
    letter-spacing: -0.03em;
    color: var(--e-global-color-primary);
    text-align: center;
}

.keto-method__text {
    flex: 1;
    font-size: 20px;
    font-weight: 400;
    line-height: 2;
    letter-spacing: -0.03em;
    color: var(--e-global-color-text);
    margin: 0;
}


/* ------------------------------------------------------------------
   Macros pills
   ------------------------------------------------------------------ */
.keto-macros {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.keto-macros__label {
    font-size: 14px;
    font-weight: 400;
    line-height: 1.6;
    letter-spacing: -0.03em;
    color: var(--e-global-color-text);
    margin: 0;
    flex-shrink: 0;
}

.keto-macros__pills {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
}

.keto-macros__pill {
    display: flex;
    flex-direction: row;
    align-items: center;
    background: #f6f6f6;
    border-radius: 8px;
    padding: 12px 20px;
    gap: 4px;
    flex: 1 1 0;
    max-width: 25%;
}

.keto-macros__value {
    font-size: 18px;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -0.03em;
    color: var(--e-global-color-text);
}

.keto-macros__name {
    font-size: 13px;
    font-weight: 400;
    line-height: 1.4;
    letter-spacing: -0.01em;
    color: var(--e-global-color-text);
    margin-top: 2px;
}


/* ------------------------------------------------------------------
   Share button + popover
   ------------------------------------------------------------------ */
.keto-share {
    position: relative;
    display: inline-flex;
}

.keto-share__btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
    color: var(--e-global-color-text) !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    letter-spacing: normal !important;
    box-shadow: none !important;
    text-transform: none !important;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.keto-share__btn:hover {
    opacity: 0.6;
    background: transparent !important;
    background-color: transparent !important;
}

.keto-share__popover {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--e-global-color-4fd12c0);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    padding: 8px;
    display: flex;
    flex-direction: row;
    gap: 2px;
    z-index: 200;
    white-space: nowrap;
}

.keto-share__popover[hidden] {
    display: none;
}

.keto-share__option {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 10px 12px !important;
    border-radius: 8px !important;
    border: none !important;
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
    color: var(--e-global-color-text) !important;
    font-size: 11px !important;
    font-weight: 400 !important;
    letter-spacing: -0.01em !important;
    text-transform: none !important;
    cursor: pointer;
    transition: background 0.15s ease;
    min-width: 60px;
}

.keto-share__option:hover {
    background: #f6f6f6 !important;
    background-color: #f6f6f6 !important;
}

.keto-share__label {
    display: block;
}


/* ------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------ */
@media (max-width: 768px) {
    .keto-recipe-controls {
/*         flex-direction: column; */
/*         align-items: stretch; */
        gap: 20px;
		justify-content: flex-start;
    }

    .keto-recipe-controls__group--units {
        flex: none;
    }

    .keto-ingredient__amount {
        font-size: 16px;
        width: 70px;
    }

    .keto-ingredient__unit {
        font-size: 16px;
    }

    .keto-ingredient__name {
        font-size: 17px;
    }

    .keto-method__number {
        font-size: 20px;
        width: 40px;
        margin-top: 1px;
    }

    .keto-method__text {
        font-size: 18px;
    }

    .keto-macros {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .keto-macros__pills {
        width: 100%;
    }

    .keto-macros__pill {
        flex: 1 1 0;
        max-width: 50%;
    }

}

@media (max-width: 1024px) {
    .keto-share__popover {
        bottom: auto;
        top: calc(100% + 10px);
        left: auto;
        right: 0;
        transform: none;
        flex-direction: column;
    }

    .keto-share__option {
        flex-direction: row !important;
        justify-content: flex-start !important;
        gap: 10px !important;
        min-width: 140px;
    }
}
