/* Sacred Library - Manakahthey LIT Bookstore */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Hebrew:wght@400;500;600&display=swap');

:root {
    --primary-gold: #d4af37;
    --gold-light: #e8c968;
    --light-gold: #f8e49b;
    --bg-dark: #0a0a0a;
    --card-dark: #141414;
    --card-elevated: #1c1c1c;
    --card-brown: #1e1914;
    --border-gold: rgba(212, 175, 55, 0.12);
    --text-primary: #f0f0f0;
    --text-secondary: #888;
    --success: #4ade80;
    --error: #f87171;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Manakahthey', 'Noto Sans Hebrew';
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

.container { max-width: 1300px; margin: 0 auto; padding: 0 50px; position: relative; z-index: 1; }

.top-bar { display: flex; justify-content: space-between; padding: 15px 0; font-size: 13px; color: var(--text-secondary); border-bottom: 1px solid var(--border-gold); }
.top-bar a { color: var(--text-secondary); text-decoration: none; transition: color 0.3s; }
.top-bar a:hover { color: var(--primary-gold); }

header { padding: 40px 0; text-align: center; }
.header-ornament { font-size: 24px; color: var(--primary-gold); opacity: 0.5; letter-spacing: 20px; margin-bottom: 20px; }
.site-title { font-size: 56px; font-weight: 700; letter-spacing: 8px; margin-bottom: 10px; }
.site-title span { background: linear-gradient(135deg, var(--primary-gold) 0%, var(--light-gold) 50%, var(--primary-gold) 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.site-subtitle { font-size: 20px; color: var(--gold-light); direction: rtl; opacity: 0.8; margin-bottom: 10px; }
.site-tagline { font-size: 14px; color: var(--text-secondary); letter-spacing: 4px; text-transform: uppercase; }

.search-section { max-width: 600px; margin: 40px auto; }
.search-bar { display: flex; background: var(--card-dark); border: 1px solid var(--border-gold); border-radius: 50px; overflow: hidden; transition: all 0.3s; }
.search-bar:focus-within { border-color: var(--primary-gold); box-shadow: 0 0 20px rgba(212, 175, 55, 0.15); }
.search-bar input { flex: 1; padding: 18px 30px; background: transparent; border: none; color: var(--text-primary); font-size: 16px; font-family: inherit; }
.search-bar input::placeholder { color: var(--text-secondary); }
.search-bar input:focus { outline: none; }
.search-btn { padding: 18px 30px; background: var(--primary-gold); border: none; color: #000; font-size: 16px; cursor: pointer; transition: all 0.3s; font-family: inherit; }
.search-btn:hover { background: var(--gold-light); }

.category-tabs { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-bottom: 50px; padding: 0 20px; }
.tab { padding: 12px 28px; background: var(--card-dark); border: 1px solid var(--border-gold); border-radius: 30px; color: var(--text-secondary); font-size: 14px; cursor: pointer; transition: all 0.3s; font-family: inherit; }
.tab:hover { border-color: var(--primary-gold); color: var(--text-primary); }
.tab.active { background: var(--primary-gold); border-color: var(--primary-gold); color: #000; font-weight: 600; }

.featured-banner { display: grid; grid-template-columns: 300px 1fr; gap: 50px; background: linear-gradient(135deg, var(--card-brown) 0%, var(--card-dark) 100%); border: 1px solid var(--border-gold); border-radius: 20px; padding: 50px; margin-bottom: 60px; position: relative; overflow: hidden; }
.featured-banner::before { content: ''; position: absolute; top: 0; right: 0; width: 50%; height: 100%; background: radial-gradient(ellipse at 100% 50%, rgba(212, 175, 55, 0.08) 0%, transparent 70%); }
.featured-book-visual { position: relative; z-index: 1; }
.featured-book-3d { width: 260px; height: 360px; position: relative; transform-style: preserve-3d; transform: perspective(1000px) rotateY(-20deg) rotateX(5deg); transition: transform 0.6s; }
.featured-book-3d:hover { transform: perspective(1000px) rotateY(-10deg) rotateX(2deg); }
.featured-cover-front { width: 100%; height: 100%; background: linear-gradient(180deg, #2d2518 0%, #1a150d 100%); border-radius: 2px 12px 12px 2px; position: relative; box-shadow: 20px 20px 60px rgba(0,0,0,0.6), -5px 0 15px rgba(0,0,0,0.3); display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 40px; border: 1px solid rgba(212, 175, 55, 0.2); }
.featured-cover-front::before { content: ''; position: absolute; left: 0; top: 0; width: 25px; height: 100%; background: linear-gradient(90deg, rgba(0,0,0,0.4) 0%, transparent 100%); }
.featured-cover-front .ornament { font-size: 40px; color: var(--primary-gold); opacity: 0.8; margin-bottom: 20px; }
.featured-cover-front .title { font-size: 20px; color: var(--primary-gold); text-align: center; line-height: 1.4; }
.featured-cover-spine { position: absolute; left: -20px; top: 0; width: 20px; height: 100%; background: linear-gradient(90deg, #1a150d 0%, #2d2518 100%); transform: rotateY(90deg); transform-origin: right; border-radius: 2px 0 0 2px; }
.featured-content { position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: center; }
.featured-label { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--primary-gold); letter-spacing: 3px; text-transform: uppercase; margin-bottom: 20px; }
.featured-content h2 { font-size: 42px; font-weight: 700; color: var(--text-primary); line-height: 1.2; margin-bottom: 15px; }
.featured-author { font-size: 18px; color: var(--text-secondary); font-style: italic; margin-bottom: 20px; }
.featured-desc { font-size: 16px; color: var(--text-secondary); line-height: 1.8; margin-bottom: 30px; max-width: 500px; }
.featured-meta { display: flex; align-items: center; gap: 30px; margin-bottom: 30px; }
.featured-price { font-size: 36px; font-weight: 600; color: var(--primary-gold); }
.featured-rating { color: var(--gold-light); font-size: 16px; }
.featured-actions { display: flex; gap: 15px; }

.btn-gold { padding: 16px 40px; background: var(--primary-gold); color: #000; border: none; border-radius: 8px; font-size: 15px; font-weight: 600; cursor: pointer; transition: all 0.3s; font-family: inherit; }
.btn-gold:hover { background: var(--gold-light); transform: translateY(-2px); box-shadow: 0 8px 25px rgba(212, 175, 55, 0.3); }
.btn-gold:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-outline { padding: 16px 40px; background: transparent; color: var(--primary-gold); border: 1px solid var(--primary-gold); border-radius: 8px; font-size: 15px; font-weight: 500; cursor: pointer; transition: all 0.3s; font-family: inherit; }
.btn-outline:hover { background: rgba(212, 175, 55, 0.1); }

.books-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 30px; margin-bottom: 60px; }
.book-item { background: var(--card-dark); border: 1px solid var(--border-gold); border-radius: 16px; overflow: hidden; transition: all 0.4s; cursor: pointer; position: relative; animation: fadeIn 0.6s ease-out forwards; opacity: 0; }
.book-item:hover { border-color: var(--primary-gold); transform: translateY(-10px); box-shadow: 0 20px 50px rgba(0,0,0,0.4); }
.book-cover-wrap { height: 300px; overflow: hidden; position: relative; }
.book-cover-img { width: 100%; height: 100%; background: linear-gradient(145deg, var(--card-brown) 0%, #151210 100%); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px; transition: transform 0.4s; position: relative; }
.cover-hebrew { font-size: 48px; color: rgba(212, 175, 55, 0.2); position: absolute; top: 20px; left: 20px; }
.cover-title { font-size: 18px; color: var(--primary-gold); text-align: center; line-height: 1.4; position: relative; z-index: 1; }
.book-badge { position: absolute; top: 15px; right: 15px; padding: 6px 12px; background: var(--primary-gold); color: #000; font-size: 11px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; border-radius: 4px; }
.book-info { padding: 25px; }
.book-info h3 { font-size: 18px; color: var(--text-primary); margin-bottom: 8px; line-height: 1.3; }
.book-info .author { font-size: 14px; color: var(--text-secondary); margin-bottom: 15px; }
.book-footer { display: flex; align-items: center; justify-content: space-between; }
.book-price { font-size: 22px; font-weight: 600; color: var(--primary-gold); }
.book-add { width: 42px; height: 42px; background: var(--card-elevated); border: 1px solid var(--border-gold); border-radius: 50%; color: var(--primary-gold); font-size: 22px; cursor: pointer; transition: all 0.3s; display: flex; align-items: center; justify-content: center; }
.book-add:hover { background: var(--primary-gold); color: #000; border-color: var(--primary-gold); }
.book-add.added { background: var(--success); border-color: var(--success); color: #000; }

.load-more { text-align: center; padding: 40px 0; }
.load-more-btn { padding: 18px 60px; background: transparent; border: 2px solid var(--border-gold); border-radius: 50px; color: var(--text-secondary); font-size: 15px; cursor: pointer; transition: all 0.3s; font-family: inherit; letter-spacing: 2px; }
.load-more-btn:hover { border-color: var(--primary-gold); color: var(--primary-gold); }

.cart-sidebar { position: fixed; top: 0; right: -420px; width: 400px; height: 100vh; background: var(--card-dark); border-left: 1px solid var(--border-gold); z-index: 1000; display: flex; flex-direction: column; transition: right 0.4s cubic-bezier(0.23, 1, 0.32, 1); }
.cart-sidebar.open { right: 0; }
.cart-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.7); z-index: 999; opacity: 0; visibility: hidden; transition: all 0.3s; }
.cart-overlay.open { opacity: 1; visibility: visible; }
.cart-header { display: flex; justify-content: space-between; align-items: center; padding: 25px 30px; border-bottom: 1px solid var(--border-gold); }
.cart-header h3 { font-size: 24px; color: var(--text-primary); }
.cart-close { width: 40px; height: 40px; background: transparent; border: 1px solid var(--border-gold); border-radius: 50%; color: var(--text-secondary); font-size: 24px; cursor: pointer; transition: all 0.3s; }
.cart-close:hover { border-color: var(--primary-gold); color: var(--primary-gold); }
.cart-items { flex: 1; overflow-y: auto; padding: 20px 30px; }
.cart-item { display: flex; gap: 15px; padding: 20px 0; border-bottom: 1px solid var(--border-gold); }
.cart-item-cover { width: 60px; height: 80px; background: var(--card-brown); border-radius: 4px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cart-item-cover span { font-size: 24px; color: rgba(212, 175, 55, 0.3); }
.cart-item-details { flex: 1; }
.cart-item-details h4 { font-size: 16px; color: var(--text-primary); margin-bottom: 5px; }
.cart-item-details .author { font-size: 13px; color: var(--text-secondary); margin-bottom: 10px; }
.cart-item-price { font-size: 18px; font-weight: 600; color: var(--primary-gold); }
.cart-item-remove { background: transparent; border: none; color: var(--text-secondary); cursor: pointer; font-size: 14px; padding: 5px; transition: color 0.3s; }
.cart-item-remove:hover { color: var(--error); }
.cart-empty { text-align: center; padding: 60px 20px; color: var(--text-secondary); }
.cart-empty-icon { font-size: 60px; margin-bottom: 20px; opacity: 0.3; }
.cart-footer { padding: 25px 30px; border-top: 1px solid var(--border-gold); background: var(--bg-dark); }
.cart-total-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; font-size: 18px; }
.cart-total-row span:last-child { font-size: 28px; font-weight: 600; color: var(--primary-gold); }
.btn-checkout { width: 100%; padding: 18px; background: var(--primary-gold); color: #000; border: none; border-radius: 8px; font-size: 16px; font-weight: 600; cursor: pointer; transition: all 0.3s; font-family: inherit; }
.btn-checkout:hover:not(:disabled) { background: var(--gold-light); transform: translateY(-2px); box-shadow: 0 8px 25px rgba(212, 175, 55, 0.3); }
.btn-checkout:disabled { opacity: 0.5; cursor: not-allowed; }
.cart-secure { text-align: center; font-size: 12px; color: var(--text-secondary); margin-top: 15px; }

footer { border-top: 1px solid var(--border-gold); padding: 50px 0 30px; text-align: center; }

.toast { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(100px); background: var(--card-elevated); border: 1px solid var(--primary-gold); border-radius: 10px; padding: 15px 30px; color: var(--text-primary); font-size: 14px; z-index: 1001; opacity: 0; transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1); display: flex; align-items: center; gap: 10px; }
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast-success { border-color: var(--success); }
.toast-error { border-color: var(--error); }

@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.book-item:nth-child(1) { animation-delay: 0.1s; }
.book-item:nth-child(2) { animation-delay: 0.15s; }
.book-item:nth-child(3) { animation-delay: 0.2s; }
.book-item:nth-child(4) { animation-delay: 0.25s; }

@media (max-width: 1024px) {
    .container { padding: 0 30px; }
    .featured-banner { grid-template-columns: 1fr; text-align: center; padding: 40px; gap: 40px; }
    .featured-book-visual { display: flex; justify-content: center; order: -1; }
    .featured-content { align-items: center; }
}

@media (max-width: 768px) {
    .container { padding: 0 20px; }
    .site-title { font-size: 28px; letter-spacing: 3px; }
    .category-tabs { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; padding: 0 20px 15px; scrollbar-width: none; }
    .category-tabs::-webkit-scrollbar { display: none; }
    .tab { flex-shrink: 0; white-space: nowrap; }
    .books-grid { grid-template-columns: repeat(2, 1fr); gap: 15px; }
    .book-cover-wrap { height: 200px; }
    .book-info { padding: 15px; }
    .book-info h3 { font-size: 14px; }
    .cart-sidebar { width: 100%; right: -100%; }
    .featured-content h2 { font-size: 26px; }
    .top-bar { flex-direction: column; gap: 10px; text-align: center; }
}

@media (max-width: 380px) {
    .books-grid { grid-template-columns: 1fr; }
}
