
/* ==================================================
   ISLAMIC QALAM — FREE & PREMIUM E-BOOKS
   ================================================== */

/* Free / Premium badges */


/* ================= ACCESS BADGES ================= */

.ebook-access-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: fit-content;
    min-height: 35px;
    margin: 0 0 16px;
    padding: 8px 15px;

    border: 1px solid;
    border-radius: 50px;

    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.3px;
    line-height: 1.2;
}

/* FREE — GREEN */

.ebook-access-badge.is-free {
    color: #17643a;
    background: #e5f4e9;
    border-color: #a5d4b1;
}

/* PREMIUM — GOLD */

.ebook-access-badge.is-premium {
    color: #825613;
    background: linear-gradient(
        135deg,
        #fff4d8,
        #f3dda8
    );
    border-color: #d6b56b;
}

/* Badge inside the individual e-book information box */

.ebook-information .ebook-tier-info {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.ebook-information .ebook-tier-value {
    display: flex;
    align-items: center;
    min-height: 38px;
}

.ebook-information .ebook-tier-value
.ebook-access-badge {
    margin: 0;
    padding: 10px 18px;
    font-size: 0.9rem;
}

/* Slightly closer category/badge spacing in library cards */

.ebook-card .ebook-category {
    margin-bottom: 9px;
}


/* Library buttons */

.ebook-card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
}

.ebook-access-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    width: 100%;
    min-height: 47px;
    padding: 12px 14px;

    background: var(--secondary-color);
    border: 1px solid var(--secondary-color);
    border-radius: 7px;

    color: #ffffff;

    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 750;
    text-align: center;

    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.ebook-access-button:hover:not(:disabled) {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(13, 59, 38, 0.14);
}

.ebook-access-button:focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: 3px;
}

.ebook-access-button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* Detail page */

.ebook-detail-access-button {
    flex: 1;
    min-height: 52px;
    font-size: 0.96rem;
}

.product-page .ebook-access-badge {
    margin-bottom: 18px;
}

/* Download dialog */

.ebook-access-dialog {
    position: fixed;
    inset: 0;
    z-index: 5000;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;
    background: rgba(0, 0, 0, 0.68);
}

.ebook-access-dialog[hidden] {
    display: none !important;
}

.ebook-access-dialog-panel {
    position: relative;

    width: min(490px, 100%);
    max-height: min(85vh, 750px);
    overflow-y: auto;

    padding: 38px 30px 30px;

    border: 1px solid rgba(140, 98, 57, 0.24);
    border-radius: 16px;

    background: #fffdf8;
    box-shadow: 0 24px 65px rgba(0, 0, 0, 0.28);
}

.ebook-access-dialog-close {
    position: absolute;
    top: 12px;
    right: 16px;

    width: 38px;
    height: 38px;

    border: none;
    border-radius: 50%;
    background: transparent;

    color: var(--secondary-color);
    font-size: 2rem;

    cursor: pointer;
}

.ebook-access-dialog-close:hover {
    background: rgba(140, 98, 57, 0.1);
}

.ebook-access-dialog-panel h2 {
    margin-bottom: 12px;

    color: var(--secondary-color);
    font-family: "Playfair Display", Georgia, serif;
    font-size: 1.7rem;
    line-height: 1.3;
}

.ebook-access-dialog-panel > p {
    color: var(--text-color);
    font-size: 0.95rem;
    line-height: 1.6;
}

.ebook-access-file-list {
    display: flex;
    flex-direction: column;
    gap: 12px;

    margin-top: 25px;
}

.ebook-access-file-button {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    padding: 15px 18px;

    border: 1px solid var(--secondary-color);
    border-radius: 8px;

    background: var(--secondary-color);
    color: #ffffff;

    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 750;

    cursor: pointer;
}

.ebook-access-file-button:hover:not(:disabled) {
    background: var(--accent-color);
    border-color: var(--accent-color);
}

.ebook-access-file-button:disabled {
    opacity: 0.6;
    cursor: progress;
}

.ebook-access-message {
    margin-top: 15px;
    color: #a32626;
    font-size: 0.88rem;
    line-height: 1.5;
}


/* ================= GOLD ACTION BUTTONS ================= */

.ebook-access-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    width: 100%;
    min-height: 48px;
    padding: 12px 15px;

    background: #bf9446;
    border: 1px solid #bf9446;
    border-radius: 7px;

    color: #173426;

    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 800;
    text-align: center;
    text-decoration: none;

    cursor: pointer;

    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.ebook-access-button:hover:not(:disabled) {
    background: #d5ae63;
    border-color: #d5ae63;
    color: #173426;

    transform: translateY(-2px);

    box-shadow:
        0 7px 20px rgba(145, 100, 28, 0.22);
}

.ebook-access-button:focus-visible {
    outline: 3px solid #bf9446;
    outline-offset: 3px;
}

.ebook-access-button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* Keep View E-book distinctly green */

.ebook-card .ebook-view-button {
    background: #17482f;
    color: #ffffff;
}

.ebook-card:hover .ebook-view-button {
    background: #246746;
    color: #ffffff;
}

/* Larger button on individual detail pages */

.btn-container .ebook-detail-access-button {
    width: 100%;
    min-height: 53px;
    font-size: 1rem;
}

.ebook-access-file-button {
    background: #bf9446;
    border-color: #bf9446;
    color: #173426;
}

.ebook-access-file-button:hover:not(:disabled) {
    background: #d5ae63;
    border-color: #d5ae63;
    color: #173426;
}

@media (max-width: 450px) {
    .ebook-card-actions {
        grid-template-columns: 1fr;
    }

    .ebook-access-dialog-panel {
        padding: 38px 20px 24px;
    }
}
