/* CCS turn detail - product list. Scoped to #turnProductsPackage (releaseFlag turnMemberPackage).
   Load AFTER sailnet.css - several overrides win by source order only. */

#turnProductsPackage {
    --red: #e42c2a;
    --red-d: #bf1f1d;
    --ink: #222;
    --muted: #5f5f5f;
    --faint: #8f8f8f;
    --line: #e4e4e4;
    --line2: #d0d0d0;
    --panel: #f5f5f5;
    --member-ink: #004e97;
    --member-bg: #eaf1f9;
    --green: #059610;
}

#turnProductsPackage,
#turnProductsPackage * {
    box-sizing: border-box;
    font-family: 'Mulish', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* guard against modulpark_standard.css `.center div { align-items:center }` */
#turnProductsPackage div {
    align-items: initial;
}

/* Head */
#turnProductsPackage .pd-h {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}
#turnProductsPackage .pd-h b {
    font-size: 15px;
    font-weight: 700;
    color: var(--ink);
}

/* Status lines (toggled by detail.js) */
#turnProductsPackage #productsLoading,
#turnProductsPackage #noProductsFound {
    padding: 14px 2px;
    font-size: 13.5px;
    color: var(--muted);
}

/* List */
#turnProductsPackage .pd-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
}

/* detail.js removes only .listElement and leaves the bootstrap hull empty - no box, no ghost gap */
#turnProductsPackage .pd-item {
    display: contents;
}

/* Flatten the wrapper chain between .pd-list and .pd-row */
#turnProductsPackage .pd-item .listElement,
#turnProductsPackage .pd-item .turnInfoWrap,
#turnProductsPackage .pd-item .turnProdAttributes,
#turnProductsPackage .pd-row > .pd-info,
#turnProductsPackage .pd-row > .pd-price,
#turnProductsPackage .pd-row > .pd-act {
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    outline: none;
    width: auto;
    min-width: 0;
    float: none;
    font-size: inherit;
    line-height: inherit;
}

/* Row = the card. Must not sit on .listElement - detail.js .show() writes display:block.
   Flex, not grid: bootstrap 3 columns use float + width:%, both dead inside a flex container. */
#turnProductsPackage .pd-row {
    position: relative;
    display: flex;
    flex-direction: row;
    gap: 20px;
    align-items: center;
    margin: 0;
    padding: 14px 20px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    transition: box-shadow .16s, border-color .16s;
}
@media (hover: hover) {
    #turnProductsPackage .pd-row:hover {
        border-color: var(--line2);
        box-shadow: 0 8px 28px rgba(20, 30, 40, .09);
    }
}

/* Text takes the slack, price and button sit content-wide at the right - the amounts
   line up on their right edge because the button is always the last item. */
#turnProductsPackage .pd-row > .pd-info {
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
}
#turnProductsPackage .pd-row > .pd-price {
    flex: 0 0 auto;
    max-width: none;
}
#turnProductsPackage .pd-row > .pd-act {
    flex: 0 0 auto;
    max-width: none;
}
#turnProductsPackage .pd-row--guard > .pd-guardtext {
    flex: 1 1 auto;
    min-width: 0;
}

/* Product name */
#turnProductsPackage .pd-name {
    display: block;
    margin: 0;
    font-size: 15.5px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--ink);
}

/* Included items. !important on both levels - without it the items stacked, the
   responsible rule is not greppable (site CSS is partly DB generated). */
#turnProductsPackage ul.pd-incl {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: flex-start;
    column-gap: 18px;
    list-style: none;
    margin: 5px 0 0 0;
    padding: 0;
    font-size: 12px;
    line-height: 1.5;
    color: var(--muted);
}
#turnProductsPackage ul.pd-incl > li.pd-incl-item {
    display: inline-flex !important;
    flex: 0 1 auto !important;
    align-items: flex-start;
    gap: 5px;
    min-width: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* kills the CMS bullet from modulpark_standard.css `.inner_content ul li:before` */
#turnProductsPackage ul.pd-incl > li.pd-incl-item::before,
#turnProductsPackage ul.pd-incl > li.pd-incl-item::after {
    content: none;
    display: none;
}
#turnProductsPackage ul.pd-incl > li.pd-incl-item svg {
    flex: none;
    margin-top: 3px;
    color: var(--green);
}

/* Junior hint = info icon, same look as the price info on the turn list (.ccs-pinfo).
   Text comes from the title attribute via tooltipster, init in turnDetailInfo.cfm. */
#turnProductsPackage .pd-pinfo {
    position: absolute;
    top: -9px;
    right: -7px;
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 1px solid var(--line2);
    border-radius: 5px;
    background: #fff;
    color: var(--muted);
    cursor: pointer;
}
#turnProductsPackage .pd-pinfo:hover,
#turnProductsPackage .pd-pinfo.is-on {
    color: #fff;
    background: var(--red);
    border-color: var(--red);
}

/* Price */
#turnProductsPackage .pd-price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
    text-align: right;
}
#turnProductsPackage .pd-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: .4px;
    white-space: nowrap;
}
#turnProductsPackage .pd-tag.is-paket {
    color: var(--member-ink);
    background: var(--member-bg);
}
#turnProductsPackage .pd-amount {
    font-size: 19px;
    font-weight: 800;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    letter-spacing: -.3px;
    white-space: nowrap;
}

/* beats `#wrapper .productPrice { width:100px; display:inline-block }` from sailnet.css */
#turnProductsPackage .pd-amount .productPrice {
    display: inline;
    width: auto;
    text-align: inherit;
}

/* Button. Colour/hover/radius/font stay with #wrapper .mp_btn + .mp_btnSuccess as in
   turnProduct_orig.cfm - only .mp_btnFull width/display undone, size one notch up. */
#turnProductsPackage .pd-btn {
    display: inline-block;
    width: auto;
    padding: 0 22px;
    line-height: 38px;
    white-space: nowrap;
}

/* Login guard */
#turnProductsPackage .pd-guardtext {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    line-height: 1.45;
    color: var(--ink);
}
#turnProductsPackage .pd-guardtext svg {
    flex: none;
    color: var(--muted);
}

/* Tooltip theme, identical to turnList.css. Ungescoped on purpose - tooltipster appends
   the tooltip to <body>, isolation comes from the theme name. */
.tooltipster-ccsPrice {
    background: #fff;
    border: 1px solid #d0d0d0;
    border-radius: 9px;
    box-shadow: 0 12px 34px rgba(20, 30, 40, .2);
}
.tooltipster-ccsPrice .tooltipster-content {
    padding: 12px 14px;
    font-family: 'Mulish', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 12px;
    line-height: 1.45;
    color: #5f5f5f;
    text-align: left;
}
.tooltipster-ccsPrice b {
    display: block;
    margin-bottom: 5px;
    font-size: 13.5px;
    font-weight: 700;
    color: #222;
}
.tooltipster-ccsPrice .ccs-tip-f {
    display: block;
    margin-top: 9px;
    font-size: 11px;
    color: #8f8f8f;
}

/* Mobile */
@media (max-width: 767px) {
    #turnProductsPackage .pd-row {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 15px 16px 16px;
    }
    #turnProductsPackage .pd-row > .pd-info,
    #turnProductsPackage .pd-row > .pd-price,
    #turnProductsPackage .pd-row > .pd-act {
        flex: 0 0 auto;
    }
    #turnProductsPackage ul.pd-incl {
        flex-direction: column !important;
        align-items: flex-start;
        row-gap: 4px;
    }
    #turnProductsPackage .pd-pinfo {
        top: -8px;
        right: -6px;
    }
    #turnProductsPackage .pd-price {
        align-items: flex-start;
        gap: 4px;
        padding-top: 11px;
        border-top: 1px solid var(--line);
        text-align: left;
    }
    #turnProductsPackage .pd-btn {
        width: 100%;
        text-align: center;
    }
    #turnProductsPackage .pd-guardtext {
        align-items: flex-start;
    }
    #turnProductsPackage .pd-guardtext svg {
        margin-top: 3px;
    }
}
