/**
 * WooCommerce Discount Packages - Frontend Styles
 */

/* Package Container */
.wdp-packages-container {
    margin: 30px 0;
    padding: 20px;
    background: #fafafa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.wdp-packages-container h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 1.5em;
    font-weight: 600;
    text-align: center;
}

/* Package Grid */
.wdp-packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Package Card */
.wdp-package-card {
    background: #ffffff;
    border: 2px solid #603ce9;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(96, 60, 233, 0.1);
}

.wdp-package-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(96, 60, 233, 0.15);
}

/* Package Header */
.wdp-package-header {
    position: relative;
    margin-bottom: 15px;
}

.wdp-package-header h4 {
    margin: 0;
    color: #603ce9;
    font-size: 1.3em;
    font-weight: 700;
}

.wdp-discount-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #603ce9;
    color: #ffffff;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Package Content */
.wdp-package-content {
    margin-bottom: 20px;
}

.wdp-package-quantity {
    margin-bottom: 15px;
}

.wdp-quantity-label {
    display: block;
    color: #666;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.wdp-quantity-value {
    display: block;
    font-size: 2em;
    font-weight: 700;
    color: #333;
}

/* Package Pricing */
.wdp-package-price {
    margin-bottom: 15px;
}

.wdp-price-original,
.wdp-price-discounted {
    margin-bottom: 8px;
}

.wdp-price-label {
    display: block;
    color: #666;
    font-size: 0.8em;
    margin-bottom: 3px;
}

.wdp-price-value {
    display: block;
    font-weight: 600;
}

.wdp-price-original .wdp-price-value {
    color: #666;
    text-decoration: line-through;
    font-size: 0.9em;
}

.wdp-price-discounted .wdp-price-value {
    color: #603ce9;
    font-size: 1.2em;
}

/* Package Savings */
.wdp-package-savings {
    padding: 10px;
    background: #f0f8ff;
    border-radius: 6px;
    border: 1px solid #e6f3ff;
}

.wdp-savings-label {
    display: block;
    color: #666;
    font-size: 0.8em;
    margin-bottom: 3px;
}

.wdp-savings-value {
    display: block;
    color: #28a745;
    font-weight: 700;
    font-size: 1.1em;
}

/* Package Footer */
.wdp-package-footer {
    margin-top: 20px;
}

.wdp-add-package {
    width: 100%;
    background: #603ce9;
    color: #ffffff;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wdp-add-package:hover {
    background: #5e4ca3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(96, 60, 233, 0.3);
}

.wdp-add-package:active {
    transform: translateY(0);
}

.wdp-add-package.loading {
    background: #5e4ca3;
    color: #ffffff;
    cursor: not-allowed;
}

.wdp-add-package.loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: wdp-spin 1s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}

@keyframes wdp-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Delivery Date */
.wdp-delivery-date {
    margin: 15px 0;
    padding: 12px 16px;
    background: linear-gradient(135deg, #603ce9, #5e4ca3);
    color: #ffffff;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    box-shadow: 0 4px 6px rgba(96, 60, 233, 0.2);
}

.wdp-delivery-label {
    display: block;
    font-size: 0.9em;
    opacity: 0.9;
    margin-bottom: 3px;
}

.wdp-delivery-value {
    display: block;
    font-size: 1.1em;
    font-weight: 600;
}

/* Cart Package Info */
.wdp-cart-package-info {
    margin-top: 8px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #603ce9;
}

.wdp-package-label,
.wdp-discount-label {
    display: block;
    color: #666;
    font-size: 0.85em;
    line-height: 1.4;
}

.wdp-package-label {
    font-weight: 600;
    color: #603ce9;
}

/* Price Note */
.wdp-price-note {
    margin-top: 8px;
    text-align: center;
}

.wdp-price-note small {
    color: #603ce9;
    font-weight: 500;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    .wdp-packages-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .wdp-packages-container {
        margin: 20px 0;
        padding: 15px;
    }
    
    .wdp-package-card {
        padding: 15px;
    }
    
    .wdp-package-header h4 {
        font-size: 1.1em;
    }
    
    .wdp-quantity-value {
        font-size: 1.8em;
    }
    
    .wdp-price-discounted .wdp-price-value {
        font-size: 1.1em;
    }
    
    .wdp-add-package {
        padding: 10px 16px;
        font-size: 0.9em;
    }
    
    .wdp-delivery-date {
        margin: 10px 0;
        padding: 10px 14px;
    }
}

@media (max-width: 480px) {
    .wdp-packages-container {
        margin: 15px 0;
        padding: 12px;
    }
    
    .wdp-packages-container h3 {
        font-size: 1.3em;
        margin-bottom: 15px;
    }
    
    .wdp-package-card {
        padding: 12px;
    }
    
    .wdp-package-header h4 {
        font-size: 1em;
    }
    
    .wdp-discount-badge {
        font-size: 0.7em;
        padding: 4px 8px;
        top: -8px;
        right: -8px;
    }
    
    .wdp-quantity-value {
        font-size: 1.6em;
    }
    
    .wdp-price-label {
        font-size: 0.75em;
    }
    
    .wdp-savings-label {
        font-size: 0.75em;
    }
    
    .wdp-savings-value {
        font-size: 1em;
    }
    
    .wdp-add-package {
        padding: 8px 12px;
        font-size: 0.85em;
    }
    
    .wdp-delivery-date {
        margin: 8px 0;
        padding: 8px 12px;
    }
    
    .wdp-delivery-label {
        font-size: 0.8em;
    }
    
    .wdp-delivery-value {
        font-size: 1em;
    }
}

/* RTL Support */
.rtl .wdp-discount-badge {
    left: -10px;
    right: auto;
}

.rtl .wdp-cart-package-info {
    border-left: none;
    border-right: 3px solid #603ce9;
}

/* Animation for package cards */
.wdp-package-card {
    animation: wdp-fadeInUp 0.6s ease-out;
}

@keyframes wdp-fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger animation for multiple cards */
.wdp-packages-grid .wdp-package-card:nth-child(1) {
    animation-delay: 0.1s;
}

.wdp-packages-grid .wdp-package-card:nth-child(2) {
    animation-delay: 0.2s;
}

.wdp-packages-grid .wdp-package-card:nth-child(3) {
    animation-delay: 0.3s;
}
