/**
 * Protection Cover Plan Frontend Styles
 * 
 * CSS styles for the protection cover plan interface elements.
 * 
 * @version 1.0.0
 */

/* Protection Plan Main Container */
.ppp-protection-plan-wrapper {
    margin: 20px 0;
    padding: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background-color: #f9f9f9;
    transition: all 0.3s ease;
    width: 100%;
}

.ppp-protection-plan-wrapper:hover {
    border-color: #62957f;
    box-shadow: 0 2px 8px rgba(98, 149, 127, 0.1);
}

/* Header Styles */
.ppp-protection-plan-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.ppp-protection-plan-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ppp-shield-icon {
    font-size: 20px;
}

.ppp-protection-plan-badge {
    display: inline-block;
    background: #62957f;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Content Area */
.ppp-protection-plan-content {
    margin: 15px 0;
}

/* Benefits Section */
.ppp-benefits {
    margin-bottom: 15px;
}

.ppp-benefits h4 {
    margin: 10px 0 8px 0;
    color: #34495e;
    font-size: 14px;
    font-weight: 600;
}

.ppp-benefits ul {
    margin: 0;
    padding-left: 20px;
    color: #555;
    line-height: 1.5;
}

.ppp-benefits li {
    margin-bottom: 4px;
    position: relative;
}

.ppp-benefits li::before {
    content: "✓";
    color: #62957f;
    font-weight: bold;
    position: absolute;
    left: -18px;
}

/* Variable Product Notice */
.ppp-variable-notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.ppp-variable-notice small {
    color: #856404;
    display: block;
}

/* Pricing Information */
.ppp-pricing-info {
    background: white;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    border: 1px solid #e0e0e0;
}

.ppp-price-calculation {
    font-size: 14px;
}

.ppp-price-calculation > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ppp-price-calculation small {
    color: #888;
    font-style: italic;
    margin-top: 5px;
    display: block;
}

/* Action Buttons */
.ppp-action-buttons {
    margin-top: 15px;
}

.ppp-checkbox-wrapper {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-bottom: 10px;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.ppp-checkbox-wrapper:hover {
    background-color: rgba(98, 149, 127, 0.05);
}

.ppp-protection-checkbox {
    margin-right: 10px !important;
    transform: scale(1.2);
    accent-color: #62957f;
}

.ppp-checkbox-wrapper span {
    color: #2c3e50;
    font-weight: 500;
    user-select: none;
}

.ppp-protection-actions {
    margin-top: 15px;
    display: none;
}

.ppp-add-protection-btn {
    width: 100%;
    padding: 12px;
    background: #62957f;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.ppp-add-protection-btn:hover:not(:disabled) {
    background: #537a69;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(98, 149, 127, 0.3);
}

.ppp-add-protection-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.ppp-btn-loading {
    display: none;
}

.ppp-btn-loading .spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: ppp-spin 1s linear infinite;
    margin-right: 8px;
}

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

/* Why Choose Section */
.ppp-why-choose {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.ppp-why-choose h4 {
    margin: 0 0 10px 0;
    color: #34495e;
    font-size: 14px;
    font-weight: 600;
}

.ppp-why-choose > div {
    display: flex;
    justify-content: space-around;
    text-align: center;
    gap: 10px;
}

.ppp-why-choose > div > div {
    flex: 1;
    padding: 0 10px;
}

.ppp-why-choose > div > div > div {
    font-size: 24px;
    margin-bottom: 5px;
    filter: grayscale(1);
    transition: filter 0.3s ease;
}

.ppp-why-choose:hover > div > div > div {
    filter: grayscale(0);
}

.ppp-why-choose small {
    color: #666;
    font-size: 11px;
    font-weight: 500;
}

/* Cart Page Styles */
.ppp-protection-plan-row {
    background-color: rgba(98, 149, 127, 0.05);
}

.ppp-linked-item {
    color: #62957f;
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ppp-protection-plan-wrapper {
        margin: 15px 0;
        padding: 15px;
    }
    
    .ppp-protection-plan-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .ppp-protection-plan-header h3 {
        font-size: 16px;
    }
    
    .ppp-why-choose > div {
        flex-direction: column;
        text-align: center;
    }
    
    .ppp-why-choose > div > div {
        margin-bottom: 15px;
    }
}

@media (max-width: 480px) {
    .ppp-protection-plan-wrapper {
        padding: 12px;
        margin: 10px 0;
    }
    
    .ppp-pricing-info {
        padding: 12px;
    }
    
    .ppp-add-protection-btn {
        padding: 10px;
        font-size: 13px;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .ppp-protection-plan-wrapper {
        border: 3px solid #000;
        background-color: #fff;
    }
    
    .ppp-add-protection-btn {
        border: 2px solid #000;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .ppp-protection-plan-wrapper,
    .ppp-add-protection-btn,
    .ppp-checkbox-wrapper {
        transition: none;
    }
    
    .ppp-btn-loading .spinner {
        animation: none;
    }
}

/* Print Styles */
@media print {
    .ppp-protection-plan-wrapper {
        border: 1px solid #000;
        background: white;
        break-inside: avoid;
    }
    
    .ppp-add-protection-btn,
    .ppp-protection-actions {
        display: none;
    }
}


#side-cart .widget_shopping_cart_content .woocommerce-mini-cart .woocommerce-mini-cart-item{
    flex-wrap: wrap;
}

/* Subtotal Update Animations */
.ppp-subtotal-updating {
    position: relative;
    transition: all 0.3s ease-in-out;
    transform: scale(1.05);
}

.ppp-subtotal-updating::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #62957f, #6fa285, #62957f, #6fa285);
    background-size: 400% 400%;
    border-radius: 4px;
    z-index: -1;
    animation: ppp-glow 1s ease-in-out;
}

@keyframes ppp-glow {
    0% {
        background-position: 0% 50%;
        opacity: 0.7;
    }
    50% {
        background-position: 100% 50%;
        opacity: 0.9;
    }
    100% {
        background-position: 0% 50%;
        opacity: 0;
    }
}

/* Smooth transitions for price elements */
.woocommerce-Price-amount,
.amount,
.total .amount,
.subtotal .amount,
.cart-subtotal .amount {
    transition: color 0.2s ease, transform 0.2s ease;
}

.woocommerce-Price-amount:hover,
.amount:hover {
    transform: scale(1.02);
}

/* Protection plan checkbox animations */
.ppp-cart-checkbox {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ppp-cart-checkbox:checked {
    transform: scale(1.1);
    box-shadow: 0 0 0 2px rgba(98, 149, 127, 0.3);
}

.ppp-cart-checkbox:hover {
    transform: scale(1.05);
}

/* Protection plan wrapper animations */
.ppp-cart-protection-wrapper {
    animation: ppp-slideIn 0.3s ease-out;
    transition: all 0.3s ease;
}

.ppp-cart-protection-wrapper:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

@keyframes ppp-slideIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
        max-height: 0;
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        max-height: 200px;
    }
}

/* Loading state animations */
.ppp-cart-checkbox:disabled + span {
    opacity: 0.6;
    position: relative;
}

.ppp-cart-checkbox:disabled + span::after {
    content: '';
    position: absolute;
    left: -20px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    border: 2px solid #62957f;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: ppp-loading 0.8s linear infinite;
}
.ppp-protection-plan-item p{
    font-size: 14px;
}
@keyframes ppp-loading {
    0% {
        transform: translateY(-50%) rotate(0deg);
    }
    100% {
        transform: translateY(-50%) rotate(360deg);
    }
}
