/**
 * Affiliate link frontend styles — v3.9.14
 *
 * Scoped under the recipe container ID (#drd-*, #drm-*, #dre-*)
 * via the inline <style> ID-selector pattern from CLAUDE.md rule 9.
 * These rules are loaded as a fallback; the templates also print
 * scoped inline <style> blocks for maximum specificity.
 */

/* ── FTC / Google disclosure banner ──────────────────────────────────────── */
.delice-affiliate-disclosure {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 6px;
    padding: 10px 14px;
    margin: 0 0 18px;
    font-size: 12px;
    line-height: 1.55;
    color: #78350f;
}
.delice-aff-disc-icon {
    flex-shrink: 0;
    fill: #92400e;
    margin-top: 1px;
}

/* ── Buy chip — outline pill style (v3.9.24) ─────────────────────────────── */
/*
 * Replaces the old filled `.delice-aff-btn` buttons with a lighter, more
 * editorial "chip" design: transparent background, coloured border + text,
 * small cart icon.  Generated by Delice_Affiliate_Manager::render_ingredient_buttons().
 */
.delice-buy-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    flex-shrink: 0;
    padding: 3px 9px 3px 7px;
    border-radius: 20px;
    border: 1.5px solid currentColor;
    background: transparent;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none !important;
    white-space: nowrap;
    transition: background .15s, box-shadow .15s, transform .1s;
}
.delice-buy-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 7px rgba(0,0,0,.12);
}
.delice-buy-chip:focus-visible {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}
.delice-buy-chip-icon {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}
.delice-buy-chip-label {
    /* inherits color from chip */
}

/* ── Platform colours — border + text, tinted hover background ───────────── */

/* Amazon — warm amber */
.delice-buy-chip--amazon            { color: #b86200 !important; }
.delice-buy-chip--amazon:hover      { background: #fff7ed; color: #9a5000 !important; }

/* ShareASale — forest green */
.delice-buy-chip--shareasale        { color: #0d7a4d !important; }
.delice-buy-chip--shareasale:hover  { background: #f0fdf6; color: #095f3c !important; }

/* CJ Affiliate — royal blue */
.delice-buy-chip--cj                { color: #0048a8 !important; }
.delice-buy-chip--cj:hover          { background: #eef4ff; color: #003888 !important; }

/* Impact — violet */
.delice-buy-chip--impact            { color: #6b2ed4 !important; }
.delice-buy-chip--impact:hover      { background: #f5f0ff; color: #5820b0 !important; }

/* Custom / fallback — slate */
.delice-buy-chip--custom            { color: #475569 !important; }
.delice-buy-chip--custom:hover      { background: #f1f5f9; color: #334155 !important; }

/* ── Multi-chip container ─────────────────────────────────────────────────── */
/*
 * Wraps multiple chips when an ingredient matches more than one platform.
 * Single-chip case has no wrapper.
 */
.delice-buy-chips {
    display: inline-flex !important;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
    margin-left: auto;
    flex-shrink: 0;
}
.delice-buy-chips .delice-buy-chip {
    margin-left: 0;
}

/* ── Ingredient row adjustment when chip(s) are present ──────────────────── */
.delice-recipe-ingredient--linked {
    position: relative;
}
/* Ingredient name: prevent crush when affiliate chip(s) are present.
 * With the 2-row grid layout the name occupies its own 1fr column so it
 * cannot be squeezed to zero width regardless of how many chips exist. */
.delice-recipe-ingredient--linked .delice-recipe-ingredient-name,
.delice-recipe-ingredient--linked .delice-modern-ingredient-name,
.delice-recipe-ingredient--linked .delice-elegant-ingredient-name {
    min-width: 80px;
    word-break: break-word;
}

/* ── Equipment card grid — v3.9.17 ──────────────────────────────────────── */
/*
 * Fallback styles for the equipment card grid. Templates render ID-scoped
 * inline <style> blocks (CLAUDE.md rule 9) that take priority, so these
 * rules only fire when the inline block is absent (e.g. email previews).
 */
.delice-eq-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(185px, 1fr)) !important;
    gap: 14px !important;
    padding: 14px 0 20px !important;
}
.delice-eq-card {
    display: flex !important;
    flex-direction: column !important;
    background: #fff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    transition: transform .2s, box-shadow .2s !important;
}
.delice-eq-card:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 10px 28px rgba(0,0,0,.1) !important;
}
.delice-eq-card-top {
    padding: 16px 14px 10px !important;
    display: flex !important;
    align-items: flex-start !important;
    gap: 11px !important;
    flex: 1 !important;
}
.delice-eq-icon {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #fff7ed, #fed7aa) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    color: #ea580c !important;
}
.delice-eq-card-info { flex: 1 !important; min-width: 0 !important; }
.delice-eq-name {
    display: block !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    line-height: 1.35 !important;
    color: #111827 !important;
}
.delice-eq-notes {
    display: block !important;
    font-size: 12px !important;
    color: #6b7280 !important;
    margin-top: 4px !important;
    line-height: 1.4 !important;
}
.delice-eq-badge-row { padding: 0 14px 10px !important; }
.delice-eq-badge {
    display: inline-block !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    letter-spacing: .05em !important;
    text-transform: uppercase !important;
    padding: 3px 9px !important;
    border-radius: 20px !important;
}
.delice-eq-badge--req { background: #fef3c7 !important; color: #92400e !important; }
.delice-eq-badge--opt { background: #f3f4f6 !important; color: #6b7280 !important; }
.delice-eq-btn-wrap { padding: 0 14px 14px !important; }
.delice-eq-buy-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 7px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 10px 14px !important;
    border-radius: 8px !important;
    background: linear-gradient(135deg, #ff9900, #e67700) !important;
    color: #111 !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    transition: transform .15s, filter .15s !important;
    white-space: nowrap !important;
    box-shadow: 0 3px 10px rgba(255,153,0,.4) !important;
}
.delice-eq-buy-btn:hover {
    transform: translateY(-1px) !important;
    filter: brightness(1.1) !important;
    color: #111 !important;
}
.delice-eq-buy-btn svg { flex-shrink: 0 !important; }

@media (max-width: 600px) {
    .delice-eq-grid { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 380px) {
    .delice-eq-grid { grid-template-columns: 1fr !important; }
}

/* ── Print: hide all affiliate elements ─────────────────────────────────── */
@media print {
    .delice-affiliate-disclosure,
    .delice-buy-chip,
    .delice-buy-chips,
    .delice-eq-buy-btn,
    .delice-eq-btn-wrap { display: none !important; }
}
