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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    background-color: #131921;
    color: white;
    padding: 6px 0;   /* increased padding */
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.navbar {
    padding: 10px 0;
}


.navbar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
    min-height: 5px;   /* this FIXES the top line issue */
}

.logo a {
    color: white;
    text-decoration: none;
    font-size: 22px;     /* slightly bigger, more premium */
    font-weight: bold;
    letter-spacing: 0.5px;
}

.search-bar {
    flex: 1;
    max-width: 480px; /* reduced width */
    display: flex;
    align-items: center;
    background: white;
    border-radius: 4px;
    overflow: hidden;
    height: 36px; /* thinner search bar */
}

.search-bar input {
    flex: 1;
    padding: 8px 12px; /* thinner input */
    font-size: 14px;
    border: none;
}

.search-bar button {
    padding: 8px 15px;
    font-size: 15px;
    background-color: #febd69;
    border: none;
    cursor: pointer;
}

.search-bar button:hover {
    background-color: #f3a847;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-size: 15px;
    padding: 6px 10px;
    border-radius: 4px;
}

.nav-links a:hover,
.nav-links a.active {
    background-color: #232f3e;
}

.nav-links span {
    color: white;
    font-size: 14px;
    font-weight: 600;
}

#userName {
    color: #febd69;
    font-weight: 700;
    padding: 0 8px;
}

main {
    min-height: calc(100vh - 200px);
    padding: 30px 0;
}

.hero {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
}

.hero h1 {
    font-size: 42px;
    margin-bottom: 15px;
}

.hero p {
    font-size: 18px;
}

.books-section h2 {
    font-size: 28px;
    margin-bottom: 25px;
    color: #131921;
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.book-card {
    background: white;
    border-radius: 6px;
    padding: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    height: 100%;
}

/* Alternating gradient backgrounds */
.book-card:nth-child(6n+1) {
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
}

.book-card:nth-child(6n+2) {
    background: linear-gradient(135deg, #f093fb15 0%, #f5576c15 100%);
}

.book-card:nth-child(6n+3) {
    background: linear-gradient(135deg, #4facfe15 0%, #00f2fe15 100%);
}

.book-card:nth-child(6n+4) {
    background: linear-gradient(135deg, #43e97b15 0%, #38f9d715 100%);
}

.book-card:nth-child(6n+5) {
    background: linear-gradient(135deg, #fa709a15 0%, #fee14015 100%);
}

.book-card:nth-child(6n+6) {
    background: linear-gradient(135deg, #30cfd015 0%, #330867 15 100%);
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.book-cover {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 8px;
    background-color: #e0e0e0;
}

.book-card h3 {
    font-size: 13px;
    margin-bottom: 4px;
    color: #131921;
    min-height: 32px;
    line-height: 1.2;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.book-author {
    color: #666;
    font-size: 11px;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.book-price {
    font-size: 16px;
    font-weight: bold;
    color: #B12704;
    margin-bottom: 8px;
}

.book-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: auto;
    width: 100%;
}

.btn-primary,
.btn-secondary {
    padding: 6px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    transition: all 0.3s;
    text-decoration: none;
    display: block;
    text-align: center;
    width: 100%;
}

.btn-primary {
    background-color: #f0c14b;
    color: #111;
    flex: 1;
}

.btn-primary:hover {
    background-color: #ddb347;
}

.btn-secondary {
    background-color: #e7e9ec;
    color: #111;
    flex: 1;
}

.btn-secondary:hover {
    background-color: #d5d9dd;
}

.btn-disabled {
    background-color: #6c757d !important;
    color: #ffffff !important;
    cursor: not-allowed !important;
    opacity: 0.6;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    transition: none;
}

.btn-disabled:hover {
    background-color: #6c757d !important;
    transform: none !important;
}

/* Stock Overlay Stickers */
.book-image-container {
    position: relative;
    display: inline-block;
    width: 100%;
}

.stock-overlay {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 10;
    transform: rotate(15deg);
    font-weight: 700;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 8px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(2px);
    animation: stockPulse 2s infinite;
}

.stock-overlay.out-of-stock {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    border-color: #fff;
}

.stock-overlay.limited-stock {
    background: linear-gradient(135deg, #ffc107, #e0a800);
    color: #856404;
    border-color: #fff;
}

.stock-overlay span {
    display: block;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

@keyframes stockPulse {
    0%, 100% {
        transform: rotate(15deg) scale(1);
    }
    50% {
        transform: rotate(15deg) scale(1.05);
    }
}

/* Hover effect for stock overlay */
.book-card:hover .stock-overlay {
    transform: rotate(0deg) scale(1.1);
    transition: all 0.3s ease;
}

/* Cashback Sticker */
.cashback-sticker {
    position: absolute;
    bottom: 6px;
    left: 6px;
    background: linear-gradient(135deg, #ff6f61, #ff9800);
    color: white;
    padding: 4px 8px;
    border-radius: 15px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 6px rgba(255, 111, 97, 0.4);
    transform: rotate(-8deg);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 3px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(4px);
}

.cashback-sticker .cashback-icon {
    font-size: 12px;
    filter: drop-shadow(1px 1px 1px rgba(0, 0, 0, 0.3));
}

.cashback-sticker .cashback-text {
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    font-size: 8px;
}

/* Hover effect for cashback sticker */
.book-card:hover .cashback-sticker {
    transform: rotate(0deg) scale(1.1);
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(255, 111, 97, 0.6);
}

.btn-large {
    padding: 15px 30px;
    font-size: 16px;
    width: 100%;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

.loading,
.empty-state,
.error-state {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 16px;
}

.book-detail-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 40px;
    background: white;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 40px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.book-detail-cover {
    width: 100%;
    max-width: 400px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    margin-bottom: 20px;
}

.book-detail-right h1 {
    font-size: 32px;
    margin-bottom: 10px;
    color: #131921;
}

/* Dual Pricing Display Styles */
.pricing-section {
    display: flex;
    gap: 20px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.pricing-option {
    flex: 1;
    min-width: 200px;
    padding: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: #fff;
    transition: all 0.3s ease;
}

.pricing-option:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.physical-pricing {
    border-color: #28a745;
}

.digital-pricing {
    border-color: #667eea;
    background: linear-gradient(135deg, #f8f9ff 0%, #fff 100%);
}

.pricing-title {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.digital-pricing .pricing-title {
    color: #667eea;
}

.physical-pricing .pricing-title {
    color: #28a745;
}

.pricing-note {
    margin: 5px 0 0 0;
    font-size: 14px;
    color: #666;
    font-style: italic;
}

.digital-price {
    color: #667eea !important;
}

/* Purchase Buttons Styles */
.purchase-buttons {
    margin: 25px 0;
}

.button-group {
    margin-bottom: 15px;
}

.button-group:last-child {
    margin-bottom: 0;
}

.digital-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.digital-btn:hover {
    background: linear-gradient(135deg, #5565d3 0%, #6a4190 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.book-description {
    margin-top: 30px;
}

.book-description h3 {
    font-size: 20px;
    margin-bottom: 15px;
    color: #131921;
}

.book-description p {
    color: #555;
    line-height: 1.8;
}

.preview-section {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.preview-section h2 {
    font-size: 26px;
    margin-bottom: 10px;
    color: #131921;
}

.preview-note {
    color: #666;
    margin-bottom: 25px;
}

/* Make preview images smaller and nice looking */
.preview-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 15px;
}

.preview-grid img {
    width: 200px;     /* smaller */
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    object-fit: cover;
    transition: transform 0.2s ease;
}

.preview-grid img:hover {
    transform: scale(1.05);
}

.preview-image {
    width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
}

.auth-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 450px;
}

.auth-box h1 {
    font-size: 28px;
    margin-bottom: 10px;
    color: #131921;
}

.auth-subtitle {
    color: #666;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group textarea {
    resize: vertical;
    font-family: inherit;
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 15px;
    border: 1px solid #f5c6cb;
}

.success-message {
    background-color: #d4edda;
    color: #155724;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 15px;
    border: 1px solid #c3e6cb;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    color: #666;
}

.auth-footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.admin-container {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.admin-container h1 {
    font-size: 32px;
    margin-bottom: 10px;
    color: #131921;
}

.admin-subtitle {
    color: #666;
    margin-bottom: 30px;
    font-size: 16px;
}

.admin-section {
    margin-bottom: 40px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.admin-header h2 {
    font-size: 24px;
    color: #131921;
}

.admin-form {
    background: #f9f9f9;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.form-group small {
    display: block;
    color: #666;
    font-size: 12px;
    margin-top: 5px;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.admin-table th,
.admin-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.admin-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #131921;
}

.admin-table tr:hover {
    background-color: #f9f9f9;
}

.admin-table img {
    width: 50px;
    height: 70px;
    object-fit: cover;
    border-radius: 4px;
}

.admin-actions {
    display: flex;
    gap: 10px;
}

.admin-actions button {
    padding: 6px 12px;
    font-size: 13px;
}

footer {
    background-color: #131921;
    color: white;
    text-align: center;
    padding: 20px 0;
    margin-top: 50px;
}

/* ========================================
   MOBILE RESPONSIVE STYLES
======================================== */

/* Tablets and smaller */
@media (max-width: 1024px) {
    .container {
        padding: 0 15px;
    }

    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 15px;
    }

    .hero h1 {
        font-size: 36px;
    }

    .hero p {
        font-size: 16px;
    }
}

/* Mobile devices */
@media (max-width: 768px) {
    /* Navbar */
    .navbar-content {
        flex-direction: column;
        gap: 10px;
    }

    .logo a {
        font-size: 20px;
    }

    .search-bar {
        max-width: 100%;
        width: 100%;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
        font-size: 13px;
    }

    .nav-links a {
        padding: 6px 10px;
        font-size: 13px;
    }

    /* Hero */
    .hero {
        padding: 30px 15px;
    }

    .hero h1 {
        font-size: 28px;
    }

    .hero p {
        font-size: 14px;
    }

    /* Books Grid */
    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }

    .book-cover {
        height: 140px;
    }

    .book-card h3 {
        font-size: 12px;
        min-height: 28px;
    }

    .book-author {
        font-size: 10px;
    }

    .book-price {
        font-size: 14px;
    }

    .book-actions {
        flex-direction: column;
        gap: 4px;
    }

    .btn-primary,
    .btn-secondary {
        padding: 6px 10px;
        font-size: 11px;
    }

    /* Sections */
    .bundles-section,
    .books-section {
        padding: 20px 15px;
    }

    .bundles-section h2,
    .books-section h2 {
        font-size: 22px;
    }

    /* Book Detail Page */
    .book-detail-container {
        grid-template-columns: 1fr;
        padding: 20px;
        gap: 20px;
    }

    .book-detail-cover {
        max-width: 100%;
    }

    .book-detail-right h1 {
        font-size: 24px;
    }

    /* Dual Pricing Mobile Styles */
    .pricing-section {
        flex-direction: column;
        gap: 15px;
    }
    
    .pricing-option {
        min-width: auto;
        padding: 15px;
    }
    
    .pricing-title {
        font-size: 16px;
    }

    /* Preview Grid */
    .preview-grid {
        grid-template-columns: 1fr;
    }

    .preview-grid img {
        width: 100%;
    }

    /* Forms */
    .form-row {
        grid-template-columns: 1fr;
    }

    .auth-box {
        padding: 25px;
    }

    .auth-box h1 {
        font-size: 24px;
    }

    /* Admin */
    .admin-container {
        padding: 20px 15px;
    }

    .admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .admin-table {
        font-size: 13px;
    }

    .admin-table th,
    .admin-table td {
        padding: 10px 8px;
    }

    /* Cart */
    .cart-item {
        flex-direction: column;
    }

    .cart-img {
        width: 100%;
        height: 200px;
    }

    /* Filter Row */
    .filter-row {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-row select,
    .filter-row input,
    .filter-row button {
        width: 100%;
    }

    /* Footer */
    footer {
        padding: 20px 15px;
        font-size: 14px;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .logo a {
        font-size: 18px;
    }

    .hero h1 {
        font-size: 24px;
    }

    .hero p {
        font-size: 13px;
    }

    .books-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .book-card {
        padding: 8px;
    }

    .book-cover {
        height: 120px;
    }

    .book-card h3 {
        font-size: 11px;
        min-height: 24px;
    }

    .book-price {
        font-size: 13px;
    }

    .btn-primary,
    .btn-secondary {
        padding: 5px 8px;
        font-size: 10px;
    }

    .bundles-section h2,
    .books-section h2 {
        font-size: 20px;
    }

    .nav-links {
        gap: 5px;
    }

    .nav-links a {
        padding: 5px 8px;
        font-size: 12px;
    }

    .admin-table {
        font-size: 11px;
    }

    .admin-table th,
    .admin-table td {
        padding: 8px 5px;
    }
}


.admin-filter-row {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: center;
    flex-wrap: wrap;
}


/* ---------- BOOK FILTER BAR ---------- */
.filter-row {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #ffffff;
    padding: 12px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-row label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.filter-row select,
.filter-row input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: #f9f9f9;
    min-width: 120px;
}

.filter-row input:focus,
.filter-row select:focus {
    outline: none;
    border-color: #667eea;
}

.filter-row button {
    padding: 9px 18px;
    background: #667eea;
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    font-weight: 600;
    transition: 0.3s;
}

.filter-row button:hover {
    background: #5565d3;
}

/* Mobile view */
@media (max-width: 600px) {
    .filter-row {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-row select,
    .filter-row input,
    .filter-row button {
        width: 100%;
    }
}


.cart-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cart-item {
    background: white;
    padding: 15px;
    border-radius: 10px;
    display: flex;
    gap: 15px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.cart-img {
    width: 120px;
    height: 160px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.cart-info {
    flex: 1;
    min-width: 0;
}

.cart-info h3 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cart-price {
    font-size: 18px;
    font-weight: bold;
    color: #B12704;
}

.cart-qty {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
}

.qty-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    flex-shrink: 0;
}

.cart-summary {
    margin-top: 20px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    text-align: center;
}

/* Mobile cart styles */
@media (max-width: 768px) {
    .cart-item {
        flex-direction: column;
        padding: 12px;
    }

    .cart-img {
        width: 100%;
        height: 200px;
    }

    .cart-info h3 {
        white-space: normal;
        font-size: 16px;
    }

    .cart-qty {
        justify-content: center;
    }

    .qty-btn {
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
}


.book-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}


.cart-icon {
    background-color: #febd69;
    padding: 8px 14px;
    border-radius: 6px;
    color: #111;
    font-weight: bold;
    text-decoration: none;
    transition: 0.3s;
}

.cart-icon:hover {
    background-color: #f3a847;
}

.cart-icon {
    background-color: #febd69;
    padding: 8px 14px;
    border-radius: 6px;
    color: #111;
    font-weight: bold;
    text-decoration: none;
    transition: 0.3s;
}

.cart-icon:hover {
    background-color: #f3a847;
}

#cartCount {
    font-weight: bold;
}

/* Enhanced Cart Button Styles */
.cart-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
    color: white !important;
    border: none !important;
    transition: all 0.3s ease !important;
}

.cart-btn:hover {
    background: linear-gradient(135deg, #218838 0%, #1e7e34 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3) !important;
}

.cart-btn:disabled {
    background: #6c757d !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}


/* Bundle Styles */
.bundles-section {
    margin: 40px 0;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
}

.bundles-section h2 {
    color: white;
    margin-bottom: 20px;
    font-size: 28px;
}

.bundle-card {
    background: white;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.bundle-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(255, 68, 68, 0.3);
}

/* ========================================
   ENHANCED MOBILE RESPONSIVENESS
======================================== */

/* Mobile-first approach */
@media (max-width: 1200px) {
    .container {
        padding: 0 15px;
    }
}

@media (max-width: 768px) {
    /* Prevent horizontal scroll */
    body {
        overflow-x: hidden;
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }

    /* Enhanced navbar for mobile */
    .navbar-content {
        flex-direction: column;
        gap: 15px;
        padding: 10px 0;
    }

    .logo a {
        font-size: 20px;
    }

    .nav-links {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
        width: 100%;
    }

    .nav-links a {
        padding: 8px 12px;
        font-size: 13px;
        border-radius: 20px;
        transition: all 0.3s ease;
    }

    /* Container adjustments */
    .container {
        padding: 0 10px;
    }

    /* Form improvements */
    input, select, textarea {
        font-size: 16px !important; /* Prevents zoom on iOS */
        padding: 12px 15px;
        border-radius: 8px;
    }

    /* Button improvements */
    .btn, .btn-primary, .btn-secondary {
        min-height: 44px; /* iOS recommended touch target */
        padding: 12px 20px;
        font-size: 14px;
        border-radius: 8px;
        cursor: pointer;
        transition: all 0.3s ease;
    }

    /* Card layouts */
    .card, .book-card, .bundle-card {
        margin-bottom: 10px;
        padding: 10px;
        border-radius: 8px;
        box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    }

    /* Grid layouts */
    .books-grid, .bundles-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    /* Typography */
    h1 { font-size: 24px; }
    h2 { font-size: 20px; }
    h3 { font-size: 18px; }
    h4 { font-size: 16px; }

    /* Modal improvements */
    .modal, .modal-content {
        padding: 15px;
        margin: 10px;
        border-radius: 15px;
    }

    /* Table responsiveness */
    table {
        font-size: 14px;
    }

    th, td {
        padding: 8px 6px;
    }
}

@media (max-width: 480px) {
    /* Extra small devices */
    .container {
        padding: 0 8px;
    }

    .navbar-content {
        gap: 10px;
        padding: 8px 0;
    }

    .logo a {
        font-size: 18px;
    }

    .nav-links a {
        padding: 6px 10px;
        font-size: 12px;
    }

    /* Single column layouts */
    .books-grid, .bundles-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    /* Form elements */
    input, select, textarea {
        padding: 10px 12px;
        font-size: 16px;
    }

    .btn, .btn-primary, .btn-secondary {
        padding: 10px 16px;
        font-size: 13px;
        width: 100%;
        margin-bottom: 10px;
    }

    /* Typography for small screens */
    h1 { font-size: 20px; }
    h2 { font-size: 18px; }
    h3 { font-size: 16px; }
    h4 { font-size: 14px; }

    /* Card adjustments */
    .card, .book-card, .bundle-card {
        padding: 8px;
        margin-bottom: 8px;
    }

    /* Modal full screen on small devices */
    .modal-content {
        width: calc(100vw - 20px);
        max-width: none;
        margin: 10px;
        max-height: calc(100vh - 20px);
        overflow-y: auto;
    }
}

/* Landscape phone optimization */
@media (max-width: 768px) and (orientation: landscape) {
    .navbar-content {
        flex-direction: row;
        gap: 20px;
    }

    .nav-links {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .books-grid, .bundles-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Ensure all interactive elements have proper touch targets */
    a, button, input, select, textarea {
        min-height: 44px;
        min-width: 44px;
    }

    /* Remove hover effects on touch devices */
    .btn:hover, .btn-primary:hover, .btn-secondary:hover {
        transform: none;
    }

    /* Add touch feedback */
    .btn:active, .btn-primary:active, .btn-secondary:active {
        transform: scale(0.98);
    }

    /* Mobile stock overlay adjustments */
    .stock-overlay {
        top: 6px;
        right: 6px;
        font-size: 9px;
        padding: 4px 8px;
        border-radius: 6px;
        transform: rotate(12deg);
    }

    .book-card:hover .stock-overlay {
        transform: rotate(12deg) scale(1.05);
    }

    /* Mobile cashback sticker adjustments */
    .cashback-sticker {
        bottom: 6px;
        left: 6px;
        padding: 4px 8px;
        font-size: 9px;
        border-radius: 15px;
        transform: rotate(-8deg);
    }

    .cashback-sticker .cashback-text {
        font-size: 8px;
    }

    .cashback-sticker .cashback-icon {
        font-size: 12px;
    }

    .book-card:hover .cashback-sticker {
        transform: rotate(-4deg) scale(1.05);
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Print styles */
@media print {
    .navbar, .nav-links, .btn, button {
        display: none !important;
    }

    body {
        background: white !important;
        color: black !important;
        font-size: 20px !important;
        line-height: 1.6 !important;
    }

    .container {
        max-width: none !important;
        padding: 0 !important;
    }

    * {
        font-size: 20px !important;
        color: black !important;
        font-weight: bold !important;
    }

    h1, h2, h3, h4, h5, h6 {
        font-size: 28px !important;
        font-weight: bold !important;
        color: black !important;
    }

    p, div, span, td, th {
        font-size: 20px !important;
        color: black !important;
        font-weight: bold !important;
    }
}

/* ========================================
   ENHANCED LOGO STYLING (GLOBAL)
======================================== */

.logo a {
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    padding: 8px 12px;
    border-radius: 12px;
    position: relative;
    transition: all 0.3s ease;
    text-decoration: none;
    font-weight: 700;
}

.logo a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    border-radius: 12px;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: -1;
}

.logo a:hover::before {
    opacity: 1;
}

.logo a:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* ========================================
   UTILITY CLASSES FOR MOBILE
======================================== */

.mobile-hidden {
    display: block;
}

.mobile-only {
    display: none;
}

@media (max-width: 768px) {
    .mobile-hidden {
        display: none !important;
    }

    .mobile-only {
        display: block !important;
    }

    .mobile-center {
        text-align: center !important;
    }

    .mobile-full-width {
        width: 100% !important;
    }

    .mobile-no-padding {
        padding: 0 !important;
    }

    .mobile-small-text {
        font-size: 14px !important;
    }
}

/* Scroll to top button (global) */
.scroll-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    z-index: 1000;
    opacity: 0;
    transform: translateY(100px);
}

.scroll-to-top.show {
    opacity: 1;
    transform: translateY(0);
}

.scroll-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

@media (max-width: 768px) {
    .scroll-to-top {
        bottom: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
}