.custom-edd-grid-container {
    width: 100%;
    margin: 0 auto;
}

/* Filter Section */
.edd-grid-filters {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.edd-filter-form {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.edd-search-field input[type="text"],
.edd-category-filter select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: white;
    font-size: 14px;
    min-width: 200px;
}
.edd-search-field input[type="text"] {
    min-width: 280px;
}
.edd-category-filter select {
    -webkit-appearance: none; /* For Webkit browsers like Chrome, Safari */
    -moz-appearance: none; /* For Firefox */
    appearance: none; /* Standard property */
}
.edd-category-filter {
    position: relative;
}
.edd-category-filter::after {
    content: "\2304"; /* Unicode for a down arrow */
    position: absolute;
    right: 12px; /* Adjust for desired padding from the right */
    top: 50%;
    transform: translateY(-70%) scaleX(1.5);
    pointer-events: none; /* Ensures clicks go through to the select */
}

.edd-filter-submit,
.edd-clear-filters {
    padding: 10px 20px;
    background: var(--color-primary);
    color: black;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
    height: 43px;
}

.edd-filter-submit:hover {
    background: var(--color-primary-hover);
    color: black;
}

.edd-clear-filters {
    background: transparent;
    border: 1px solid rgb(98, 98, 98);
    box-sizing: border-box;
}
.edd-clear-filters:hover {
    background: #00000020;
}

/* Downloads Grid */
.edd-downloads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* Responsive grid columns */
@media (min-width: 1200px) {
    .edd-downloads-grid[data-columns="4"] {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 768px) and (max-width: 1199px) {
    .edd-downloads-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 480px) and (max-width: 767px) {
    .edd-downloads-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 479px) {
    .edd-downloads-grid {
        grid-template-columns: 1fr;
    }
}

/* Download Card Styles */
.edd-download-card {
    background: white;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.edd-download-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.edd-download-thumbnail {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.edd-download-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

/* Magnifier Icon Overlay */
.edd-download-thumbnail::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 32px 32px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.edd-download-card:hover .edd-download-thumbnail::after {
    opacity: 1;
}

.edd-download-card:hover .edd-download-thumbnail img {
    transform: scale(1.05);
}

.edd-no-thumbnail {
    width: 100%;
    height: 200px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 14px;
}

.edd-download-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.edd-download-title {
    margin: 0 0 10px 0;
    font-size: 18px;
    line-height: 1.3;
}

.edd-download-title a {
    color: #333;
    text-decoration: none;
}

.edd-download-title a:hover {
    color: #0073aa;
}

.edd-download-categories {
    margin-bottom: 15px;
    flex-wrap: wrap;
    display: flex;
    gap: 5px;
}

.edd-category-tag {
    background: #e1f5fe;
    color: #0277bd;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.edd-download-price {
    margin-bottom: 15px;
    margin-top: auto;
}

.edd-price {
    font-size: 20px;
    font-weight: bold;
    color: #2e7d32;
}

.edd-download-purchase {
    margin-top: auto;
}

.edd-download-purchase .edd-submit {
    width: 100%;
    background: var(--color-primary) !important;
    color: black !important;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}
.edd-download-purchase .edd-submit.edd_go_to_checkout {
    background: #2e7d32 !important;
    color: white !important;
}

.edd-download-purchase .edd-submit:hover {
    background: var(--color-primary-hover) !important;
}
.edd-download-purchase .edd-submit.edd_go_to_checkout:hover {
    background: #29702d !important;
    color: white !important;
}

/* No Downloads Message */
.edd-no-downloads {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #666;
}

/* Pagination */
.edd-grid-pagination {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

.edd-grid-pagination .page-numbers {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 4px;
    background: white;
    border: 1px solid #ddd;
    color: #0073aa;
    text-decoration: none;
    border-radius: 8px;
}

.edd-grid-pagination .page-numbers:hover,
.edd-grid-pagination .page-numbers.current {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
}

.edd-cart-added-alert {
    text-align: center;
    position: initial !important;
}

/* Mobile Responsive Filters */
@media (max-width: 767px) {
    .edd-modal-meta {
        flex-direction: column;
        gap: 20px;
    }

    .edd-filter-form {
        flex-direction: column;
        align-items: stretch;
    }

    .edd-search-field input,
    .edd-category-filter select {
        min-width: auto;
        width: 100%;
    }

    .edd-filter-submit,
    .edd-clear-filters {
        width: 100%;
        margin-left: 0;
        margin-top: 10px;
    }
}

/* Modal Styles */
.edd-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
}

.edd-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(3px);
}

.edd-modal-content {
    position: relative;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    margin: 5vh auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.edd-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    padding-bottom: 3px;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #333;
    transition: all 0.3s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.edd-modal-close:hover {
    color: white;
    background-color: #333;
}

.edd-modal-body {
    padding: 40px 30px 20px;
    overflow-y: auto;
    flex: 1;
}

.edd-modal-title {
    margin: 0 0 20px 0;
    font-size: 28px;
    color: #333;
    line-height: 1.3;
    padding-right: 40px;
}

.edd-modal-article-content {
    margin-bottom: 25px;
    color: #555;
    line-height: 1.6;
    font-size: 16px;
}

.edd-modal-article-content p {
    margin-bottom: 15px;
}

.edd-modal-article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.edd-modal-meta {
    margin-top: 25px;
    margin-bottom: 20px;
    padding-top: 20px;
    border-top: 1px solid #e1e1e1;
    display: flex;
}

.edd-modal-categories-wrapper,
.edd-modal-tags-wrapper {
    flex: 1;
}

.edd-modal-categories-wrapper strong,
.edd-modal-tags-wrapper strong {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-size: 16px;
}

.edd-modal-categories,
.edd-modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.edd-modal-categories .edd-category-tag {
    background: #e1f5fe;
    color: #0277bd;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
}

.edd-modal-tags .edd-tag-badge {
    background: #c2c2c2;
    color: #000000;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
}

.edd-modal-opening-paragraph-wrapper,
.edd-modal-key-concepts-wrapper {
    margin-bottom: 20px;
}

.edd-modal-opening-paragraph-wrapper strong,
.edd-modal-key-concepts-wrapper strong {
    display: block;
    margin-bottom: 10px;
    color: #333;
    font-size: 16px;
}

.edd-modal-opening-paragraph,
.edd-modal-key-concepts {
    color: #555;
    line-height: 1.6;
    font-size: 15px;
}

.edd-modal-opening-paragraph p,
.edd-modal-key-concepts p {
    margin-bottom: 10px;
}

.edd-modal-opening-paragraph ul,
.edd-modal-opening-paragraph ol,
.edd-modal-key-concepts ul,
.edd-modal-key-concepts ol {
    margin-left: 20px;
    margin-bottom: 10px;
}

.edd-modal-footer {
    padding: 20px 30px;
    background: #f8f9fa;
    border-top: 1px solid #e1e1e1;
    display: flex;
    justify-content: flex-end;
}

.edd-modal-purchase .edd-submit {
    background: var(--color-primary) !important;
    color: black !important;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}
.edd-modal-purchase .edd-submit.edd_go_to_checkout {
    background: #2e7d32 !important;
    color: white !important;
}

.edd-modal-purchase .edd-submit:hover {
    background: var(--color-primary-hover) !important;
}

.edd-modal-purchase .edd-submit.edd_go_to_checkout:hover {
    background: #29702d !important;
}

/* Modal Responsive */
@media (max-width: 767px) {
    .edd-modal-content {
        width: 95%;
        max-height: 95vh;
        margin: 2.5vh auto;
    }

    .edd-modal-body {
        padding: 35px 20px 15px;
    }

    .edd-modal-title {
        font-size: 22px;
        padding-right: 35px;
    }

    .edd-modal-footer {
        padding: 15px 20px;
    }

    .edd-modal-close {
        top: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
}

/* Checkout page */
.edd_checkout_cart_item_title .edd_cart_item_image img {
    width: 100px;
    height: 100px;
    object-fit: cover;
}

/* Confirmation page */
.wp-block-edd-confirmation.edd-blocks__confirmation {
    margin-top: 40px;
}
.wp-block-edd-confirmation.edd-blocks__confirmation h3,
.wp-block-edd-receipt.edd-blocks__receipt h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
}
.edd-blocks-receipt__row-header {
    font-size: 17px !important;
}
.edd-blocks__confirmation-details a {
    text-decoration: underline !important;
}
.edd-blocks-receipt__items .edd_purchase_receipt_files {
    list-style: disc;
    padding-left: 40px;
}
.edd-blocks-receipt__items .edd_purchase_receipt_files a {
    text-decoration: underline !important;
    color: #0000ee;
}

/* Navigation cart icon button */
.edd-navigation-cart {
    display: flex;
    align-items: center;
    margin-left: auto;
    padding: 0 2px;
}

.edd-cart-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s;
}

.edd-cart-link:hover {
    opacity: 0.7;
}

.edd-cart-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.edd-cart-icon svg {
    width: 24px;
    height: 24px;
}

.edd-cart-quantity {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
}

@media (max-width: 768px) {
    .edd-navigation-cart {
        padding: 0 10px;
    }
    .edd-cart-link {
        position: absolute;
        top: -24px;
        right: 24px;
    }
}
