:root {
    --green: #009b4d;
    --red: #e73548;
    --turquoise: #00a6a6;
    --text: #24323a;
    --muted: #687982;
    --line: #d7e2e6;
    --surface: #ffffff;
    --background: #f4f7f8;
    --shadow: 0 14px 35px rgba(24, 45, 55, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--text);
    background: var(--background);
    font-family: Arial, Helvetica, sans-serif;
}

.page {
    width: min(1480px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 48px;
}

.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}

.eyebrow {
    margin: 0 0 4px;
    color: var(--turquoise);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 0;
    font-size: clamp(28px, 4vw, 46px);
    line-height: 1;
}

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

.filter-link {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--text);
    background: var(--surface);
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
}

.filter-link:hover {
    color: var(--turquoise);
}

.filter-link.is-active {
    color: #ffffff;
    border-color: var(--turquoise);
    background: var(--turquoise);
}

.week-section {
    margin-top: 34px;
}

.week-title {
    margin-bottom: 18px;
    color: var(--turquoise);
    font-size: 34px;
    line-height: 1;
}

.collection-section {
    margin-bottom: 14px;
}

.collection-details {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.collection-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    padding: 16px 18px;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.collection-summary::-webkit-details-marker {
    display: none;
}

.collection-summary:hover {
    background: #f8fbfc;
}

.collection-summary-main {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.collection-title {
    color: var(--text);
    font-size: 20px;
    font-weight: 800;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.collection-dates {
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.collection-summary-meta {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 8px;
}

.collection-badge-link {
    text-decoration: none;
    cursor: pointer;
}

.collection-badge-link:hover {
    text-decoration: none;
    filter: brightness(0.96);
}

.collection-badge-link:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.collection-chevron {
    color: var(--muted);
    transition: transform 0.16s ease-in-out;
}

.collection-details[open] .collection-chevron {
    transform: rotate(180deg);
}

.collection-body {
    padding: 0 18px 18px;
}

.offer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 18px;
    content-visibility: auto;
}

.offer-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 355px;
    border-top: 4px solid var(--turquoise);
    background: var(--surface);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.offer-card--shoppinglist {
    outline: 2px solid rgba(0, 155, 77, 0.22);
    outline-offset: -2px;
}

.offer-card--favorite {
    border-top-color: #d9a300;
}

.purchase-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 34px;
    height: 28px;
    padding: 0 9px;
    border-radius: 999px;
    color: #ffffff;
    background: var(--turquoise);
    box-shadow: 0 6px 18px rgba(24, 45, 55, 0.16);
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
}

.purchase-badge .bi {
    font-size: 14px;
}

.favorite-toggle {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 6px 18px rgba(24, 45, 55, 0.16);
    cursor: pointer;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.14s ease-in-out, transform 0.14s ease-in-out;
}

.offer-card:hover .favorite-toggle,
.favorite-toggle--active,
.favorite-toggle:focus-visible {
    opacity: 1;
    transform: translateY(0);
}

.favorite-toggle img {
    width: 21px;
    height: 21px;
}

.favorite-toggle--inactive img {
    filter: grayscale(1);
    opacity: 0.48;
}

.favorite-toggle--active img {
    filter: none;
    opacity: 1;
}

.favorite-toggle.is-updating {
    pointer-events: none;
    opacity: 0.7;
}

.offer-image-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 230px;
    padding: 16px 16px 8px;
}

.offer-image {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.offer-image[data-src] {
    opacity: 0.35;
}

.offer-bottom {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: end;
    padding: 0 7px 7px;
    margin-top: auto;
}

.offer-text {
    min-width: 0;
    padding-bottom: 2px;
}

.offer-brand,
.offer-name,
.offer-amount {
    overflow-wrap: anywhere;
}

.offer-brand {
    color: #587883;
    font-size: 15px;
    line-height: 1.2;
}

.offer-name {
    color: #293b44;
    font-size: 14px;
    line-height: 1.2;
}

.offer-amount {
    margin-top: 1px;
    color: #10242b;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.2;
}

.offer-location {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    margin-top: 7px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.2;
}

.offer-price-area {
    display: grid;
    grid-template-columns: auto auto auto;
    align-items: end;
    gap: 7px;
    white-space: nowrap;
}

.shopping-icon {
    width: 27px;
    height: 27px;
    align-self: center;
}

.price-label {
    align-self: center;
    color: var(--red);
    font-size: 11px;
    font-weight: 900;
    line-height: 1.05;
    text-align: right;
    text-transform: uppercase;
}

.prices {
    display: grid;
    gap: 1px;
    min-width: 53px;
}

.price-main,
.price-secondary {
    padding: 1px 4px 0;
    color: #ffffff;
    font-size: 14px;
    font-weight: 900;
    line-height: 1.05;
    text-align: right;
}

.price-main {
    background: var(--green);
}

.price-secondary {
    background: var(--red);
}

.state-card {
    max-width: 780px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.state-card h2 {
    margin-bottom: 8px;
}

.state-card p {
    margin-bottom: 0;
    color: var(--muted);
    font-weight: 700;
}

.state-card--error {
    border-color: rgba(231, 53, 72, 0.35);
}

@media (hover: none) {
    .favorite-toggle {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 720px) {
    .page {
        width: min(100% - 20px, 1480px);
        padding-top: 18px;
    }

    .page-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 14px;
    }
}
