/* Confirm Product Popup Styles */
.confirm-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

.confirm-popup-content {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: confirmPopupSlideIn 0.3s ease-out;
}

@keyframes confirmPopupSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.confirm-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px 15px;
    border-bottom: 1px solid #e5e5e5;
}

.confirm-popup-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.4em;
    font-weight: 600;
}

.confirm-popup-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.confirm-popup-close:hover {
    background-color: #f5f5f5;
    color: #666;
}

.confirm-popup-body {
    padding: 25px;
    text-align: left;
}

.confirm-icon {
    font-size: 48px;
    margin-bottom: 15px;
    text-align: center;
    animation: confirmIconPulse 2s infinite;
}

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

.confirm-popup-body p {
    margin: 0 0 15px 0;
    color: #333;
    line-height: 1.6;
}

.confirm-notice-box {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
}

.confirm-notice-box h4 {
    margin: 0 0 10px 0;
    color: #856404;
    font-size: 1.1em;
    font-weight: 600;
}

.confirm-notice-box p {
    margin: 0;
    color: #856404;
    font-size: 0.95em;
}

.confirm-disclaimer {
    background: #f8f9fa;
    border-left: 4px solid #dc3545;
    padding: 12px 15px;
    margin: 20px 0;
    font-size: 0.9em;
    color: #721c24;
}

.read-details-link {
    color: #007bff;
    text-decoration: underline;
    font-weight: 500;
}

.read-details-link:hover {
    color: #0056b3;
}

.confirm-acceptance {
    margin: 25px 0 15px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.confirm-checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    color: #2c3e50;
    position: relative;
    padding-left: 35px;
    user-select: none;
}

.confirm-accept-checkbox {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 20px;
    width: 20px;
    background-color: #fff;
    border: 2px solid #007bff;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.confirm-checkbox-label:hover .checkmark {
    background-color: #f0f8ff;
}

.confirm-accept-checkbox:checked ~ .checkmark {
    background-color: #007bff;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.confirm-accept-checkbox:checked ~ .checkmark:after {
    display: block;
}

.confirm-checkbox-label .checkmark:after {
    left: 6px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.confirm-popup-footer {
    display: flex;
    gap: 15px;
    padding: 20px 25px 25px;
    border-top: 1px solid #e5e5e5;
}

.confirm-popup-cancel,
.confirm-popup-confirm {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.confirm-popup-cancel {
    background-color: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.confirm-popup-cancel:hover {
    background-color: #e9ecef;
    color: #495057;
}

.confirm-popup-confirm {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border: 1px solid #007bff;
}

.confirm-popup-confirm:hover:not(:disabled) {
    background: linear-gradient(135deg, #0056b3, #004085);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

.confirm-popup-confirm:disabled {
    background: #6c757d;
    color: #adb5bd;
    border-color: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Custom Confirmation Add to Cart Button Styles */
.custom-confirm-add-to-cart {
    background-color: #eeeeee !important;
    color: #000000 !important;
    border: 1px solid #6c757d !important;
    font-weight: 500 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    position: relative !important;
    overflow: hidden !important;
    transition: all 0.2s ease !important;
    border-radius: 3px !important;
    padding: 10px 20px !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    cursor: pointer !important;
    display: inline-block !important;
    text-decoration: none !important;
}

.custom-confirm-add-to-cart:hover {
    background-color: #eeeeee !important;
    color: #000000 !important;
    border-color: #5a6268 !important;
}

.custom-confirm-add-to-cart:before {
    content: "";
    margin-right: 0;
    font-size: 14px;
}

.custom-confirm-add-to-cart-wrapper {
    margin: 20px 0;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
}

.custom-confirm-add-to-cart-wrapper:before {
    content: "";
    display: none;
    font-weight: normal;
    color: inherit;
    margin-bottom: 0;
    font-size: 14px;
}

/* Loading state for add to cart buttons */
.custom-confirm-add-to-cart.loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.custom-confirm-add-to-cart.loading:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid #ffffff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Success and error messages */
.woocommerce-message,
.woocommerce-error {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999999;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-width: 400px;
    font-weight: 500;
    animation: slideInRight 0.3s ease-out;
}

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

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

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

/* Responsive adjustments for messages */
@media (max-width: 768px) {
    .woocommerce-message,
    .woocommerce-error {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .confirm-popup-content {
        width: 95%;
        margin: 20px;
        max-width: none;
    }
    
    .confirm-popup-header {
        padding: 15px 20px 10px;
    }
    
    .confirm-popup-header h3 {
        font-size: 1.2em;
    }
    
    .confirm-popup-body {
        padding: 20px;
    }
    
    .confirm-popup-footer {
        padding: 15px 20px 20px;
        flex-direction: column;
    }
    
    .confirm-popup-cancel,
    .confirm-popup-confirm {
        width: 100%;
    }
    
    .confirm-notice-box {
        padding: 12px;
    }
    
    .confirm-disclaimer {
        padding: 10px 12px;
    }
    
    .custom-confirm-add-to-cart {
        font-size: 12px !important;
        padding: 10px 15px !important;
    }
}

@media (max-width: 480px) {
    .confirm-popup-content {
        width: 98%;
        margin: 10px;
    }
    
    .confirm-popup-header {
        padding: 12px 15px 8px;
    }
    
    .confirm-popup-body {
        padding: 15px;
    }
    
    .confirm-popup-footer {
        padding: 12px 15px 15px;
    }
    
    .confirm-icon {
        font-size: 36px;
    }
    
    .confirm-notice-box {
        padding: 10px;
    }
    
    .confirm-disclaimer {
        padding: 8px 10px;
        font-size: 0.85em;
    }
    
    .custom-confirm-add-to-cart {
        font-size: 11px !important;
        padding: 8px 12px !important;
    }
}

/* Accessibility improvements */
.confirm-popup-close:focus,
.confirm-popup-cancel:focus,
.confirm-popup-confirm:focus,
.confirm-accept-checkbox:focus + .checkmark,
.custom-confirm-add-to-cart:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .confirm-popup-overlay {
        background-color: rgba(0, 0, 0, 0.8);
    }
    
    .confirm-popup-content {
        border: 2px solid #000;
    }
    
    .confirm-popup-header,
    .confirm-popup-footer {
        border-color: #000;
    }
    
    .confirm-notice-box {
        border-color: #000;
        background: #ffff00;
    }
    
    .confirm-disclaimer {
        border-left-color: #ff0000;
        background: #ffff00;
    }
    
    .custom-confirm-add-to-cart {
        border: 2px solid #000 !important;
        background: #ff0000 !important;
        color: #000 !important;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .confirm-popup-content {
        animation: none;
    }
    
    .confirm-icon {
        animation: none;
    }
    
    .confirm-popup-confirm:hover:not(:disabled),
    .custom-confirm-add-to-cart:hover {
        transform: none;
    }
}