:root {
  --primary: #e6b800;
  --secondary: #1a1a2e;
  --accent: #ff4343;
  --text: #f0f0f0;
  --dark: #0f0f1a;
  --light: #f8f8f8;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Arial, sans-serif;
}

body {
  background-color: var(--dark);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

header {
  background: linear-gradient(135deg, var(--secondary), var(--dark));
  padding: 1rem 2rem;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
}

.guide {
  width: 100%;
  text-align: center;
  font-size: 2rem;
  padding: 1rem;
}

.logo {
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--primary);
  text-decoration: none;
  display: flex;
  align-items: center;
}

.logo span {
  color: var(--text);
}

.logo::before {
  margin-right: 0.5rem;
}

nav ul {
  display: flex;
  list-style: none;
}

nav li {
  margin-left: 1.5rem;
}

nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
  position: relative;
}

nav a:hover {
  color: var(--primary);
}

nav a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -5px;
  left: 0;
  background-color: var(--primary);
  transition: width 0.3s;
}

nav a:hover::after {
  width: 100%;
}

main {
  max-width: 1400px;
  margin: 1rem auto;
  padding: 0 1rem;
  display: flex;
  gap: 2rem;
}

mainSection {
  max-width: 1400px;
  gap: 2rem;
  width: calc(100% - 100px);
}

.search-section {
  margin-bottom: 2rem;
  display: flex;
  gap: 1rem;
  align-items: center;
}

.search-bar {
  flex: 1;
  position: relative;
}

.search-bar input {
  width: 100%;
  padding: 0.8rem 1rem 0.8rem 2.5rem;
  border: none;
  border-radius: 5px;
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: background-color 0.3s;
}

.search-bar::before {
  content: "🔍";
  position: absolute;
  left: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text);
  opacity: 0.7;
}

.search-bar input:focus {
  background-color: rgba(255, 255, 255, 0.2);
}

select {
  padding: 0.8rem;
  border: none;
  border-radius: 5px;
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  outline: none;
  transition: background-color 0.3s;
}

select:hover,
select:focus {
  background-color: rgba(255, 255, 255, 0.2);
}

select,
select option {
  background-color: var(--secondary);
  color: var(--text);
}

/* For better cross-browser compatibility, add these styles */
select::-ms-expand {
  background-color: var(--secondary);
}

select option:hover,
select option:focus,
select option:active,
select option:checked {
  background-color: var(--primary);
  color: var(--dark);
}

/* For webkit browsers (Chrome, Safari) */
select {
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg fill='white' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

.shop-content {
  flex: 1;
}

.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.item-card {
  background: linear-gradient(145deg, var(--secondary), #252547);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.3s, box-shadow 0.3s;
  position: relative;
}

.item-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.4);
}

.item-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  cursor: pointer;
}

.item-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: var(--accent);
  color: white;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  font-size: 0.8rem;
  font-weight: bold;
}

.item-content {
  padding: 1.2rem;
}

.item-title {
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
  color: var(--primary);
  cursor: pointer;
}

.item-expiry {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 0.8rem;
}

.item-description {
  font-size: 0.9rem;
  margin-bottom: 1rem;
  color: var(--text);
  line-height: 1.5;
  cursor: pointer;
}

.item-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1rem;
}

.token-counter {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.counter-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background-color: var(--primary);
  color: var(--dark);
  font-size: 1.2rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.1s, background-color 0.3s;
}

.counter-btn:hover {
  background-color: #ffd700;
  transform: scale(1.1);
}

.counter-btn:active {
  transform: scale(0.9);
}

.token-count {
  font-size: 1.1rem;
  font-weight: bold;
  min-width: 30px;
  text-align: center;
}

.token-price {
  background-color: rgba(230, 184, 0, 0.2);
  padding: 0.5rem 0.8rem;
  border-radius: 5px;
  font-weight: bold;
  color: var(--primary);
}

.basket-container {
  width: 300px;
  position: sticky;
  top: 5rem;
  align-self: flex-start;
}

.basket {
  background: linear-gradient(145deg, var(--secondary), #252547);
  border-radius: 10px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.basket-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 0.8rem;
}

.basket-title h2 {
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.basket-title h2::before {
  content: "🛒";
}

.basket-total {
  display: flex;
  align-items: center;
  font-weight: bold;
  background-color: rgba(230, 184, 0, 0.2);
  padding: 0.3rem 0.6rem;
  border-radius: 5px;
  color: var(--primary);
}

.basket-items {
  max-height: 400px;
  overflow-y: auto;
  margin-bottom: 1rem;
}

.basket-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.basket-item-img {
  width: 50px;
  height: 50px;
  border-radius: 5px;
  object-fit: cover;
}

.basket-item-info {
  flex: 1;
}

.basket-item-title {
  font-size: 0.9rem;
  font-weight: bold;
  margin-bottom: 0.2rem;
}

.basket-item-tokens {
  display: flex;
  align-items: center;
  font-size: 0.8rem;
  color: var(--primary);
}

.basket-item-remove {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 1.2rem;
  transition: transform 0.2s;
}

.basket-item-remove:hover {
  transform: scale(1.2);
}

.checkout-btn {
  width: 100%;
  padding: 0.8rem;
  border: none;
  border-radius: 5px;
  background-color: var(--primary);
  color: var(--dark);
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s;
  margin-top: 1rem;
}

.checkout-btn:hover {
  background-color: #ffd700;
}

.empty-basket {
  text-align: center;
  padding: 2rem 0;
  color: rgba(255, 255, 255, 0.5);
}

footer {
  background: var(--secondary);
  padding: 2rem;
  margin-top: 3rem;
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2rem;
}

.footer-section {
  flex: 1;
  min-width: 250px;
}

.footer-title {
  color: var(--primary);
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.3s;
}

.footer-links a:hover {
  color: var(--primary);
}

.copyright {
  text-align: center;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.5);
}

/* Modal styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  overflow-y: auto;
}

.modal-content {
  background: linear-gradient(145deg, var(--secondary), #252547);
  margin: 5% auto;
  width: 90%;
  max-width: 600px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-title {
  color: var(--primary);
  font-size: 1.5rem;
}

.close-modal {
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.3s;
}

.close-modal:hover {
  color: var(--accent);
}

.modal-body {
  padding: 1.5rem;
}

.checkout-form label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.checkout-form input {
  width: 100%;
  padding: 0.8rem;
  margin-bottom: 1.5rem;
  border: none;
  border-radius: 5px;
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.checkout-options {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.checkout-option {
  flex: 1;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  transition: background-color 0.3s;
}

.checkout-option:hover,
.checkout-option.active {
  background-color: rgba(230, 184, 0, 0.1);
  border-color: var(--primary);
}

.checkout-option-title {
  font-weight: bold;
  margin-bottom: 0.5rem;
  color: var(--primary);
}

.checkout-option-desc {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
}

.checkout-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 1.5rem;
}

.essay-section {
  display: none;
  margin-top: 1.5rem;
}

.essay-section textarea {
  width: 100%;
  height: 200px;
  padding: 0.8rem;
  border: none;
  border-radius: 5px;
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text);
  resize: vertical;
  margin-bottom: 1rem;
}

.word-counter {
  font-size: 0.9rem;
  margin-bottom: 1rem;
  color: rgba(255, 255, 255, 0.7);
}

.legal-content {
  max-width: 900px;
  margin: 3rem auto;
  padding: 2rem;
  background: linear-gradient(145deg, var(--secondary), #252547);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.legal-title {
  color: var(--primary);
  margin-bottom: 2rem;
  text-align: center;
}

.legal-section {
  margin-bottom: 2rem;
}

.legal-section h2 {
  color: var(--primary);
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 0.5rem;
}

.legal-section p {
  margin-bottom: 1rem;
  line-height: 1.6;
}

/* Loader */
.loader {
  display: none;
  text-align: center;
  padding: 1rem;
}

.loader-spinner {
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top: 4px solid var(--primary);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Responsive design */
@media (max-width: 992px) {
  main {
    flex-direction: column-reverse;
  }

  .basket-container {
    width: 100%;
    position: static;
  }

  .items-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
}

@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    gap: 1rem;
  }

  nav ul {
    justify-content: center;
    flex-wrap: wrap;
  }

  nav li {
    margin: 0.5rem;
  }

  .search-section {
    flex-direction: column;
  }

  select {
    width: 100%;
  }
}

@media (max-width: 576px) {
  .items-grid {
    grid-template-columns: repeat(auto-fill, minmax(100%, 1fr));
  }
}