/* Weight Discount Frontend Styling */

/* Make original unit price less prominent when discount is shown */
.product-line-info .unit-price {
    opacity: 0.6;
    font-size: 0.9em;
}

/* Style the discounted price */
.pswd-discounted-unit-price {
    display: block;
    font-size: 0.9em;
    color: #28a745 !important;
    font-weight: 600 !important;
    margin-top: 2px;
}

/* Add some visual hierarchy */
.product-line-info:has(.pswd-discounted-unit-price) .unit-price {
    text-decoration: line-through;
    opacity: 0.5;
}

/* Ensure proper spacing */
.pswd-discounted-unit-price + .unit-price,
.unit-price + .pswd-discounted-unit-price {
    margin-top: 2px;
}

/* Order confirmation discount styles */
.weight-discount-info {
    margin: 8px 0;
    font-family: Arial, sans-serif;
    font-size: 13px;
}

.weight-discount-info .pswd-original-price {
    text-decoration: line-through;
    color: #6c757d;
}

.weight-discount-info .pswd-discounted-price {
    color: #28a745;
    font-weight: 600;
    margin-left: 8px;
}

/* Per-line Weight Discount Notices */
.pswd-line-notice {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    margin: 8px 0 4px 0;
    border-radius: 4px;
    font-size: 13px;
    gap: 8px;
    border: 1px solid transparent;
}

/* Product page specific margin */
#pswd-product-discount-notice.pswd-line-notice {
    margin-top: 15px;
}

/* Success state - discount is active (green) */
.pswd-line-notice.alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.pswd-line-notice.alert-success .material-icons {
    font-size: 16px;
    color: #28a745;
    flex-shrink: 0;
}

/* Info state - more kg needed for discount (blue) */
.pswd-line-notice.alert-info {
background-color: #f1f8fe;
  border-color: #f1f8fe;
  color: #1367EF;
}

.pswd-line-notice.alert-info .material-icons {
    font-size: 16px;
    color: #1367EF;
    flex-shrink: 0;
}

/* Message content */
.pswd-line-notice .pswd-message {
    flex: 1;
    line-height: 1.4;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .pswd-line-notice {
        padding: 6px 10px;
        font-size: 12px;
        gap: 6px;
    }

    .pswd-line-notice .material-icons {
        font-size: 14px;
    }
}

/* ========================================
   CIRCLE BADGE MODE
   ======================================== */

.pswd-circle-badge {
    position: relative;
    height: 24px !important;
    min-width: 24px;
    padding: 0 8px !important;
    border-radius: 12px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: 600 !important;
    font-size: 11px !important;
    line-height: 1;
    text-align: center;
    cursor: help;
    z-index: 100;
    transition: box-shadow 0.2s ease;
    border: none;
    flex-shrink: 0;
    white-space: nowrap;
}

.pswd-circle-badge:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    z-index: 500;
}

/* Desktop tooltip */
@media (min-width: 768px) {
    .pswd-circle-badge::before {
        content: attr(data-tooltip);
        position: absolute;
        top: calc(100% + 8px);
        left: 50%;
        transform: translateX(-50%) scale(0);
        transform-origin: top center;
        padding: 12px 20px;
        background: rgba(0,0,0,0.9);
        color: #fff;
        border-radius: 3px;
        white-space: normal;
        width: 300px;
        max-width: calc(100vw - 40px);
        font-size: 11px;
        font-weight: 500;
        line-height: 1.5;
        z-index: 99999;
        opacity: 0;
        pointer-events: none;
        box-shadow: 0 4px 12px rgba(0,0,0,0.3);
        transition: opacity 0.2s ease, transform 0.2s ease;
    }
    
    .pswd-circle-badge::after {
        content: '';
        position: absolute;
        top: calc(100% + 2px);
        left: 50%;
        transform: translateX(-50%) scale(0);
        border: 6px solid transparent;
        border-bottom-color: rgba(0,0,0,0.9);
        z-index: 99999;
        opacity: 0;
        transition: opacity 0.2s ease, transform 0.2s ease;
    }
    
    .pswd-circle-badge:hover::before {
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }
    
    .pswd-circle-badge:hover::after {
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }
}

/* Mobile tooltip */
@media (max-width: 767px) {
    .pswd-circle-badge.active::before {
        content: attr(data-tooltip);
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        padding: 10px 14px;
        background: rgba(0,0,0,0.9);
        color: #fff;
        border-radius: 3px;
        max-width: 80vw;
        white-space: normal;
        text-align: center;
        font-size: 12px;
        font-weight: 500;
        z-index: 99999;
        box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    }
    
    .pswd-circle-badge.active::after {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 99998;
    }
}

/* Overflow fixes for cart/checkout containers */
.cart-summary-top,
.js-cart-summary-top,
.cart-summary-products,
.cart-summary-products-wrapper,
.js-cart-summary-products,
.cart-summary-product-list,
.cart-summary-items-subtotal,
.media,
#js-checkout-summary {
    overflow: visible !important;
}

