/* WP Rise Book Store specific styling (Bookshelf effect) */

.wp-rise-book-shelf-container {
    font-family: "Outfit", "Inter", sans-serif;
    background: #2a1b18 url("../images/bookshelf-wood.png") repeat;
    background-size: 600px;
    border-radius: 24px;
    padding: 60px 20px;
    box-shadow: inset 0 0 150px rgba(0, 0, 0, 0.8), 0 20px 40px rgba(0, 0, 0, 0.3);
    color: #f8fafc;
    position: relative;
    overflow: hidden;
    margin-bottom: 50px;
}

.wp-rise-book-shelf-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 300px;
    background: radial-gradient(circle at 50% -20%, rgba(255, 236, 179, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.wp-rise-book-header {
    text-align: center;
    margin-bottom: 60px;
    position: relative;
    z-index: 5;
}

.wp-rise-book-header h3 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 12px;
    color: #fff9f0;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    letter-spacing: -1px;
}

.wp-rise-book-header p {
    color: #d7ccc8;
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto 30px;
}

.wp-rise-book-search-wrap {
    position: relative;
    width: 100%;
    max-width: 550px;
    margin: 0 auto;
}

#wp-rise-book-search {
    width: 100%;
    padding: 18px 24px 18px 56px;
    border-radius: 60px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
    color: white;
    font-size: 1.1rem;
    backdrop-filter: blur(12px);
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

#wp-rise-book-search:focus {
    border-color: #ffa726;
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 20px rgba(255, 167, 38, 0.2);
}

.wp-rise-book-search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    color: rgba(255, 255, 255, 0.5);
    pointer-events: none;
}

.wp-rise-book-cat-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 30px;
}

.wp-rise-book-cat-btn {
    padding: 8px 20px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    color: #d7ccc8;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.3s;
    backdrop-filter: blur(5px);
}

.wp-rise-book-cat-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
}

.wp-rise-book-cat-btn.active {
    background: #ffa726;
    color: #3e2723;
    border-color: #ffa726;
    font-weight: 600;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3), 0 5px 15px rgba(255, 167, 38, 0.4);
    transform: translateY(1px);
}

/* Bookshelf Grid */
.wp-rise-bookshelf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    row-gap: 60px;
    column-gap: 0;
    padding: 40px 0;
}

.wp-rise-book-item {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    padding-bottom: 25px;
    min-height: 380px;
}

/* The Continuous Shelf Plank */
.wp-rise-shelf-base {
    position: absolute;
    top: 240px;
    left: 0;
    width: 100%;
    height: 24px;
    background: linear-gradient(to bottom, #795548 0%, #5d4037 100%);
    border-bottom: 8px solid #3e2723;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

.wp-rise-shelf-base::before {
    content: "";
    position: absolute;
    top: -12px;
    left: 0;
    right: 0;
    height: 12px;
    background: #4e342e;
    transform: perspective(100px) rotateX(45deg);
    transform-origin: bottom;
    z-index: 0;
}

.wp-rise-shelf-base::after {
    content: "";
    position: absolute;
    bottom: -30px;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.4) 0%, transparent 100%);
    pointer-events: none;
}

.wp-rise-book-card {
    width: 140px;
    height: 210px;
    position: relative;
    z-index: 3;
    cursor: pointer;
    perspective: 1000px;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.wp-rise-book-cover-container {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    box-shadow: 8px 10px 20px rgba(0, 0, 0, 0.6), inset -2px 0 5px rgba(255, 255, 255, 0.1);
    border-radius: 3px 6px 6px 3px;
    background: #334155;
    overflow: hidden;
}

.wp-rise-book-cover-container::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 10px;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.2) 0%, rgba(255, 255, 255, 0.1) 50%, rgba(0, 0, 0, 0.2) 100%);
    z-index: 4;
    border-right: 1px solid rgba(0, 0, 0, 0.2);
}

.wp-rise-book-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.wp-rise-book-item:hover .wp-rise-book-card {
    transform: translateY(-20px) rotateY(-10deg) scale(1.05);
}

.wp-rise-book-card:hover {
    filter: brightness(1.1);
    box-shadow: 12px 15px 30px rgba(0, 0, 0, 0.8), inset 0 0 10px rgba(255, 255, 255, 0.1);
}

.wp-rise-book-card::after {
    content: "View Details";
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    opacity: 0;
    transition: opacity 0.3s;
    white-space: nowrap;
    z-index: 5;
    pointer-events: none;
}

.wp-rise-book-card:hover::after {
    opacity: 1;
}

.wp-rise-book-meta {
    margin-top: 40px;
    text-align: center;
    padding: 0 15px;
    z-index: 5;
    position: relative;
}

.wp-rise-book-meta h4 {
    margin: 0 0 4px;
    font-size: 1rem;
    color: #fff;
    line-height: 1.3;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wp-rise-book-meta p {
    margin: 0 0 12px;
    font-size: 0.85rem;
    color: #ffa726;
}

.wp-rise-book-item .wp-rise-buy-btn {
    background: #ffa726 !important;
    color: #3e2723 !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    padding: 10px 24px !important;
    border-radius: 6px !important;
    font-size: 0.9rem !important;
    font-weight: 800 !important;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 0 #5d4037, inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
    text-transform: uppercase;
    display: inline-block;
    width: auto;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    z-index: 10;
}

.wp-rise-buy-btn::before {
    content: "";
}

.wp-rise-buy-btn:hover {
    background: #ffb74d !important;
    transform: translateY(-1px);
    box-shadow: 0 5px 0 #e65100, inset 0 1px 0 rgba(255, 255, 255, 0.4) !important;
}

.wp-rise-buy-btn:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 #e65100, inset 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}

/* Success "Added" State - Carved Green Look */
.wp-rise-buy-btn.added,
.wp-rise-buy-btn.in-cart {
    background: var(--wp-rise-success) !important;
    color: white !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2) !important;
    border-color: #059669 !important;
    transform: translateY(1px);
    cursor: default !important;
    opacity: 0.9;
}

.wp-rise-buy-btn.added::before,
.wp-rise-buy-btn.in-cart::before {
    content: "✓ ";
}

@keyframes wp-rise-carved-pulse {
    0% {
        transform: scale(1) translateY(1px);
    }

    50% {
        transform: scale(1.05) translateY(1px);
    }

    100% {
        transform: scale(1) translateY(1px);
    }
}

.wp-rise-buy-btn:active {
    transform: translateY(2px);
    box-shadow: none;
}

#wp-rise-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px;
    color: #8d6e63;
    font-size: 1.2rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    margin: 20px;
}

@media (max-width: 600px) {
    .wp-rise-bookshelf-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }

    .wp-rise-library-header h3 {
        font-size: 2rem;
    }

    .wp-rise-book-card {
        width: 120px;
        height: 180px;
    }
}