/* Styles for the subscriptions list in the user's account panel */
body .usm-pro-subscriptions { /* Added body to increase specificity */
    max-width: 800px;
    margin: 0 auto !important; /* Use !important if centering is an issue */
    padding: 20px !important;
    background-color: #f9f9f9 !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05) !important;
}

body .usm-pro-subscription { /* Added body for specificity */
    display: flex !important; /* Make main container a flexbox */
    flex-direction: row-reverse !important; /* Arrange children in a row, reversed for RTL */
    flex-wrap: wrap !important; /* Allow wrapping on smaller screens */
    border: 1px solid #ddd !important;
    padding: 15px !important;
    margin-bottom: 20px !important;
    border-radius: 5px !important;
    background-color: #fff !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03) !important;
    justify-content: flex-start !important; /* Align content to the right */
}

body .usm-pro-subscription:last-child { /* Added body for specificity */
    margin-bottom: 0 !important;
}

/* Main Info Section (Image and Title) */
body .usm-pro-subscription-main-info {
    display: flex !important;
    flex-direction: column !important; /* Stack image and title vertically */
    align-items: center !important; /* Center content horizontally within this column */
    flex-shrink: 0 !important; /* Don't let this section shrink */
    width: 120px !important; /* Give it a fixed width for the left column (RTL right column) */
    margin-left: 15px !important; /* Space between this column and details */
    padding-bottom: 15px !important;
    border-bottom: 1px solid #eee !important;
}

/* Container for product image */
body .usm-pro-product-image-wrap { /* Added body for specificity */
    flex-shrink: 0 !important;
    width: 80px !important; /* Slightly larger fixed width for the image */
    height: 80px !important; /* Fixed height for the image container */
    margin-right: 0 !important; /* No margin on the right */
    margin-bottom: 10px !important; /* Space below image */
    border: 1px solid #eee !important;
    border-radius: 4px !important;
    overflow: hidden !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

body .usm-pro-product-image-wrap img { /* Added body for specificity */
    max-width: 100% !important;
    max-height: 100% !important;
    display: block !important;
    object-fit: cover !important;
}

/* Title wrapper (to control title style within main info) */
body .usm-pro-product-title-wrap {
    text-align: center !important; /* Center the title below the image */
    width: 100% !important;
}

body .usm-pro-product-title-wrap h3 { /* Added body for specificity */
    margin: 0 !important;
    color: #333 !important;
    font-size: 1.1em !important; /* Smaller font for title in this layout */
    text-align: center !important; /* Center the title */
    line-height: 1.3 !important;
}


/* New wrapper for details and actions - this takes the remaining space */
body .usm-pro-subscription-content-wrap {
    display: flex !important;
    flex-direction: column !important; /* Stack details and actions vertically */
    flex-grow: 1 !important; /* Allow this section to take all available horizontal space */
    padding-bottom: 0 !important; /* Reset padding */
    border-bottom: none !important; /* Reset border */
    margin-bottom: 0 !important; /* Reset margin */
}


/* Details Section */
body .usm-pro-subscription-details { /* Added body for specificity */
    padding-bottom: 15px !important;
    border-bottom: 1px solid #eee !important;
    margin-bottom: 15px !important;
    flex-grow: 1 !important; /* Allow details to grow if needed */
}

body .usm-pro-subscription-details p { /* Added body for specificity */
    margin: 5px 0 !important;
    color: #555 !important;
    font-size: 0.95em !important;
    text-align: right !important; /* Align text right for RTL */
}

/* Actions Section (Button) */
body .usm-pro-subscription-actions { /* Added body for specificity */
    text-align: center !important;
    padding-top: 5px !important; /* Small space above button */
}

body .usm-pro-expired { /* Added body for specificity */
    color: #d63638 !important;
    font-weight: bold !important;
    background-color: #ffe8e8 !important;
    padding: 5px 10px !important;
    border-radius: 4px !important;
    display: inline-block !important;
    margin-top: 10px !important;
}

/* Styling for the renewal button */
body .usm-pro-subscriptions .usm-pro-renew-button.button.btn { /* Added body for specificity */
    display: inline-block !important;
    padding: 10px 20px !important;
    background-color: #4CAF50 !important;
    color: #ffffff !important;
    text-decoration: none !important;
    border-radius: 6px !important;
    transition: background-color 0.3s ease !important;
    border: none !important;
    box-shadow: none !important;
    font-weight: 600 !important;
    text-align: center !important;
    margin-top: 0 !important;
    cursor: pointer !important;
}

body .usm-pro-subscriptions .usm-pro-renew-button.button.btn:hover { /* Added body for specificity */
    background-color: #45A049 !important;
    transform: translateY(-1px) !important;
}

body .usm-pro-subscriptions .usm-pro-renew-button.button.btn:active { /* Added body for specificity */
    background-color: #3C8D40 !important;
    transform: translateY(0) !important;
}

/* Custom message for no subscriptions */
body .usm-pro-subscriptions + p { /* Added body for specificity */
    text-align: center !important;
    color: #666 !important;
    font-style: italic !important;
    margin-top: 30px !important;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {
    body .usm-pro-subscription {
        flex-direction: column !important; /* Stack image/details vertically on small screens */
        align-items: center !important; /* Center content horizontally */
    }
    body .usm-pro-subscription-main-info {
        width: 100% !important; /* Full width for main info */
        margin-left: 0 !important;
        margin-bottom: 15px !important;
        border-bottom: 1px solid #eee !important;
        padding-bottom: 15px !important;
    }
    body .usm-pro-subscription-content-wrap {
        width: 100% !important; /* Full width for content wrap */
    }
    body .usm-pro-product-image-wrap {
        margin-right: 0 !important; /* Reset margin for stacked layout */
        margin-bottom: 10px !important; /* Space below image when stacked */
    }
    body .usm-pro-product-title-wrap h3 {
        text-align: center !important; /* Center title when stacked */
    }
    body .usm-pro-subscription-details p {
        text-align: center !important;
    }
    body .usm-pro-subscription-actions {
        text-align: center !important;
    }
}