/* ──────────────────────────────────────────────────────────────
   Product Recommendations (cross-sell) — yedinet_v4 orderforms
   Styles the native WHMCS .product-recommendation markup so it
   matches the glossy card language. Same rules cover the inline
   blocks (viewcart/checkout/complete) AND the JS-cloned modal
   cards on the configure step — do not rename these classes.
   ────────────────────────────────────────────────────────────── */

/* Section wrapper (inline pages) */
.yn-rec-card {
    background: var(--yn-surface, #fff);
    border-radius: 18px;
    padding: 24px 24px 26px;
    margin: 22px 0;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, .06),
                0 4px 6px -1px rgba(15, 23, 42, .04),
                0 18px 36px -12px rgba(99, 102, 241, .10);
}

.yn-rec-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.yn-rec-icon {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    font-size: 20px;
    color: #fff;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    box-shadow: 0 8px 18px -6px rgba(99, 102, 241, .5);
}

.yn-rec-title {
    margin: 0;
    font-family: "Fraunces", serif;
    font-weight: 900;
    letter-spacing: -.4px;
    font-size: 20px;
    color: var(--yn-text, #0f1c3f);
}

.yn-rec-desc {
    margin: 2px 0 0;
    font-size: 13px;
    color: var(--yn-text-muted, #64748b);
}

/* ── Inline cards (viewcart/checkout/complete) — hook-driven, own
   markup/classes so they can't collide with unrelated native .content/
   .cta/.price rules bundled in all.min.css. ─────────────────────────── */
.yn-rec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.yn-rec-item {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 14px;
    border: 1px solid var(--yn-border, rgba(15, 28, 63, .08));
    border-radius: 14px;
    background: #fff;
    padding: 16px;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.yn-rec-item:hover {
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, .35);
    box-shadow: 0 12px 28px -12px rgba(99, 102, 241, .3);
}
.yn-rec-item-title {
    margin: 0;
    font-weight: 600;
    font-size: 15px;
    color: var(--yn-text, #0f1c3f);
}
.yn-rec-item-tagline {
    margin: 4px 0 0;
    font-size: 12.5px;
    color: var(--yn-text-muted, #64748b);
}
.yn-rec-item-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.yn-rec-item-price {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}
.yn-rec-item-price span { font-weight: 700; font-size: 15px; color: var(--yn-text, #0f1c3f); }
.yn-rec-item-price small { color: var(--yn-text-muted, #64748b); font-size: 11px; }
.yn-rec-item-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 8px 16px -8px rgba(79, 70, 229, .6);
    transition: transform .15s ease, box-shadow .15s ease;
}
.yn-rec-item-btn:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 12px 20px -8px rgba(79, 70, 229, .7);
}

/* Grid of recommendation cards (modal on the configure step — native markup) */
.product-recommendations {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
}

/* WHMCS injects an intro <p> before the cards on viewcart/checkout */
.product-recommendations > p {
    grid-column: 1 / -1;
    margin: 0 0 2px;
    font-size: 13px;
    color: var(--yn-text-muted, #64748b);
}

/* "Product added" confirmation panel (modal add flow) */
.product-added-panel {
    border: 1px solid var(--yn-border, rgba(15, 28, 63, .08));
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 16px;
    background: rgba(99, 102, 241, .04);
}
.product-added-panel .product-name { font-weight: 600; color: var(--yn-text, #0f1c3f); }
.product-added-panel .product-group,
.product-added-panel .product-cycle { color: var(--yn-text-muted, #64748b); font-size: 13px; }

/* Individual recommendation card */
.product-recommendation {
    position: relative;
    border: 1px solid var(--yn-border, rgba(15, 28, 63, .08)) !important;
    border-radius: 14px;
    background: #fff;
    overflow: hidden;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.product-recommendation:hover {
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, .35) !important;
    box-shadow: 0 12px 28px -12px rgba(99, 102, 241, .3);
}

.product-recommendation .header {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
}

.product-recommendation .content { padding-right: 20px; }
.product-recommendation .content .headline {
    font-weight: 600;
    color: var(--yn-text, #0f1c3f);
    font-size: 15px;
    line-height: 1.3;
}
.product-recommendation .content .tagline {
    font-size: 12.5px;
    color: var(--yn-text-muted, #64748b);
    margin-top: 2px;
}

.product-recommendation .cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    order: 2;
}

.product-recommendation .price {
    font-weight: 700;
    color: var(--yn-text, #0f1c3f) !important;
    font-size: 15px;
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}
.product-recommendation .price .setup-fee {
    font-weight: 400;
    color: var(--yn-text-muted, #64748b);
    font-size: 11px;
}

/* Add-to-cart button — force the brand gradient over WHMCS inline colors */
.product-recommendation .btn-add {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #6366f1, #4f46e5) !important;
    color: #fff !important;
    border: none;
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 8px 16px -8px rgba(79, 70, 229, .6);
    transition: transform .15s ease, box-shadow .15s ease;
}
.product-recommendation .btn-add:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 20px -8px rgba(79, 70, 229, .7);
}
.product-recommendation .btn-add .arrow {
    background: transparent !important;
}

/* Collapsible description toggle — pulled out of flex flow so its native
   28px/line-height:60px box (from all.min.css) can't blow out the layout;
   pinned to the card corner instead. Hidden entirely when there's nothing
   to expand (.header-static = no shortDescription). */
.product-recommendation .expander {
    position: absolute;
    top: 14px;
    right: 14px;
    float: none;
    width: auto;
    line-height: normal;
    margin-right: 0;
    color: #94a3b8 !important;
    font-size: 13px;
}
.product-recommendation .header-static .expander { display: none; }
.product-recommendation .body { padding: 0 16px 14px; font-size: 12.5px; color: var(--yn-text-muted, #64748b); }
.product-recommendation .body p:empty { display: none; }

/* ── Modal on the configure step ─────────────────────────────── */
#recommendationsModal .modal-content {
    border: none;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 30px 60px -20px rgba(15, 23, 42, .35);
}
#recommendationsModal .modal-header {
    border: none;
    padding: 22px 24px 6px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}
#recommendationsModal .modal-header h4 {
    margin: 0;
    font-family: "Fraunces", serif;
    font-weight: 900;
    letter-spacing: -.4px;
    color: var(--yn-text, #0f1c3f);
}
#recommendationsModal .modal-header .clearfix { display: none; }

/* Native BS4-era .close markup ({$times}) — reset the browser default
   button chrome and restyle as a neutral round icon button. */
#recommendationsModal .modal-header .close {
    flex: 0 0 auto;
    appearance: none;
    -webkit-appearance: none;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border: none;
    border-radius: 50%;
    background: rgba(15, 28, 63, .06);
    color: var(--yn-text-muted, #64748b);
    font-size: 20px;
    line-height: 1;
    font-weight: 400;
    opacity: 1;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}
#recommendationsModal .modal-header .close:hover {
    background: rgba(15, 28, 63, .1);
    color: var(--yn-text, #0f1c3f);
}

#recommendationsModal .modal-body { padding: 12px 24px 22px; }
#recommendationsModal .modal-footer { border: none; padding: 0 24px 22px; }
#recommendationsModal .modal-footer .btn-primary {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    border: none;
    border-radius: 10px;
    padding: 10px 22px;
    font-weight: 600;
    box-shadow: 0 10px 22px -10px rgba(79, 70, 229, .6);
}
