/* 
 * DigiFixer.in - Cart Success Message Styles
 * Author: Ravi Shandilya
 * Version: 1.0
 * Updated: May 29, 2025
 */

.cart-success-message {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: center;
        -ms-flex-pack: center;
            justify-content: center;
    -webkit-box-align: center;
        -ms-flex-align: center;
            align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    -webkit-transition: opacity 0.3s ease, visibility 0.3s ease;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    will-change: opacity, visibility;
    -webkit-transform: translateZ(0);
            transform: translateZ(0);
}

.cart-success-message.active {
    opacity: 1;
    visibility: visible;
}

.cart-message-content {
    background-color: #fff;
    border-radius: 8px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    -webkit-animation: messagePopIn 0.5s ease forwards;
            animation: messagePopIn 0.5s ease forwards;
    position: relative;
    will-change: transform, opacity;
    -webkit-backface-visibility: hidden;
            backface-visibility: hidden;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 18px;
    color: #999;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
        -ms-flex-align: center;
            align-items: center;
    -webkit-box-pack: center;
        -ms-flex-pack: center;
            justify-content: center;
    -webkit-transition: all 0.2s ease;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    /* Improve touch target for mobile */
    touch-action: manipulation;
    z-index: 10;
    /* Add subtle background for better visibility */
    background-color: rgba(245, 245, 245, 0.5);
}

.close-btn:hover {
    background-color: #f0f0f0;
    color: #333;
}

/* Active state for better mobile feedback */
.close-btn:active {
    background-color: #e0e0e0;
    color: #111;
    -webkit-transform: scale(0.95);
            transform: scale(0.95);
}

@-webkit-keyframes messagePopIn {
    0% {
        -webkit-transform: scale(0.8);
                transform: scale(0.8);
        opacity: 0;
    }
    100% {
        -webkit-transform: scale(1);
                transform: scale(1);
        opacity: 1;
    }
}

@keyframes messagePopIn {
    0% {
        -webkit-transform: scale(0.8);
                transform: scale(0.8);
        opacity: 0;
    }
    100% {
        -webkit-transform: scale(1);
                transform: scale(1);
        opacity: 1;
    }
}

.cart-message-content h2 {
    color: #4CAF50;
    margin-bottom: 20px;
    font-size: 24px;
    will-change: transform;
}

.cart-message-content p {
    margin-bottom: 10px;
    font-size: 16px;
    color: #333;
}

.cart-message-actions {
    margin-top: 25px;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
        flex-wrap: wrap;
    -webkit-box-pack: center;
        -ms-flex-pack: center;
            justify-content: center;
    gap: 10px;
}

.cart-message-actions .btn {
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 600;
    text-decoration: none;
    -webkit-transition: all 0.3s ease;
    transition: all 0.3s ease;
    will-change: background-color, transform;
    -webkit-tap-highlight-color: transparent;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.cart-message-actions .btn-close {
    background: none;
    border: 1px solid #ddd;
    color: #666;
    cursor: pointer;
    -webkit-transform: translateZ(0);
            transform: translateZ(0);
}

.cart-message-actions .btn-close:hover {
    background-color: #f5f5f5;
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .cart-message-content {
        padding: 20px;
    }
    
    .cart-message-actions {
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
            -ms-flex-direction: column;
                flex-direction: column;
    }
    
    .cart-message-actions .btn {
        width: 100%;
        margin-bottom: 10px;
    }
    
    /* Enhanced close button for mobile */
    .close-btn {
        width: 44px;
        height: 44px;
        top: 8px;
        right: 8px;
        font-size: 20px;
        background-color: rgba(245, 245, 245, 0.8);
        /* Add subtle shadow for better visibility */
        -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
                box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }
    
    /* Increase the hit area beyond the visible button */
    .close-btn::before {
        content: '';
        position: absolute;
        top: -10px;
        left: -10px;
        right: -10px;
        bottom: -10px;
        z-index: -1;
    }
}
