:root{
    --bg-start: #eaf1ff;
    --bg-end: #f7f9ff;
    --primary-1: #3b82f6;
    --primary-2: #2563eb;
    --accent-green-1: #2ecc71;
    --accent-green-2: #27ae60;
    --danger-1: #e74c3c;
    --muted: #7f8c8d;
    --card-bg: #ffffff;
    --glass: rgba(255,255,255,0.6);
    --shadow-1: 0 8px 30px rgba(0,0,0,0.08);
    --shadow-2: 0 15px 40px rgba(0,0,0,0.12);
    --radius-lg: 12px;
    --radius-xl: 16px;
    --container-max: 1200px;
}

*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%}
body{
    font-family: 'Poppins', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    font-size:16px;
    line-height:1.5;
    color:#2c3e50;
    background: linear-gradient(135deg, var(--bg-start) 0%, var(--bg-end) 100%);
    -webkit-font-smoothing:antialiased;
    -moz-osx-font-smoothing:grayscale;
    min-height:100vh;
    padding-bottom:40px;
}


.container{
    max-width:var(--container-max);
    margin:0 auto;
    padding:0 20px;
}

.my-color { background-color: rgb(151,130,111); }
header{
    background: linear-gradient(135deg, rgb(151,130,111) 0%, rgb(225,209,196) 100%);
    color: #fff;
    padding: 14px 0;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
    position: sticky;
    top:0;
    z-index:1000;
    backdrop-filter: blur(6px);
}
.header-content{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:20px;
}
.logo{
    font-size:1.6rem;
    font-weight:700;
    letter-spacing:0.4px;
    background: rgb(171,0,62);
    -webkit-background-clip:text;
    -webkit-text-fill-color:transparent;
    background-clip:text;
}
.user-menu{
    display:flex;
    align-items:center;
    gap:10px;
    font-weight:500;
}
.user-menu span{
    background: rgba(255,255,255,0.7);
    padding:8px 12px;
    border-radius:999px;
    color: #ecf2ff;
    font-size:0.95rem;
}
.user-menu a{
    color: rgb(26,17,10);
    text-decoration:none;
    padding:8px 14px;
    border-radius: 20px;
    transition: all 0.22s ease;
    background: rgba(255,255,255,0.06);
    font-weight:600;
    font-size:0.95rem;
}
.user-menu a:hover{
    transform: translateY(-3px);
    background: rgba(255,255,255,0.12);
}

.message{
    padding:14px 18px;
    border-radius:10px;
    margin: 20px 0;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
    font-weight:600;
}
.success-message{
    background: linear-gradient(180deg, #dff3e8, #cfe9dc);
    color: #155724;
    border-left: 4px solid var(--accent-green-1);
}
.error-message{
    background: linear-gradient(180deg, #fdecea, #fbd6d6);
    color: #721c24;
    border-left: 4px solid var(--danger-1);
}

.book-details{
    display:flex;
    gap:40px;
    margin: 36px 0;
    background: var(--card-bg);
    padding: 28px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-1);
    transition: transform 0.28s ease, box-shadow 0.28s ease;
    align-items:flex-start;
}
.book-details:hover{
    transform: translateY(-6px);
    box-shadow: var(--shadow-2);
}

.book-images{
    flex:1;
    min-width:300px;
}
.main-image{
    width:100%;
    border-radius:12px;
    overflow:hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    transition: transform 0.35s ease;
    background: linear-gradient(180deg, #fff, #fafcff);
}
.main-image img{
    width:100%;
    height:auto;
    display:block;
    object-fit:cover;
    transition: transform 0.6s ease;
}
.main-image:hover img{ transform: scale(1.02); }

.thumbnail-images{
    display:flex;
    gap:10px;
    margin-top:16px;
}
.thumbnail{
    flex: 0 0 72px;
    width:72px;
    height:72px;
    border-radius:10px;
    overflow:hidden;
    border:2px solid transparent;
    cursor:pointer;
    transition: all 0.22s ease;
    box-shadow: 0 6px 14px rgba(0,0,0,0.06);
    background:#fff;
    display:flex;
    align-items:center;
    justify-content:center;
}
.thumbnail img{
    width:100%;
    height:100%;
    object-fit:cover;
    display:block;
}
.thumbnail:hover{ transform: translateY(-3px); border-color: #dfe9f7; }
.thumbnail.active{
    border-color: var(--primary-1);
    transform: translateY(-6px);
    box-shadow: 0 10px 20px rgba(59,130,246,0.18);
}

.book-info{
    flex:1;
    min-width:300px;
    display:flex;
    flex-direction:column;
    gap:12px;
}
.book-title{
    font-size:2rem;
    margin-bottom:6px;
    font-weight:700;
    color: #2c3e50;
    background: linear-gradient(90deg, #2c3e50, #3498db);
    -webkit-background-clip:text;
    -webkit-text-fill-color:transparent;
    background-clip:text;
}
.book-author{
    font-size:1.05rem;
    color:var(--muted);
    margin-bottom:10px;
    font-style:italic;
}
.book-description{
    font-size:1rem;
    color:#526074;
    line-height:1.7;
    margin-bottom:6px;
}
.pricing{
    display:flex;
    gap:20px;
    margin: 18px 0 8px 0;
}
.price-option{
    flex:1;
    padding:20px;
    border-radius:12px;
    background: linear-gradient(180deg, #fafbff, #ffffff);
    border:1px solid #eef3fb;
    text-align:center;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.price-option:hover{
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.06);
    border-color: rgba(52,152,219,0.25);
}
.price-option h3{ font-size:1.15rem; color:#2c3e50; margin-bottom:8px; font-weight:600; }
.price{ font-size:1.6rem; font-weight:700; color: var(--danger-1); margin-bottom:12px; }

.btn{
    display:inline-block;
    padding:12px 22px;
    border-radius:30px;
    font-weight:700;
    text-decoration:none;
    color:#fff;
    border:none;
    cursor:pointer;
    background: linear-gradient(135deg, var(--primary-1), var(--primary-2));
    box-shadow: 0 8px 20px rgba(59,130,246,0.18);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    font-size:0.98rem;
}
.btn:hover{ transform: translateY(-3px); box-shadow: 0 12px 28px rgba(59,130,246,0.20); }
.btn:active{ transform: translateY(-1px); }

.btn-success{
    background: linear-gradient(135deg, var(--accent-green-1), var(--accent-green-2));
    box-shadow: 0 8px 20px rgba(46,204,113,0.18);
}
.btn-warning{
    background: linear-gradient(135deg, #f39c12, #e67e22);
    box-shadow: 0 8px 20px rgba(243,156,18,0.16);
}
.btn-disabled{
    background:#95a5a6;
    box-shadow:none;
    cursor:not-allowed;
}

.demo-btn-container{
    text-align:center;
    margin-top:14px;
    padding-top:12px;
    border-top:1px solid #f1f4f8;
}

.user-books{
    background:var(--card-bg);
    padding:20px;
    border-radius:12px;
    box-shadow:var(--shadow-1);
    margin-bottom:30px;
}


footer{
        background: linear-gradient(135deg, rgb(151,130,111) 0%, rgb(225,209,196) 100%);
    color:black;
    text-align:center;
    padding:26px 0;
    margin-top:30px;
    border-radius:8px;
}

.modal{
    display:none; /* toggled by JS */
    position:fixed;
    z-index:1200;
    left:0;
    top:0;
    width:100%;
    height:100%;
    background-color: rgba(10,12,18,0.75);
    backdrop-filter: blur(6px);
    animation: modalFade 220ms ease;
    -webkit-overflow-scrolling: touch;
}
@keyframes modalFade{
    from{opacity:0}
    to{opacity:1}
}
.modal-content{
    position:relative;
    margin: 2% auto;
    width:92%;
    max-width:1100px;
    height:86%;
    background:var(--card-bg);
    border-radius:14px;
    overflow:hidden;
    box-shadow: 0 25px 60px rgba(0,0,0,0.6);
    display:flex;
    flex-direction:column;
    animation: modalSlide 260ms cubic-bezier(.2,.9,.2,1);
}
@keyframes modalSlide{
    from{transform:translateY(-20px); opacity:0}
    to{transform:translateY(0); opacity:1}
}

.modal-header{
    padding:14px 20px;
    background: linear-gradient(135deg, #2c3e50 0%, #4a6491 100%);
    color:white;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
}
.modal-title{
    font-size:1.2rem;
    font-weight:700;
}
.close-modal{
    background:none;
    border:none;
    color:white;
    font-size:1.4rem;
    width:40px;
    height:40px;
    border-radius:50%;
    cursor:pointer;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    transition: background 0.18s;
}
.close-modal:hover{ background: rgba(255,255,255,0.08); }

.modal-body{
    height: calc(100% - 60px);
    display:flex;
    flex-direction:column;
}


.flipbook-controls{
    padding:12px 18px;
    background:#fbfdff;
    border-bottom:1px solid #eef3fb;
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:12px;
}
.flipbook-nav{
    display:flex;
    gap:10px;
    align-items:center;
}
.flipbook-nav button{
    padding:10px 14px;
    border-radius:20px;
    font-weight:600;
    background: linear-gradient(135deg, var(--primary-1), var(--primary-2));
    border:none;
    color:white;
    cursor:pointer;
    transition: transform 0.16s, box-shadow 0.16s;
    box-shadow: 0 6px 14px rgba(59,130,246,0.14);
}
.flipbook-nav button:hover{ transform: translateY(-3px); }
.flipbook-nav button:disabled{
    background:#98a6bf;
    cursor: not-allowed;
    box-shadow:none;
}
.page-info{
    font-weight:700;
    color:#2c3e50;
}

.view-controls{ display:flex; gap:10px; align-items:center; }
.view-controls button{
    width:40px;height:40px;border-radius:50%;border:none;
    background: linear-gradient(135deg, var(--primary-1), var(--primary-2));
    color:white; cursor:pointer; box-shadow: 0 6px 14px rgba(59,130,246,0.14);
    transition: transform 0.16s;
}
.view-controls button:hover{ transform: translateY(-3px); }


.flipbook-container{
    flex:1;
    padding:18px;
    display:flex;
    align-items:center;
    justify-content:center;
    background: linear-gradient(180deg, #f7f9fc, #f2f5f9);
    overflow:hidden;
}
.book-vertical{
    width:360px;
    height:520px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 18px 40px rgba(0,0,0,0.3);
    overflow:hidden;
    position:relative;
    display:flex;
    align-items:center;
    justify-content:center;
}
@media (max-width: 768px){
    .book-vertical{ width:320px; height:480px; }
}
@media (max-width:480px){
    .book-vertical{ width:280px; height:420px; }
}


.page-container{
    position:absolute;
    top:0; left:0;
    width:100%; height:100%;
    display:flex;
    flex-direction:column;
    transition: transform 420ms cubic-bezier(.22,.9,.3,1);
    will-change: transform;
}
.page{
    width:100%; height:100%; flex-shrink:0;
    display:flex; align-items:center; justify-content:center;
    background: white; position:relative; overflow:hidden;
}
.page img{
    max-width:100%; max-height:100%; object-fit:contain;
    transition: transform 220ms ease;
}
.page-cover{
    display:flex; flex-direction:column; align-items:center; justify-content:center;
    color:white; text-align:center; padding:24px;
    background: linear-gradient(180deg, #2c3e50, #4a6491);
}
.page-cover h2{ font-size:1.6rem; margin-bottom:8px; text-shadow:0 3px 10px rgba(0,0,0,0.25); }
.page-cover p{ font-size:1rem; opacity:0.95; }


.page-indicator{
    position:absolute; bottom:10px; right:10px;
    background: rgba(0,0,0,0.65);
    color:white; padding:6px 10px; border-radius:14px;
    font-size:0.9rem; z-index:10;
}


.demo-notice{
    text-align:center;
    padding:12px 16px;
    background:#fff3cd;
    color:#856404;
    border-radius:8px;
    border:1px solid #ffeaa7;
    margin:12px 0;
    box-shadow: 0 6px 16px rgba(0,0,0,0.04);
}
.scroll-hint{
    text-align:center;
    padding:10px;
    color:#666;
    font-size:0.95rem;
    display:none;
}
@media (max-width:768px){ .scroll-hint{ display:block } }

.hidden{ display:none !important; }
.center{ display:flex; align-items:center; justify-content:center; }
.mt-8{ margin-top:8px; }
.mb-8{ margin-bottom:8px; }

@media (max-width: 992px){
    .book-details{
        flex-direction:column;
        padding:20px;
        gap:18px;
    }
    .pricing{ flex-direction:column; }
}
@media (max-width:480px){
    .logo{ font-size:1.4rem }
    .user-menu a, .user-menu span{ padding:6px 10px; font-size:0.85rem }
    .book-title{ font-size:1.4rem }
    .price{ font-size:1.3rem }
}


a:focus, button:focus, input:focus{
    outline: 3px solid rgba(76,139,245,0.18);
    outline-offset: 2px;
}

 #preorder-badge{
    position: fixed;
    left: 16px;
    bottom: 16px;
    z-index: 9999;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(0,0,0,0.85);
    color: #fff;
    padding: 10px 14px;
    border-radius: 10px;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 6px 18px rgba(0,0,0,0.35);
    backdrop-filter: blur(4px);
    cursor: default;
    transform: translateY(0);
    transition: transform 250ms ease, opacity 250ms ease;
  }

  #preorder-badge.hidden {
    transform: translateY(24px);
    opacity: 0;
    pointer-events: none;
  }

  #preorder-close{
    background: transparent;
    border: none;
    color: inherit;
    font-size: 15px;
    line-height: 1;
    padding: 4px;
    cursor: pointer;
    border-radius: 6px;
  }

  #preorder-close:focus{
    outline: 2px solid rgba(255,255,255,0.3);
    outline-offset: 2px;
  }

  /* Responsive adjustments */
  @media (max-width:420px){
    #preorder-badge{
      left: 10px;
      right: 10px;
      bottom: 12px;
      justify-content: space-between;
      width: auto;
      font-size: 13px;
      padding: 8px 10px;
    }
  }
  
  .book-benefits {
    margin-top: 30px;
    padding: 20px;
    background: #fff7e6;
    border-radius: 12px;
    border: 1px solid #ffd28a;
}

.benefits-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #b35a00;
}

.benefits-list {
    list-style: none;
    padding-left: 0;
}

.benefits-list li {
    font-size: 1.05rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #4d3a22;
}

.benefits-list i {
    color: #ff9900;
    font-size: 1.2rem;
}

 a, button, input {
    -webkit-tap-highlight-color: transparent;
}
        .stock-info {
            background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
            color: white;
            padding: 15px;
            border-radius: 8px;
            margin-bottom: 20px;
            text-align: center;
            font-weight: bold;
            box-shadow: 0 4px 15px rgba(238, 90, 82, 0.2);
            animation: pulse 2s infinite;
        }
        
        .stock-info.preorder {
            background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
        }
        
        @keyframes pulse {
            0% { transform: scale(1); }
            50% { transform: scale(1.02); }
            100% { transform: scale(1); }
        }
        
        /* Fullscreen Gallery Styles */
        .fullscreen-gallery {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.95);
            z-index: 9999;
            display: none;
            opacity: 0;
            transition: opacity 0.3s ease;
            overflow: hidden;
            touch-action: none;
            user-select: none;
        }
        
        .fullscreen-gallery.active {
            display: flex;
            opacity: 1;
        }
        
        .fullscreen-container {
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
            overflow: hidden;
            cursor: grab;
        }
        
        .fullscreen-container.grabbing {
            cursor: grabbing;
        }
        
        .fullscreen-image-wrapper {
            position: absolute;
            transition: transform 0.1s ease-out;
            will-change: transform;
        }
        
        .fullscreen-image {
            max-width: 100%;
            max-height: 100%;
            object-fit: contain;
            transform-origin: center center;
            transition: transform 0.3s ease;
            display: block;
        }
        
        .fullscreen-image.loaded {
            transform: scale(1);
        }
        
        .fullscreen-nav {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            background: rgba(255, 255, 255, 0.1);
            color: white;
            border: none;
            width: 60px;
            height: 60px;
            border-radius: 50%;
            font-size: 24px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
            backdrop-filter: blur(5px);
            z-index: 10001;
        }
        
        .fullscreen-nav:hover {
            background: rgba(255, 255, 255, 0.2);
            transform: translateY(-50%) scale(1.1);
        }
        
        .fullscreen-nav.prev {
            left: 20px;
        }
        
        .fullscreen-nav.next {
            right: 20px;
        }
        
        .fullscreen-close {
            position: absolute;
            top: 20px;
            right: 20px;
            background: rgba(255, 255, 255, 0.1);
            color: white;
            border: none;
            width: 50px;
            height: 50px;
            border-radius: 50%;
            font-size: 24px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
            z-index: 10000;
            backdrop-filter: blur(5px);
        }
        
        .fullscreen-close:hover {
            background: rgba(255, 255, 255, 0.2);
            transform: rotate(90deg);
        }
        
        .fullscreen-counter {
            position: absolute;
            bottom: 20px;
            left: 0;
            width: 100%;
            text-align: center;
            color: white;
            font-size: 18px;
            font-weight: 500;
            padding: 10px;
            background: rgba(0, 0, 0, 0.5);
            z-index: 10000;
        }
        
        .fullscreen-zoom-controls {
            position: absolute;
            bottom: 80px;
            right: 20px;
            display: flex;
            flex-direction: column;
            gap: 10px;
            z-index: 10001;
        }
        
        .fullscreen-zoom-btn {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.1);
            color: white;
            border: none;
            font-size: 20px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
            backdrop-filter: blur(5px);
        }
        
        .fullscreen-zoom-btn:hover {
            background: rgba(255, 255, 255, 0.2);
            transform: scale(1.1);
        }
        
        .fullscreen-zoom-info {
            position: absolute;
            top: 20px;
            left: 20px;
            color: white;
            background: rgba(0, 0, 0, 0.5);
            padding: 8px 15px;
            border-radius: 20px;
            font-size: 14px;
            z-index: 10001;
            display: none;
        }
        
        .main-image {
            cursor: zoom-in;
            transition: transform 0.3s ease;
        }
        
        .main-image:hover {
            transform: scale(1.01);
        }
        
        .thumbnail {
            cursor: pointer;
            transition: transform 0.2s ease;
        }
        
        .thumbnail:hover {
            transform: scale(1.05);
        }
        
        @media (max-width: 768px) {
            .fullscreen-nav {
                width: 50px;
                height: 50px;
                font-size: 20px;
            }
            
            .fullscreen-nav.prev {
                left: 10px;
            }
            
            .fullscreen-nav.next {
                right: 10px;
            }
            
            .fullscreen-close {
                width: 40px;
                height: 40px;
                font-size: 20px;
                top: 10px;
                right: 10px;
            }
            
            .fullscreen-counter {
                font-size: 16px;
                bottom: 10px;
            }
            
            .fullscreen-zoom-controls {
                bottom: 70px;
                right: 10px;
            }
            
            .fullscreen-zoom-btn {
                width: 45px;
                height: 45px;
                font-size: 18px;
            }
        }
 .floating-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #28a745;
    color: #fff;
    border: none;
    padding: 15px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 22px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .floating-menu {
    position: fixed;
    bottom: 80px;
    right: 20px;
    display: none;
    flex-direction: column;
    gap: 10px;
    z-index: 9999;
  }

  .floating-menu button {
    background: #ffffff;
    color: #333;
    border: 1px solid #28a745;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
    text-align: left;
  }

  .floating-menu button:hover {
    background: #e8ffe8;
  }