/* Book Item Component Styles */

.book-item {
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    width: 22vw;
    aspect-ratio:0.7;
    border-radius: 15px;
    border: 2px solid var(--color1);
    margin: auto;
    overflow: hidden;
}

.book-item-link {
    height: 100%;
    text-decoration: none !important;
}

/* Book Cover Container */
.book-cover {
    position: relative;
    overflow: hidden;
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    background: white;
}

.book-item:hover .book-cover img {
    transform: scale(1.05);
}

/* Book Placeholder */
.book-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 1rem;
    text-align: center;
    color: var(--color4);
    font-size: 0.85rem;
    background: var(--color5);
}

/* Action Buttons Column - Left Top Corner */
.cover-actions-column {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 10;
   
}

 

.action-btn {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    padding:0;
    border: none;
    background: var(--color1);
    color: var(--color5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.action-btn:hover {
    background: var(--color2);
    transform: scale( 1.1 );
}

.action-btn.active {
    background: var(--desert-gold);
}

/* Tags Container - Right Top Corner */
.tags-container {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    z-index: 10;
   
}

 
.tag {
    padding: 0.35rem 0.65rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    line-height: 1;
}

.tag-sale {
    background:  #ff3636;
    color: white;
}

.tag-status {
    color: var(--color5);
    background: var(--color1);
}

/* Book Info Section - Details Sheet */
.book-info {
    width:100%;
    height: fit-content;
    display:flex;
    flex-direction:column;
    justify-content: flex-end;
    position: absolute;
    padding:20px 10px;
    border-radius: 15px 15px 0 0;
    background: var(--color5);
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 -5px 12px rgba(0, 0, 0, 0.3);
    transform: translateY(0);
    top: 100%;
}

.book-item:hover .book-info {
 transform: translateY(-100%);
}

.book-author {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color4);
}

.book-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--color4);
    margin-bottom: 0.75rem;
    gap: 0.5rem;
}

.book-meta span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.book-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.btn {
    flex: 1;
    padding: 0.5rem;
    border: none;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
}

.btn-primary {
    background: var(--color1);
    color: var(--color5);
}

.btn-primary:hover {
    background: var(--color2);
}

/* Price Section */
.price-section {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    white-space: nowrap;
}

.price-old {
    font-size: 0.8rem;
    color: var(--color4);
    text-decoration: line-through;
    text-decoration-thickness: 2px;
    text-underline-offset: 2px;
}

.price-final {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color2);
}

.currency {
    font-size: 0.85rem;
    color: var(--color2);
    font-weight: 600;
}

/* Quick Info Bar - Title below cover */
.quick-info-bar {
    height: auto;
    background:var(--color1);
    padding: 0.5rem;
    gap: 0.5rem;
}

.book-title-quick {
    margin:0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color5);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-item:hover .book-title-quick {
    /* show all lines */
    -webkit-line-clamp: none;
    line-clamp: none;
}

.quick-info-bar .price-section {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    white-space: nowrap;
}

@media (min-width: 1024px ) {
    .book-item {
  
    width:calc(1024px / 4.3);
  
    
    }
}
/* Responsive Design */
@media ( max-width: 768px ) {
    .book-item {
  
    width: 40vw;
  
    
    }
    .cover-actions-column {
        opacity: 1;
        transform: translateX( 0 );
    }
    
    .tags-container {
        opacity: 1;
        transform: translateX( 0 );
    }
    
    .action-btn {
        width: 2rem;
        height: 2rem;
        font-size: 0.9rem;
    }
    
    .tag {
        font-size: 0.7rem;
        padding: 0.3rem 0.5rem;
    }
    
    
    .btn {
        font-size: 0.8rem;
        padding: 0.4rem;
    }
}

@media ( max-width: 480px ) {
    .action-btn {
        width: 1.8rem;
        height: 1.8rem;
        font-size: 0.8rem;
    }

    .book-title-quick {
        font-size:0.8rem;
    }
    
    .book-author {
        font-size: 0.9rem;
    }
    
    .price-final {
        font-size: 1rem;
    }
}
