/**
 * TDW Custom Progress Bar - Styling
 * Version: 1.0
 */

/* Progress Bar Wrapper */
.tdw-progress-bar-wrapper {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    margin: 0 0 20px 0;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.4s ease, opacity 0.4s ease, transform 0.4s ease;
}

.tdw-progress-bar-wrapper.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Progress Header */
.tdw-progress-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    color: white;
}

.tdw-progress-icon {
    font-size: 28px;
    line-height: 1;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.tdw-progress-text {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
    transition: opacity 0.15s ease;
}

.tdw-progress-text strong {
    font-weight: 700;
    font-size: 15px;
}

.tdw-progress-reached {
    display: block;
    font-weight: 600;
    font-size: 15px;
}

.tdw-progress-remaining {
    display: block;
}

/* Progress Bar Container */
.tdw-progress-bar-container {
    position: relative;
    padding-bottom: 20px;
}

.tdw-progress-bar-track {
    height: 12px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    overflow: visible;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tdw-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50 0%, #45a049 100%);
    border-radius: 20px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.4);
}

.tdw-progress-bar-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.tdw-progress-bar-fill.reached {
    background: linear-gradient(90deg, #FFD700 0%, #FFA500 100%);
    box-shadow: 0 2px 12px rgba(255, 215, 0, 0.6);
}

.tdw-progress-checkmark {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 14px;
    animation: checkmarkPop 0.5s ease;
}

@keyframes checkmarkPop {
    0% {
        transform: translateY(-50%) scale(0);
    }
    50% {
        transform: translateY(-50%) scale(1.2);
    }
    100% {
        transform: translateY(-50%) scale(1);
    }
}

/* Progress Amount Label */
.tdw-progress-amounts {
    position: absolute;
    right: 0;
    bottom: 0;
    display: flex;
    gap: 40px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
}

.tdw-amount-label {
    display: block;
}

/* Milestone Marker for Gift */
.tdw-milestone-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    background: white;
    border: 3px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s ease;
}

.tdw-milestone-marker i {
    font-size: 16px;
    color: #FF9800;
}

.tdw-milestone-marker.reached {
    background: #4CAF50;
    border-color: #4CAF50;
    animation: milestoneReached 0.6s ease;
}

.tdw-milestone-marker.reached i {
    color: white;
}

@keyframes milestoneReached {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.3);
    }
}

/* Gift Selector Container */
.tdw-gift-selector-container {
    margin-top: 15px;
}

.tdw-gift-selector {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.4s ease;
}

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

/* Gift Header */
.tdw-gift-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.tdw-gift-header i {
    font-size: 42px;
    color: #FF9800;
    display: block;
    margin-bottom: 10px;
    animation: giftPulse 2s infinite;
}

@keyframes giftPulse {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    25% {
        transform: scale(1.1) rotate(-5deg);
    }
    75% {
        transform: scale(1.1) rotate(5deg);
    }
}

.tdw-gift-header h3 {
    margin: 0 0 10px;
    font-size: 20px;
    color: #333;
    font-weight: 700;
}

.tdw-gift-header p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

/* Gift Products Grid - VERTICAL LAYOUT */
.tdw-gift-products {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Gift Product Card - NY STRUKTUR: Vandret top sektion + knap under */
.tdw-gift-product {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tdw-gift-product:hover:not(.out-of-stock) {
    border-color: #FF9800;
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.15);
}

.tdw-gift-product.selected {
    border-color: #FF9800;
    background: #fff8f0;
}

.tdw-gift-product.selected::after {
    content: '✓';
    position: absolute;
    top: -6px;
    right: -6px;
    width: 24px;
    height: 24px;
    background: #4CAF50;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.4);
}

.tdw-gift-product.out-of-stock {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Top sektion med billede + info (vandret) */
.tdw-gift-product-top {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

/* Gift Product Image - LILLE */
.tdw-gift-product-image {
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    background: #f9f9f9;
    padding: 8px;
    flex-shrink: 0;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tdw-gift-product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.tdw-out-of-stock-badge {
    position: absolute;
    top: 3px;
    right: 3px;
    background: #d63638;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 600;
}

/* Gift Product Info - ved siden af billede */
.tdw-gift-product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.tdw-gift-product-info h4 {
    font-size: 14px;
    margin: 0;
    color: #333;
    font-weight: 600;
    line-height: 1.3;
}

.tdw-gift-price {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.tdw-gift-original-price {
    font-size: 12px;
    color: #999;
    text-decoration: line-through;
}

.tdw-gift-free-price {
    font-size: 16px;
    font-weight: 700;
    color: #4CAF50;
}

/* Gift Select Button - FULD BREDDE og under top sektion */
.tdw-gift-select-btn {
    width: 100%;
    padding: 8px 14px;
    background: #FF9800;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.tdw-gift-select-btn:hover:not(:disabled) {
    background: #F57C00;
    box-shadow: 0 2px 6px rgba(255, 152, 0, 0.3);
}

.tdw-gift-select-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.tdw-gift-product.selected .tdw-gift-select-btn {
    background: #4CAF50;
}

.tdw-gift-product.selected .tdw-gift-select-btn:hover {
    background: #45a049;
}

/* Gift Message */
.tdw-gift-message {
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    animation: slideDown 0.3s ease;
}

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

.tdw-gift-message-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.tdw-gift-message-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Gift badge in cart */
.tdw-gift-badge {
    display: inline-block;
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    margin-left: 8px;
    letter-spacing: 0.5px;
}

/* Gift Confirmation View - COMPACT */
.tdw-gift-confirmation-compact {
    background: #f1f8f4;
    border-radius: 8px;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 2px solid #4CAF50;
    margin-top: 12px;
}

.tdw-gift-confirmed-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    font-size: 13px;
    color: #333;
}

.tdw-gift-confirmed-info i {
    font-size: 20px;
    color: #4CAF50;
}

.tdw-change-gift-btn-compact {
    background: white;
    border: 2px solid #FF9800;
    color: #FF9800;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

.tdw-change-gift-btn-compact:hover {
    background: #FF9800;
    color: white;
    transform: translateY(-1px);
}

.tdw-change-gift-btn-compact i {
    font-size: 11px;
}

/* OLD confirmation view - keep for fallback but hide */
.tdw-gift-confirmation {
    display: none;
}

/* Responsive Design */
@media (max-width: 480px) {
    .tdw-progress-bar-wrapper {
        padding: 15px;
    }
    
    .tdw-progress-icon {
        font-size: 24px;
    }
    
    .tdw-progress-text {
        font-size: 13px;
    }
    
    .tdw-progress-text strong {
        font-size: 14px;
    }
    
    .tdw-progress-bar-track {
        height: 10px;
    }
    
    .tdw-progress-amount {
        font-size: 11px;
    }
}

/* Empty Cart State */
.xoo-wsc-empty-cart ~ .tdw-progress-bar-wrapper {
    display: none;
}