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

:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --secondary-color: #059669;
    --accent-color: #f59e0b;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --border-color: #e5e7eb;
    --success-color: #10b981;
    --danger-color: #ef4444;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    background-color: var(--bg-white);
}

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

/* Header Styles */
.top-bar {
    background-color: var(--text-dark);
    color: white;
    font-size: 0.875rem;
    padding: 10px 0;
}

.top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-bar-right {
    display: flex;
    gap: 20px;
}

.top-bar a {
    color: white;
    text-decoration: none;
    transition: color 0.3s;
}

.top-bar a:hover {
    color: var(--accent-color);
}

.top-bar i {
    margin-right: 5px;
}

.main-header {
    background-color: var(--bg-white);
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
}

.logo {
    flex-shrink: 0;
}

.logo h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo .tagline {
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 400;
    margin-top: -5px;
}

.search-bar {
    flex: 1;
    max-width: 600px;
}

.search-form {
    display: flex;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.3s;
}

.search-form:focus-within {
    border-color: var(--primary-color);
}

.search-input {
    flex: 1;
    padding: 12px 15px;
    border: none;
    font-size: 0.95rem;
    outline: none;
}

.search-btn {
    padding: 12px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
}

.search-btn:hover {
    background-color: var(--primary-dark);
}

.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.icon-btn {
    position: relative;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-dark);
    cursor: pointer;
    padding: 8px;
    transition: color 0.3s;
}

.icon-btn:hover {
    color: var(--primary-color);
}

.cart-badge {
    position: absolute;
    top: 0;
    right: 0;
    background-color: var(--danger-color);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* Navigation */
.main-nav {
    background-color: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 5px;
    padding: 0;
    overflow-x: auto;
}

.nav-link {
    display: block;
    padding: 15px 20px;
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    white-space: nowrap;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.nav-link:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background-color: white;
}

.sustainability-link {
    color: var(--secondary-color);
}

.sustainability-link:hover {
    color: var(--secondary-color);
    border-bottom-color: var(--secondary-color);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 80px 0;
    text-align: center;
}

.hero-content h2 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 20px;
}

.hero-content p {
    font-size: 1.25rem;
    margin-bottom: 30px;
    opacity: 0.95;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-large {
    padding: 16px 40px;
    font-size: 1.1rem;
}

.btn-block {
    width: 100%;
    display: block;
}

/* Value Propositions */
.value-props {
    padding: 60px 0;
    background-color: var(--bg-white);
}

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

.value-card {
    text-align: center;
    padding: 30px;
    border-radius: 12px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.value-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.value-icon {
    font-size: 3rem;
    color: var(--secondary-color);
    margin-bottom: 20px;
}

.value-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.value-card p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Featured Books Section */
.featured-books {
    padding: 60px 0;
    background-color: var(--bg-light);
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 40px;
    color: var(--text-dark);
}

.filter-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 10px 24px;
    background-color: white;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-tab:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.filter-tab.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

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

.book-card {
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
}

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

.book-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 1;
}

.badge-new {
    background-color: var(--primary-color);
    color: white;
}

.badge-used {
    background-color: var(--secondary-color);
    color: white;
}

.book-image {
    width: 100%;
    height: 280px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 4rem;
    padding: 20px;
}

.book-content {
    padding: 20px;
}

.book-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-dark);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-author {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 12px;
}

.book-genre {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 12px;
    font-style: italic;
}

.book-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 15px;
}

.price-current {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
}

.price-original {
    font-size: 1rem;
    color: var(--text-light);
    text-decoration: line-through;
}

.discount-badge {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--danger-color);
}

.add-to-cart-btn {
    width: 100%;
    padding: 10px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

.add-to-cart-btn:hover {
    background-color: var(--primary-dark);
}

/* Why Choose Us */
.why-choose {
    padding: 60px 0;
    background-color: var(--bg-white);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-top: 40px;
}

.feature-card {
    text-align: center;
}

.feature-number {
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.feature-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.feature-card p {
    color: var(--text-light);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.3s;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: white;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s;
    position: relative;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 2rem;
    font-weight: 300;
    color: var(--text-light);
    cursor: pointer;
    z-index: 1;
    transition: color 0.3s;
}

.modal-close:hover {
    color: var(--text-dark);
}

.modal-body {
    padding: 50px 40px;
    text-align: center;
}

.modal-icon {
    font-size: 4rem;
    color: var(--accent-color);
    margin-bottom: 20px;
}

.modal-body h2 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.modal-body p {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 30px;
}

.signup-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.signup-form input[type="text"],
.signup-form input[type="email"] {
    padding: 14px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.signup-form input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    text-align: left;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-light);
}

.checkbox-label input[type="checkbox"] {
    margin-top: 3px;
    cursor: pointer;
}

/* Floating Discount Button */
.floating-discount-btn {
    position: fixed;
    right: 30px;
    bottom: 30px;
    background: linear-gradient(135deg, var(--accent-color) 0%, #dc7609 100%);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 16px 24px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 999;
    transition: all 0.3s;
    animation: pulse 2s infinite;
}

.floating-discount-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(245, 158, 11, 0.6);
}

.floating-discount-btn i {
    font-size: 1.25rem;
    animation: shake 1s infinite;
}

.floating-discount-btn.hidden {
    opacity: 0;
    pointer-events: none;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
    }
    50% {
        box-shadow: 0 4px 30px rgba(245, 158, 11, 0.7);
    }
}

@keyframes shake {
    0%, 100% { transform: rotate(0deg); }
    10%, 30%, 50%, 70%, 90% { transform: rotate(-10deg); }
    20%, 40%, 60%, 80% { transform: rotate(10deg); }
}

/* Cart Sidebar */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100%;
    background-color: white;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    transition: right 0.3s;
    z-index: 1001;
    display: flex;
    flex-direction: column;
}

.cart-sidebar.open {
    right: 0;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.cart-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
}

.cart-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-light);
    transition: color 0.3s;
}

.cart-close:hover {
    color: var(--text-dark);
}

.cart-items {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.empty-cart {
    text-align: center;
    color: var(--text-light);
    padding: 40px 20px;
}

.cart-item {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.cart-item-image {
    width: 60px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.cart-item-details {
    flex: 1;
}

.cart-item-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 5px;
}

.cart-item-author {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 5px;
}

.cart-item-condition {
    font-size: 0.8rem;
    color: var(--secondary-color);
    font-weight: 600;
}

.cart-item-price {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.cart-item-remove {
    background: none;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    padding: 5px;
    transition: opacity 0.3s;
}

.cart-item-remove:hover {
    opacity: 0.7;
}

.cart-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 1.5rem;
    font-weight: 700;
}

/* Footer */
.footer {
    background-color: var(--text-dark);
    color: white;
    padding: 60px 0 20px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 12px;
}

.footer-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-link:hover {
    color: white;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.social-link {
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: all 0.3s;
}

.social-link:hover {
    background-color: var(--primary-color);
    transform: translateY(-3px);
}

.newsletter-signup h5 {
    font-size: 0.95rem;
    margin-bottom: 10px;
}

.newsletter-signup form {
    display: flex;
    gap: 5px;
}

.newsletter-signup input {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
}

.newsletter-signup button {
    padding: 10px 15px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.newsletter-signup button:hover {
    background-color: var(--primary-dark);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
}

.footer-bottom a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
}

.footer-bottom a:hover {
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }

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

    .hero-content h2 {
        font-size: 2rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .nav-list {
        justify-content: flex-start;
    }

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

    .cart-sidebar {
        width: 100%;
        right: -100%;
    }

    .modal-content {
        width: 95%;
    }

    .modal-body {
        padding: 40px 20px;
    }

    .section-title {
        font-size: 2rem;
    }

    .top-bar-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .top-bar-left,
    .top-bar-right {
        width: 100%;
        justify-content: center;
    }

    .floating-discount-btn {
        right: 15px;
        bottom: 15px;
        padding: 12px 18px;
        font-size: 0.9rem;
    }

    .floating-discount-btn span {
        display: none;
    }

    .floating-discount-btn i {
        margin: 0;
        font-size: 1.5rem;
    }
}
