* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}
body {
    font-family: 'Segoe UI', Roboto, system-ui, sans-serif;
    background: #f8fafc;
    color: #0f172a;
    line-height: 1.5;
}
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}
header {
    background: #0f172a;
    color: white;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    will-change: transform;
}
.header-hidden {
    transform: translateY(-100%);
}
.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
}
header h1 {
    font-size: 1.4rem;
}
nav {
    display: flex;
    gap: 20px;
}
nav a {
    color: #cbd5e1;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
}
nav a:hover {
    color: white;
}
@media (max-width: 768px) {
    nav {
        display: none;
    }
}
.hero {
    background: #0b1120;
    background-image: repeating-linear-gradient(45deg, rgba(59,130,246,0.08) 0px, rgba(59,130,246,0.08) 1px, transparent 1px, transparent 30px), repeating-linear-gradient(135deg, rgba(59,130,246,0.08) 0px, rgba(59,130,246,0.08) 1px, transparent 1px, transparent 30px);
    color: white;
    text-align: center;
    padding: 60px 20px;
}
.hero h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
}
.hero p {
    font-size: 1.1rem;
    opacity: 0.9;
}
.section {
    padding: 60px 0;
}
.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 40px;
    position: relative;
}
.section-title:after {
    content: '';
    display: block;
    width: 70px;
    height: 4px;
    background: #3b82f6;
    margin: 12px auto 0;
    border-radius: 2px;
}
.bg-light {
    background: #f1f5f9;
}
.books-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: center;
}
/* Десктоп: flip-картки */
.flip-card {
    background: transparent;
    width: 320px;
    height: 420px;
    perspective: 1000px;
    cursor: pointer;
}
.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    border-radius: 20px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}
.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}
.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 20px;
    overflow: hidden;
}
.flip-card-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.flip-card-back {
    background: linear-gradient(145deg, #fff, #f8fafc);
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    text-align: center;
}
.flip-card-back h3 {
    font-size: 1.4rem;
    margin-bottom: 10px;
}
.flip-card-back p {
    font-size: 0.95rem;
    color: #334155;
    margin-bottom: 15px;
}
.flip-card-back .price {
    font-size: 1.6rem;
    font-weight: 800;
    background: #e2e8f0;
    padding: 6px 14px;
    border-radius: 40px;
    margin: 15px 0;
}
.btn {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 12px;
    width: 100%;
    border-radius: 40px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn:hover {
    background: #2563eb;
}
/* Мобільна картка (проста, без акордеону) */
.mobile-card-simple {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    width: 320px;
    margin: 0 auto 20px;
}
.mobile-card-simple img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    background: #f1f5f9;
    display: block;
}
.simple-card-content {
    padding: 20px;
    text-align: center;
}
.simple-card-content h3 {
    font-size: 1.4rem;
    margin-bottom: 10px;
}
.simple-card-content p {
    color: #334155;
    margin-bottom: 15px;
    line-height: 1.4;
}
.simple-card-content .price {
    font-size: 1.6rem;
    font-weight: 800;
    margin: 10px 0;
}
@media (min-width: 769px) {
    .mobile-card-simple {
        display: none;
    }
}
@media (max-width: 768px) {
    .flip-card {
        display: none;
    }
}
/* Відгуки */
.reviews-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 30px;
}
.review-form {
    background: white;
    padding: 25px;
    border-radius: 24px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}
.review-form input, .review-form textarea {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: 1px solid #cbd5e1;
    border-radius: 16px;
}
.rating {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
}
.stars-container {
    display: inline-flex;
    gap: 5px;
    font-size: 1.5rem;
}
.star {
    cursor: pointer;
    color: #cbd5e1;
    transition: color 0.2s;
}
.star.selected {
    color: #f59e0b;
}
.review-item {
    background: white;
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 5px 12px rgba(0,0,0,0.05);
    border-left: 5px solid #3b82f6;
}
.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}
.review-name {
    font-weight: 700;
    font-size: 1.1rem;
}
.review-stars {
    display: inline-flex;
    gap: 2px;
    font-size: 1.2rem;
}
.review-stars .star-filled {
    color: #f59e0b;
}
.review-stars .star-empty {
    color: #cbd5e1;
}
.review-text {
    color: #334155;
    line-height: 1.4;
}
.cart-icon {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #0f172a;
    color: white;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 200;
}
#cartCount {
    background: #ef4444;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    position: absolute;
    top: -5px;
    right: -5px;
}
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    justify-content: center;
    align-items: center;
}
.modal-content {
    background: white;
    width: 90%;
    max-width: 500px;
    border-radius: 28px;
    padding: 20px;
    position: relative;
    animation: fadeIn 0.2s;
}
.close {
    position: absolute;
    right: 18px;
    top: 12px;
    font-size: 28px;
    cursor: pointer;
}
.cart-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #cbd5e1;
}
.remove-item {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
}
.cart-total {
    font-size: 1.3rem;
    font-weight: bold;
    text-align: right;
    margin: 15px 0;
}
.discount-note {
    color: #16a34a;
    text-align: right;
    margin-bottom: 10px;
}
input, textarea {
    width: 100%;
    padding: 12px;
    margin: 8px 0;
    border: 1px solid #cbd5e1;
    border-radius: 16px;
}
.btn-primary {
    background: #22c55e;
    color: white;
    border: none;
    padding: 14px;
    width: 100%;
    border-radius: 40px;
    font-weight: bold;
    margin-top: 10px;
    cursor: pointer;
}
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: inline-block;
    margin-right: 8px;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.success-message {
    text-align: center;
    padding: 20px;
}
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
@media (max-width: 768px) {
    .hero h2 {
        font-size: 1.5rem;
    }
    .section {
        padding: 40px 0;
    }
    .section-title {
        font-size: 1.6rem;
    }
}