/* ==========================================================================
   biedaki.pl — design system
   Jasna, ciepła tonacja z pomarańczowym akcentem.
   ========================================================================== */

:root {
    /* Ciepłe neutralne */
    --bg: #fdf8f4;
    --surface: #ffffff;
    --surface-2: #fdf1e9;
    --text: #1c1613;
    --text-2: #6f6159;
    --text-3: #8a7b71;

    /* Skala pomarańczowa — od najjaśniejszego tła po najciemniejszy tekst.
       accent/accent-strong: duże i pogrubione elementy,
       accent-deep: drobny tekst (lepszy kontrast na białym). */
    --accent-tint: #fff4ee;
    --accent-tint-2: #ffe6d8;
    --accent-tint-3: #ffcbb0;
    --accent-light: #ff9f73;
    --accent: #e85d20;
    --accent-strong: #cc4712;
    --accent-deep: #a3380e;

    --border: rgba(28, 22, 19, 0.08);
    --border-strong: rgba(28, 22, 19, 0.14);

    /* Promienie */
    --r-sm: 10px;
    --r-md: 16px;
    --r-lg: 22px;
    --r-full: 999px;

    /* Cienie */
    --shadow-sm: 0 1px 2px rgba(74, 45, 28, 0.05), 0 1px 3px rgba(74, 45, 28, 0.06);
    --shadow-md: 0 4px 14px rgba(74, 45, 28, 0.08), 0 2px 4px rgba(74, 45, 28, 0.05);
    --shadow-lg: 0 16px 40px rgba(74, 45, 28, 0.13), 0 4px 10px rgba(74, 45, 28, 0.06);
    --shadow-accent: 0 8px 22px rgba(232, 93, 32, 0.26);

    /* Rytm */
    --header-h: 88px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
}

h1, h2, h3 {
    letter-spacing: -0.02em;
    line-height: 1.15;
}

:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

.wrap {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ==========================================================================
   Header
   ========================================================================== */

.brand-bar {
    height: 4px;
    background: linear-gradient(90deg, var(--accent-light), var(--accent) 50%, var(--accent-strong));
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    border-bottom: 1px solid var(--border);
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    padding: 16px 24px 14px;
}

/* Logo */

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.logo__icon {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    filter: drop-shadow(0 6px 14px rgba(234, 90, 36, 0.32));
    transition: transform 0.25s cubic-bezier(0.34, 1.3, 0.64, 1);
}

.logo:hover .logo__icon {
    transform: rotate(-6deg) scale(1.05);
}

.logo__text {
    font-size: clamp(26px, 3.4vw, 38px);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1;
    color: var(--text);
}

.logo__accent {
    background: linear-gradient(120deg, var(--accent-light), var(--accent-strong));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Wyszukiwarka */

.search {
    display: flex;
    flex: 1;
    max-width: 440px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-full);
    padding: 5px 5px 5px 20px;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.search:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-tint);
}

.search input {
    flex: 1;
    min-width: 0;
    border: none;
    background: none;
    font-size: 15px;
    color: var(--text);
    font-family: inherit;
}

.search input::placeholder {
    color: var(--text-3);
}

.search input:focus {
    outline: none;
}

.search button {
    flex-shrink: 0;
    padding: 10px 22px;
    background: linear-gradient(135deg, var(--accent-light), var(--accent));
    color: #fff;
    border: none;
    border-radius: var(--r-full);
    cursor: pointer;
    font-weight: 650;
    font-size: 14px;
    font-family: inherit;
    transition: filter 0.18s ease, transform 0.18s ease;
}

.search button:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
}

.search button:active {
    transform: translateY(0);
}

/* Zakładki główne — segmentowany przełącznik */

.main-tabs {
    padding-bottom: 14px;
}

.main-tabs__inner {
    display: inline-flex;
    gap: 4px;
    padding: 5px;
    background: var(--surface-2);
    border-radius: var(--r-full);
    border: 1px solid var(--border);
}

.main-tabs__link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 30px;
    border-radius: var(--r-full);
    font-size: 15.5px;
    font-weight: 650;
    color: var(--text-2);
    transition: color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.main-tabs__link:hover {
    color: var(--accent-deep);
}

.main-tabs__link.is-active {
    background: var(--surface);
    color: var(--accent-deep);
    box-shadow: var(--shadow-sm);
}

/* Kategorie */

.categories {
    border-top: 1px solid var(--border);
    overflow-x: auto;
    scrollbar-width: none;
    background: var(--surface);
}

.categories::-webkit-scrollbar {
    display: none;
}

.categories__inner {
    display: flex;
    gap: 6px;
    padding: 12px 24px;
    white-space: nowrap;
}

.categories a {
    padding: 7px 15px;
    border-radius: var(--r-full);
    font-size: 14px;
    font-weight: 550;
    color: var(--text-2);
    border: 1px solid transparent;
    transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.categories a span {
    color: var(--text-3);
    font-size: 12px;
    font-weight: 500;
}

.categories a:hover {
    background: var(--accent-tint);
    color: var(--accent-deep);
}

.categories a.is-active {
    background: var(--accent-tint);
    border-color: var(--accent-tint-3);
    color: var(--accent-deep);
}

.categories a.is-active span {
    color: var(--accent);
}

/* ==========================================================================
   Nagłówki sekcji
   ========================================================================== */

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 20px;
}

.page-title {
    font-size: clamp(24px, 3vw, 32px);
    font-weight: 800;
    margin: 30px 0 22px;
}

.section-head__title {
    display: flex;
    align-items: center;
    gap: 11px;
    font-size: clamp(20px, 2.4vw, 26px);
    font-weight: 750;
    margin: 0;
}

.section-head__count {
    display: inline-flex;
    align-items: center;
    padding: 3px 11px;
    border-radius: var(--r-full);
    background: var(--accent-tint);
    color: var(--accent-deep);
    font-size: 13.5px;
    font-weight: 650;
    letter-spacing: 0;
}

/* ==========================================================================
   Gorące okazje
   ========================================================================== */

.hot-deals {
    padding: 36px 0 4px;
}

.hot-deals__badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 16px 7px 13px;
    border-radius: var(--r-full);
    background: linear-gradient(135deg, var(--accent-light), var(--accent-strong));
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.01em;
    box-shadow: var(--shadow-accent);
}

.hot-deals__scroller {
    display: flex;
    gap: 18px;
    overflow-x: auto;
    padding: 4px 4px 14px;
    margin: -4px -4px 0;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
}

.hot-deals__scroller .offer-card {
    flex: 0 0 230px;
    scroll-snap-align: start;
}

/* ==========================================================================
   Listing
   ========================================================================== */

.listing {
    padding: 34px 0 72px;
}

.sort {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 14px;
    color: var(--text-2);
}

.sort select {
    padding: 9px 14px;
    border-radius: var(--r-full);
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    font-weight: 550;
    font-family: inherit;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.16s ease;
}

.sort select:hover {
    border-color: var(--accent);
}

.empty-state {
    color: var(--text-2);
    background: var(--surface);
    border: 1px dashed var(--border-strong);
    border-radius: var(--r-lg);
    padding: 56px 24px;
    text-align: center;
    font-size: 15.5px;
}

.empty-state a {
    color: var(--accent-deep);
    font-weight: 650;
}

/* ==========================================================================
   Karta oferty
   ========================================================================== */

.offer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
    gap: 20px;
}

.offer-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.22s ease, transform 0.22s ease, border-color 0.22s ease;
}

.offer-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    border-color: var(--accent-tint-2);
}

.offer-card__link {
    display: block;
}

.offer-card__image {
    position: relative;
    aspect-ratio: 1 / 1;
    background: var(--surface-2);
    overflow: hidden;
}

.offer-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.offer-card:hover .offer-card__image img {
    transform: scale(1.06);
}

.offer-card__badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--accent-strong);
    color: #fff;
    font-size: 13px;
    font-weight: 750;
    padding: 4px 11px;
    border-radius: var(--r-full);
    box-shadow: 0 3px 10px rgba(163, 56, 14, 0.32);
    letter-spacing: -0.01em;
}

.offer-card__body {
    padding: 14px 15px 16px;
}

.offer-card__title {
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0;
    margin: 0 0 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    min-height: 2.8em;
    color: var(--text);
}

.offer-card__prices {
    display: flex;
    align-items: baseline;
    gap: 9px;
    margin-bottom: 9px;
    flex-wrap: wrap;
}

.offer-card__sale {
    font-size: 19px;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: var(--accent-strong);
}

.offer-card__original {
    font-size: 13px;
    color: var(--text-3);
    text-decoration: line-through;
}

.offer-card__meta {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
    color: var(--text-2);
    padding-top: 9px;
    border-top: 1px solid var(--border);
}

/* ==========================================================================
   Paginacja
   ========================================================================== */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 44px;
    font-size: 14px;
}

.pagination a {
    padding: 10px 20px;
    border-radius: var(--r-full);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    font-weight: 650;
    color: var(--accent-deep);
    box-shadow: var(--shadow-sm);
    transition: background 0.16s ease, transform 0.16s ease;
}

.pagination a:hover {
    background: var(--accent-tint);
    transform: translateY(-1px);
}

.pagination span {
    color: var(--text-2);
    padding: 0 8px;
}

/* ==========================================================================
   Karta przepisu
   ========================================================================== */

.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 22px;
}

.recipe-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.22s ease, transform 0.22s ease, border-color 0.22s ease;
}

.recipe-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    border-color: var(--accent-tint-2);
}

.recipe-card__image {
    aspect-ratio: 4 / 3;
    background: var(--surface-2);
    overflow: hidden;
    position: relative;
}

.recipe-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.recipe-card:hover .recipe-card__image img {
    transform: scale(1.06);
}

.recipe-card__placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 44px;
    opacity: 0.3;
}

.recipe-card__body {
    padding: 16px 18px 18px;
}

.recipe-card__title {
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 10px;
    line-height: 1.3;
}

.recipe-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 11px;
    border-radius: var(--r-full);
    background: var(--surface-2);
    color: var(--text-2);
    font-size: 12.5px;
    font-weight: 550;
}

/* ==========================================================================
   Strona przepisu
   ========================================================================== */

.recipe-page {
    padding: 28px 0 72px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 20px;
    padding: 8px 16px 8px 13px;
    border-radius: var(--r-full);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    font-size: 14px;
    font-weight: 650;
    color: var(--accent-deep);
    box-shadow: var(--shadow-sm);
    transition: background 0.16s ease, transform 0.16s ease;
}

.back-link:hover {
    background: var(--accent-tint);
    transform: translateX(-2px);
}

/* Hero */

.recipe__hero {
    position: relative;
    aspect-ratio: 21 / 9;
    border-radius: var(--r-lg);
    overflow: hidden;
    background: var(--surface-2);
    box-shadow: var(--shadow-md);
    margin-bottom: 26px;
    display: flex;
    align-items: flex-end;
}

.recipe__hero img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recipe__hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(28, 22, 19, 0.84) 0%, rgba(28, 22, 19, 0.36) 44%, rgba(28, 22, 19, 0) 72%);
}

.recipe__hero-text {
    position: relative;
    z-index: 1;
    padding: 30px 34px;
    color: #fff;
    width: 100%;
}

.recipe__hero-text .recipe__title {
    color: #fff;
    margin-bottom: 8px;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.35);
}

.recipe__hero-text .recipe__description {
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    max-width: 68ch;
}

.recipe__head {
    margin-bottom: 24px;
}

.recipe__title {
    font-size: clamp(28px, 4.2vw, 42px);
    font-weight: 800;
    margin: 0 0 12px;
}

.recipe__description {
    color: var(--text-2);
    font-size: 17px;
    line-height: 1.6;
    margin: 0 0 16px;
    max-width: 72ch;
}

.recipe__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
}

.recipe__meta .chip {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 7px 15px;
    font-size: 13.5px;
    box-shadow: var(--shadow-sm);
}

/* Układ dwukolumnowy: składniki (sticky) + przygotowanie */

.recipe__layout {
    display: grid;
    grid-template-columns: 400px minmax(0, 1fr);
    gap: 26px;
    align-items: start;
}

.recipe__ingredients,
.recipe__instructions {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 26px 28px;
    box-shadow: var(--shadow-sm);
}

.recipe__ingredients {
    position: sticky;
    top: calc(var(--header-h) + 20px);
}

.recipe__ingredients h2,
.recipe__instructions h2 {
    margin: 0 0 18px;
    font-size: 20px;
    font-weight: 750;
}

/* Przelicznik porcji */

.portion-selector {
    background: var(--accent-tint);
    border: 1px solid var(--accent-tint-2);
    border-radius: var(--r-md);
    padding: 16px 18px;
    margin-bottom: 22px;
}

.portion-selector__label {
    display: block;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent-deep);
    margin-bottom: 12px;
}

.portion-selector__buttons {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.portion-selector__buttons button {
    padding: 8px 15px;
    border-radius: var(--r-full);
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text-2);
    font-weight: 650;
    font-size: 13.5px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.16s ease;
}

.portion-selector__buttons button:hover {
    border-color: var(--accent);
    color: var(--accent-deep);
    transform: translateY(-1px);
}

.portion-selector__buttons button.is-active {
    background: var(--accent);
    border-color: transparent;
    color: #fff;
    box-shadow: var(--shadow-accent);
}

.portion-selector__custom {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-2);
}

.portion-selector__custom input {
    width: 92px;
    padding: 8px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--r-sm);
    font-size: 14.5px;
    font-weight: 650;
    font-family: inherit;
    color: var(--text);
    background: var(--surface);
}

.portion-selector__custom input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-tint);
}

/* Lista składników */

.ingredient-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ingredient-list__item {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    font-size: 15px;
}

.ingredient-list__item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.ingredient-list__qty {
    font-weight: 750;
    font-size: 15.5px;
    color: var(--accent-strong);
    min-width: 3em;
    text-align: right;
    font-variant-numeric: tabular-nums;
    transition: color 0.2s ease;
}

.ingredient-list__qty--taste {
    min-width: auto;
    text-align: left;
    font-weight: 600;
    font-size: 13.5px;
    font-style: italic;
    color: var(--text-3);
}

.ingredient-list__unit {
    color: var(--text-2);
    font-size: 14px;
    min-width: 4.5em;
}

.ingredient-list__name {
    color: var(--text);
    flex: 1;
}

/* Kroki przygotowania */

.recipe-steps {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: step;
}

.recipe-steps li {
    counter-increment: step;
    position: relative;
    padding: 0 0 22px 52px;
    line-height: 1.7;
    font-size: 15.5px;
}

.recipe-steps li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: -2px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--r-full);
    background: var(--accent);
    color: #fff;
    font-size: 14.5px;
    font-weight: 750;
    box-shadow: 0 3px 9px rgba(232, 93, 32, 0.3);
}

.recipe-steps li::after {
    content: "";
    position: absolute;
    left: 16.5px;
    top: 36px;
    bottom: 6px;
    width: 2px;
    background: var(--accent-tint-3);
}

.recipe-steps li:last-child {
    padding-bottom: 0;
}

.recipe-steps li:last-child::after {
    display: none;
}

/* ==========================================================================
   Stopka
   ========================================================================== */

.site-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 34px 0;
}

.site-footer p {
    color: var(--text-2);
    font-size: 13px;
    line-height: 1.7;
    margin: 0;
    max-width: 90ch;
}

/* ==========================================================================
   Responsywność
   ========================================================================== */

@media (max-width: 1080px) {
    .recipe__layout {
        grid-template-columns: 340px minmax(0, 1fr);
    }
}

@media (max-width: 900px) {
    .recipe__layout {
        grid-template-columns: 1fr;
    }

    .recipe__ingredients {
        position: static;
    }
}

@media (max-width: 720px) {
    .wrap {
        padding: 0 16px;
    }

    .site-header {
        position: static;
    }

    .site-header__inner {
        flex-wrap: wrap;
        gap: 14px;
        padding: 14px 16px 12px;
    }

    .logo__icon {
        width: 34px;
        height: 34px;
    }

    .search {
        max-width: 100%;
        order: 3;
        width: 100%;
    }

    .main-tabs {
        padding-bottom: 12px;
    }

    .main-tabs__inner {
        display: flex;
        width: 100%;
    }

    .main-tabs__link {
        flex: 1;
        justify-content: center;
        padding: 11px 12px;
        font-size: 15px;
    }

    .categories__inner {
        padding: 10px 16px;
    }

    .offer-grid {
        grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
        gap: 14px;
    }

    .recipe-grid {
        grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
        gap: 16px;
    }

    .recipe__hero {
        aspect-ratio: 3 / 2;
    }

    .recipe__hero-text {
        padding: 20px;
    }

    .recipe__ingredients,
    .recipe__instructions {
        padding: 20px;
    }

    .hot-deals__scroller .offer-card {
        flex: 0 0 168px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
