* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'swap', sans-serif;
  background: white;
}

header {
  display: flex;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #ddd;
}
.logo-box {
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    margin-right: 46px;
}

.left-menu {
    display: flex;
    align-items: center;
}

.left-menu, .right-menu {
    flex: 0 0 auto;
    width: 450px; 
}

.search-container {
  display: flex;
  align-items: center;
  justify-content: center; 
  flex: 1; 
}

.login-box {
  font-size: 24px;
  margin-left: auto;
  margin-right: 30px;
}

.register-box {
  font-size: 24px;
  margin-right: 15px;
}


.search-textbox {
  font-size: 18px;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 5px;
  width: 225px;
  margin-right: 8px;
  font-family: 'swap', sans-serif;
}


.search-box {
  font-size: 18px;
  background: #c71720;
  color: white;
  padding: 4px 8px;
  border-radius: 5px;
  cursor: pointer;
}

.search-box:hover {
  color: rgba(0,91,182,0.7);
}

.right-menu {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}



.token-box {
  padding: 5px 0px 0px 0px;
}

.nav-item {
    cursor: pointer;
    font-size: 24px;
    margin-right: 20px;
    white-space: nowrap;
}

.nav-item:hover {
  color: rgba(0,91,182,0.7);
}

.text-head, .buytoken{
    color: black;
    text-decoration: none; 
    font-weight: normal;   
    }

.profile {
    color: rgb(0, 0, 0);
    text-decoration: none;
}


.book-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px; 
  justify-content: center;
}

.book-box {
  border: 1px solid #ddd;
  padding: 20px 20px 50px 20px;
  text-align: center;
  width: 250px; 
  box-sizing: border-box;
  cursor: pointer;
}

.book-image {
  width: 208px;          
  height: 298px;       
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  margin-bottom: 8px;  
}

.book-title {
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  justify-content: vertical;
}
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
}

.modal-content {
  background-color: white;
  margin: 5% auto;
  padding: 20px;
  border-radius: 10px;
  width: 80%;
  max-width: 800px;
  position: relative;
}

.close {
  position: absolute;
  right: 20px;
  top: 15px;
  font-size: 30px;
  cursor: pointer;
}

.modal-body {
  display: flex;
  gap: 30px;
}

.modal-left {
  flex: 1;
  display: flex;
  gap: 15px;
}

.modal-image {
  width: 150px;
  height: 210px;
  background: #f0f0f0;
  margin-bottom: 12px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.modal-right {
  padding-top: 2px;
  flex: 2;
  font-family: 'swap', sans-serif;
}

.image-title-section {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.modal-labels {
  flex: 1;
  text-align: right;
}

.modal-labels p {
  margin-bottom: 8px;
  font-size: 14px;
}

.modal-values p {
  margin-bottom: 8px;
  font-size: 14px;
}

.dropdown-box {
  position: relative;
  margin-right: 38px;
  width: 170px;
}

.dropdown-box span {
  font-size: 24px;
  cursor: pointer;
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: #f9f9f9;
  min-width: 120px;
  box-shadow: 0px 8px 16px rgba(0,0,0,0.2);
  z-index: 1;
  top: 100%;
}

.dropdown-content a {
  color: black;
  padding: 9px 12px;
  text-decoration: none;
  display: block;
  font-size: 18px;
}

.dropdown-content a:hover {
  background-color: #f1f1f1;
}

.show {
  display: block;
}

.breadcrumb-box {
  font-size: 24px;
  padding: 15px;
  margin: 15px 0;
  margin-left: 100px;
  cursor: pointer;
  display: flex;
  gap: 10px;
}
.books-container {
  display: flex;
  gap: 15px;
  padding: 15px;
  flex-wrap: wrap;
  justify-content: center;
}



.book-image {
  width: 208px;
  height: 298px;
  background: #f0f0f0;
  margin-bottom: 8px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.book-title {
  font-size: 18px;
}

.action-buttons {
  margin-top: 20px;
  display: flex;
  gap: 5px;
  width: 50%;
}

.red-button {
  background: rgba(199,23,32,0.89);
  color: white;
  border: none;
  padding: 20px 20px;
  border-radius: 5px;
  font-size: 12px;
  font-family: 'swap', sans-serif;
  cursor: pointer;
  flex: 1;
  height: 35px;
  transition: background-color 0.3s;
}

.action-buttons {
  margin-top: 10px;
  display: flex;
  gap: 10px;
  width: 70%;
}

.red-button {
  background: rgba(199,23,32,0.89);
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 5px;
  font-size: 12px;
  font-family: 'swap', sans-serif;
  cursor: pointer;
  flex: 1;
  height: 35px;
  transition: background-color 0.3s;
}

#modalSummary {
  width: 100%;
  height: 80px;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-family: 'swap', sans-serif;
  font-size: 14px;
  resize: none;
  background-color: #f9f9f9;
}

.red-button:hover {
  background: rgba(199,23,32,1);
}

.breadcrumb-item {
  color: black;
  text-decoration: none; 
  font-weight: normal;
}

.breadcrumb-item.active-breadcrumb {
    color: #007bff !important;
    font-weight: bold;
}

.alert.buy{
  padding: 15px;
  background-color: #43f436;
  color: white;
  border-radius: 5px;
  position: fixed;
  top: 20%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2000;
  min-width: 300px;
  max-width: 90vw;
  text-align: center;
  box-shadow: 0 4px 24px rgba(0,0,0,0.18);
  margin: 0;
  opacity: 1;
  transition: opacity 0.5s;
}
.alert.buy.hide {
  opacity: 0;
  pointer-events: none;
}
.selected {
    color: rgba(0,91,182,1);
    font-weight: bold;
}
.alert.eorr{
  padding: 15px;
  background-color: #f43636;
  color: white;
  border-radius: 5px;
  position: fixed;
  top: 20%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2000;
  min-width: 300px;
  max-width: 90vw;
  text-align: center;
  box-shadow: 0 4px 24px rgba(0,0,0,0.18);
  margin: 0;
}

.error {
  padding: 15px;
  background-color: #f43636;
  color: white;
  border-radius: 5px;
  position: fixed;
  top: 20%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2000;
  min-width: 300px;
  max-width: 90vw;
  text-align: center;
  box-shadow: 0 4px 24px rgba(0,0,0,0.18);
  margin: 0;
  opacity: 1;
  transition: opacity 0.5s;
}
.error.hide {
  opacity: 0;
  pointer-events: none;
}

.modal-info {
  width: 80%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-info .row {
  display: grid;
  grid-template-columns: 120px 1fr; /* label fixed width, value ขยายตาม */
  gap: 25px;
  align-items: start;
}

.modal-info .row .label {
  text-align: right;
  font-weight: bold;
}

.modal-info .row .value {
  padding-top: 3px;
  text-align: left;
}

.breadcrumb-item:hover {
  color: rgb(0, 60, 255);
}