/**
 * Product Bundles Styles
 * Modern, conversion-optimized design
 */

.magaztk-product-bundle {
    margin: 0 0 30px 0;
    padding: 24px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 2px solid #e9ecef;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: visible;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    clear: both;
}

.magaztk-product-bundle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #27ae60, #2ecc71);
}

.magaztk-product-bundle:hover {
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

/* Header Section */
.magaztk-bundle-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.magaztk-bundle-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    border-radius: 12px;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

.magaztk-bundle-title-wrapper {
    flex: 1;
    min-width: 200px;
}

.magaztk-bundle-title {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.3;
}

.magaztk-bundle-subtitle {
    margin: 4px 0 0;
    font-size: 14px;
    color: #7f8c8d;
    font-weight: 400;
}

.magaztk-bundle-savings-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 20px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    border-radius: 12px;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
    animation: pulse-badge 2s infinite;
}

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

.magaztk-bundle-savings-badge .savings-text {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

.magaztk-bundle-savings-badge .savings-amount {
    font-size: 20px;
    font-weight: 700;
    margin-top: 2px;
}

/* Products Section */
.magaztk-bundle-products {
    display: flex;
    flex-wrap: nowrap;
    gap: 16px;
    margin-bottom: 24px;
    align-items: stretch;
    overflow-x: auto;
    width: 100%;
}

.magaztk-bundle-product-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    flex: 1;
    min-width: 0;
    transition: all 0.2s ease;
}

.magaztk-bundle-product-item:hover {
    border-color: #27ae60;
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.15);
}

.bundle-product-image {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
}

.bundle-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bundle-product-details {
    flex: 1;
    min-width: 0;
}

.bundle-product-title {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bundle-product-price {
    font-size: 13px;
    font-weight: 700;
    color: #27ae60;
}

.bundle-product-plus {
    font-size: 20px;
    font-weight: 700;
    color: #27ae60;
    flex-shrink: 0;
    padding: 0 8px;
}

/* Pricing Section */
.magaztk-bundle-pricing {
    background: #ffffff;
    border: 2px dashed #e9ecef;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.magaztk-bundle-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.magaztk-bundle-price-row .price-label {
    font-size: 14px;
    color: #7f8c8d;
    font-weight: 500;
}

.magaztk-bundle-price-row .price-value {
    font-size: 16px;
    font-weight: 700;
    color: #2c3e50;
}

.magaztk-bundle-price-row.bundle-total {
    border-top: 2px solid #e9ecef;
    margin-top: 8px;
    padding-top: 12px;
}

.magaztk-bundle-price-row.bundle-total .price-label {
    font-size: 16px;
    color: #2c3e50;
    font-weight: 700;
}

.magaztk-bundle-price-row.bundle-total .price-value {
    font-size: 24px;
    color: #27ae60;
}

.magaztk-bundle-price-row .original-price {
    text-decoration: line-through;
    color: #95a5a6;
    font-size: 14px;
}

.magaztk-bundle-price-row.savings-row {
    background: linear-gradient(135deg, #fff3cd, #fff8e1);
    margin: 8px -20px 0;
    padding: 12px 20px;
    border-radius: 0 0 10px 10px;
}

.magaztk-bundle-price-row.savings-row .savings-label {
    color: #856404;
    font-weight: 600;
}

.magaztk-bundle-price-row.savings-row .savings-value {
    color: #e74c3c;
    font-size: 18px;
}

/* Action Button */
.magaztk-bundle-actions {
    margin-bottom: 20px;
}

.magaztk-bundle-add-to-cart-button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 18px 32px;
    font-size: 18px;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.magaztk-bundle-add-to-cart-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: left 0.5s ease;
}

.magaztk-bundle-add-to-cart-button:hover::before {
    left: 100%;
}

.magaztk-bundle-add-to-cart-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.4);
}

.magaztk-bundle-add-to-cart-button:active {
    transform: translateY(0);
}

.magaztk-bundle-add-to-cart-button.loading {
    pointer-events: none;
    opacity: 0.8;
}

.magaztk-bundle-add-to-cart-button .button-icon {
    flex-shrink: 0;
}

.magaztk-bundle-add-to-cart-button .button-loading {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.magaztk-bundle-add-to-cart-button .spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.magaztk-bundle-add-to-cart-button.success {
    background: #27ae60 !important;
}

.magaztk-bundle-add-to-cart-button.success::after {
    content: '\2713';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
}

/* Features List */
.magaztk-bundle-features {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(135deg, #e8f5e9, #f1f8f4);
    border-radius: 12px;
}

.bundle-feature {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #2c3e50;
    font-weight: 500;
}

.bundle-feature svg {
    flex-shrink: 0;
    color: #27ae60;
}

/* Responsive Design */
@media (max-width: 768px) {
    .magaztk-product-bundle {
        padding: 16px 12px;
        margin: 0 0 20px 0;
        border-radius: 12px;
    }

    .magaztk-bundle-header {
        gap: 12px;
        margin-bottom: 16px;
    }

    .magaztk-bundle-icon {
        width: 36px;
        height: 36px;
    }

    .magaztk-bundle-title {
        font-size: 18px;
    }

    .magaztk-bundle-subtitle {
        font-size: 12px;
    }

    .magaztk-bundle-savings-badge {
        padding: 8px 12px;
        margin-left: auto;
    }

    .magaztk-bundle-savings-badge .savings-text {
        font-size: 10px;
    }

    .magaztk-bundle-savings-badge .savings-amount {
        font-size: 16px;
    }

    .magaztk-bundle-products {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-bottom: 16px;
        overflow-x: visible;
    }

    .magaztk-bundle-product-item {
        flex-direction: column;
        text-align: center;
        min-width: auto;
        padding: 12px 8px;
        gap: 8px;
    }

    .bundle-product-image {
        width: 80px;
        height: 80px;
        margin: 0 auto;
    }

    .bundle-product-details {
        width: 100%;
    }

    .bundle-product-title {
        font-size: 11px;
        -webkit-line-clamp: 2;
        text-align: center;
        margin-bottom: 4px;
    }

    .bundle-product-price {
        font-size: 13px;
        text-align: center;
        font-weight: 700;
    }

    .bundle-product-plus {
        display: none;
    }

    .magaztk-bundle-pricing {
        padding: 14px;
        margin-bottom: 16px;
    }

    .magaztk-bundle-price-row {
        padding: 6px 0;
    }

    .magaztk-bundle-price-row .price-label {
        font-size: 12px;
    }

    .magaztk-bundle-price-row .price-value {
        font-size: 14px;
    }

    .magaztk-bundle-price-row.bundle-total .price-label {
        font-size: 14px;
    }

    .magaztk-bundle-price-row.bundle-total .price-value {
        font-size: 18px;
    }

    .magaztk-bundle-price-row.savings-row {
        padding: 10px 14px;
        margin: 8px -14px 0;
    }

    .magaztk-bundle-price-row.savings-row .savings-value {
        font-size: 15px;
    }

    .magaztk-bundle-add-to-cart-button {
        padding: 14px 20px;
        font-size: 15px;
    }

    .magaztk-bundle-features {
        flex-direction: column;
        gap: 8px;
        padding: 12px;
    }

    .bundle-feature {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .magaztk-product-bundle {
        padding: 14px 10px;
    }

    .magaztk-bundle-header {
        gap: 10px;
        margin-bottom: 14px;
    }

    .magaztk-bundle-icon {
        width: 32px;
        height: 32px;
    }

    .magaztk-bundle-title {
        font-size: 16px;
    }

    .magaztk-bundle-subtitle {
        font-size: 11px;
    }

    .magaztk-bundle-savings-badge {
        padding: 6px 10px;
    }

    .magaztk-bundle-savings-badge .savings-text {
        font-size: 9px;
    }

    .magaztk-bundle-savings-badge .savings-amount {
        font-size: 14px;
    }

    .magaztk-bundle-products {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .magaztk-bundle-product-item {
        padding: 10px 6px;
    }

    .bundle-product-image {
        width: 70px;
        height: 70px;
        margin: 0 auto;
    }

    .bundle-product-title {
        font-size: 10px;
        -webkit-line-clamp: 2;
    }

    .bundle-product-price {
        font-size: 12px;
    }

    .magaztk-bundle-pricing {
        padding: 12px;
    }

    .magaztk-bundle-price-row .price-label {
        font-size: 11px;
    }

    .magaztk-bundle-price-row .price-value {
        font-size: 13px;
    }

    .magaztk-bundle-price-row.bundle-total .price-label {
        font-size: 13px;
    }

    .magaztk-bundle-price-row.bundle-total .price-value {
        font-size: 16px;
    }

    .magaztk-bundle-price-row.savings-row .savings-value {
        font-size: 14px;
    }

    .magaztk-bundle-add-to-cart-button {
        padding: 12px 18px;
        font-size: 14px;
        gap: 8px;
    }

    .magaztk-bundle-add-to-cart-button .button-icon {
        width: 16px;
        height: 16px;
    }

    .magaztk-bundle-features {
        padding: 10px;
        gap: 6px;
    }

    .bundle-feature {
        font-size: 10px;
    }

    .bundle-feature svg {
        width: 12px;
        height: 12px;
    }
}

/* Success Message */
.magaztk-bundle-success-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    background: #27ae60;
    color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.magaztk-bundle-success-message.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateX(400px);
    }
}
