/* Dynamic Product Bundler Pro - Gamified Frontend */

.dpb-app-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    padding-bottom: 100px; /* Space for sticky footer */
}

/* Loader */
.dpb-loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: dpb-spin 1s linear infinite;
    margin: 40px auto;
}

@keyframes dpb-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.dpb-error {
    color: #e74c3c;
    text-align: center;
    padding: 20px;
    background: #fdf0ed;
    border-radius: 8px;
}

/* Header & Progress */
.dpb-header {
    text-align: center;
    margin-bottom: 30px;
}

.dpb-header h2 {
    font-size: 28px;
    margin-bottom: 15px;
    color: #333;
}

.dpb-progress-container {
    background: #f5f7fa;
    border-radius: 12px;
    padding: 15px;
    max-width: 600px;
    margin: 0 auto;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.dpb-progress-text {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 500;
    color: #555;
}

.dpb-progress-bar {
    background: #e0e0e0;
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
}

.dpb-progress-fill {
    height: 100%;
    background: #2196f3;
    width: 0;
    transition: width 0.4s ease, background-color 0.4s ease;
}

/* Product List */
.dpb-product-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.dpb-product-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    border: 1px solid #e2e4e7;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s ease;
}

.dpb-product-row:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.dpb-item-info {
    flex-grow: 1;
    padding-right: 15px;
    display: flex;
    align-items: center;
}

.dpb-item-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #eee;
    margin-right: 15px;
    flex-shrink: 0;
}

.dpb-item-details {
    display: flex;
    flex-direction: column;
}

.dpb-item-title {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: #2271b1;
    text-decoration: none;
    margin-bottom: 4px;
}

.dpb-item-title:hover {
    text-decoration: underline;
}

.dpb-item-cats {
    display: block;
    font-size: 12px;
    color: #8c8f94;
    margin-bottom: 8px;
}

.dpb-item-price {
    font-weight: bold;
    color: #3c434a;
    font-size: 15px;
}

/* Controls */
.dpb-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dpb-controls button {
    background: #f0f0f1;
    border: 1px solid #dcdcde;
    color: #3c434a;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dpb-controls button:hover {
    background: #e2e4e7;
    border-color: #8c8f94;
}

.dpb-qty {
    font-size: 16px;
    font-weight: bold;
    min-width: 20px;
    text-align: center;
}

/* Static Footer */
.dpb-static-footer {
    background: #f8f9fa;
    border: 1px solid #e2e4e7;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.dpb-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    margin-bottom: 15px;
}

.dpb-label {
    color: #50575e;
}

.dpb-total-price {
    font-weight: 800;
    font-size: 22px;
    color: #1d2327;
}

.dpb-savings-wrap {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 15px;
}

.dpb-add-to-cart-btn {
    background: #1d2327;
    color: #fff;
    border: none;
    width: 100%;
    padding: 15px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.dpb-add-to-cart-btn:hover:not(:disabled) {
    background: #2b3339;
}

.dpb-add-to-cart-btn:disabled {
    background: #c3c4c7;
    cursor: not-allowed;
}

/* Mobile */
@media (max-width: 768px) {
    .dpb-product-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    .dpb-controls {
        width: 100%;
        justify-content: space-between;
    }
}
