/**
 * DataFirefly - Quantity Deals & Promo Badges
 * @author    DataFirefly
 * @copyright 2026 DataFirefly Limited
 */

.dfqd-badges {
    display: block;
    line-height: 0;
}

.dfqd-badges--inline {
    margin: 6px 0;
	position: relative;
    left: 30px;
	top: -9px;
}

.dfqd-badge {
    display: inline-block;
    padding: 4px 9px;
    margin: 0 4px 4px 0;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: 0.2px;
    text-transform: lowercase;
    white-space: nowrap;
    vertical-align: middle;
    z-index: 3;
}

.dfqd-badge--square {
    border-radius: 0;
}

.dfqd-badge--rounded {
    border-radius: 3px;
}

.dfqd-badge--pill {
    border-radius: 999px;
    padding-left: 12px;
    padding-right: 12px;
}

.dfqd-badge--circle {
    border-radius: 50%;
    width: 52px;
    height: 52px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: normal;
}

.dfqd-badge--ribbon {
    border-radius: 0;
    transform: rotate(-8deg);
}

/* Badge overlaid on the product thumbnail */
.dfqd-thumb-badges {
    position: absolute;
    z-index: 3;
    pointer-events: none;
    line-height: 0;
}

.dfqd-thumb-badges .dfqd-badge {
    pointer-events: auto;
}

.dfqd-thumb-badges.dfqd-at-top-left {
    top: 8px;
    left: 8px;
}

.dfqd-thumb-badges.dfqd-at-top-right {
    top: 8px;
    right: 8px;
}

.dfqd-thumb-badges.dfqd-at-bottom-left {
    bottom: 8px;
    left: 8px;
}

.dfqd-thumb-badges.dfqd-at-bottom-right {
    bottom: 8px;
    right: 8px;
}

.dfqd-has-badge {
    position: relative;
}

/* Fallback without JavaScript for badges rendered by the dedicated hook */
.product-cover:has(> .dfqd-thumb-badges),
.thumbnail-container:has(> .dfqd-thumb-badges),
.product-miniature:has(> .dfqd-thumb-badges),
.product-thumbnail:has(> .dfqd-thumb-badges) {
    position: relative;
}

/* Product page cover: the badge sits a bit further from the edges */
.product-cover.dfqd-has-badge .dfqd-thumb-badges,
.images-container.dfqd-has-badge .dfqd-thumb-badges {
    z-index: 4;
}

.product-cover.dfqd-has-badge .dfqd-thumb-badges.dfqd-at-top-left,
.images-container.dfqd-has-badge .dfqd-thumb-badges.dfqd-at-top-left {
    top: 14px;
    left: 14px;
}

.product-cover.dfqd-has-badge .dfqd-thumb-badges.dfqd-at-top-right,
.images-container.dfqd-has-badge .dfqd-thumb-badges.dfqd-at-top-right {
    top: 14px;
    right: 14px;
}

.product-cover.dfqd-has-badge .dfqd-thumb-badges.dfqd-at-bottom-left,
.images-container.dfqd-has-badge .dfqd-thumb-badges.dfqd-at-bottom-left {
    bottom: 14px;
    left: 14px;
}

.product-cover.dfqd-has-badge .dfqd-thumb-badges.dfqd-at-bottom-right,
.images-container.dfqd-has-badge .dfqd-thumb-badges.dfqd-at-bottom-right {
    bottom: 14px;
    right: 14px;
}

/* Offer table on the product page */
.dfqd-offers {
    margin: 16px 0;
    padding: 14px 16px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.02);
}

.dfqd-offers__title {
    margin: 0 0 10px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.dfqd-offers__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dfqd-offers__item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 6px 0;
}

.dfqd-offers__text {
    display: flex;
    flex-direction: column;
}

.dfqd-offers__text em {
    font-style: normal;
    opacity: 0.75;
}

.dfqd-offers__desc {
    margin-top: 4px;
    font-size: 0.9em;
    opacity: 0.8;
}

.dfqd-offers__hint {
    margin: 8px 0 0;
    font-size: 0.85em;
    opacity: 0.7;
}

/* Cart recap */
.dfqd-cart {
    margin: 12px 0;
}

.dfqd-cart__item {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
}

.dfqd-cart__amount {
    color: #e2001a;
    font-weight: 700;
    white-space: nowrap;
}

/* Once moved into the totals card, inherit the theme summary spacing */
.dfqd-cart--in-totals {
    margin: 0;
}

.dfqd-cart--in-totals .dfqd-cart__item {
    padding: 0;
}

/* Cart line: offer badge and struck through price */
.dfqd-line-badges {
    margin: 4px 0 0;
    line-height: 1.3;
}

.dfqd-line-badge {
    display: inline-block;
    margin-right: 8px;
    font-weight: 700;
    color: #e2001a;
}

.dfqd-struck {
    text-decoration: line-through;
    font-weight: 400;
    opacity: 0.6;
}

.dfqd-line-price {
    display: block;
    font-weight: 700;
    color: #e2001a;
    white-space: nowrap;
}

/* Cart incentive: complete the set */
.dfqd-nudges {
    margin: 12px 0;
}

.dfqd-nudge {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    margin-bottom: 8px;
    border: 1px solid #e2001a;
    border-radius: 4px;
    background: rgba(226, 0, 26, 0.05);
}

.dfqd-nudge__flag {
    background: #e2001a;
    color: #fff;
    font-weight: 700;
    text-transform: uppercase;
    text-align: center;
    letter-spacing: 0.3px;
}

/* Desktop: red disc on the left */
.dfqd-nudge__flag--circle {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    padding: 6px;
    border-radius: 50%;
    font-size: 11px;
    line-height: 1.15;
}

/* Mobile: half width banner on top, hidden on desktop */
.dfqd-nudge__flag--banner {
    display: none;
}

.dfqd-nudge__body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.dfqd-nudge__text {
    font-weight: 700;
}

.dfqd-nudge__product {
    font-size: 0.9em;
    opacity: 0.75;
}

.dfqd-nudge__btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

@media (max-width: 767px) {
    .dfqd-nudge {
        flex-wrap: wrap;
        gap: 0;
    }

    .dfqd-nudge__flag--circle {
        display: none;
    }

    .dfqd-nudge__flag--banner {
        display: block;
        flex: 0 0 50%;
        width: 50%;
        margin: 0 auto 10px;
        padding: 5px 8px;
        border-radius: 3px;
        font-size: 12px;
        line-height: 1.3;
    }

    .dfqd-nudge__body {
        flex: 1 1 100%;
    }

    .dfqd-nudge__btn {
        width: 100%;
        margin-top: 10px;
    }
}

/* Cart recap */
.dfqd-cart {
    margin: 12px 0;
}

.dfqd-cart__item {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
}

.dfqd-cart__amount {
    color: #e2001a;
    font-weight: 700;
    white-space: nowrap;
}

/* Once moved into the totals card, inherit the theme summary spacing */
.dfqd-cart--in-totals {
    margin: 0;
}

.dfqd-cart--in-totals .dfqd-cart__item {
    padding: 0;
}

/* Cart line: offer badge and struck through price */
.dfqd-line-badges {
    margin: 4px 0 0;
    line-height: 1.3;
}

.dfqd-line-badge {
    display: inline-block;
    margin-right: 8px;
    font-weight: 700;
    color: #fff !important;
    background: #e2001a;
    padding: 4px 8px;
    border-radius: 4px;
}

.dfqd-struck {
    text-decoration: line-through;
    font-weight: 400;
    opacity: 0.6;
}

.dfqd-line-price {
    display: block;
    font-weight: 700;
    color: #e2001a;
    white-space: nowrap;
}

/* Cart incentive: complete the set */
.dfqd-nudges {
    margin: 12px 0;
}

.dfqd-nudge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    margin-bottom: 8px;
    border: 1px solid #e2001a;
    border-radius: 4px;
    background: rgba(226, 0, 26, 0.05);
}

.dfqd-nudge__icon {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    line-height: 28px;
    text-align: center;
    border-radius: 50%;
    font-weight: 700;
    color: #fff;
    background: #e2001a;
}

.dfqd-nudge__body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.dfqd-nudge__text {
    font-weight: 700;
}

.dfqd-nudge__product {
    font-size: 0.9em;
    opacity: 0.75;
}

.dfqd-nudge__btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

@media (max-width: 575px) {
    .dfqd-nudge {
        flex-wrap: wrap;
    }

    .dfqd-nudge__btn {
        width: 100%;
        margin-top: 8px;
    }
}

/* -----------------------------------------------------------------
 * Cart line layout: quantity, then a right aligned price stack
 * ----------------------------------------------------------------- */

/* Reference and variants on a single line */
.product-line-meta {
    margin: 2px 0 0;
}

.product-line-meta > span {
    display: inline;
    margin-right: 10px;
}

.product-line-meta > span:last-child {
    margin-right: 0;
}

/* Badge slot placed by the theme right under the reference and variants */
.dfqd-line-badge-slot {
    margin: 8px 0 0;
}

.dfqd-line-badge-slot:empty {
    display: none;
}

.dfqd-line-badge-slot .dfqd-line-badges {
    margin: 0;
}

/* Quantity, price stack and delete icon share one top aligned row */
.product-line-actions__row {
    align-items: flex-start;
}

.product-line-actions__row .qty {
    padding-top: 2px;
}

/* Unit price, small and right aligned above the separator */
.product-line-unit-price {
    text-align: right;
    font-size: 0.9em;
    white-space: nowrap;
    padding-bottom: 6px;
}

.product-line-unit-price .unit-label {
    font-weight: 400;
    opacity: 0.75;
}

.product-line-unit-price .product-discount {
    display: block;
}

/* Totals block, separated from the unit price by a hairline */
.product-line-totals {
    border-top: 1px solid #e5e5e5;
    padding-top: 6px;
    text-align: right;
}

.product-line-totals .product-price {
    display: block;
    margin: 0;
}

/* Row 1: struck total then discounted total.
   Row 2: caption. Row 3: saved amount. */
.dfqd-price-holder {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: flex-end;
    gap: 2px 8px;
}

.dfqd-price-holder .dfqd-struck {
    order: 1;
}

.dfqd-price-holder .dfqd-line-price {
    order: 2;
    display: inline-block;
    font-size: 1.15em;
    font-weight: 700;
    color: inherit;
}

.dfqd-line-caption {
    order: 3;
    display: block;
    flex: 0 0 100%;
    width: 100%;
    text-align: right;
    font-size: 0.85em;
    color: #e2001a;
    line-height: 1.3;
}

.dfqd-line-saved {
    order: 4;
    display: block;
    flex: 0 0 100%;
    width: 100%;
    text-align: right;
    color: #e2001a;
    font-weight: 700;
    white-space: nowrap;
}

@media (max-width: 767px) {
    .product-line-unit-price,
    .product-line-totals {
        text-align: right;
    }
}

/* -----------------------------------------------------------------
 * Cart summary accordion under the native discount row
 * ----------------------------------------------------------------- */
.cart-summary-line.dfqd-toggle {
    cursor: pointer;
    user-select: none;
}

.dfqd-toggle__caret {
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 6px;
    vertical-align: middle;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    transition: transform 0.15s ease;
}

.dfqd-toggle[aria-expanded="true"] .dfqd-toggle__caret {
    transform: rotate(180deg);
}

.dfqd-cart--accordion {
    display: none;
}

.dfqd-cart--accordion.is-open {
    display: block;
    margin-bottom: 15px;
}

.dfqd-cart--accordion .dfqd-cart__item {
    padding: 2px 0;
    margin-bottom: 0;
    font-size: 0.92em;
}

.dfqd-cart--accordion .dfqd-cart__label {
    opacity: 0.85;
}

/* Gap between the struck line total and the discounted one */
.dfqd-struck {
    margin-right: 10px;
}

/* Summary row of the cart rule maintained by the module */
.dfqd-voucher-hidden {
    display: none !important;
}
