/* Base styles for better responsiveness */
html {
    font-size: 16px;
}

body {
    font-family: 'Montserrat', Arial, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Hero Section Responsive Styles */
.hero-section-bookshelf {
    background: linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)), url('../assets/images/book.jpeg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    align-items: center;
    color: white;
    position: relative;
    padding: 2rem 0;
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.3));
    z-index: 1;
}

.hero-flex {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 2rem;
    min-height: 100vh;
    padding: 1rem;
    width: 100%;
}

.hero-fairy-col {
    flex: 0 0 300px;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    margin-left: 0;
    margin-top: 0;
    position: relative;
    z-index: 1;
}

.hero-fairy-img {
    max-width: 100%;
    max-height: 520px;
    border-radius: 5px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
    object-fit: contain;
}

.hero-main-col {
    flex: 1 1 500px;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    padding: 1rem;
    position: relative;
    z-index: 2;
    background: rgba(0, 0, 0, 0.55);
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.hero-main-logo {
    max-width: 280px;
    width: 100%;
    margin-bottom: 1.5rem;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    font-weight: 600;
    color: #ffd700;
    margin-bottom: 0.5rem;
}

.hero-description {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    margin-bottom: 1.5rem;
}

.hero-btn-row {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.hero-btn {
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    white-space: nowrap;
}

.hero-features {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #ffd700;
    font-size: clamp(0.9rem, 2vw, 1.1rem);
}

.feature i {
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin-bottom: 0.3rem;
}

/* Responsive Breakpoints */
@media (max-width: 992px) {
    .hero-section-bookshelf {
        background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('../assets/images/no-image.png') center center/cover no-repeat !important;
    }

    .hero-fairy-col,
    .hero-main-logo {
        display: none !important;
    }

    .hero-main-col {
        width: 100%;
        max-width: 600px;
        /* background: rgba(0, 0, 0, 0.5); */
        border-radius: 10px;
        backdrop-filter: blur(5px);
        padding: 2rem;
        margin: 0 auto;
        z-index: 2;
    }

    .hero-flex {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-height: 100vh;
        padding: 1rem;
    }
}

@media (max-width: 768px) {
    .hero-section-bookshelf {
        padding: 1rem 0;
    }

    .hero-flex {
        padding: 0.5rem;
    }

    .hero-main-col {
        padding: 1.5rem;
    }

    .hero-btn-row {
        gap: 0.75rem;
    }

    .hero-features {
        gap: 1.5rem;
    }
}

@media (max-width: 576px) {
    .hero-section-bookshelf {
        padding: 0.5rem 0;
    }

    .hero-flex {
        padding: 0.25rem;
    }

    .hero-main-col {
        padding: 1rem 0.5rem;
        max-width: 98vw;
    }

    .hero-btn {
        width: 100%;
        max-width: 250px;
    }

    .hero-features {
        gap: 1rem;
    }

    .hero-fairy-col {
        opacity: 0.2;
    }
}

/* Product Cards Responsive Styles */
.book-card,
.paint-card {
    height: 100%;
    transition: transform 0.3s ease;
}

.book-image-container,
.paint-image-container {
    height: clamp(200px, 30vw, 320px);
    padding: 0.75rem;
}

.book-image,
.paint-image {
    max-height: 100%;
    width: auto;
    margin: 0 auto;
}

.book-title,
.paint-title {
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    margin-bottom: 0.5rem;
}

.price {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
}

/* Newsletter Section Responsive Styles */
.newsletter-section {
    padding: clamp(2rem, 5vw, 4rem) 0;
}

.newsletter-section h3 {
    font-size: clamp(1.5rem, 4vw, 2rem);
}

.newsletter-section p {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
}

/* Footer Responsive Styles */
footer {
    font-size: clamp(0.9rem, 2vw, 1rem);
}

footer h5 {
    font-size: clamp(1.1rem, 2.5vw, 1.3rem);
    margin-bottom: 1rem;
}

.social-icon {
    width: clamp(30px, 5vw, 35px);
    height: clamp(30px, 5vw, 35px);
    line-height: clamp(30px, 5vw, 35px);
    font-size: clamp(0.9rem, 2vw, 1rem);
}

/* Utility Classes */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.img-fluid {
    max-width: 100%;
    height: auto;
}

/* Animation Enhancements */
.animate__animated {
    animation-duration: 1s;
}

.animate__delay-1s {
    animation-delay: 0.5s;
}

.animate__delay-2s {
    animation-delay: 1s;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

.hero-btn {
    animation: float 3s ease-in-out infinite;
}

.hero-btn:nth-child(2) {
    animation-delay: 0.5s;
}

.section-title {
    position: relative;
    padding-bottom: 15px;
    margin-bottom: 30px;
}

.section-title:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background: #007bff;
}

/* Book Card Styles */
.book-card {
    transition: transform 0.3s, box-shadow 0.3s;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    background: #fff;
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.book-image-container {
    position: relative;
    overflow: hidden;
    padding: 1rem;
    height: 320px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
}

.book-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s;
    margin: 0 auto;
    display: block;
}

.book-card:hover .book-image {
    transform: scale(1.05);
}

@media (max-width: 992px) {
    .book-image-container {
        height: 220px;
    }

    .book-image {
        max-width: 150px;
        max-height: 180px;
    }
}

@media (max-width: 768px) {
    .book-image-container {
        height: 160px;
        padding: 0.5rem;
    }

    .book-image {
        max-width: 100px;
        max-height: 120px;
        padding: 5px;
    }
}

/* Book Trailer Styles */
.book-trailer-container {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 1rem;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
    height: fit-content;
    border-top: 3px solid #007bff;
}

.book-trailer-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.book-trailer-container h5 {
    color: #007bff;
    font-weight: 700;
    font-size: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.video-container iframe {
    width: 100%;
    height: 400px;
    border-radius: 5px;
}

@media (max-width: 992px) {
    .book-trailer-container {
        padding: 0.75rem;
    }

    .book-trailer-container h5 {
        font-size: 1.1rem;
    }

    .video-container iframe {
        height: 300px;
    }
}

@media (max-width: 768px) {
    .book-trailer-container {
        padding: 0.5rem;
    }

    .book-trailer-container h5 {
        font-size: 0.95rem;
    }

    .video-container iframe {
        height: 250px;
    }
}

/* Featured Video Card Styles */
.featured-video-card {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.featured-video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.featured-video-card h4 {
    color: #007bff;
    font-weight: 700;
    font-size: 1.35rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.featured-video-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    flex: 1;
}

.featured-video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 8px;
}

@media (max-width: 992px) {
    .featured-video-card {
        padding: 1rem;
    }

    .featured-video-card h4 {
        font-size: 1.1rem;
    }
}

@media (max-width: 768px) {
    .featured-video-card {
        padding: 0.75rem;
    }

    .featured-video-card h4 {
        font-size: 0.95rem;
    }
}

/* Paint Card Styles */
.paint-card {
    transition: transform 0.3s, box-shadow 0.3s;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    background: #fff;
}

.paint-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.paint-image-container {
    position: relative;
    overflow: hidden;
    padding: 1rem;
    height: 300px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.paint-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s;
    background: white;
    padding: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.paint-card:hover .paint-image {
    transform: scale(1.05);
}

.book-overlay,
.paint-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.book-card:hover .book-overlay,
.paint-card:hover .paint-overlay {
    opacity: 1;
    transform: translateY(0);
}

.book-overlay .btn,
.paint-overlay .btn {
    width: 100%;
    max-width: 200px;
    font-weight: 600;
    transition: all 0.3s;
}

.book-overlay .btn-info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    border: none;
}

.book-overlay .btn-info:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.4);
}

/* Book Preview Button Styles */
.book-preview-btn {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border: none;
    color: white !important;
}

.book-preview-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.5);
    color: white !important;
}

.book-badge,
.paint-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1;
}

.author,
.artist {
    color: #666;
    font-size: 0.9rem;
}

.newsletter-section {
    background: linear-gradient(45deg, #2c3e50, #3498db);
    color: white;
}

.pulse-animation {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.quantity-selector .btn {
    padding: 0.375rem 0.75rem;
}

.quantity-selector .form-control {
    border-left: 0;
    border-right: 0;
}

.buy-now {
    transition: all 0.3s;
}

.buy-now:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.3);
}

.checkout-btn {
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.checkout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.toast {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Modal Styles */
.product-modal-image {
    max-height: 500px;
    width: 100%;
    object-fit: contain;
    background: white;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

.modal-qty {
    width: 60px !important;
}

.modal-body .col-md-6:first-child {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}

/* Responsive adjustments */
@media (max-width: 768px) {

    .book-image-container,
    .paint-image-container {
        height: 250px;
    }

    .product-modal-image {
        max-height: 300px;
    }
}

/* Fix for dropdown visibility on index page */
.navbar {
    overflow: visible !important;
}

.navbar .container {
    overflow: visible !important;
}

.navbar-right {
    overflow: visible !important;
}

.dropdown-menu {
    z-index: 10000 !important;
    position: absolute !important;
    display: none;
}

.dropdown-menu.show {
    display: block !important;
}

.dropdown:hover .dropdown-menu,
.dropdown.show .dropdown-menu {
    z-index: 10000 !important;
    position: absolute !important;
}

/* Ensure toast containers don't interfere with dropdowns */
.toast-container {
    pointer-events: none;
}

.toast-container .toast {
    pointer-events: auto;
}

.btn-contact {
    background: linear-gradient(90deg, #ff9800, #ff5722);
    color: #fff !important;
    border: none;
    box-shadow: 0 2px 10px rgba(255, 152, 0, 0.15);
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: background 0.3s, box-shadow 0.3s, transform 0.2s;
}

.btn-contact i {
    margin-right: 6px;
}

.btn-contact:hover,
.btn-contact:focus {
    background: linear-gradient(90deg, #ff5722, #ff9800);
    color: #fff;
    box-shadow: 0 4px 20px rgba(255, 87, 34, 0.25);
    transform: translateY(-2px) scale(1.04);
}

/* Live Cart Summary Styles - Compact & Responsive */
.live-cart-summary {
    position: fixed;
    bottom: 15px;
    right: 15px;
    z-index: 2050;
    max-width: 280px;
    width: auto;
    opacity: 0;
    transform: translateX(100%) scale(0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.live-cart-summary.show {
    opacity: 1;
    transform: translateX(0) scale(1);
    pointer-events: auto;
}

.cart-summary-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    position: relative;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.cart-summary-header {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.cart-icon {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.cart-info {
    flex: 1;
    min-width: 0;
}

.cart-total-amount {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 1px;
    background: linear-gradient(45deg, #fff, #f8f9fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.cart-item-count {
    font-size: 11px;
    opacity: 0.9;
    font-weight: 500;
    line-height: 1.2;
}

.cart-summary-actions {
    padding: 0 16px 12px;
    display: flex;
    gap: 8px;
}

.cart-action-btn {
    flex: 1;
    padding: 8px 12px;
    border-radius: 10px;
    text-decoration: none;
    text-align: center;
    font-weight: 600;
    font-size: 11px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    position: relative;
    overflow: hidden;
    line-height: 1;
}

.cart-action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s;
}

.cart-action-btn:hover::before {
    left: 100%;
}

.cart-action-btn i {
    font-size: 10px;
}

.view-cart-btn {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.view-cart-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.checkout-btn {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.checkout-btn:hover {
    background: linear-gradient(135deg, #218838, #1aa085);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
}

/* Pulse animation for new items */
@keyframes cartSummaryPulse {
    0% {
        transform: translateX(0) scale(1);
    }

    50% {
        transform: translateX(0) scale(1.03);
    }

    100% {
        transform: translateX(0) scale(1);
    }
}

.live-cart-summary.pulse {
    animation: cartSummaryPulse 0.5s ease;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .live-cart-summary {
        bottom: 12px;
        right: 12px;
        max-width: 150px;
    }

    .cart-summary-header {
        padding: 10px 14px;
        gap: 10px;
    }

    .cart-icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .cart-total-amount {
        font-size: 16px;
    }

    .cart-item-count {
        font-size: 10px;
    }

    .cart-summary-actions {
        padding: 0 14px 10px;
        gap: 6px;
    }

    .cart-action-btn {
        padding: 7px 10px;
        font-size: 10px;
    }

    .cart-action-btn i {
        font-size: 9px;
    }
}

@media (max-width: 576px) {
    .live-cart-summary {
        bottom: 10px;
        right: 10px;
        max-width: 180px;
    }

    .cart-summary-header {
        padding: 10px 12px;
    }

    .cart-total-amount {
        font-size: 15px;
    }

    .cart-summary-actions {
        padding: 0 12px 10px;
        gap: 6px;
        flex-direction: column;
    }

    .cart-action-btn {
        padding: 8px 10px;
        font-size: 10px;
        gap: 3px;
    }
}

@media (max-width: 480px) {
    .live-cart-summary {
        max-width: calc(100vw - 20px);
    }

    .cart-summary-actions {
        flex-direction: column;
        /* Make buttons vertical on very small screens */
    }

    .cart-action-btn {
        padding: 6px 8px;
        font-size: 9px;
    }

    .cart-total-amount {
        font-size: 14px;
    }

    .cart-item-count {
        font-size: 9px;
    }
}

/* --- Modal ScrollNav & Responsiveness --- */
#productModal .modal-dialog {
    max-width: 600px;
    width: 95vw;
}

#productModal .modal-content {
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#productModal .modal-body {
    overflow-y: auto;
    flex: 1 1 auto;
    padding-bottom: 0;
}

.product-modal-scrollnav {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.95);
    z-index: 2;
    display: flex;
    gap: 1.5rem;
    border-bottom: 1px solid #eee;
    padding: 0.5rem 0;
    margin-bottom: 1rem;
}

.product-modal-scrollnav a {
    color: #007bff;
    font-weight: 600;
    text-decoration: none;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.product-modal-scrollnav a.active,
.product-modal-scrollnav a:hover {
    background: #e9f5ff;
}

/* --- Hero Section Readability --- */
@media (max-width: 576px) {
    .hero-title {
        font-size: 1.5rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .hero-description {
        font-size: 1rem;
    }
}