/* Pauk Books - Stylesheet */

/* The book detail page is a standalone document with no theme assets. */
.pauk-book-page { margin: 0; background: #f8fafc; color: #0f172a; font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
.pauk-book-page *, .pauk-book-page *::before, .pauk-book-page *::after { box-sizing: border-box; }
.pauk-book-page button, .pauk-book-page input { font-family: inherit; }
.pauk-book-page img { height: auto; max-width: 100%; }
.pauk-book-page .pauk-single-content { min-width: 0; }
.pauk-book-page .pauk-annotation-text { overflow-wrap: anywhere; }
.pauk-book-page a:focus-visible, .pauk-book-page button:focus-visible { outline: 3px solid #2563eb; outline-offset: 4px; }
.pauk-book-page .pauk-single-cover-placeholder { padding: 32px; background: #e2e8f0; border-radius: 8px; }

.pauk-container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Catalog Grid */
.pauk-books-grid {
    display: grid;
    grid-template-columns: repeat(var(--pauk-cols, 3), 1fr);
    gap: 30px;
    margin: 30px 0;
}

@media (max-width: 900px) {
    .pauk-books-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .pauk-books-grid {
        grid-template-columns: 1fr;
    }
}

/* Card */
.pauk-book-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.pauk-book-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.pauk-book-cover-wrap {
    position: relative;
    background: #0f172a;
    padding: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 280px;
}

.pauk-book-cover {
    max-width: 180px;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    display: block;
    transition: transform 0.25s ease;
}

.pauk-book-card:hover .pauk-book-cover {
    transform: scale(1.03);
}

.pauk-book-cover-placeholder {
    width: 170px;
    height: 250px;
    background: linear-gradient(135deg, #1e293b, #334155);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
    box-sizing: border-box;
    color: #ffffff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.pauk-placeholder-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
}

.pauk-placeholder-author {
    font-size: 13px;
    color: #94a3b8;
}

.pauk-badge-genre {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(4px);
    color: #f8fafc;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.pauk-book-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.pauk-book-author {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 5px;
}

.pauk-book-title {
    margin: 0 0 10px 0;
    font-size: 18px;
    line-height: 1.4;
    font-weight: 700;
}

.pauk-book-title a {
    color: #0f172a;
    text-decoration: none;
}

.pauk-book-title a:hover {
    color: #2563eb;
}

.pauk-book-excerpt {
    font-size: 14px;
    color: #475569;
    line-height: 1.5;
    margin-bottom: 20px;
    flex-grow: 1;
}

.pauk-book-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f1f5f9;
    padding-top: 15px;
    margin-top: auto;
}

.pauk-book-price-box {
    display: flex;
    flex-direction: column;
}

.pauk-book-price {
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
}

.pauk-book-formats {
    font-size: 11px;
    color: #94a3b8;
}

.pauk-btn-buy {
    background: #2563eb;
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
}

.pauk-btn-buy:hover {
    background: #1d4ed8;
}

.pauk-btn-buy:active {
    transform: scale(0.98);
}

.pauk-book-sublink {
    text-align: center;
    margin-top: 12px;
}

.pauk-book-sublink a {
    font-size: 12px;
    color: #64748b;
    text-decoration: underline;
}

.pauk-book-sublink a:hover {
    color: #0f172a;
}

/* Single Book Page */
.pauk-single-book-wrapper {
    background: #f8fafc;
    padding: 40px 0 60px 0;
}

.pauk-breadcrumbs {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 30px;
}

.pauk-breadcrumbs a {
    color: #64748b;
    text-decoration: none;
}

.pauk-breadcrumbs a:hover {
    color: #0f172a;
}

.pauk-single-grid {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 40px;
    background: #ffffff;
    padding: 40px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

@media (max-width: 850px) {
    .pauk-single-grid {
        grid-template-columns: 1fr;
        padding: 20px;
    }
}

.pauk-single-cover-wrap {
    text-align: center;
    margin-bottom: 25px;
}

.pauk-single-cover {
    max-width: 100%;
    width: 280px;
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

.pauk-formats-box {
    background: #f1f5f9;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.pauk-formats-box h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #334155;
}

.pauk-format-badges {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pauk-format-badge {
    background: #ffffff;
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 6px;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.pauk-guarantee-box {
    font-size: 13px;
    color: #475569;
    line-height: 1.6;
}

.pauk-guarantee-box p {
    margin: 8px 0;
}

.pauk-single-genre {
    display: inline-block;
    background: #e0f2fe;
    color: #0369a1;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 12px;
}

.pauk-single-title {
    margin: 0 0 10px 0;
    font-size: 32px;
    line-height: 1.25;
    color: #0f172a;
}

.pauk-single-author {
    font-size: 16px;
    color: #475569;
    margin-bottom: 25px;
}

.pauk-buy-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 30px;
}

.pauk-single-price {
    font-size: 32px;
    font-weight: 800;
    color: #0f172a;
    margin-right: 15px;
}

.pauk-single-edition {
    font-size: 14px;
    color: #64748b;
}

.pauk-btn-single-buy {
    width: 100%;
    margin-top: 15px;
    background: #2563eb;
    color: #ffffff;
    border: none;
    padding: 16px;
    font-size: 18px;
    font-weight: 700;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    transition: background 0.2s ease, transform 0.1s ease;
}

.pauk-btn-single-buy:hover {
    background: #1d4ed8;
}

.pauk-btn-single-buy:active {
    transform: scale(0.99);
}

.pauk-single-already-bought {
    text-align: center;
    margin-top: 12px;
}

.pauk-single-already-bought a {
    font-size: 13px;
    color: #64748b;
    text-decoration: underline;
}

.pauk-single-already-bought a:hover {
    color: #0f172a;
}

.pauk-annotation-section h3 {
    font-size: 20px;
    margin-bottom: 15px;
    color: #0f172a;
}

.pauk-annotation-text {
    font-size: 16px;
    line-height: 1.8;
    color: #334155;
}

/* Modals */
.pauk-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.pauk-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(5px);
}

.pauk-modal-content {
    position: relative;
    background: #ffffff;
    width: 100%;
    max-width: 460px;
    max-height: 100%;
    overflow-y: auto;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    z-index: 2;
    animation: paukModalFadeIn 0.2s ease-out;
}

@keyframes paukModalFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.pauk-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 26px;
    cursor: pointer;
    color: #94a3b8;
    line-height: 1;
}

.pauk-modal-close:hover {
    color: #0f172a;
}

.pauk-modal-header {
    text-align: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 15px;
}

.pauk-modal-badge {
    display: inline-block;
    background: #f1f5f9;
    color: #475569;
    font-size: 11px;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 4px;
    margin-bottom: 8px;
}

.pauk-modal-title {
    margin: 5px 0;
    font-size: 20px;
    color: #0f172a;
}

.pauk-modal-price {
    font-size: 26px;
    font-weight: 800;
    color: #2563eb;
    margin-top: 5px;
}

.pauk-form-group {
    margin-bottom: 18px;
}

.pauk-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

.pauk-input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s ease;
}

.pauk-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.pauk-form-note {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 20px;
    line-height: 1.4;
}

.pauk-btn-submit {
    width: 100%;
    background: #2563eb;
    color: #ffffff;
    border: none;
    padding: 14px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
    transition: background 0.2s ease;
}

.pauk-btn-submit:hover {
    background: #1d4ed8;
}

.pauk-btn-submit:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

.pauk-alert {
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 15px;
}

.pauk-alert-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.pauk-alert-success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.pauk-dl-btn-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 15px;
}

.pauk-dl-btn {
    display: block;
    text-align: center;
    padding: 10px;
    background: #0f172a;
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    border-radius: 6px;
    font-size: 14px;
}

.pauk-dl-btn:hover {
    background: #1e293b;
    color: #ffffff;
}

@media (max-width: 600px) {
    .pauk-book-page .pauk-single-book-wrapper { padding: 12px 0 30px; }
    .pauk-book-page .pauk-container { padding: 14px; }
    .pauk-book-page .pauk-single-grid { gap: 24px; padding: 20px 16px; }
    .pauk-book-page .pauk-buy-card { padding: 18px 14px; }
    .pauk-modal { padding: 12px; }
    .pauk-modal-content { padding: 28px 20px 22px; }
}
