/* ===================================
   Modern Bookstore Website Styles
   =================================== */

/* CSS Variables */
:root {
    --brand-primary: #2563eb;
    --brand-secondary: #7c3aed;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --bg-white: #ffffff;
    --bg-light: #f9fafb;
    --bg-gray: #f3f4f6;
    --border-color: #e5e7eb;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
.site-header {
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.business-logo {
    height: 50px;
    width: auto;
    object-fit: contain;
}

.business-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--brand-primary);
}

.main-nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.nav-link:hover {
    background: var(--bg-gray);
    color: var(--brand-primary);
}

.nav-link-cta {
    background: var(--brand-primary);
    color: white;
}

.nav-link-cta:hover {
    background: #1d4ed8;
    color: white;
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 300px);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.95;
    margin-bottom: 2rem;
}

/* Section Styles */
.featured-books-section,
.business-info-section,
.map-section,
.order-form-section {
    padding: 4rem 0;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    text-align: center;
    color: var(--text-dark);
}

/* Books Grid */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.book-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s, box-shadow 0.3s;
}

.book-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.book-image {
    position: relative;
    width: 100%;
    height: 320px;
    overflow: hidden;
    background: var(--bg-gray);
}

.book-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.book-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: var(--text-light);
}

.badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    text-transform: uppercase;
}

.badge-new {
    background: var(--success);
    color: white;
}

.badge-sale {
    background: var(--error);
    color: white;
}

.book-details {
    padding: 1.25rem;
}

.book-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    line-height: 1.4;
}

.book-author {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.book-subject {
    font-size: 0.875rem;
    color: var(--brand-primary);
    margin-bottom: 0.5rem;
}

.book-level {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--bg-gray);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.book-price {
    margin: 1rem 0;
}

.price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--brand-primary);
}

.price-original {
    text-decoration: line-through;
    color: var(--text-light);
    font-size: 0.875rem;
    margin-right: 0.5rem;
}

.price-discounted {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--error);
}

.book-availability {
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.in-stock {
    color: var(--success);
}

.out-of-stock {
    color: var(--error);
}

.no-books-message {
    text-align: center;
    color: var(--text-light);
    font-size: 1.125rem;
    padding: 3rem 0;
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.info-card {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: transform 0.3s;
}

.info-card:hover {
    transform: translateY(-4px);
}

.info-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.75rem;
}

.info-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--text-dark);
}

.info-card p {
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

/* Map */
.map-container {
    width: 100%;
    height: 400px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

/* Order Form */
.form-header {
    text-align: center;
    margin-bottom: 3rem;
}

.form-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.form-header p {
    color: var(--text-light);
    font-size: 1.125rem;
}

.order-form {
    background: var(--bg-white);
    padding: 2.5rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    max-width: 900px;
    margin: 0 auto;
}

.form-section {
    margin-bottom: 2.5rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid var(--border-color);
}

.form-section:last-child {
    border-bottom: none;
}

.form-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.item-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: end;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    font-size: 0.875rem;
}

.required {
    color: var(--error);
}

.form-control {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s;
    background: var(--bg-white);
}

.form-control:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-control:invalid:not(:placeholder-shown) {
    border-color: var(--error);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-primary {
    background: var(--brand-primary);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--bg-gray);
    color: var(--text-dark);
}

.btn-secondary:hover:not(:disabled) {
    background: #e5e7eb;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-icon {
    padding: 0.5rem;
    width: 40px;
    height: 40px;
}

.btn-remove {
    background: transparent;
    color: var(--error);
    border: 1px solid var(--error);
}

.btn-remove:hover:not(:disabled) {
    background: var(--error);
    color: white;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.form-actions {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

/* Alerts */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    margin: 2rem 0;
    box-shadow: var(--shadow-md);
}

.alert i {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.alert h3 {
    margin-bottom: 0.5rem;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid var(--success);
}

.alert-success i {
    color: var(--success);
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid var(--error);
}

.alert-error i {
    color: var(--error);
}

/* Error Pages */
.error-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    padding: 2rem;
}

.error-content {
    text-align: center;
    max-width: 500px;
}

.error-icon {
    font-size: 5rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.error-content h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.error-content p {
    color: var(--text-light);
    font-size: 1.125rem;
    margin-bottom: 2rem;
}

/* Footer */
.site-footer {
    background: var(--text-dark);
    color: white;
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.footer-section p {
    opacity: 0.8;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: white;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.footer-links a:hover {
    opacity: 1;
}

.footer-powered {
    text-align: center;
    opacity: 0.6;
    font-size: 0.875rem;
}

.footer-powered a {
    color: white;
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1.5rem;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .item-row {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .order-form {
        padding: 1.5rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .business-name {
        font-size: 1.25rem;
    }

    .main-nav {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }

    .nav-link {
        width: 100%;
        text-align: center;
    }
}

/* Loading Spinner */
.fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Print Styles */
@media print {
    .site-header,
    .site-footer,
    .btn,
    .main-nav {
        display: none;
    }
}
