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;
}


/* my cart edit section */

.library{
    padding-top: 80px;
    margin-left: 250px;
    margin-right: 250px;
    margin-bottom: 20px;
}
.my-library{
    margin-top: 40px;
}
.my-library p{
    margin-top: -14px;
}
.download{
    display: flex;
    margin-top: 40px;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #c7a6a6;
}
.download:last-child {
    margin-bottom: 0;
}
.img img{
    margin-top: 0px;
}
.img {
    flex-shrink: 0; 
}

.namelly {
    width: 220px;
    flex-shrink: 0;
}
.namelly h3{
    font-size: 20px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.namelly p{
    margin-top: -15px;
    font-size: 16px;
    color: rgb(107, 106, 106);
}
.ready{
    text-align: right;
     margin-left: auto;
}
.ready button{
    border: none;
    margin-top: 20px;
    padding-left: 15px;
    padding-right: 10px;
    padding-top: 7px;
    padding-bottom: 7px;
    border-radius: 5px;
    background-color: rgb(192, 187, 187);
    cursor: pointer;
}




.checkout{
    display: flex;
    margin-left: 250px;
    gap: 550px;
}
.total h2{
    font-size: 17px;
    font-family: Arial, Helvetica, sans-serif;
    
}
.downloaded{
    margin-left: 30px;
    margin-top: 15px;
}
.downloaded button{
    padding-bottom: 10px;
    padding-top: 10px;
    padding-left: 20px;
    padding-right: 20px;
    background: black;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-top: -10px;
}


@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 (same as the other pages) ---------- */
    .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; /* stops iOS zooming in on focus */
    }

    .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;
    }

    /* ---------- cart list ---------- */
    .library{
        padding: 0 16px;
        margin: 0 0 8px;
    }
    .my-library{
        margin: 0;
        padding-top: 20px;
    }
    .my-library h1{
        margin: 0;
        font-size: 24px;
    }
    .empty-cart{
        margin-top: 20px;
    }

    .download{
        align-items: center;
        gap: 12px;
        margin-top: 0;
        padding: 14px 0;
    }
    .img img{
        display: block;
        width: 50px;
        height: 70px;
        object-fit: cover;
        border-radius: 4px;
    }
    /* title takes the free space and truncates instead of pushing Remove off screen */
    .namelly{
        flex: 1;
        width: auto;
        min-width: 0;
    }
    .namelly h3{
        margin: 0 0 4px;
        font-size: 16px;
    }
    .namelly p{
        margin: 0;
        font-size: 15px;
    }
    .ready{
        margin-left: 0;
        flex-shrink: 0;
    }
    .ready button{
        margin: 0;
        padding: 9px 12px;
        font-size: 13px;
    }

    /* ---------- checkout bar: stays pinned to the bottom of the screen ---------- */
    .checkout-part{
        position: sticky;
        bottom: 0;
        z-index: 100;
        background: #faf6ef;
        border-top: 1px solid #E3DCC9;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
    .checkout{
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin: 0;
        padding: 12px 16px;
    }
    .total h2{
        margin: 0;
        font-size: 17px;
    }
    .downloaded{
        margin: 0;
    }
    .downloaded button{
        margin: 0;
        padding: 12px 24px;
        font-size: 15px;
    }
}