/* Store modal: sidebar (categories) + item list + detail panel, matching real Tibia's own
   three-pane layout. Reuses the same dark/gradient look as market.css and the same row-list
   conventions as modal.css's .offer-row / .character-row. */

.store-modal {
  background: #444 url("../png/bg.png") repeat;
  border: 1px solid #111;
  box-shadow: inset 0 0 0 1px #777, 0 4px 18px #000;
  color: #dedede;
  flex-direction: column;
  font-family: Verdana, Arial, sans-serif;
  font-size: 11px;
  height: min(600px, calc(100% - 20px));
  left: 50%;
  min-height: 480px;
  min-width: 760px;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(900px, calc(100% - 24px));
  z-index: 40000;
  display: none;
}

.store-body {
  display: grid;
  flex: 1 1 auto;
  gap: 10px;
  grid-template-columns: 170px minmax(0, 1.4fr) minmax(0, 1fr);
  min-height: 0;
  padding: 10px;
  box-shadow: none;
}

/* ---- Sidebar ---- */

.store-sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background-image: url("../png/bg2.png");
  box-shadow: inset 0 0 6px black;
  border: 1px solid black;
  padding: 4px;
}

.store-category-list {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1 1 auto;
  overflow-y: auto;
}

.store-category {
  padding: 5px 6px;
  cursor: pointer;
  border-radius: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.store-category:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

.store-category.selected {
  background-color: rgba(255, 255, 255, 0.22);
  font-weight: bold;
}

.store-category-arrow {
  margin-left: auto;
  opacity: 0.6;
  font-size: 9px;
}

.store-subcategory-list {
  list-style: none;
  margin: 0;
  padding: 0 0 4px 14px;
}

.store-subcategory {
  padding: 3px 6px;
  cursor: pointer;
  border-radius: 2px;
  opacity: 0.85;
}

.store-subcategory:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

.store-subcategory.selected {
  background-color: rgba(255, 255, 255, 0.18);
  opacity: 1;
  font-weight: bold;
}

.store-search-input {
  margin-top: 6px;
  box-sizing: border-box;
  width: 100%;
  color: white;
  background-image: url("../png/bg2.png");
  border: 1px solid black;
  padding: 4px;
}

/* ---- Main item list ---- */

.store-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.store-toolbar {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
}

.store-subcategory-select,
.store-sort-select {
  flex: 1 1 auto;
  min-width: 0;
  color: white;
  background-image: url("../png/bg2.png");
  border: 1px solid black;
  padding: 3px 4px;
}

/* The closed select box above picks up color/background from the rule above just fine, but
   the native popup list a browser opens for <option> ignores background-image entirely and,
   left with no background-color of its own, defaults to opaque white -- inheriting this
   modal's white text color on top of that made every unselected row unreadable (white on
   white), which is the "fica em branco" Douglas ran into. background-color/color on <option>
   itself IS respected by the popup even though nothing else about its chrome can be styled. */
.store-subcategory-select option,
.store-sort-select option {
  background-color: #2b2b2b;
  color: #ddd;
}

.store-item-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  background-image: url("../png/bg2.png");
  box-shadow: inset 0 0 6px black;
  border: 1px solid black;
  padding: 2px;
}

.store-item-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  cursor: pointer;
  border-radius: 2px;
}

.store-item-row:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

.store-item-row.selected {
  background-color: rgba(255, 255, 255, 0.22);
}

.store-item-icon {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  image-rendering: pixelated;
  display: flex;
  align-items: center;
  justify-content: center;
}

.store-item-icon-placeholder {
  width: 56px;
  height: 56px;
  border: 1px solid #222;
  background: linear-gradient(#5e5e5e, #343434);
  border-radius: 3px;
}

/* Premium Time/Blessings/Extras have no in-game sprite of their own (they are services, not
   items) -- these use the real Store icon artwork straight from png/storeicon instead. */
.store-icon-image {
  max-width: 100%;
  max-height: 100%;
  image-rendering: pixelated;
}

.store-item-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.store-item-price {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 3px;
  font-weight: bold;
  color: #f2d675;
}

.store-item-price-unavailable {
  color: #888;
  font-weight: normal;
  font-style: italic;
}

.store-empty-message {
  padding: 20px;
  text-align: center;
  color: #999;
}

/* ---- Detail panel ---- */

.store-detail {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background-image: url("../png/bg2.png");
  box-shadow: inset 0 0 6px black;
  border: 1px solid black;
  padding: 10px;
  overflow-y: auto;
}

.store-detail-empty {
  margin: auto;
  color: #999;
  text-align: center;
  padding: 20px;
}

.store-detail-icon {
  width: 128px;
  height: 128px;
  margin: 0 auto 8px;
  image-rendering: pixelated;
  display: flex;
  align-items: center;
  justify-content: center;
}

.store-detail-name {
  text-align: center;
  font-weight: bold;
  font-size: 13px;
  margin-bottom: 6px;
}

.store-detail-price {
  text-align: center;
  font-weight: bold;
  color: #f2d675;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-bottom: 10px;
}

.store-detail-bundles {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.store-detail-bundle-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 6px;
  border: 1px solid black;
  background-color: rgba(0, 0, 0, 0.2);
  cursor: pointer;
  border-radius: 2px;
}

/* Quantity stepper for Potions/Runes: a plain per-unit price scaled by a whole-number amount
   the player picks with -/+ (1x = one unit batch, 2x = two, ...), rather than the real Store's
   two fixed bulk-discount tiers -- Douglas asked for the simpler linear version. */
.store-detail-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 10px;
}

.store-detail-stepper-button {
  width: 22px;
  height: 22px;
  padding: 0;
}

.store-detail-stepper-amount {
  min-width: 90px;
  text-align: center;
}

.store-detail-stepper-quantity {
  color: #cfcfcf;
  font-size: 10px;
}

.store-detail-bundle-row:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

.store-detail-bundle-row.selected {
  background-color: rgba(255, 255, 255, 0.2);
}

.store-detail-description {
  font-size: 11px;
  color: #cfcfcf;
  line-height: 1.4;
  margin-bottom: 10px;
}

.store-detail-buy-button {
  margin-top: auto;
}

/* ---- Footer ---- */

.store-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-top: 1px solid black;
  background-image: url("../png/bg2.png");
}

.store-balance {
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: bold;
}

.store-coin-icon {
  display: inline-block;
  width: 14px;
  height: 14px;
  background-image: url("../png/storeicon/coin.png");
  background-size: contain;
  background-repeat: no-repeat;
}

.store-footer-buttons {
  display: flex;
  gap: 6px;
}

/* The store's own footer buttons reuse the same two-state gray graphic every other modal
   footer button uses (see modal.css) -- only the layout (row instead of right-aligned block)
   differs here. */
.store-footer .store-footer-buttons button {
  background: url("../png/button_gray.png") no-repeat left center / 200% 100%;
  border: 0;
  box-shadow: none;
  outline: none;
  filter: none;
  height: 24px;
  font-size: 11px;
  color: #ddd;
  padding: 0 10px;
}

.store-footer .store-footer-buttons button:active {
  background: url("../png/button_gray.png") no-repeat right center / 200% 100%;
}
