body{
    background-color: #faf6ef;
}



.page-loader{
  position:fixed; inset:0;
  background:#fff;
  display:none; align-items:center; justify-content:center;
  z-index:200;
}
.page-loader.show{ display:flex; }

.buffer-spinner{
  position:relative;
  width:44px; height:44px;
}
.buffer-spinner .dash{
  position:absolute;
  top:50%; left:50%;
  width:3px; height:11px;
  border-radius:2px;
  background:#7A2E2E;
  opacity:0.2;
  transform: translate(-50%, -50%) rotate(var(--angle)) translateY(-18px);
  animation: bufferFade 1s linear infinite;
}
.buffer-spinner .dash:nth-child(1){ --angle:0deg;   animation-delay:0s; }
.buffer-spinner .dash:nth-child(2){ --angle:45deg;  animation-delay:0.125s; }
.buffer-spinner .dash:nth-child(3){ --angle:90deg;  animation-delay:0.25s; }
.buffer-spinner .dash:nth-child(4){ --angle:135deg; animation-delay:0.375s; }
.buffer-spinner .dash:nth-child(5){ --angle:180deg; animation-delay:0.5s; }
.buffer-spinner .dash:nth-child(6){ --angle:225deg; animation-delay:0.625s; }
.buffer-spinner .dash:nth-child(7){ --angle:270deg; animation-delay:0.75s; }
.buffer-spinner .dash:nth-child(8){ --angle:315deg; animation-delay:0.875s; }

@keyframes bufferFade{
  0%   { opacity:1; }
  100% { opacity:0.2; }
}





.bar{
    display: flex;
    padding-bottom: 20px;
    border-bottom: 1px solid #E3DCC9;
    background-color: #faf6ef;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 999;
}
.name{
    font-size: 20px;
    margin-top: -5px;
    margin-left: 30px;
}
.search{
    margin-left: 100px;
}
.search input{
    margin-top: 20px;
    height: 35px;
    width: 250px;
    border-radius: 8px;
    background-color: #F1EBDD;
    border: 1px solid #beaf8d;
}
.search button{
    font-size: 20px;
    background-color: #F1EBDD;
}
.button{
    margin-left: 100px;
    margin-top: 15px;
  display:flex;
  gap:4px;
  background: #F1EBDD;
  border:1px solid  #E3DCC9;
  border-radius:8px;
  padding:10px;
  padding-top: 7px;
  padding-bottom: -40px;
  margin-bottom: 0px;
}
.button button{
    padding:8px 16px;
  background:transparent;
  border-radius:5px;
  font-size:13.5px;
  color:#5C584F;
  font-weight:500;
  border: none;
  cursor: pointer;
}
.button button:hover{
    background:#211f1c;
  color:#faf6ef;
}
.cart{
    padding-top: 25px;
    margin-left: 140px;
    position: relative;
    display: inline-block;
}


.cart-count {
    position: absolute;
    top: 20px;
    right: -8px;
    background: #7A2E2E;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sign{
    margin-left: 70px;
    margin-top: 25px;
}
.sign button{
    padding-bottom: 10px;
    padding-top: 10px;
    padding-left: 15px;
    padding-right: 15px;
    background: #7A2E2E;
    color: white;
    border: none;
    border-radius: 5px;
    text-decoration: none;
}
.user-chip {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}
.user-icon {
    font-size: 20px;
}
.user-name {
    font-size: 18px;
    font-weight: 500;
}
.user-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border: 1px solid #E3DCC9;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    min-width: 120px;
    overflow: hidden;
    z-index: 50;
}
.user-dropdown.open {
    display: block;
}
.user-dropdown a {
    display: block;
    padding: 10px 14px;
    font-size: 13px;
    color: #5C584F;
    text-decoration: none;
}
.user-dropdown a:hover {
    background: #F1EBDD;
}




.hero{
    background-color: #faf6ef;
    padding-bottom: 80px;
}
.top-hero{
   padding-top: 80px;
    display: flex;
    align-items: center;
    gap: 50px;
    margin-left:120px;
}
.left-hero{
    margin-top: 50px;
}
.left-hero h1{
    font-size: 49px;
}
.left-hero p{
    font-size: 19px;
    margin-top: -15px;
}
.browse{
    margin-top: 30px;
}
.browse button{
     padding-bottom: 15px;
    padding-top: 15px;
    padding-left: 25px;
    padding-right: 25px;
    background: white;
    color: black;
    border: 1px solid rgb(213, 164, 129);
    border-radius: 5px;
    box-shadow: 1 5px 10px rgba(0, 10, 10, 10);
}
.browse button:hover{
    background-color: #7A2E2E;
    color: white;
}

/* the stack part */
.stack{
    position: relative;
    height: 200px;
    width: 200px;
    margin-left: 100px;
    z-index: 1;
}
.cover{
    position: absolute;
    top: 0;
    left: 0;
    width: 180px;
    height: 250px;
    border-radius: 14px;
    box-shadow: 0 18px 30px rgba(0, 0, 0, 0,);
    align-items: flex-end;
    display: flex;
    padding: 5px;
    overflow: hidden;
}
.cover.front{
    background: #7a2c2c;
    transform: rotate(-9deg) translate(-46px,14px);
    z-index: 1;
}
.cover.back{
    margin-top: -10px;
    background: #3f6157;
    transform: rotate(8deg) translate(46px,20px);
    z-index: 2;
}
.cover img{
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.cover.mid{
    margin-top: -20px;
    background: #c99a2e;
    transform: rotate(-1deg);
    z-index: 3;
}
.cover span{
    font-family: georgia,serif;
    font-size: 20px;
    font-weight: 700;
    color: #fdf9ee;
    position: relative;
    z-index: 1;
}

/* the grid part which shows rate */

.rate{
    background-color: #faf6ef;
}


/* spinner area */
.mini-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #E3DCC9;
    border-top-color: #7A2E2E;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
/* end */

.trust-grid{
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: #fdf9ee;
    border: 1px solid #e3dcc9;
    border-radius: 12px;
    overflow: hidden;
    margin-left: 120px;
    margin-right: 140px;
}
.trust-item{
    border-right: 1px solid #e3dcc9;
    background: #faf6ef;
    padding: 2px 2px;
    text-align: center;
}
.trust-item h1{
    font-family: 'lora' serif;
    font-weight: 700;
    color: #7a2e2e;
}
.trust-item p{
    margin-top: -10px;
    color: #5c5c5e;
    font-size: 15px;
}


/* this is the tab section */

.heroo{
    background-color: #faf6ef;
}
.tabs{
    padding-top: 80px;
    padding-left: 110px;
}
.tabs button{
     padding-bottom: 8px;
    padding-top: 8px;
    padding-left: 15px;
    padding-right: 15px;
    background: #faf6ef;
    color: black;
    border: 1px solid #e9cc99;
    border-radius: 15px;
    margin-left: 10px;
}
.all {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 16px;
    padding-bottom: 12px;
    scrollbar-width: none;
}

.card {
    flex-shrink: 0;
}

.all::-webkit-scrollbar {
    display: none;
}

.tabs button:hover{
    background-color: black;
    color: white;
}
.tab.active{
    background-color: black;
    color: white;
}



.overall{
    display: none;
}
.overall.active{
    display: block;
}
.month{
    padding-left: 120px;
    font-size: 20px;
    display: flex;
    gap: 700px;
}
.all-link{
    margin-top: 60px;
    color: #7a2e2e;
    text-decoration: none;
    font-size: 17px;
}

.card{
    padding-left: 120px;
    padding-top: 10px;
    margin-right: -130px;
}

.card img{
    width: 250px;
    height: 350px;
}
.card-title{
    margin-top: 10px;
    font-size: 20px;
}
.card-text{
    margin-top: -30px;
    font-size: 15px;
    color: rgb(139, 138, 138);
}
.list-group{
    margin-top: -10px;
    list-style: none;
    margin-left: -40px;
    color: #b8923f;
}
.all-down{
    display: flex;
}




.new-account{
    display: grid;
    grid-template-columns: 1fr;
    background-color: #211f1c;
    color: #faf6ef;
    border-radius: 15px;
    margin-top: 40px;
    margin-left: 110px;
    margin-right: 50px;
    padding-left: 40px;
    padding-top: 15px;
    padding-bottom: 15px;
    margin-bottom: 50px;
}
.new-account h1{
    font-family:  serif;
    font-size: 25px;
}
.new-account p{
    font-family: 'lora' serif;
    margin-top: -10px;
    font-size: 16px;
}
.create-account{
    text-align: end;
    margin-right: 20px;
    margin-top: -65px;
}
.create-account  button{
    padding-left: 20px;
    padding-right: 20px;
    border-radius: 10px;
    border: none;
    background-color: #b8923f;
    cursor: pointer;
}
.create-account h2{
    font-size: 15px;
}



.footer{
    display: flex;
    gap: 140px;
    background-color: #f1ebdd;
    padding-left: 120px;
}
.footer h1{
    padding-top: 30px;
    font-size: 25px;
}
.footer h2{
    padding-top: 40px;
    font-size: 18px;
}
.footer p{
    margin-top: -7px;
    font-size: 16px;
    color: rgb(93, 92, 92);
}
.footer a{
    text-decoration: none;
}
.flex input{
    height: 35px;
    width: 200px;
    border-radius: 8px;
    background-color: #F1EBDD;
    border: 1px solid #beaf8d;
}
.flex button{
    padding-bottom: 10px;
    padding-top: 10px;
    padding-left: 15px;
    padding-right: 15px;
    background: #7A2E2E;
    color: white;
    border: none;
    border-radius: 5px;
}


/* phone */
@media (max-width: 768px){

    html, body{
        overflow-x: hidden;
        width: 100%;
    }
    *, *::before, *::after{
        box-sizing: border-box;
    }
    /* header is fixed, so push the page down by its height */
    body{
        padding-top: 150px;
    }

    /* ---------- header ---------- */
    .bar{
        display: grid;
        grid-template-columns: 1fr auto auto;
        grid-template-areas:
            "name   cart   sign"
            "search search search"
            "menu   menu   menu";
        align-items: center;
        column-gap: 14px;
        row-gap: 8px;
        padding: 8px 14px 10px;
    }
    .bar > a:first-child{ grid-area: name; }
    .bar > a.nav-link{ grid-area: cart; }
    .search{ grid-area: search; margin: 0; }
    .button{ grid-area: menu; }
    .sign{ grid-area: sign; }

    .name{
        margin: 0;
        font-size: 18px;
    }
    .name h3{
        margin: 0;
    }

    .search .container-fluid{
        padding: 0;
    }
    .search form{
        margin: 0;
    }
    .search input{
        display: block;
        width: 100%;
        margin: 0;
        height: 38px;
        padding: 0 12px;
        font-size: 16px; /* 16px stops iOS from zooming in when focused */
    }

    .button{
        width: 100%;
        margin: 0;
        padding: 4px;
        justify-content: space-between;
        gap: 2px;
        overflow-x: auto;
        scrollbar-width: none;
    }
    .button::-webkit-scrollbar{ display: none; }
    .button a{
        flex: 1;
    }
    .button button{
        width: 100%;
        padding: 8px 6px;
        font-size: 13px;
        white-space: nowrap;
    }

    .cart{
        margin: 0;
        padding: 6px 0 0;
    }
    .cart-count{
        top: -4px;
        right: -8px;
    }
    .sign{
        margin: 0;
    }
    .sign button{
        padding: 8px 12px;
        font-size: 13px;
    }
    .user-name{
        font-size: 14px;
        max-width: 80px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .user-icon{
        font-size: 18px;
    }

    /* ---------- hero ---------- */
    .hero{
        padding-bottom: 30px;
    }
    .top-hero{
        padding: 20px 16px 0;
        margin: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 36px;
    }
    .left-hero{
        margin-top: 0;
    }
    .left-hero h1{
        width: auto;
        font-size: 30px;
        line-height: 1.2;
        margin: 0 0 12px;
    }
    .left-hero br{
        display: none;
    }
    .left-hero p{
        display: block;
        font-size: 16px;
        line-height: 1.5;
        margin: 0;
    }
    .browse{
        display: flex;
        gap: 10px;
        margin-top: 20px;
    }
    .browse a{
        flex: 1;
    }
    .browse button{
        width: 100%;
        padding: 12px 10px;
        font-size: 14px;
    }
    .browse .btn-ghost{
        flex: 1;
        padding: 12px 10px;
        font-size: 14px;
        background: transparent;
        border: 1px solid #E3DCC9;
        border-radius: 5px;
    }

    /* book stack: centred and sized for a phone */
    .stack{
        width: 180px;
        height: 280px;
        margin: 0 auto;
    }
    .cover{
        width: 160px;
        height: 225px;
    }

    /* ---------- trust grid ---------- */
    .trust-grid{
        margin: 20px 16px 0;
        grid-template-columns: repeat(2, 1fr);
        gap: 1px;
    }
    .trust-item{
        padding: 12px 8px;
        border-right: none;
        border-bottom: 1px solid #e3dcc9;
    }
    .trust-item h1{
        font-size: 24px;
        margin: 0 0 6px;
    }
    .trust-item p{
        margin: 0;
        font-size: 13px;
    }

    /* ---------- tabs ---------- */
    .tabs{
        display: flex;
        gap: 8px;
        padding: 30px 16px 0;
        margin: 0;
        overflow-x: auto;
        scrollbar-width: none;
    }
    .tabs::-webkit-scrollbar{ display: none; }
    .tabs button{
        margin: 0;
        flex-shrink: 0;
        white-space: nowrap;
        font-size: 14px;
    }

    .month{
        padding: 0 16px;
        margin: 0;
        gap: 0;
        justify-content: space-between;
        align-items: center;
    }
    .month h1{
        font-size: 22px;
    }
    .all-link{
        margin-top: 0;
        font-size: 15px;
    }

    /* ---------- book cards (horizontal swipe row) ---------- */
    .all{
        padding: 0 16px 12px;
        gap: 14px;
        scroll-snap-type: x mandatory;
    }
    .card{
        width: 150px !important; /* overrides the inline width:18rem */
        padding: 0;
        margin: 0;
        scroll-snap-align: start;
        color: #211f1c;
    }
    .card img{
        width: 100%;
        height: 210px;
        object-fit: cover;
        border-radius: 8px;
    }
    .card-body{
        padding: 8px 0 0;
    }
    .card-title{
        margin: 0 0 4px;
        font-size: 15px;
        line-height: 1.25;
    }
    .card-text{
        margin: 0;
        font-size: 13px;
        color: rgb(139, 138, 138);
    }
    .list-group{
        margin: 6px 0 0;
        padding: 0;
        font-size: 13px;
        color: #b8923f;
    }
    .list-group-item{
        list-style: none;
    }

    .staff{
        padding-top: 20px;
    }

    /* ---------- create account banner ---------- */
    .create{
        display: block;
    }
    .new-account{
        margin: 24px 16px;
        padding: 20px;
    }
    .new-account h1{
        font-size: 20px;
        margin: 0 0 8px;
    }
    .new-account p{
        margin: 0;
    }
    .create-account{
        margin: 16px 0 0;
        text-align: start;
    }
    .create-account button{
        width: 100%;
        padding: 10px 20px;
    }

    /* ---------- footer ---------- */
    .footer{
        flex-wrap: wrap;
        gap: 0 24px;
        margin: 0;
        padding: 0 16px 24px;
    }
    .footer br{
        display: none;
    }
    .me{
        width: 100%;
    }
    .shop-foot,
    .support-foot{
        width: calc(50% - 12px);
    }
    .stay-foot{
        display: block;
        width: 100%;
    }
    .flex{
        display: flex;
        gap: 8px;
    }
    .flex input{
        flex: 1;
        min-width: 0;
        font-size: 16px;
        padding: 0 10px;
    }
}

/* ---------- very small phones (iPhone SE, small Androids) ---------- */
@media (max-width: 380px){
    body{
        padding-top: 156px;
    }
    .left-hero h1{
        font-size: 26px;
    }
    .browse{
        flex-direction: column;
    }
    .card{
        width: 138px !important;
    }
    .card img{
        height: 190px;
    }
}