/* Items Page Styles */

/* Filter Chips */
.filter-section {
    z-index: 1020;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 50px;
    color: #6c757d;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.filter-chip:hover {
    background: #e9ecef;
    color: #495057;
    transform: translateY(-1px);
}

.filter-chip.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
    box-shadow: 0 4px 8px rgba(0,123,255,0.3);
}

.filter-chip .badge {
    background: rgba(255,255,255,0.2);
    color: inherit;
    margin-left: 6px;
    font-size: 0.75em;
    padding: 2px 6px;
    border-radius: 10px;
}

.filter-chip.active .badge {
    background: rgba(255,255,255,0.3);
}

/* Desktop Item Cards */
.item-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.07);
    transition: all 0.3s ease;
    overflow: hidden;
    border: none;
}

.item-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.15);
}

.item-card.sold-out {
    opacity: 0.7;
}

.item-image-container {
    position: relative;
    overflow: hidden;
    aspect-ratio: 3/4;
    background: #f8f9fa;
}

.item-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.image-link:hover .item-image {
    transform: scale(1.05);
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-link:hover .image-overlay {
    opacity: 1;
}

.stock-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stock-badge.in-stock {
    background: #28a745;
    color: white;
}

.stock-badge.sold-out {
    background: #dc3545;
    color: white;
}

.age-restriction-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
}

.item-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.item-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.3;
    color: #2c3e50;
}

.item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.meta-item {
    font-size: 0.8rem;
    color: #6c757d;
    background: #f8f9fa;
    padding: 2px 8px;
    border-radius: 12px;
}

.item-description {
    font-size: 0.9rem;
    color: #6c757d;
    line-height: 1.4;
    margin-bottom: 16px;
    flex-grow: 1;
}

.item-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: #007bff;
    margin-bottom: 16px;
}

.item-actions {
    padding: 0 20px 20px;
}

.add-to-cart-btn {
    background: linear-gradient(135deg, #007bff, #0056b3);
    border: none;
    border-radius: 10px;
    padding: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.add-to-cart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,123,255,0.3);
}

/* Desktop love button - overwrite.css handles base styling */
.love-btn:hover {
    transform: scale(1.05);
}

/* Mobile Styles */
.mobile-item-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.mobile-item-card:active {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.mobile-image-container {
    position: relative;
    aspect-ratio: 3/4;
    overflow: hidden;
}

.mobile-item-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mobile-stock-badge {
    position: absolute;
    bottom: 4px;
    left: 4px;
    background: #dc3545;
    color: white;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 600;
}

.mobile-age-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
}

.mobile-item-content {
    padding: 12px;
}

.mobile-item-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.3;
    color: #2c3e50;
}

.mobile-item-meta {
    margin-bottom: 8px;
}

.mobile-item-price {
    font-size: 1rem;
    font-weight: 700;
    color: #007bff;
    margin-bottom: 8px;
}

.mobile-actions .btn {
    font-size: 0.8rem;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.item-card {
    animation: fadeInUp 0.5s ease forwards;
}

.mobile-item-card {
    animation: fadeInUp 0.3s ease forwards;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .filter-chip {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    
    .container-fluid {
        padding-left: 8px;
        padding-right: 8px;
    }
}

/* Loading states */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Empty state */
.fa-book {
    opacity: 0.3;
}

/* Mobile Book Image */
.mobile-book-image {
    height: 100%;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    background: #f8f9fa;
    border-radius: 0.375rem 0 0 0.375rem;
}

/* Title Links */
.card-title a {
    transition: color 0.3s ease;
}

.card-title a:hover {
    color: #145688 !important;
}

/* Mobile More Button */
.mobile-more-btn {
    color: #6c757d !important;
    text-decoration: none !important;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.mobile-more-btn:hover {
    color: #495057 !important;
}

.mobile-more-btn i {
    transition: transform 0.3s ease;
}

.mobile-more-btn[aria-expanded="true"] i {
    transform: rotate(180deg);
}


/* Mobile button fixes - overrides overwrite.css for mobile consistency */
.mobile-actions .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    line-height: 1.2;
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px; /* Override overwrite.css 20px radius for mobile */
}

.mobile-actions .btn-saihan.btn-sm {
    width: 32px;
    height: 32px;
    padding: 0;
    min-width: 32px;
}

.mobile-actions .btn-love.btn-sm {
    width: 32px;
    height: 32px;
    min-width: 32px;
    padding: 0;
}

/* Mobile responsive fixes */
@media (max-width: 767px) {
    .mobile-book-image {
        height: 120px;
    }
    
    .card-body {
        padding: 0.75rem !important;
    }
}