/* assets/css/style.css - COMPLETE UPDATED VERSION */

/* ============ RESET & BASE ============ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #e94560;
    --primary-dark: #c73650;
    --secondary: #1a1a2e;
    --dark: #16213e;
    --accent: #0f3460;
    --text: #0F1111;
    --text-light: #565959;
    --bg: #f8f9fa;
    --white: #ffffff;
    --border: #e0e0e0;
    --success: #27ae60;
    --warning: #f39c12;
    --danger: #e74c3c;
    --link: #007185;
    --link-hover: #C7511F;
    --amazon-yellow: #FFD814;
    --amazon-yellow-hover: #F7CA00;
    --amazon-dark: #232F3E;
    --amazon-orange: #FF9900;
    --shadow: 0 2px 15px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.12);
    --radius: 12px;
    --transition: all 0.3s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============ ALERTS ============ */
.alert {
    padding: 14px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-close {
    cursor: pointer;
    font-size: 20px;
    font-weight: bold;
    margin-left: 15px;
}

/* ============ HEADER / NAVBAR ============ */
.top-bar {
    background: var(--amazon-dark);
    color: #ccc;
    font-size: 13px;
    padding: 8px 0;
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-bar a {
    color: #ccc;
    margin-left: 15px;
}

.top-bar a:hover {
    color: var(--amazon-orange);
}

.navbar {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.logo {
    font-size: 26px;
    font-weight: 800;
    color: var(--secondary);
}

.logo span {
    color: var(--primary);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 30px;
    align-items: center;
}

.nav-links a {
    color: var(--text);
    font-weight: 500;
    font-size: 15px;
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: var(--transition);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-search {
    position: relative;
}

.nav-search input {
    padding: 10px 40px 10px 16px;
    border: 2px solid var(--border);
    border-radius: 25px;
    width: 220px;
    font-size: 14px;
    transition: var(--transition);
}

.nav-search input:focus {
    outline: none;
    border-color: var(--amazon-orange);
    width: 280px;
}

.nav-search button {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: var(--text-light);
}

/* ============ AJAX SEARCH DROPDOWN ============ */
.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    z-index: 1000;
    display: none;
    max-height: 400px;
    overflow-y: auto;
}

.search-dropdown.active {
    display: block;
}

.search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
    cursor: pointer;
}

.search-item:hover {
    background: #f8f9fa;
}

.search-item img {
    width: 40px;
    height: 55px;
    object-fit: cover;
    border-radius: 4px;
}

.search-item-placeholder {
    width: 40px;
    height: 55px;
    background: #f0f0f0;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.search-item-info {
    flex: 1;
}

.search-item-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
}

.search-item-author {
    font-size: 12px;
    color: #999;
}

.search-item-price {
    font-weight: 700;
    color: #e94560;
    font-size: 14px;
}

.search-no-results {
    padding: 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

.cart-icon {
    position: relative;
    font-size: 22px;
    cursor: pointer;
    color: var(--text);
}

.cart-icon:hover {
    color: var(--primary);
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background: var(--primary);
    color: white;
    font-size: 11px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text);
}

/* ============ HERO SECTION ============ */
.hero {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--dark) 50%, var(--accent) 100%);
    color: white;
    padding: 80px 0;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200"><circle cx="100" cy="100" r="80" fill="rgba(233,69,96,0.1)"/></svg>') center/cover;
}

.hero .container {
    display: flex;
    align-items: center;
    gap: 60px;
    position: relative;
    z-index: 1;
}

.hero-content {
    flex: 1;
}

.hero-content h1 {
    font-size: 48px;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-content h1 span {
    color: var(--primary);
}

.hero-content p {
    font-size: 18px;
    color: #ccc;
    margin-bottom: 30px;
    max-width: 500px;
}

.hero-actions {
    display: flex;
    gap: 15px;
}

.hero-image {
    flex: 1;
    text-align: center;
}

.hero-image img {
    max-width: 400px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

/* ============ BUTTONS ============ */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-align: center;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(233, 69, 96, 0.4);
}

.btn-secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.btn-secondary:hover {
    background: white;
    color: var(--secondary);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-dark {
    background: var(--secondary);
    color: white;
}

.btn-dark:hover {
    background: var(--dark);
}

.btn-sm {
    padding: 8px 18px;
    font-size: 13px;
}

.btn-lg {
    padding: 16px 36px;
    font-size: 17px;
}

.btn-block {
    display: block;
    width: 100%;
}

/* ============ SECTION STYLES ============ */
.section {
    padding: 70px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-header h2 {
    font-size: 32px;
    color: var(--secondary);
    margin-bottom: 10px;
}

.section-header p {
    color: var(--text-light);
    font-size: 16px;
}

.section-header .line {
    width: 60px;
    height: 3px;
    background: var(--primary);
    margin: 15px auto 0;
    border-radius: 2px;
}

/* ============ AMAZON SECTION HEADER ============ */
.amazon-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.amazon-section-header h2 {
    font-size: 21px;
    font-weight: 700;
    color: #0F1111;
    margin: 0;
}

.amazon-section-header a {
    color: var(--link);
    font-size: 14px;
    font-weight: 400;
}

.amazon-section-header a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

.amazon-section {
    background: var(--white);
    padding: 25px 0;
    margin-bottom: 15px;
}

/* ============ AMAZON KDP STYLE BOOKS ============ */

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 20px 16px;
}

.book-card {
    background: transparent;
    border-radius: 0;
    overflow: visible;
    box-shadow: none;
    transition: var(--transition);
    position: relative;
}

.book-card:hover {
    transform: none;
    box-shadow: none;
}

/* --- Book Cover Container --- */
.book-card-image {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 3;
    overflow: visible;
    background: transparent;
    margin-bottom: 10px;
    cursor: pointer;
    display: block;
}

/* --- 3D Book Cover Effect --- */
.book-card-image .book-cover-wrap {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.3s ease;
}

.book-card:hover .book-cover-wrap {
    transform: translateY(-4px);
}

.book-card-image .book-cover-wrap::before {
    content: '';
    position: absolute;
    top: 3px;
    right: -6px;
    width: 6px;
    height: 100%;
    background: linear-gradient(to right, #d4d0c8, #b8b4ab);
    transform: skewY(-45deg);
    transform-origin: top left;
    border-radius: 0 2px 2px 0;
    z-index: 1;
}

.book-card-image .book-cover-wrap::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 3px;
    width: 100%;
    height: 6px;
    background: linear-gradient(to bottom, #d4d0c8, #b8b4ab);
    transform: skewX(-45deg);
    transform-origin: top left;
    border-radius: 0 0 2px 2px;
    z-index: 1;
}

.book-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 2px;
    box-shadow:
        0 1px 3px rgba(0,0,0,0.12),
        0 4px 12px rgba(0,0,0,0.08),
        3px 3px 8px rgba(0,0,0,0.15);
    transition: box-shadow 0.3s ease;
    position: relative;
    z-index: 2;
}

.book-card:hover .book-card-image img {
    box-shadow:
        0 2px 8px rgba(0,0,0,0.15),
        0 8px 25px rgba(0,0,0,0.12),
        3px 3px 10px rgba(0,0,0,0.2);
}

/* --- No Cover Placeholder --- */
.book-card-image .no-cover {
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, #f5f0e8, #e8e0d4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
    border-radius: 2px;
    box-shadow:
        0 1px 3px rgba(0,0,0,0.12),
        0 4px 12px rgba(0,0,0,0.08),
        3px 3px 8px rgba(0,0,0,0.15);
    position: relative;
    z-index: 2;
}

/* --- Sale / Featured Badge --- */
.book-card .badge {
    position: absolute;
    top: 0;
    left: 0;
    background: #CC0C39;
    color: white;
    padding: 3px 8px;
    border-radius: 2px 0 4px 0;
    font-size: 11px;
    font-weight: 700;
    z-index: 5;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* --- Overlay Hidden (Amazon style) --- */
.book-card-overlay {
    display: none;
}

/* --- Book Info Below Cover --- */
.book-card-body {
    padding: 0;
}

.book-card-category {
    display: none;
}

.book-card-title {
    font-size: 14px;
    font-weight: 400;
    color: #0F1111;
    margin-bottom: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    cursor: pointer;
}

.book-card-title:hover,
.book-card-title a:hover {
    color: var(--link-hover);
    text-decoration: none;
}

.book-card-title a {
    color: #0F1111;
}

.book-card-title a:hover {
    color: var(--link-hover);
}

.book-card-author {
    color: var(--text-light);
    font-size: 12px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.book-card-author a {
    color: var(--link);
}

.book-card-author a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

/* --- Star Rating (Amazon Style) --- */
.book-card-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 4px;
}

.book-card-rating .stars {
    color: #FFA41C;
    font-size: 13px;
    letter-spacing: -1px;
}

.book-card-rating .rating-count {
    color: var(--link);
    font-size: 12px;
}

.book-card-rating .rating-count:hover {
    color: var(--link-hover);
    cursor: pointer;
}

/* --- Price (Amazon Style) --- */
.book-card-footer {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
}

.book-price {
    font-size: 14px;
    font-weight: 400;
    color: #0F1111;
}

.book-price .price-symbol {
    font-size: 11px;
    vertical-align: top;
    position: relative;
    top: 2px;
}

.book-price .price-whole {
    font-size: 21px;
    font-weight: 400;
    color: #0F1111;
    letter-spacing: -0.5px;
}

.book-price .price-fraction {
    font-size: 11px;
    vertical-align: top;
    position: relative;
    top: 2px;
}

.book-price .old-price {
    font-size: 12px;
    color: var(--text-light);
    text-decoration: line-through;
    margin-left: 6px;
    font-weight: 400;
}

/* --- Book Type / Format Label --- */
.book-card-format {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 2px;
}

/* --- Add to Cart (Amazon Style) --- */
.add-cart-btn {
    background: var(--amazon-yellow);
    color: #0F1111;
    border: 1px solid #FCD200;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 400;
    transition: var(--transition);
    margin-top: 8px;
    width: 100%;
    text-align: center;
}

.add-cart-btn:hover {
    background: var(--amazon-yellow-hover);
    border-color: #F2C200;
}

/* --- Horizontal Scroll Section --- */
.books-scroll-section {
    position: relative;
    margin: 0 -20px;
    padding: 0 20px;
}

.books-scroll-container {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 10px 0 20px;
    cursor: grab;
}

.books-scroll-container::-webkit-scrollbar {
    display: none;
}

.books-scroll-container .book-card {
    flex: 0 0 170px;
    min-width: 170px;
}

.scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-60%);
    width: 44px;
    height: 80px;
    background: rgba(255,255,255,0.9);
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: var(--transition);
}

.scroll-btn:hover {
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.scroll-btn.left {
    left: 0;
}

.scroll-btn.right {
    right: 0;
}

.book-rating {
    color: #FFA41C;
    font-size: 13px;
}

.stars {
    color: #FFA41C;
}

/* ============ CATEGORIES SECTION ============ */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.category-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 30px 20px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 2px solid transparent;
}

.category-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
}

.category-card .icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.category-card h3 {
    font-size: 16px;
    color: var(--secondary);
    margin-bottom: 5px;
}

.category-card span {
    font-size: 13px;
    color: var(--text-light);
}

/* ============ NEWSLETTER ============ */
.newsletter {
    background: linear-gradient(135deg, var(--secondary), var(--accent));
    color: white;
    padding: 60px 0;
}

.newsletter .container {
    text-align: center;
}

.newsletter h2 {
    font-size: 30px;
    margin-bottom: 10px;
}

.newsletter p {
    color: #ccc;
    margin-bottom: 25px;
}

.newsletter-form {
    display: flex;
    max-width: 500px;
    margin: 0 auto;
    gap: 10px;
}

.newsletter-form input {
    flex: 1;
    padding: 14px 20px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
}

.newsletter-form input:focus {
    outline: none;
}

.newsletter-form button {
    padding: 14px 30px;
    background: var(--amazon-yellow);
    color: #0F1111;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.newsletter-form button:hover {
    background: var(--amazon-yellow-hover);
}

/* ============ FOOTER ============ */
.footer {
    background: var(--amazon-dark);
    color: #ccc;
    padding: 60px 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h3 {
    color: white;
    margin-bottom: 20px;
    font-size: 18px;
}

.footer-col p {
    line-height: 1.8;
    font-size: 14px;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col ul li a {
    color: #ccc;
    font-size: 14px;
}

.footer-col ul li a:hover {
    color: var(--amazon-orange);
    padding-left: 5px;
}

.footer-social {
    display: flex;
    gap: 12px;
    margin-top: 15px;
}

.footer-social a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-size: 18px;
    transition: var(--transition);
}

.footer-social a:hover {
    background: var(--primary);
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 20px 0;
    text-align: center;
    font-size: 13px;
}

/* ============ PAGE HEADER ============ */
.page-header {
    background: linear-gradient(135deg, var(--secondary), var(--accent));
    color: white;
    padding: 50px 0;
    text-align: center;
}

.page-header h1 {
    font-size: 36px;
    margin-bottom: 10px;
}

.breadcrumb {
    font-size: 14px;
    color: #ccc;
}

.breadcrumb a {
    color: var(--amazon-orange);
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* ============ FORMS ============ */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--text);
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    transition: var(--transition);
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--amazon-orange);
    box-shadow: 0 0 0 3px rgba(255,153,0,0.15);
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

select.form-control {
    appearance: none;
    background: white url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8"><path d="M1 1l5 5 5-5" stroke="%23666" stroke-width="2" fill="none"/></svg>') right 16px center/12px no-repeat;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* ============ PAGINATION ============ */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
}

.pagination a,
.pagination span {
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    border: 2px solid var(--border);
    color: var(--text);
    transition: var(--transition);
}

.pagination a:hover,
.pagination .active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ============ BLOG CARDS ============ */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

.blog-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: block;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.blog-card-image {
    height: 220px;
    overflow: hidden;
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.blog-card:hover .blog-card-image img {
    transform: scale(1.05);
}

.blog-card-body {
    padding: 25px;
}

.blog-card-meta {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 10px;
    display: flex;
    gap: 15px;
}

.blog-card-title {
    font-size: 20px;
    color: var(--secondary);
    margin-bottom: 10px;
    font-weight: 700;
}

.blog-card-excerpt {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 15px;
    line-height: 1.7;
}

/* ============ CART & CHECKOUT ============ */
.cart-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.cart-table th {
    background: var(--amazon-dark);
    color: white;
    padding: 15px 20px;
    text-align: left;
    font-size: 14px;
}

.cart-table td {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.cart-table .cart-item-image {
    width: 70px;
    height: 90px;
    object-fit: cover;
    border-radius: 6px;
}

.cart-item-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.qty-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qty-control button {
    width: 32px;
    height: 32px;
    border: 2px solid var(--border);
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: var(--transition);
}

.qty-control button:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.qty-control input {
    width: 50px;
    text-align: center;
    border: 2px solid var(--border);
    border-radius: 6px;
    padding: 5px;
    font-size: 14px;
}

.cart-summary {
    background: var(--white);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
}

.cart-summary h3 {
    margin-bottom: 20px;
    color: var(--secondary);
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    font-size: 15px;
}

.cart-summary-total {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    border-bottom: none;
    padding-top: 15px;
}

.checkout-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 30px;
    align-items: start;
}

/* ============ PAYMENT METHODS ============ */
.payment-methods {
    display: grid;
    gap: 12px;
    margin: 20px 0;
}

.payment-option {
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: var(--transition);
}

.payment-option:hover,
.payment-option.selected {
    border-color: var(--amazon-orange);
    background: #fff8f0;
}

.payment-option input[type="radio"] {
    accent-color: var(--amazon-orange);
    width: 18px;
    height: 18px;
}

.payment-option-info h4 {
    font-size: 15px;
    color: var(--secondary);
}

.payment-option-info p {
    font-size: 12px;
    color: var(--text-light);
}

/* ============ BOOK DETAIL PAGE ============ */
.book-detail {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 50px;
    padding: 50px 0;
}

.book-detail-image {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.book-detail-image img {
    width: 100%;
    height: auto;
}

.book-detail-info h1 {
    font-size: 32px;
    color: var(--secondary);
    margin-bottom: 10px;
}

.book-detail-author {
    font-size: 16px;
    color: var(--text-light);
    margin-bottom: 15px;
}

.book-detail-author a {
    color: var(--link);
}

.book-detail-author a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

.book-detail-price {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 20px;
}

.book-detail-desc {
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 25px;
}

.book-meta-table {
    width: 100%;
    margin: 20px 0;
}

.book-meta-table td {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.book-meta-table td:first-child {
    font-weight: 600;
    width: 140px;
    color: var(--secondary);
}

/* ============ AUTH PAGES ============ */
.auth-container {
    max-width: 480px;
    margin: 50px auto;
    padding: 0 20px;
}

.auth-box {
    background: var(--white);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    border-top: 3px solid var(--amazon-orange);
}

.auth-box h2 {
    text-align: center;
    color: var(--secondary);
    margin-bottom: 30px;
}

.auth-divider {
    text-align: center;
    margin: 20px 0;
    color: var(--text-light);
    font-size: 14px;
}

/* ============ SIDEBAR & FILTERS ============ */
.sidebar-filter {
    background: var(--white);
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--shadow);
}

.sidebar-filter h3 {
    font-size: 16px;
    margin-bottom: 15px;
    color: var(--secondary);
}

.filter-list {
    list-style: none;
}

.filter-list li {
    margin-bottom: 8px;
}

.filter-list li a {
    color: var(--text-light);
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
}

.filter-list li a:hover,
.filter-list li a.active {
    color: var(--link-hover);
}

.books-page-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 30px;
    padding: 40px 0;
}

/* ============ TABS ============ */
.tab-nav {
    display: flex;
    border-bottom: 2px solid var(--border);
    margin-bottom: 25px;
}

.tab-btn {
    padding: 12px 25px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-light);
    transition: var(--transition);
    margin-bottom: -2px;
    font-family: inherit;
    font-size: 14px;
}

.tab-btn.active,
.tab-btn:hover {
    color: var(--link-hover);
    border-bottom-color: var(--amazon-orange);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ============ MISC ============ */
.text-center { text-align: center; }
.text-primary { color: var(--primary); }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state .icon {
    font-size: 60px;
    margin-bottom: 15px;
}

.empty-state h3 {
    color: var(--secondary);
    margin-bottom: 10px;
}

.empty-state p {
    color: var(--text-light);
    margin-bottom: 20px;
}

.remove-btn {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 18px;
}

.remove-btn:hover {
    color: var(--primary-dark);
}

.loading-spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid rgba(0,0,0,0.1);
    border-radius: 50%;
    border-top-color: var(--amazon-orange);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.overlay-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.9);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.overlay-loading.active {
    display: flex;
}

/* ============ RESPONSIVE ============ */

/* Tablets */
@media (max-width: 968px) {
    .hero .container {
        flex-direction: column;
        text-align: center;
    }

    .hero-content p {
        margin: 0 auto 30px;
    }

    .hero-actions {
        justify-content: center;
    }

    .hero-content h1 {
        font-size: 36px;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .book-detail {
        grid-template-columns: 1fr;
    }

    .checkout-grid {
        grid-template-columns: 1fr;
    }

    /* Books Grid - Tablet */
    .books-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 16px 12px;
    }

    .book-card-title {
        font-size: 13px;
    }

    .book-price .price-whole {
        font-size: 18px;
    }

    .books-scroll-container .book-card {
        flex: 0 0 150px;
        min-width: 150px;
    }

    /* Categories - Tablet 4 cols */
    .categories-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 15px;
    }

    .category-card {
        padding: 20px 12px;
    }

    .category-card .icon {
        font-size: 32px;
        margin-bottom: 8px;
    }

    .category-card h3 {
        font-size: 14px;
    }

    .category-card span {
        font-size: 11px;
    }

    .books-page-layout {
        grid-template-columns: 1fr;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 20px;
        box-shadow: var(--shadow);
        gap: 15px;
    }

    .nav-links.active {
        display: flex;
    }

    .mobile-menu-btn {
        display: block;
    }

    .nav-search input {
        width: 160px;
    }

    .nav-search input:focus {
        width: 200px;
    }

    .hero-content h1 {
        font-size: 30px;
    }

    .hero {
        padding: 50px 0;
    }

    .section {
        padding: 40px 0;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .blog-grid {
        grid-template-columns: 1fr;
    }

    .newsletter-form {
        flex-direction: column;
    }

    .top-bar {
        display: none;
    }

    .cart-table {
        font-size: 13px;
    }

    .cart-table th,
    .cart-table td {
        padding: 10px;
    }

    .page-header {
        padding: 35px 0;
    }

    .page-header h1 {
        font-size: 28px;
    }

    /* Books Grid - Mobile 3 cols */
    .books-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px 8px;
    }

    .book-card-image .book-cover-wrap::before {
        width: 4px;
        right: -4px;
    }

    .book-card-image .book-cover-wrap::after {
        height: 4px;
        bottom: -4px;
        left: 2px;
    }

    .book-card-title {
        font-size: 12px;
        -webkit-line-clamp: 2;
    }

    .book-card-author {
        font-size: 10px;
        margin-bottom: 3px;
    }

    .book-card-rating .stars {
        font-size: 11px;
    }

    .book-card-rating .rating-count {
        font-size: 10px;
    }

    .book-price .price-symbol {
        font-size: 10px;
    }

    .book-price .price-whole {
        font-size: 16px;
    }

    .book-price .price-fraction {
        font-size: 10px;
    }

    .book-price .old-price {
        font-size: 10px;
    }

    .add-cart-btn {
        padding: 5px 8px;
        font-size: 11px;
        margin-top: 6px;
    }

    .book-card-format {
        font-size: 10px;
    }

    .books-scroll-container .book-card {
        flex: 0 0 130px;
        min-width: 130px;
    }

    .scroll-btn {
        width: 36px;
        height: 60px;
        font-size: 14px;
    }

    .amazon-section-header h2 {
        font-size: 18px;
    }

    /* Categories - Mobile 4 cols */
    .categories-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }

    .category-card {
        padding: 15px 8px;
        border-radius: 10px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    }

    .category-card .icon {
        font-size: 28px;
        margin-bottom: 6px;
    }

    .category-card h3 {
        font-size: 11px;
        margin-bottom: 2px;
        line-height: 1.3;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .category-card span {
        font-size: 9px;
    }

    .category-card:hover {
        transform: none;
    }

    .section-header h2 {
        font-size: 24px;
    }

    .auth-box {
        padding: 25px;
    }
}

/* Small Phones */
@media (max-width: 480px) {
    .books-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px 6px;
    }

    .book-card-title {
        font-size: 11px;
        line-height: 1.3;
    }

    .book-card-author {
        font-size: 9px;
    }

    .book-card-rating {
        margin-bottom: 2px;
    }

    .book-card-rating .stars {
        font-size: 10px;
    }

    .book-card-rating .rating-count {
        display: none;
    }

    .book-price .price-whole {
        font-size: 14px;
    }

    .book-price .old-price {
        display: block;
        margin-left: 0;
        font-size: 10px;
    }

    .add-cart-btn {
        padding: 4px 6px;
        font-size: 10px;
    }

    .book-card-format {
        display: none;
    }

    .books-scroll-container .book-card {
        flex: 0 0 110px;
        min-width: 110px;
    }

    .hero-content h1 {
        font-size: 24px;
    }

    .hero-content p {
        font-size: 15px;
    }

    .hero-actions {
        flex-direction: column;
        gap: 10px;
    }

    .container {
        padding: 0 15px;
    }
}

/* Very Small Phones */
@media (max-width: 380px) {
    .books-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px 5px;
    }

    .book-card-image .no-cover {
        font-size: 30px;
    }

    .book-card-title {
        font-size: 10px;
    }

    .book-card-author {
        font-size: 8px;
    }

    .book-price .price-symbol {
        font-size: 9px;
    }

    .book-price .price-whole {
        font-size: 13px;
    }

    .book-price .price-fraction {
        font-size: 9px;
    }

    .book-price .old-price {
        font-size: 9px;
    }

    .add-cart-btn {
        padding: 4px 5px;
        font-size: 9px;
    }

    /* Categories - Very Small 4 cols */
    .categories-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }

    .category-card {
        padding: 12px 5px;
        border-radius: 8px;
    }

    .category-card .icon {
        font-size: 24px;
        margin-bottom: 4px;
    }

    .category-card h3 {
        font-size: 10px;
    }

    .category-card span {
        font-size: 8px;
    }

    .nav-search input {
        width: 120px;
    }

    .nav-search input:focus {
        width: 160px;
    }

    .scroll-btn {
        width: 30px;
        height: 50px;
        font-size: 12px;
    }
}

/* Very Tiny Screens */
@media (max-width: 320px) {
    .books-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .navbar .container {
        padding: 10px 12px;
    }

    .logo {
        font-size: 20px;
    }

    .nav-search {
        display: none;
    }
}

/* ============ AMAZON STYLE FILTERS & BOOKS PAGE ============ */

/* --- Books Page Layout --- */
.amazon-books-layout {
    display: grid;
    grid-template-columns: 230px 1fr;
    gap: 20px;
    padding: 20px 0 50px;
}

/* --- Amazon Results Top Bar --- */
.amazon-results-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.amazon-results-bar .results-count {
    font-size: 14px;
    color: #565959;
}

.amazon-results-bar .results-count span {
    color: #C7511F;
    font-weight: 700;
}

.amazon-results-sort {
    display: flex;
    align-items: center;
    gap: 8px;
}

.amazon-results-sort label {
    font-size: 13px;
    color: #565959;
    white-space: nowrap;
}

.amazon-results-sort select {
    padding: 6px 28px 6px 10px;
    border: 1px solid #888;
    border-radius: 8px;
    font-size: 13px;
    background: #f0f2f2;
    appearance: none;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="10" height="6" viewBox="0 0 10 6"><path d="M0 0l5 6 5-6z" fill="%23555"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    cursor: pointer;
    color: #0F1111;
}

.amazon-results-sort select:focus {
    outline: none;
    border-color: #e77600;
    box-shadow: 0 0 0 3px rgba(228,121,17,0.5);
}

/* --- Amazon Left Sidebar --- */
.amazon-sidebar {
    font-size: 14px;
    color: #0F1111;
}

/* --- Amazon Department Navigation --- */
.amazon-dept-nav {
    margin-bottom: 18px;
}

.amazon-dept-title {
    font-size: 16px;
    font-weight: 700;
    color: #0F1111;
    padding-bottom: 5px;
    margin-bottom: 8px;
}

.amazon-dept-back {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #0F1111;
    padding: 4px 0;
    font-weight: 700;
    cursor: pointer;
}

.amazon-dept-back:hover {
    color: #C7511F;
}

.amazon-dept-back i {
    font-size: 10px;
    color: #999;
}

.amazon-dept-current {
    font-size: 14px;
    font-weight: 700;
    color: #C7511F;
    padding: 4px 0 4px 12px;
    margin: 4px 0;
}

.amazon-dept-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.amazon-dept-list li {
    margin: 0;
}

.amazon-dept-list li a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0 5px 12px;
    font-size: 13px;
    color: #0F1111;
    transition: color 0.15s;
    line-height: 1.4;
}

.amazon-dept-list li a:hover {
    color: #C7511F;
}

.amazon-dept-list li a .dept-count {
    font-size: 12px;
    color: #999;
    margin-left: 5px;
}

.amazon-dept-list li a.active-cat {
    font-weight: 700;
    color: #C7511F;
}

/* --- Amazon Filter Section --- */
.amazon-filter-section {
    border-top: 1px solid #e0e0e0;
    padding: 14px 0;
}

.amazon-filter-section:first-child {
    border-top: none;
    padding-top: 0;
}

.amazon-filter-title {
    font-size: 13px;
    font-weight: 700;
    color: #0F1111;
    margin-bottom: 8px;
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.amazon-filter-title .toggle-icon {
    font-size: 10px;
    color: #999;
    transition: transform 0.2s;
}

.amazon-filter-title.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.amazon-filter-body {
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.amazon-filter-body.collapsed {
    max-height: 0 !important;
    overflow: hidden;
}

/* --- Amazon Checkbox List --- */
.amazon-check-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.amazon-check-list li {
    margin: 0;
}

.amazon-check-list li a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 13px;
    color: #0F1111;
    line-height: 1.4;
}

.amazon-check-list li a:hover {
    color: #C7511F;
}

.amazon-check-list li a .filter-checkbox {
    width: 16px;
    height: 16px;
    border: 2px solid #888;
    border-radius: 3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s;
}

.amazon-check-list li a .filter-checkbox.checked {
    background: #007185;
    border-color: #007185;
    color: #fff;
    font-size: 10px;
}

.amazon-check-list li a .filter-count {
    color: #999;
    font-size: 12px;
    margin-left: auto;
}

/* --- Amazon Star Filter --- */
.amazon-star-filter a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
    font-size: 13px;
    color: #0F1111;
}

.amazon-star-filter a:hover {
    color: #C7511F;
}

.amazon-star-filter .stars-row {
    color: #FFA41C;
    font-size: 14px;
    letter-spacing: -1px;
}

.amazon-star-filter .up-text {
    font-size: 12px;
    color: #007185;
}

/* --- Amazon Price Range Filter --- */
.amazon-price-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.amazon-price-list li a {
    display: block;
    padding: 4px 0;
    font-size: 13px;
    color: #0F1111;
}

.amazon-price-list li a:hover {
    color: #C7511F;
}

.amazon-price-list li a.active-price {
    font-weight: 700;
    color: #C7511F;
}

.amazon-price-form {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 8px;
}

.amazon-price-form input {
    width: 60px;
    padding: 5px 8px;
    border: 1px solid #888;
    border-radius: 4px;
    font-size: 12px;
    text-align: center;
}

.amazon-price-form input:focus {
    outline: none;
    border-color: #e77600;
    box-shadow: 0 0 0 3px rgba(228,121,17,0.5);
}

.amazon-price-form span {
    font-size: 12px;
    color: #999;
}

.amazon-price-form button {
    padding: 5px 12px;
    border: 1px solid #888;
    border-radius: 8px;
    background: #f0f2f2;
    font-size: 12px;
    cursor: pointer;
    color: #0F1111;
}

.amazon-price-form button:hover {
    background: #e3e6e6;
}

/* --- Active Filters Bar --- */
.amazon-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 0;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 15px;
    align-items: center;
}

.amazon-active-filters .filter-label {
    font-size: 13px;
    color: #565959;
    font-weight: 700;
}

.amazon-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: #f0f2f2;
    border: 1px solid #d5d9d9;
    border-radius: 4px;
    font-size: 12px;
    color: #0F1111;
    cursor: pointer;
    transition: all 0.15s;
}

.amazon-filter-tag:hover {
    background: #e3e6e6;
    border-color: #bbb;
}

.amazon-filter-tag .tag-remove {
    color: #007185;
    font-weight: 700;
    font-size: 14px;
}

.amazon-clear-all {
    font-size: 12px;
    color: #007185;
    margin-left: 5px;
}

.amazon-clear-all:hover {
    color: #C7511F;
    text-decoration: underline;
}

/* --- Amazon Breadcrumb --- */
.amazon-breadcrumb {
    font-size: 12px;
    color: #565959;
    padding: 12px 0 5px;
}

.amazon-breadcrumb a {
    color: #007185;
}

.amazon-breadcrumb a:hover {
    color: #C7511F;
    text-decoration: underline;
}

.amazon-breadcrumb .separator {
    margin: 0 5px;
    color: #999;
}

/* ============ RESPONSIVE AMAZON FILTERS ============ */

/* Mobile Filter Toggle */
.amazon-filter-toggle {
    display: none;
    width: 100%;
    padding: 12px 18px;
    background: #f0f2f2;
    border: 1px solid #d5d9d9;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #0F1111;
    cursor: pointer;
    margin-bottom: 15px;
    text-align: left;
}

.amazon-filter-toggle i {
    margin-right: 8px;
}

.amazon-filter-toggle .toggle-arrow {
    float: right;
    transition: transform 0.3s;
}

@media (max-width: 968px) {
    .amazon-books-layout {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .amazon-sidebar {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 300px;
        height: 100vh;
        background: #fff;
        z-index: 2000;
        overflow-y: auto;
        padding: 20px;
        box-shadow: 5px 0 30px rgba(0,0,0,0.3);
        animation: slideInLeft 0.3s ease;
    }

    @keyframes slideInLeft {
        from { transform: translateX(-100%); }
        to { transform: translateX(0); }
    }

    .amazon-sidebar.open {
        display: block;
    }

    .amazon-sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1999;
    }

    .amazon-sidebar-overlay.open {
        display: block;
    }

    .amazon-filter-toggle {
        display: block;
    }

    .amazon-sidebar-close {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-bottom: 15px;
        margin-bottom: 15px;
        border-bottom: 1px solid #e0e0e0;
    }

    .amazon-sidebar-close h3 {
        font-size: 18px;
        color: #0F1111;
    }

    .amazon-sidebar-close button {
        background: none;
        border: none;
        font-size: 24px;
        cursor: pointer;
        color: #555;
        padding: 5px;
    }
}

@media (min-width: 969px) {
    .amazon-sidebar-close {
        display: none;
    }
    .amazon-sidebar-overlay {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .amazon-sidebar.open {
        width: 85vw;
    }

    .amazon-results-bar {
        flex-direction: column;
        align-items: flex-start;
    }
}