/**
 * Discount Conditions Popup - Frontend Styles
 */

/* Button Styles */
.dcp-open-popup {
    display: inline-block;
    padding: 12px 24px;
    margin-top: 15px;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    background-color: #2c7a3f;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dcp-open-popup:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.dcp-cart-button {
    margin: 10px 0;
}

/* Popup Overlay */
.dcp-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 999999;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.dcp-popup-overlay.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Popup Container */
.dcp-popup-container {
    position: relative;
    background-color: #ffffff;
    border-radius: 8px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Popup Header */
.dcp-popup-header {
    background-color: #2c7a3f;
    color: #ffffff;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dcp-popup-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #ffffff;
}

.dcp-close-popup {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.dcp-close-popup:hover {
    transform: scale(1.2);
}

/* Popup Content */
.dcp-popup-content {
    padding: 30px;
    max-height: calc(90vh - 80px);
    overflow-y: auto;
}

.dcp-loading {
    text-align: center;
    padding: 40px 20px;
    font-size: 18px;
    color: #666;
}

/* Product Info */
.dcp-product-info {
    margin: 0;
}

.dcp-product-header {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding-bottom: 20px;
}

.dcp-product-image {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f9f9f9;
}

.dcp-product-image img {
    max-width: 100%;
    height: auto;
    display: block;
}

.dcp-product-details {
    flex: 1;
}

.dcp-product-details h3 {
    margin: 0 0 15px 0;
    font-size: 22px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

.dcp-price-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.dcp-sale-price {
    font-size: 24px;
    font-weight: 700;
    color: #2c7a3f;
}

.dcp-regular-price {
    font-size: 18px;
    color: #999;
}

.dcp-regular-price del {
    text-decoration: line-through;
}

.dcp-discount-amount {
    font-size: 16px;
    font-weight: 600;
    color: #d32f2f;
    background-color: #ffebee;
    padding: 4px 10px;
    border-radius: 4px;
}

/* Discount Rules */
.dcp-discount-rules {
    margin-top: 20px;
}

.dcp-discount-rules h4 {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.dcp-rules-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dcp-rules-list li {
    padding: 12px 15px;
    margin-bottom: 10px;
    background-color: #f0f8f0;
    border-left: 4px solid #2c7a3f;
    border-radius: 4px;
    font-size: 15px;
    color: #333;
}

.dcp-rules-list li:last-child {
    margin-bottom: 0;
}

/* Cart Info */
.dcp-cart-info h3 {
    margin: 0 0 20px 0;
    font-size: 22px;
    font-weight: 600;
    color: #333;
}

.dcp-cart-info h4 {
    margin: 25px 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

/* Total Savings Box */
.dcp-total-savings {
    margin: 0 0 30px 0;
}

.dcp-savings-box {
    background: linear-gradient(135deg, #2c7a3f 0%, #1d5c2e 100%);
    color: #ffffff;
    padding: 25px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(44, 122, 63, 0.3);
}

.dcp-savings-box h4 {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
}

.dcp-savings-amount {
    font-size: 36px;
    font-weight: 700;
    margin: 10px 0;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.dcp-savings-percent {
    margin: 10px 0 0 0;
    font-size: 16px;
    color: #e8f5e9;
}

/* Discount Summary List */
.dcp-discount-summary {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 20px;
    margin: 20px 0;
    border-radius: 4px;
}

.dcp-discount-summary h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: #856404;
}

.dcp-discount-items-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dcp-discount-items-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #ffeaa7;
}

.dcp-discount-items-list li:last-child {
    border-bottom: none;
}

.dcp-item-name {
    color: #333;
    font-weight: 500;
    flex: 1;
}

.dcp-item-discount {
    background: #ff5722;
    color: #ffffff;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
    margin-left: 10px;
}

/* Discounted Items */
.dcp-discounted-item {
    border-left: 4px solid #2c7a3f !important;
    background-color: #f0f8f0 !important;
}

.dcp-price-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0 !important;
}

.dcp-current-price {
    font-size: 18px;
    font-weight: 700;
    color: #2c7a3f;
}

.dcp-discount-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0 !important;
}

.dcp-discount-badge {
    display: inline-block;
    background: #ff5722;
    color: #ffffff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.dcp-savings-text {
    color: #2c7a3f;
    font-weight: 600;
    font-size: 14px;
}

.dcp-product-discount-rules {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e0e0e0;
}

.dcp-rule-detail {
    display: inline-block;
    color: #666;
    font-size: 12px;
    line-height: 1.6;
}

.dcp-cart-products {
    margin-top: 30px;
}

.dcp-cart-product-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    margin-bottom: 15px;
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.dcp-cart-product-item:last-child {
    margin-bottom: 0;
}

.dcp-cart-product-image {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
}

.dcp-cart-product-image img {
    max-width: 100%;
    height: auto;
    display: block;
}

.dcp-cart-product-details {
    flex: 1;
}

.dcp-cart-product-details p {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #666;
}

.dcp-cart-product-details p:last-child {
    margin-bottom: 0;
}

.dcp-cart-product-details strong {
    color: #333;
    font-size: 16px;
}

/* Scrollbar Styles */
.dcp-popup-content::-webkit-scrollbar {
    width: 8px;
}

.dcp-popup-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.dcp-popup-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.dcp-popup-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dcp-popup-container {
        width: 95%;
        margin: 20px;
    }

    .dcp-popup-header {
        padding: 15px 20px;
    }

    .dcp-popup-header h2 {
        font-size: 16px;
    }

    .dcp-popup-content {
        padding: 20px;
    }

    .dcp-product-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .dcp-product-image {
        width: 150px;
        height: 150px;
    }

    .dcp-product-details h3 {
        font-size: 18px;
    }

    .dcp-sale-price {
        font-size: 20px;
    }

    .dcp-regular-price {
        font-size: 16px;
    }

    .dcp-cart-product-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .dcp-cart-product-image {
        width: 100px;
        height: 100px;
    }
}

@media (max-width: 480px) {
    .dcp-open-popup {
        width: 100%;
        padding: 10px 20px;
        font-size: 14px;
    }

    .dcp-popup-header h2 {
        font-size: 14px;
    }

    .dcp-close-popup {
        font-size: 28px;
    }

    .dcp-product-details h3 {
        font-size: 16px;
    }

    .dcp-discount-rules h4,
    .dcp-cart-info h4 {
        font-size: 16px;
    }

    .dcp-rules-list li {
        font-size: 14px;
        padding: 10px 12px;
    }
}

/* No discount message */
.dcp-no-discount {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 16px;
}

/* Price display adjustments for netto display */
.dcp-price-info .price-label {
    font-size: 14px;
    color: #666;
    margin-left: 5px;
}

.dcp-variation-attributes {
    margin-bottom: 0;
    font-size: 16px;
}

.dcp-cart-item-separator {
    margin: 0 0 15px;
    border: none;
    border-top: 1px solid #eee;
}