/*
 * Content Egg deals. Colours and spacing are custom properties: set any of them
 * from the theme, anywhere (:root included). Nothing here declares them - each
 * var() carries its default as the fallback:
 *   --cegg-deal-accent: #e11d48;        buttons, current chips
 *   --cegg-deal-accent-text: #fff;
 *   --cegg-deal-muted: #6b7280;
 *   --cegg-deal-border: rgba(127, 127, 127, .25);
 *   --cegg-deal-good: #15803d;          discount %, "lowest price"
 *   --cegg-deal-hot: #ea580c;           Hot badge
 *   --cegg-deal-surface: #fff;          cards and panels
 *   --cegg-deal-surface-2: #f6f7f9;     image wells
 *   --cegg-deal-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
 *   --cegg-deal-radius: 10px;
 *   --cegg-deal-gap: 20px;
 */
.cegg-deal-main { box-sizing: border-box; max-width: 1180px; margin: 0 auto; padding: 20px 16px 48px; }
.cegg-deal-main *, .cegg-deal-grid * { box-sizing: border-box; }
.cegg-deal-icon { display: inline-block; flex: none; vertical-align: -.125em; }

/* Badges */
.cegg-deal-badge { position: absolute; top: 10px; left: 10px; z-index: 1; background: var(--cegg-deal-accent, #e11d48); color: var(--cegg-deal-accent-text, #fff); font-weight: 700; font-size: .8em; line-height: 1; padding: 5px 8px; border-radius: 6px; }
.cegg-deal-hot { position: absolute; top: 10px; right: 10px; z-index: 1; display: inline-flex; align-items: center; gap: 3px; background: var(--cegg-deal-hot, #ea580c); color: #fff; font-weight: 700; font-size: .75em; line-height: 1; padding: 5px 8px; border-radius: 6px; text-transform: uppercase; letter-spacing: .03em; }
.cegg-deal-hot--inline { position: static; }
.cegg-deal-flag { display: inline-block; font-size: .85em; font-weight: 600; color: var(--cegg-deal-muted, #6b7280); border: 1px solid var(--cegg-deal-border, rgba(127, 127, 127, .25)); border-radius: 999px; padding: 2px 10px; }

/* Price */
.cegg-deal-price { display: flex; align-items: baseline; gap: 4px 10px; flex-wrap: wrap; }
.cegg-deal-price__now { font-size: 2em; font-weight: 800; line-height: 1.1; color: var(--cegg-deal-accent, #e11d48); }
.cegg-deal-price__old { color: var(--cegg-deal-muted, #6b7280); }
.cegg-deal-price__off { font-weight: 700; color: var(--cegg-deal-good, #15803d); }
.cegg-deal-price--sm .cegg-deal-price__now { font-size: 1.2em; }
.cegg-deal-price--sm .cegg-deal-price__old, .cegg-deal-price--sm .cegg-deal-price__off { font-size: .85em; }

/* Grid + card: a square image well keeps every card in a row the same height. */
.cegg-deal-grid { display: grid; grid-template-columns: repeat(var(--cegg-deal-cols, 4), minmax(0, 1fr)); gap: var(--cegg-deal-gap, 20px); }
.cegg-deal-card { display: flex; flex-direction: column; background: var(--cegg-deal-surface, #fff); border: 1px solid var(--cegg-deal-border, rgba(127, 127, 127, .25)); border-radius: var(--cegg-deal-radius, 10px); box-shadow: var(--cegg-deal-shadow, 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08)); overflow: hidden; transition: box-shadow .15s, transform .15s; }
.cegg-deal-card:hover { box-shadow: 0 6px 18px rgba(16, 24, 40, .12); transform: translateY(-2px); }
.cegg-deal-card__media { position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 1 / 1; overflow: hidden; margin: 10px 10px 0; padding: 14px; background: var(--cegg-deal-surface-2, #f6f7f9); border-radius: calc(var(--cegg-deal-radius, 10px) - 2px); }
.cegg-deal-card__img { width: 100%; height: 100%; min-height: 0; object-fit: contain; mix-blend-mode: multiply; }
.cegg-deal-card__body { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px 14px; flex: 1; }
.cegg-deal-card__store { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: .8em; color: var(--cegg-deal-muted, #6b7280); }
.cegg-deal-card__store-link { display: inline-flex; align-items: center; gap: 6px; min-width: 0; color: inherit; text-decoration: none; }
.cegg-deal-card__store-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cegg-deal-card__store-link:hover span { text-decoration: underline; }
.cegg-deal-card__store-logo { width: 16px; height: 16px; object-fit: contain; border-radius: 3px; }
.cegg-deal-card__coupon { flex: none; padding: 1px 6px; border: 1px dashed var(--cegg-deal-accent, #e11d48); border-radius: 4px; color: var(--cegg-deal-accent, #e11d48); font-weight: 700; font-size: .9em; text-transform: uppercase; letter-spacing: .03em; }
.cegg-deal-card__title { font-size: 1em; font-weight: 600; line-height: 1.35; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cegg-deal-card__title a { text-decoration: none; color: inherit; }
.cegg-deal-card__title a:hover { text-decoration: underline; }
.cegg-deal-card__foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--cegg-deal-border, rgba(127, 127, 127, .25)); display: flex; align-items: center; gap: 12px; font-size: .8em; color: var(--cegg-deal-muted, #6b7280); }
.cegg-deal-card__score, .cegg-deal-card__comments { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.cegg-deal-card__ago { margin-left: auto; white-space: nowrap; }

.is-expired .cegg-deal-card__media, .is-expired .cegg-deal-hero__media { filter: grayscale(1); opacity: .6; }
.is-expired .cegg-deal-price__now, .is-expired .cegg-deal-price__off { color: var(--cegg-deal-muted, #6b7280); }
.is-expired .cegg-deal-badge { background: var(--cegg-deal-muted, #6b7280); }

@media (max-width: 900px) { .cegg-deal-grid { grid-template-columns: repeat(min(var(--cegg-deal-cols, 4), 3), minmax(0, 1fr)); } }
@media (max-width: 720px) { .cegg-deal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }
@media (max-width: 480px) { .cegg-deal-grid { gap: 10px; } .cegg-deal-card__media { margin: 6px 6px 0; padding: 8px; } .cegg-deal-card__body { padding: 10px; } .cegg-deal-card__ago { display: none; } }
@media (max-width: 340px) { .cegg-deal-grid { grid-template-columns: 1fr; } }

/* Single: hero panel */
.cegg-deal-hero { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 32px; align-items: start; padding: 24px; background: var(--cegg-deal-surface, #fff); border: 1px solid var(--cegg-deal-border, rgba(127, 127, 127, .25)); border-radius: var(--cegg-deal-radius, 10px); box-shadow: var(--cegg-deal-shadow, 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08)); }
.cegg-deal-hero__media { position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; overflow: hidden; padding: 24px; background: var(--cegg-deal-surface-2, #f6f7f9); border-radius: calc(var(--cegg-deal-radius, 10px) - 2px); }
.cegg-deal-hero__img { width: 100%; height: 100%; min-height: 0; object-fit: contain; mix-blend-mode: multiply; }
.cegg-deal-hero__info { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; min-width: 0; }
.cegg-deal-hero__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: .9em; color: var(--cegg-deal-muted, #6b7280); }
.cegg-deal-hero__title { margin: 0; font-size: 1.75em; line-height: 1.25; }
.cegg-deal-store { display: inline-flex; align-items: center; gap: 8px; color: inherit; font-weight: 600; text-decoration: none; }
.cegg-deal-store:hover span { text-decoration: underline; }
.cegg-deal-store__logo { width: 24px; height: 24px; object-fit: contain; border-radius: 4px; }
.cegg-deal-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: .9em; color: var(--cegg-deal-muted, #6b7280); }
.cegg-deal-meta__ends { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; color: var(--cegg-deal-hot, #ea580c); }
.cegg-deal-lowest { color: var(--cegg-deal-good, #15803d); font-weight: 600; }
.cegg-deal-btn { display: inline-flex; align-items: center; justify-content: center; min-width: min(100%, 320px); background: var(--cegg-deal-accent, #e11d48); color: var(--cegg-deal-accent-text, #fff); text-decoration: none; font-weight: 700; font-size: 1.05em; padding: 14px 32px; border-radius: 999px; box-shadow: 0 4px 12px color-mix(in srgb, var(--cegg-deal-accent, #e11d48) 25%, transparent); }
.cegg-deal-btn:hover, .cegg-deal-btn:focus { filter: brightness(.93); color: var(--cegg-deal-accent-text, #fff); }
.cegg-deal-hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; align-self: stretch; margin-top: 4px; padding-top: 16px; border-top: 1px solid var(--cegg-deal-border, rgba(127, 127, 127, .25)); }
.cegg-deal-hero__comments { display: inline-flex; align-items: center; gap: 6px; color: var(--cegg-deal-muted, #6b7280); text-decoration: none; font-weight: 600; font-size: .9em; }
.cegg-deal-hero__comments:hover { text-decoration: underline; }

/* Coupon ticket */
.cegg-deal-coupon { display: flex; flex-direction: column; gap: 4px; }
.cegg-deal-coupon__label { font-size: .8em; color: var(--cegg-deal-muted, #6b7280); text-transform: uppercase; letter-spacing: .04em; }
.cegg-deal-coupon__row { display: inline-flex; align-items: stretch; align-self: flex-start; max-width: 100%; border: 2px dashed var(--cegg-deal-good, #15803d); border-radius: 8px; background: color-mix(in srgb, var(--cegg-deal-good, #15803d) 6%, transparent); overflow: hidden; }
.cegg-deal-coupon__cut { display: flex; align-items: center; padding: 0 0 0 12px; color: var(--cegg-deal-good, #15803d); }
.cegg-deal-coupon__code { min-width: 0; overflow-wrap: anywhere; font-family: inherit; font-size: 1.15em; font-weight: 800; letter-spacing: .06em; padding: 9px 14px; background: none; color: var(--cegg-deal-good, #15803d); }
.cegg-deal-coupon__copy { flex: none; border: 0; border-left: 2px dashed var(--cegg-deal-good, #15803d); background: none; color: var(--cegg-deal-good, #15803d); font-weight: 700; padding: 9px 16px; cursor: pointer; }
.cegg-deal-coupon__copy:hover { background: color-mix(in srgb, var(--cegg-deal-good, #15803d) 10%, transparent); }
.cegg-deal-coupon__note { font-size: .85em; color: var(--cegg-deal-muted, #6b7280); }
.is-expired .cegg-deal-coupon { opacity: .6; }

/* Deal score */
.cegg-deal-votes { display: inline-flex; align-items: center; gap: 4px; }
.cegg-deal-votes__label { font-size: .8em; font-weight: 700; line-height: 1.1; padding: 8px 10px; border-radius: 8px 0 0 8px; background: color-mix(in srgb, var(--cegg-deal-hot, #ea580c) 12%, transparent); color: var(--cegg-deal-hot, #ea580c); }
.cegg-deal-votes__score { min-width: 3ch; margin: 0 6px 0 -4px; padding: 6px 10px; border-radius: 0 8px 8px 0; background: color-mix(in srgb, var(--cegg-deal-hot, #ea580c) 6%, transparent); text-align: center; font-weight: 800; font-size: 1.1em; }
.cegg-deal-votes__btn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 1px solid var(--cegg-deal-border, rgba(127, 127, 127, .25)); border-radius: 999px; background: none; cursor: pointer; font-size: 1.05em; color: var(--cegg-deal-muted, #6b7280); }
.cegg-deal-votes__btn--up:hover:not(:disabled) { color: var(--cegg-deal-good, #15803d); border-color: currentColor; }
.cegg-deal-votes__btn--down:hover:not(:disabled) { color: var(--cegg-deal-accent, #e11d48); border-color: currentColor; }
.cegg-deal-votes__btn:disabled { cursor: default; opacity: .45; }
.cegg-deal-votes.is-busy { opacity: .6; }

/* Single: section panels */
.cegg-deal-section { margin-top: 20px; padding: 24px; background: var(--cegg-deal-surface, #fff); border: 1px solid var(--cegg-deal-border, rgba(127, 127, 127, .25)); border-radius: var(--cegg-deal-radius, 10px); box-shadow: var(--cegg-deal-shadow, 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08)); }
.cegg-deal-section__title { font-size: 1.2em; margin: 0 0 16px; }
.cegg-deal-section--alert { padding: 0; border: 0; background: none; box-shadow: none; }
.cegg-deal-section--related { background: none; border: 0; box-shadow: none; padding: 24px 0 0; }
.cegg-deal__content > :first-child { margin-top: 0; }
.cegg-deal__content > :last-child { margin-bottom: 0; }

@media (max-width: 720px) {
    .cegg-deal-hero { grid-template-columns: 1fr; gap: 20px; padding: 16px; }
    .cegg-deal-hero__title { font-size: 1.4em; }
    .cegg-deal-btn { align-self: stretch; }
    .cegg-deal-section { padding: 16px; }
}

/* Breadcrumbs */
.cegg-deal-crumbs { margin: 0 0 16px; font-size: .85em; color: var(--cegg-deal-muted, #6b7280); }
.cegg-deal-crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0; padding: 0; list-style: none; }
.cegg-deal-crumbs li { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.cegg-deal-crumbs li + li::before { content: "\203A"; opacity: .6; }
.cegg-deal-crumbs a { color: inherit; text-decoration: none; }
.cegg-deal-crumbs a:hover { text-decoration: underline; }
.cegg-deal-crumbs [aria-current] { color: inherit; opacity: .8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40ch; }

/* Chips */
.cegg-deal-chips { display: flex; gap: 8px; margin: 0 0 16px; padding-bottom: 4px; overflow-x: auto; scrollbar-width: thin; }
.cegg-deal-chip { flex: none; display: inline-block; padding: 6px 14px; border: 1px solid var(--cegg-deal-border, rgba(127, 127, 127, .25)); border-radius: 999px; background: var(--cegg-deal-surface, #fff); color: inherit; font-size: .9em; font-weight: 500; text-decoration: none; white-space: nowrap; }
.cegg-deal-chip:hover { border-color: var(--cegg-deal-accent, #e11d48); color: var(--cegg-deal-accent, #e11d48); }
.cegg-deal-chip.is-current { background: var(--cegg-deal-accent, #e11d48); border-color: var(--cegg-deal-accent, #e11d48); color: var(--cegg-deal-accent-text, #fff); }
.cegg-deal-chip--sm { padding: 2px 10px; font-size: .95em; white-space: normal; }

/* Archive head + store/category header */
.cegg-deal-archive__head { margin-bottom: 16px; }
.cegg-deal-archive__title { margin: 0 0 6px; font-size: 1.9em; }
.cegg-deal-archive__desc { color: var(--cegg-deal-muted, #6b7280); }
.cegg-deal-termhead { display: flex; align-items: center; gap: 20px; margin-bottom: 20px; padding: 20px 24px; background: var(--cegg-deal-surface, #fff); border: 1px solid var(--cegg-deal-border, rgba(127, 127, 127, .25)); border-radius: var(--cegg-deal-radius, 10px); box-shadow: var(--cegg-deal-shadow, 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08)); }
.cegg-deal-termhead__logo { flex: none; display: flex; align-items: center; justify-content: center; width: 128px; height: 88px; padding: 12px; background: var(--cegg-deal-surface-2, #f6f7f9); border-radius: calc(var(--cegg-deal-radius, 10px) - 2px); }
.cegg-deal-termhead__logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.cegg-deal-termhead__body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cegg-deal-termhead__title { margin: 0; font-size: 1.6em; line-height: 1.2; }
.cegg-deal-termhead__count { font-size: .9em; font-weight: 600; color: var(--cegg-deal-muted, #6b7280); }
.cegg-deal-termhead__desc { color: var(--cegg-deal-muted, #6b7280); }
.cegg-deal-termhead__desc > :first-child { margin-top: 0; }
.cegg-deal-termhead__desc > :last-child { margin-bottom: 0; }
.cegg-deal-termhead__links { display: flex; flex-wrap: wrap; gap: 8px 20px; font-weight: 600; font-size: .9em; }
.cegg-deal-termhead__cashback { color: var(--cegg-deal-good, #15803d); }
.cegg-deal-archive > .cegg-deal-section--coupons { margin: 0 0 20px; }

/* Toolbar */
.cegg-deal-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; }
.cegg-deal-sort { display: flex; flex-wrap: wrap; gap: 6px; }
.cegg-deal-sort__link { text-decoration: none; padding: 6px 14px; border: 1px solid var(--cegg-deal-border, rgba(127, 127, 127, .25)); border-radius: 999px; font-size: .9em; color: inherit; background: var(--cegg-deal-surface, #fff); }
.cegg-deal-sort__link:hover { border-color: var(--cegg-deal-accent, #e11d48); }
.cegg-deal-sort__link.is-current { background: var(--cegg-deal-accent, #e11d48); border-color: var(--cegg-deal-accent, #e11d48); color: var(--cegg-deal-accent-text, #fff); }
.cegg-deal-filter { display: flex; gap: 8px; flex-wrap: wrap; }
.cegg-deal-filter select { padding: 6px 10px; border: 1px solid var(--cegg-deal-border, rgba(127, 127, 127, .25)); border-radius: 8px; background: var(--cegg-deal-surface, #fff); }
.cegg-deal-empty { padding: 40px 0; text-align: center; color: var(--cegg-deal-muted, #6b7280); }
.cegg-deal-pagination { margin-top: 28px; }

@media (max-width: 720px) {
    .cegg-deal-termhead { flex-direction: column; align-items: flex-start; padding: 16px; }
    .cegg-deal-termhead__logo { width: 64px; height: 64px; }
    .cegg-deal-archive__title { font-size: 1.5em; }
}
