/* ==========================================================================
   Shortcodes: [uag_books_grid] & [uag_book_profile]
   ========================================================================== */

/* --- Books Grid --- */
.uag-books-grid-wrapper {
    max-width: 1200px;
    margin: 40px auto;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.uag-books-filters {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-bottom: 40px;
}

.uag-books-search {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
    width: 100%;
}

.uag-books-search input {
    width: 100%;
    padding: 12px 20px;
    border: 1px solid #ddd;
    border-radius: 50px;
    font-size: 16px;
    box-sizing: border-box;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.uag-books-search input:focus {
    outline: none;
    border-color: var(--uag-primary, rgb(121, 36, 47));
    box-shadow: 0 0 0 3px rgba(121, 36, 47, 0.1);
}

.uag-category-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.uag-category-pill {
    background-color: #f0f0f0;
    color: #555;
    border: 1px solid transparent;
    padding: 8px 18px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
}

.uag-category-pill:hover {
    background-color: #e0e0e0;
}

.uag-category-pill.active {
    background-color: var(--uag-primary, rgb(121, 36, 47));
    color: #fff;
    border-color: var(--uag-primary, rgb(121, 36, 47));
}

.uag-books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 30px;
    min-height: 200px;
}

.uag-book-card {
    text-align: center;
    text-decoration: none;
    opacity: 0;
    transform: translateY(20px);
    animation: uagBookFadeIn 0.5s forwards;
}

@keyframes uagBookFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.uag-book-card-image {
    aspect-ratio: 2 / 3;
    background-color: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.uag-book-card-image:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}

.uag-book-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.uag-book-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--uag-primary, rgb(121, 36, 47));
    line-height: 1.4;
    margin: 0;
}

.uag-books-footer {
    text-align: center;
    margin-top: 40px;
    position: relative;
    height: 40px;
}

.uag-load-more-btn {
    background-color: var(--uag-primary, rgb(121, 36, 47));
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

.uag-load-more-btn:hover {
    background-color: var(--uag-primary-dark, #5a1e25);
}

.uag-books-loader {
    display: none;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--uag-primary, rgb(121, 36, 47));
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: uagBookSpin 1s linear infinite;
    margin: 0 auto;
}

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

/* --- Single Book Profile --- */
.uag-book-profile-container {
    max-width: 1200px;
    margin: 60px auto;
    padding: 0 20px;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.uag-book-profile-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 50px;
}

@media (min-width: 768px) {
    .uag-book-profile-grid {
        grid-template-columns: 400px 1fr;
        align-items: start;
    }
}

@media (min-width: 1024px) {
    .uag-book-profile-grid {
        grid-template-columns: 500px 1fr;
    }
}

.uag-book-cover-wrapper {
    width: 100%;
    text-align: center;
}

.uag-book-cover-wrapper img {
    max-width: 100%;
    height: auto;
    max-height: 700px;
    object-fit: contain;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.uag-book-details {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.uag-book-title {
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--uag-primary, rgb(121, 36, 47));
    margin: 0;
    line-height: 1.2;
}

.uag-book-authors-list {
    font-size: 1.2rem;
    font-weight: 500;
    color: #555;
    margin-top: -10px;
}

.uag-book-authors-list a {
    color: inherit;
    text-decoration: none;
    border-bottom: 2px solid rgba(121, 36, 47, 0.3);
    transition: all 0.2s;
}

.uag-book-authors-list a:hover {
    color: var(--uag-primary, rgb(121, 36, 47));
    border-bottom-color: var(--uag-primary, rgb(121, 36, 47));
}

.uag-book-edition {
    font-style: italic;
    color: #777;
}

.uag-book-description {
    font-size: 1.1rem;
    line-height: 1.7;
    text-align: justify;
}

.uag-purchase-links {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.uag-purchase-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    transition: transform 0.2s;
}

.uag-purchase-link:hover {
    transform: translateY(-2px);
}

.uag-purchase-link.amazon {
    background-color: #FF9900;
    color: #111;
}

.uag-purchase-link.gonvill {
    background-color: #005A9C;
    color: #fff;
}

.uag-purchase-link.uag-store {
    background-color: var(--uag-primary, rgb(121, 36, 47));
    color: #fff;
}

.uag-purchase-link.html {
    background-color: #E44D26;
    color: #fff;
}

.uag-book-tech-sheet {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 25px;
    margin-top: 20px;
}

.uag-book-tech-sheet h3 {
    margin-top: 0;
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    font-size: 1.4rem;
}

.uag-tech-item {
    display: flex;
    margin-bottom: 10px;
    font-size: 1rem;
    gap: 10px;
}

.uag-tech-item strong {
    flex: 0 0 150px;
    color: #555;
}

.uag-tech-item span {
    flex: 1;
    color: #333;
}
