html, body {
  height: 100%;
}

main.collection {
        /* padding: 1rem; */
        flex: 1;
        display: flex;
        height: 100vh;
        max-height: 100vh;
        overflow: hidden;
      }

/* Left info panel */
.left-panel {
    flex: 0 0 30%;
    min-width: 250px;          /* ensure minimum width for readability */
    max-width: 35%;
    padding: 1rem;
    max-height: 100%;
    position: sticky;
    flex-direction: column;
    position: static;             /* remove sticky behavior for simplicity */
    top: auto;                    /* reset the top offset */
    margin: 0;
}

.left-panel h2 {
    font-size: 2.25rem;
    margin-bottom: 1rem;
}

.left-body {
    flex: 0 0 auto;
    height: 70vh; /* shrink-wrap to its content */
    margin-top: 1rem;
    background: #fff;
    border-radius: 2rem;
    position: sticky;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    overflow-y: auto;           /* allow vertical scrolling */
    overflow-x: auto;           /* allow horizontal scrolling */
}
.empty-msg {
    text-align: center;
    color: #666;
}

.empty-state {
    align-items: center;
    text-align: center;
    color: #666;
}

/* Right list / grid */
.card-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}


.filters-bar{
  color: #b4d2ba;
  display:flex;
  align-items:center;
  padding: 2rem;
}

.filter-group{
    flex:1;
}
.filter-select {
  padding: 0.5rem 0.75rem;
  border-radius: 1rem;
  border: 1px solid var(--border, #e0e0e0);
  font-size: 1rem;
  
  background: var(--bg, #fff);
  cursor: pointer;
  color: #ffffff;             /* white text */
  background-color: #b4d2ba;  /* blue background (bootstrap‐style) */
  border: none;
  cursor: pointer;
}



.cards-scroll{
    flex:1 1 auto;
    overflow-y:auto;
    padding-top:1rem
}


.collection-header {
display: flex;
align-items: center;
gap: 1rem;
margin-bottom: 1rem;
}
.collection-header h2 {
margin-right: auto;
font-size: 1.3rem;
}

.clear-deck-btn {
background: transparent;
border: none;
font-size: 0.9rem;
cursor: pointer;
}

.card-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
gap: 1.5rem;
}

.deck-list {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
gap: 5rem;
padding-left: 1.5rem;
padding-right: 1.5rem;
}

.detail-card h3{
    text-align: center;

  overflow: auto;
}


/* ------------------ Individual restaurant card  ------------------ */

.collection-card-front {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;     /* Smooth flipping */
    transform-style: preserve-3d;   /* Allow 3D children rendering */
    position: relative;
    background-color: #ffffff;
    z-index: 2; /* Ensure it's above the back side initially */
    max-width: 15rem;
    max-height: 26rem;
    padding: 0.75rem;
    padding-bottom: 2rem;
    border-radius: 2rem;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,.06);
 }

 .collection-card-front h2{
    font-size: 2rem;
    max-width: 100%;
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    max-height: 2.4em; /* 2 lines * 1.2 line-height */
 }

 
 .collection-card-front .card-details {
    padding: 0.5rem 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    font-size: 1.25rem;
    gap: 0.8rem;
 }


.collection-card-front .tags {
display: flex;
flex-direction: row;
gap: 0.25rem;
margin-top: 2rem;
align-items: center;
}

.collection-card-front .tag {
font-size: 1rem;
border-radius: 1rem;
/* width: 3rem; */
background: #b4d2ba;
color: rgb(44, 43, 43);
}


.collection-card-front:hover {
transform: translateY(-4px);
box-shadow: 0 6px 8px rgb(0, 0, 0);
}

.clear-deck-btn {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  color: #fff;
  background-color: #ef6060;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: block;
  margin: 0 auto;
  margin-top: 3rem;
  margin-bottom: 3rem;
}


/* -------- Card Backside -------- */
.collection-card-back .div-imgs{
display:flex;
gap: .5rem;
}
.collection-card-back .div-imgs img{
width:7rem;
height:6rem;
margin-top:2rem;
margin-bottom:1.5rem;
object-fit:cover;
border-radius:.5rem;
}

.collection-card-back article{
background:#fff;
display:flex;
flex-direction:column;
gap: 1rem;
align-items:center;
flex:1 1 auto;
}

.collection-card-back .menu-images {
display: flex;
justify-content: center;
gap: 0.5rem;
margin-top: 0.75rem;
max-width: 100%;
}
 
 
.collection-card-back .menu-images img {
width: 70px;
height: 70px;
border-radius: 8px;
object-fit: cover;
}

.collection-card-back .link{
    font-size: 1.25rem;
    margin-top: 1.5rem;
}

 .collection-card-back h2{
    font-size: 2rem;
    max-width: 100%;
    text-align: center;
 }

 /* ==========================================================================================
   Mobile‐friendly overrides
   (max‐width: 600px or 768px, tweak to taste)
   ========================================================================================== */
@media (max-width: 550px) {

  /* 1) Stack the main <main class="collection"> vertically */
  header {
    width: 100vw;            /* force exactly the viewport width */
    max-width: 100vw;        /* ensure it never shrinks below full‐width */
  }

  html,
  body {
    overflow-x: hidden;
    overflow-y: auto;
    max-width: 100%;
    margin: 0;
    padding: 0;
  }

  main.collection {
    flex-direction: column;       /* instead of row */
    height: auto;                 /* allow natural page height */
    width: 100vw;            /* force exactly the viewport width */
    max-width: 100vw;
    margin: 0;
    padding:0;
    overflow-y: auto;
  }



  .filters-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.5rem;
    margin-top: 0;
  }

  .filter-group {
  flex: 1;  /* flex-grow:1, flex-shrink:1, flex-basis:0 → equal widths */
  min-width: 0;  /* allows the child select to shrink below its content size when needed */
  }

  .filter-select {
  display: inline-block;      /* shrink to fit content */
  width: 100%;               /* fill its .filter-group */
  /* padding: 4px 10px;         adjust for a compact pill */
  font-size: 0.8rem;         /* slightly smaller text */
  color: #ffffff;             /* white text */
  background-color: #b4d2ba;;  /* blue background (bootstrap‐style) */
  border: none;
  border-radius: 1rem;       /* full rounding → pill shape */
  cursor: pointer;
  appearance: none;           /* remove native arrow styling on some browsers */
}

  .card-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    height: 100%;
    width: 100%;
  }

.cards-scroll {
  flex: 1 1 auto;       /* take all remaining vertical space inside .card-area */
  overflow-y: auto;     /* enable its own vertical scrollbar */
  /* optional padding if you want a little gutter inside it: */
}

  /* 5) Adjust your grid so cards shrink a bit on phone */
  .deck-list {
    grid-template-columns: repeat(2, minmax(0, 48%)); 
    gap: 1rem;
    justify-content: center;
  }

  /* 6) Allow each card to grow to 100% width of its cell */
  .collection-card-front {
    width: 100%;
    margin: 0 auto;
    padding: 0.5rem;
    border-radius: 1rem;
    box-sizing: border-box;
  }

  /* 7) Reduce font‐sizes inside cards for better fit */
  .collection-card-front h2 {
    font-size: 1rem;
  }
  .collection-card-front .card-details {
    font-size: 1rem;
    gap: 0.5rem;
  }


  .left-body {
    position: static;
    max-height:550px;
    padding: 0.75rem;     /* reduce padding on mobile */
    border-radius: 2rem;  /* reduce border radius on mobile */
    overflow-y: auto;     /* ensure vertical scrolling works */
    overflow-x: auto;     /* ensure horizontal scrolling works */
    width: 100%;          /* ensure full width of parent */
  }

  .left-panel {
    max-width: 80%;
    min-width: unset;
    margin: 0 auto;
    padding: 0.5rem;
  }

  .left-panel h2 {
    text-align: center;
  }

    .collection-card-front .tags {
    display: flex;
    flex-direction: row;
    gap: 0.1rem;
    margin-top: 1rem;
    align-items: center;
    }

    .collection-card-front .tag {
    font-size: 0.4rem;
    border-radius: 1rem;
    background: #b4d2ba;
    color: rgb(44, 43, 43);
    }

    .collection-card-front .details {
    font-size: 1rem;
  }

    /* ---- "backside" ----  */
    .collection-card-back .card-details {
    padding: 0.5rem 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    font-size: 1.25rem;
    gap: 0.8rem;
    height: 50%;
  }

  /* ---------------------------
   "Return to collection" Button Styles
   --------------------------- */
    .back-button {
    display: inline-flex;
    align-items: center;
    background: transparent;
    border: none;
    padding: 0;
    font-family: "Segoe UI", Roboto, sans-serif;
    font-size: 1rem;
    color: #A67C52;
    cursor: pointer;
    margin-top: 2rem;
    }

    /* The arrow itself */
    .back-button-arrow {
    font-size: 2.4rem;
    margin-right: 0.5rem;
    line-height: 1;
    }


    .back-button-text {
    line-height: 1;
    font-size: 2rem;
    }

    #back-button {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    }

    .back-button:hover,
    .back-button:focus {
    background-color: rgba(166, 124, 82, 0.1);
    }

}
