/* Main Container */
.wc-arabic-donation-container {
    font-family: 'Tajawal', sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
    direction: rtl;
    text-align: right;
    color: #333;
}

/* Stepper */
.stepper-container {
    margin-bottom: 40px;
}

.stepper {
    display: flex;
    justify-content: space-between;
    padding: 0;
    list-style: none;
    position: relative;
    max-width: 800px;
    margin: 0 auto !important;
}

/*.stepper:after {*/
/*    content: '';*/
/*    position: absolute;*/
/*    top: 20px;*/
/*    left: 10%;*/
/*    right: 10%;*/
/*    height: 2px;*/
/*    background: #e0e0e0;*/
/*    z-index: 1;*/
/*}*/

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    width: 33.33%;
}

.step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.step-title {
    font-size: 14px;
    text-align: center;
    transition: all 0.3s ease;
}

.step.active .step-circle {
    background-color: #4CAF50;
    color: white;
    transform: scale(1.1);
}

.step.active .step-title {
    color: #4CAF50;
    font-weight: bold;
}

.step.completed .step-circle {
    background-color: #4CAF50;
    color: white;
}

.step.completed:after {
    background-color: #4CAF50;
}

/* Step Content */
.donation-step {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.donation-step h2 {
    margin-top: 0;
    margin-bottom: 30px;
    color: #333;
    font-size: 24px;
    font-weight: 500;
    text-align: center;
    position: relative;
}

.donation-step h2:after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: #4CAF50;
    margin: 15px auto 0;
    border-radius: 3px;
}

/* Section Title */
.section-title {
    font-size: 18px;
    font-weight: 500;
    color: #4CAF50;
    margin: 30px 0 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

/* Grid Layouts for Categories */
.category-grid,
.subcategory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.category-item,
.subcategory-item {
    background-color: #f9f9f9;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    aspect-ratio: 1/1; /* Create perfect square */
}

.category-item:hover,
.subcategory-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Updated for full image display */
.category-image,
.subcategory-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.category-image img,
.subcategory-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.category-item:hover .category-image img,
.subcategory-item:hover .subcategory-image img {
    transform: scale(1.05);
}

.category-title,
.subcategory-title {
    padding: 10px;
    text-align: center;
    font-weight: 500;
    color: #333;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(3px);
    margin: 0;
}

/* Subcategories Container */
.subcategories-container {
    margin-top: 30px;
    background-color: #f5f5f5;
    padding: 20px;
    border-radius: 8px;
}

.subcategory-heading {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    font-size: 20px;
    font-weight: 500;
    text-align: center;
}

/* Products Grid Layout - Updated for full image */
.products-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
    text-align: center;
}

.product-item {
    /*background-color: #fff;*/
    /*border-radius: 15px;*/
    /*overflow: hidden;*/
    /*box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);*/
    cursor: pointer;
    /*transition: transform 0.3s ease, box-shadow 0.3s ease;*/
    /*border: 1px solid #e8e8e8;*/
    position: relative;
    aspect-ratio: 3/4; /* Fixed aspect ratio */
}

.product-item:hover {
    /*transform: translateY(-5px);*/
    /*box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);*/
    /*border-color: #4CAF50;*/
}

.product-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.product-image img {
    /*width: 100%;*/
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.product-item:hover .product-image img {
    transform: scale(1.05);
    border-color: #4CAF50;
}

/* Add visual indicator for selection */
.product-item.selected {
    transform: translateY(-5px);
    /*box-shadow: 0 10px 20px rgba(76, 175, 80, 0.2);*/
    /*border: 2px solid #4CAF50;*/
}

.product-item.selected:before {
    content: '';
    position: absolute;
    top: 10px;
    right: 10px;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background-color: #4CAF50;
    z-index: 2;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z'/%3E%3C/svg%3E");
    background-size: 15px;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Product Preview */
.product-preview {
    width: 255px;
    max-width: 255px;
    height: 450px;
    max-height: 450px;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.product-preview img {
    width: 255px;
    max-width: 255px;
    height: 450px;
    max-height: 450px;
    display: block;
}

/* Recipient Name Placeholder */
.recipient-name-placeholder {
    position: absolute;
    top: 66px;
    right: 54px;
    left: 34px;
    height: 31px;
    /*background-color: rgba(255, 255, 255, 0.64);*/
    /*border-radius: 6px;*/
    /*border: 2px dashed #4caf50d9;*/
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    overflow: hidden;
}

.recipient-name-overlay {
    color: #333;
    font-size: 16px;
    font-weight: normal;
    text-align: center;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Donor Name Placeholder */
.donor-name-placeholder {
    position: absolute;
    top: 239px;
    right: 54px;
    left: 34px;
    height: 31px;
    /*background-color: rgba(255, 255, 255, 0.64);*/
    /*border-radius: 6px;*/
    /*border: 2px dashed #4caf50d9;*/
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    overflow: hidden;
}

.donor-name-overlay {
    color: #333;
    font-size: 16px;
    font-weight: normal;
    text-align: center;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Combined Form Container */
.combined-form-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 20px;
}

.form-side {
    flex: 1;
    min-width: 300px;
}

.preview-side {
    flex: 1;
    min-width: 300px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 20px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Tajawal', sans-serif;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #4CAF50;
}

/* Phone Input Styling */
.phone-input-container {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.phone-prefix {
    display: flex;
    align-items: center;
    background-color: #f5f5f5;
    padding: 0 12px;
    border-right: 1px solid #ddd;
    height: 44px;
    position: absolute;
    left: 0;
}

.phone-prefix img {
    width: 20px;
    height: auto;
    margin-right: 5px; /* Keep margin-right to position flag to the left of code */
}

.phone-input-container .form-control {
    border: none;
    padding-left: 90px; /* Make room for the prefix */
}

/* Relation Buttons */
.relation-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.relation-btn {
    padding: 8px 15px;
    background-color: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Tajawal', sans-serif;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.relation-btn:hover,
.relation-btn.active {
    background-color: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

/* Amount Buttons */
.amount-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.amount-btn {
    padding: 10px 20px;
    background-color: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Tajawal', sans-serif;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.amount-btn:hover,
.amount-btn.active {
    background-color: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

.custom-amount-container {
    display: flex;
    align-items: center;
    position: relative;
    margin-top: 15px;
}

.custom-amount-container .form-control {
    padding-left: 50px;
}

.custom-amount-container .currency {
    position: absolute;
    left: 15px;
    font-weight: 500;
}

/* Navigation Buttons */
.step-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

.prev-step,
.next-step,
.submit-donation {
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    font-family: 'Tajawal', sans-serif;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.prev-step {
    background-color: #f5f5f5;
    color: #333;
}

.prev-step:hover {
    background-color: #e0e0e0;
}

.next-step,
.submit-donation {
    background-color: #4CAF50;
    color: white;
}

.next-step:hover,
.submit-donation:hover {
    background-color: #45a049;
    transform: translateY(-2px);
}

/* Loading Spinner */
.loading-spinner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Thank You Message Styling */
.thank-you-container {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 40px 30px;
    text-align: center;
    margin: 30px auto;
    max-width: 600px;
    animation: fadeIn 0.5s ease;
}

.thank-you-icon {
    margin: 0 auto 20px;
    width: 80px;
    height: 80px;
    animation: scaleIn 0.5s ease 0.2s both;
}

.thank-you-title {
    color: #4CAF50;
    font-size: 28px;
    margin-bottom: 20px;
    font-weight: 700;
}

.thank-you-message {
    font-size: 18px;
    color: #555;
    margin-bottom: 30px;
    line-height: 1.6;
}

/* Enhanced thank you page styling */
.thank-you-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 30px;
}

.action-button {
    padding: 12px 25px;
    background-color: #4CAF50;
    color: white;
    border-radius: 4px;
    font-family: 'Tajawal', sans-serif;
    font-size: 16px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid #4CAF50;
}

.action-button:hover {
    background-color: #45a049;
    transform: translateY(-2px);
}

.action-button.secondary {
    background-color: white;
    color: #4CAF50;
    border: 2px solid #4CAF50;
}

.action-button.secondary:hover {
    background-color: #f5f5f5;
}

/* Status-specific styling */
.thank-you-icon.success svg circle {
    fill: #4CAF50;
}

.thank-you-icon.error svg circle {
    fill: #F44336;
}

.thank-you-icon.warning svg circle {
    fill: #FFC107;
}

.thank-you-icon.processing svg circle {
    fill: #3F51B5;
}

.failed-message .thank-you-title {
    color: #F44336;
}

.cancelled-message .thank-you-title {
    color: #FFC107;
}

.processing-message .thank-you-title {
    color: #3F51B5;
}

/* Checkout overlay styling */
.checkout-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.9);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.loading-spinner-checkout {
    margin-bottom: 20px;
}

.spinner-checkout {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.redirect-message {
    font-family: 'Tajawal', sans-serif;
    color: #333;
    text-align: center;
    direction: rtl;
    font-size: 18px;
    margin-top: 20px;
}

/* Animation effects */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes scaleIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.donation-step {
    animation: fadeIn 0.3s ease, slideInUp 0.3s ease;
}

/* Responsive Design */
@media (max-width: 800px) {
     .recipient-name-placeholder {
        top: 66px;
    }
    .donor-name-placeholder {
        top: 239px;
    }
}

@media (max-width: 768px) {
    .category-grid,
    .subcategory-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .products-list {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .step-title {
        font-size: 12px;
    }
    
    .donation-step {
        padding: 20px;
    }
    
    .combined-form-container {
        flex-direction: column;
    }
    
    .form-side,
    .preview-side {
        width: 100%;
    }
    
    .recipient-name-placeholder {
        top: 66px;
    }
    
    .donor-name-placeholder {
        top: 239px;
    }
}

@media (max-width: 480px) {
    .category-grid,
    .subcategory-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .products-list {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }
    
    .stepper:after {
        display: none;
    }
    
    .step-circle {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
    
    .step-title {
        font-size: 10px;
    }
    
    .prev-step,
    .next-step,
    .submit-donation {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .recipient-name-placeholder {
        top: 78px;
    }
    
    .donor-name-placeholder {
        top: 284px;
    }
    
    .form-side {
        min-width: 100%;
    }
    
    .preview-side {
        min-width: 100%;
    }
}

@media (max-width: 479px) {
    .recipient-name-placeholder {
        top: 66px;
    }
    .donor-name-placeholder {
        top: 239px;
    }
}

@media (max-width: 466px) {
    .recipient-name-placeholder {
        top: 66px;
    }
    .donor-name-placeholder {
        top: 239px;
    }
}

@media (max-width: 415px) {
    .recipient-name-placeholder {
        top: 66px;
    }
    .donor-name-placeholder {
        top: 239px;
    }
}


@media (max-width: 391px) {
    .recipient-name-placeholder {
        top: 66px;
    }
    .donor-name-placeholder {
        top: 239px;
    }
}

@media (max-width: 377px) {
    .recipient-name-placeholder {
        top: 66px;
    }
    .donor-name-placeholder {
        top: 239px;
    }
}

@media (max-width: 320px) {
    .recipient-name-placeholder {
        top: 66px;
    }
    .donor-name-placeholder {
        top: 239px;
        right: 40px;
    }
}