/* --- SHOP HERO --- */
.shop-hero {
    background-color: #0e2a47;
    padding: 140px 20px 60px;
    text-align: center;
    color: #fff;
    background-image: radial-gradient(rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 30px 30px;
    position: relative;
}
.shop-hero h1 { font-family: 'Cinzel', serif; font-size: 3rem; color: #e6be6e; margin-bottom: 10px; }
.shop-hero p { text-transform: uppercase; letter-spacing: 3px; font-size: 0.9rem; }

/* --- MOBILE CATEGORIES (Horizontalni Meni) --- */
.mobile-cat-wrapper {
    display: none;
    background: #0b223a;
    padding: 15px 0;
    position: sticky;
    top: 70px; /* Ispod headera */
    z-index: 900;
    box-shadow: 0 5px 10px rgba(0,0,0,0.1);
    border-bottom: 1px solid rgba(230, 190, 110, 0.2);
}

.mobile-cat-scroll {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding: 0 20px;
    scrollbar-width: none;
}
.mobile-cat-scroll::-webkit-scrollbar { display: none; }

.mobile-cat-scroll a {
    color: #fff;
    text-decoration: none;
    padding: 8px 20px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 20px;
    white-space: nowrap;
    font-size: 0.85rem;
    transition: 0.3s;
}
.mobile-cat-scroll a.active {
    background: #e6be6e;
    color: #0e2a47;
    border-color: #e6be6e;
    font-weight: bold;
}

/* --- LAYOUT --- */
.shop-container {
    display: flex; max-width: 1200px; margin: 40px auto; padding: 0 20px; gap: 40px;
}

/* SIDEBAR */
.shop-sidebar {
    flex: 1; max-width: 250px; height: fit-content;
    background: #f8f9fa; padding: 30px; border-radius: 5px; border-right: 1px solid #eee;
}
.sidebar-title { font-family: 'Cinzel', serif; color: #0e2a47; border-bottom: 2px solid #e6be6e; padding-bottom: 10px; margin-bottom: 20px; font-size: 1.2rem; }
.category-list { list-style: none; padding: 0; margin: 0; }
.category-list li { padding: 10px 0; border-bottom: 1px solid rgba(0,0,0,0.05); display: flex; justify-content: space-between; align-items: center; }
.category-list a { color: #555; text-decoration: none; transition: 0.3s; font-size: 0.95rem; font-family: 'Montserrat', sans-serif; }
.category-list a:hover { color: #0e2a47; padding-left: 5px; font-weight: 600; }
.cat-count { font-size: 0.8rem; color: #999; }

/* GRID (Desktop) */
.books-grid {
    flex: 3; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 40px;
}

/* --- KARTICA KNJIGE --- */
.book-card {
    background: transparent; perspective: 1000px; margin-bottom: 20px;
    display: flex; flex-direction: column;
}

.book-cover-wrapper {
    position: relative; width: 100%;
    /* Standardni omjer knjige */
    aspect-ratio: 2 / 3; 
    transition: transform 0.5s ease;
    transform-style: preserve-3d;
    cursor: pointer;
    margin-bottom: 20px;
}

.book-img {
    width: 100%; height: 100%; object-fit: cover;
    border-radius: 2px 5px 5px 2px;
    box-shadow: 10px 10px 30px rgba(0,0,0,0.15);
    transform: rotateY(-20deg) translateX(10px); 
    transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    border-left: 4px solid #ccc; background: #fff;
}

.book-card:hover .book-img {
    transform: rotateY(0deg) translateX(0) scale(1.03);
    box-shadow: 0 20px 40px rgba(14, 42, 71, 0.25);
    border-left: 0;
}

/* Bedž za popust */
.sale-badge {
    position: absolute; top: 10px; right: 10px;
    background: #e74c3c; color: white; font-weight: bold;
    padding: 4px 8px; border-radius: 3px; font-size: 0.75rem;
    z-index: 10; box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transform: translateZ(20px);
}

/* Info */
.book-info { text-align: center; position: relative; padding: 0 5px; }
.book-title {
    font-family: 'Cinzel', serif; font-size: 1.1rem; color: #0e2a47;
    margin-bottom: 5px; font-weight: 700; line-height: 1.3;
    
    /* Ograničavanje naslova na 2 reda */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2; /* OVO SI DODAO DA UKLONIŠ UPOZORENJE */
    -webkit-box-orient: vertical;
    overflow: hidden;
    
    min-height: 2.6em; 
}
.book-author { 
    font-size: 0.9rem; color: #777; margin-bottom: 5px; display: block; font-style: italic;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.price-box { margin-bottom: 10px; }
.old-price { text-decoration: line-through; color: #aaa; font-size: 0.85rem; margin-right: 5px; }
.new-price { color: #e74c3c; font-size: 1.1rem; font-weight: bold; }
.book-price { font-size: 1.1rem; color: #b08d55; font-weight: bold; }

/* Dugme */
.btn-add-cart {
    width: 100%; padding: 12px;
    background: #0e2a47; color: #e6be6e;
    border: 1px solid #0e2a47; text-transform: uppercase;
    font-weight: bold; cursor: pointer; transition: 0.3s;
    opacity: 0; transform: translateY(10px);
}
.book-card:hover .btn-add-cart { opacity: 1; transform: translateY(0); }
.btn-add-cart:hover { background: #e6be6e; color: #0e2a47; border-color: #e6be6e; }

/* --- RESPONSIVE OPTIMIZACIJA --- */
@media (max-width: 900px) {
    /* Prikaz mobilnog menija i skrivanje sidebara */
    .mobile-cat-wrapper { display: block; }
    .shop-sidebar { display: none; }
    
    .shop-container { margin-top: 20px; padding: 0 15px; }
    
    /* 2 KOLONE FIKSNO NA MOBITELU */
    .books-grid { 
        display: grid;
        grid-template-columns: 1fr 1fr; /* Dvije jednake kolone */
        gap: 15px; /* Manji razmak da stane */
    }

    /* Prilagodba kartice za manji prostor */
    .book-cover-wrapper { margin-bottom: 10px; }
    
    /* 3D efekat smirujemo na mobitelu */
    .book-img {
        transform: rotateY(0deg) translateX(0);
        border-left: none;
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
        border-radius: 4px;
    }
    
    .book-title { font-size: 0.95rem; min-height: 2.5em; }
    .book-author { font-size: 0.8rem; }
    .book-price, .new-price { font-size: 1rem; }
    
    /* Dugme uvijek vidljivo, ali manje */
    .btn-add-cart { 
        opacity: 1; transform: translateY(0); 
        font-size: 0.75rem; padding: 8px; 
    }
    
    .shop-hero { padding: 120px 20px 40px; }
    .shop-hero h1 { font-size: 2.2rem; }
}