/* ============================================================
   STORE / BOOKS PAGE — scoped under .store-page.
   Most selectors here already had unique book-/store- prefixes,
   so only the badge classes (which clash with main.css's global
   .badge-primary / .badge-success / .badge-warning) needed scoping.
   ============================================================ */

.store-page { background: var(--bg-secondary); min-height: 100vh; }

.store-page .store-hero {
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-800) 100%);
    color: var(--text-inverse);
    padding: 1rem 0;
    position: relative;
    overflow: hidden;
}
.store-page .store-hero::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.1'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    z-index: 1;
}
.store-page .store-header { position: relative; z-index: 2; text-align: center; }
.store-page .hero-eyebrow {
    display: inline-block;
    font-size: 0.68rem; font-weight: 700; letter-spacing: 1.2px;
    text-transform: uppercase; color: #ffffff;
    background: rgba(255,255,255,0.16);
    border: 1px solid rgba(255,255,255,0.35);
    padding: 3px 12px; border-radius: var(--radius-full, 999px);
    margin-bottom: 0.5rem;
}
.store-page .hero-titles {
    font-size: 1.5rem; font-weight: 700; margin-bottom: 0.375rem;
    font-family: var(--font-heading); line-height: 1.2; color: #ffffff;
}
.store-page .hero-subtitle {
    font-size: 0.875rem; color: #ffffff; font-weight: 500;
    margin-bottom: 0; line-height: 1.3;
    max-width: 450px; margin-left: auto; margin-right: auto;
}

/* Grid */
.store-page .store-section { padding: 1.5rem 0 3.5rem; }
.store-page .store-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
    align-items: start;
}

/* Card */
.store-page .book-card {
    background: var(--bg-primary, #fff);
    border: 1px solid var(--border-light, #eef0f3);
    border-radius: var(--radius-xl, 14px);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.store-page .book-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
}

.store-page .book-card-img-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    background: linear-gradient(135deg, var(--primary-50) 0%, var(--primary-100) 100%);
    overflow: hidden;
}
.store-page .book-card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 18px;
}
.store-page .book-card-img-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-300, #93c5fd);
    font-size: 2.75rem;
}

/* Badges — scoped so they don't fight main.css's global .badge-* */
.store-page .book-badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: var(--radius-full, 999px);
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
}
.store-page .book-badge.badge-primary { background: var(--primary-100); color: var(--primary-700); }
.store-page .book-badge.badge-success { background: var(--success-100, #dcfce7); color: var(--success-700, #15803d); }
.store-page .book-badge.badge-warning { background: var(--warning-100, #fff4e5); color: var(--warning-700, #b06b00); }

.store-page .book-card-body {
    padding: 1rem 1.25rem 1.1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.store-page .book-card-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.375rem;
}
.store-page .book-card-title {
    font-size: 0.95rem; font-weight: 700;
    color: var(--text-primary);
    margin: 0; line-height: 1.3;
}
.store-page .book-card-desc {
    color: var(--text-secondary);
    font-size: 0.75rem;
    line-height: 1.5;
    margin: 0 0 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.25rem;
}

.store-page .book-card-divider { height: 1px; background: var(--border-light); margin: 0 0 0.75rem; }

.store-page .book-card-price { margin-bottom: 0.875rem; }
.store-page .price-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.store-page .price-mrp-strike {
    text-decoration: line-through;
    color: var(--text-tertiary, #adb5bd);
    font-size: 0.78rem;
}
.store-page .price-current {
    display: inline-block;
    font-size: 1.3rem; font-weight: 700;
    color: var(--color-primary); line-height: 1;
}
.store-page .price-current.price-unset {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-tertiary, #adb5bd);
}
.store-page .price-off-chip {
    background: var(--success-100, #dcfce7);
    color: var(--success-700, #15803d);
    padding: 2px 8px;
    border-radius: var(--radius-full, 999px);
    font-size: 0.65rem;
    font-weight: 700;
}

.store-page .book-card-actions { margin-top: auto; }
.store-page .book-card-actions .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.55rem 1rem;
    font-size: 0.8rem; font-weight: 600;
    border-radius: var(--radius-lg);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
}
.store-page .book-card-actions .btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); color: #fff; }
.store-page .btn-buy { background: var(--primary-600, #2563eb); color: #fff; }
.store-page .btn-buy:hover { background: var(--primary-700, #1d4ed8); }
.store-page .btn-purchased {
    background: var(--success-100, #dcfce7);
    color: var(--success-700, #15803d);
    border: 1px solid var(--success-700, #15803d);
}
.store-page .btn-purchased:hover { color: var(--success-700, #15803d); transform: none; box-shadow: none; }
.store-page .btn-disabled { background: #e9ecef; color: #adb5bd; cursor: not-allowed; }
.store-page .btn-disabled:hover { transform: none; box-shadow: none; }

/* Empty */
.store-page .store-empty {
    text-align: center; padding: 3rem 1rem;
    background: var(--bg-primary); border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md); border: 1px solid var(--border-light);
}
.store-page .store-empty h3 { font-size: 1.05rem; font-weight: 700; color: var(--text-primary); margin-bottom: 0.25rem; }
.store-page .store-empty p { color: var(--text-secondary); font-size: 0.85rem; margin: 0; }
.store-page .store-empty .empty-icon {
    width: 45px; height: 45px; background: var(--primary-50);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    margin: 0 auto 0.75rem; color: var(--color-primary); font-size: 1.125rem;
}

/* Responsive */
@media (max-width: 767px) {
    .store-page .store-hero { padding: 1.25rem 0; }
    .store-page .hero-titles { font-size: 1.3rem; }
    .store-page .hero-subtitle { font-size: 0.82rem; padding: 0 10px; }
    .store-page .store-grid { grid-template-columns: 1fr; gap: 1rem; }
    .store-page .book-card-img-wrap { height: 180px; }
}