/*Button*/
.btn {
  display: inline-block;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  font-weight: 600;
}

.btn-primary {
  background: var(--color-primary);
  color: white;
}

.btn-secondary {
  background: var(--color-secondary);
  color: white;
}

.btn-success {
  background: #16a34a;
  color: white;
}

/*Card*/
.card {
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  background: white;
}

.filter-panel {
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  background: white;
}

/*Filter group*/
.filter-group {
  margin-bottom: var(--space-lg);
}

.filter-label {
  display: block;
  margin-bottom: var(--space-sm);
  font-weight: 600;
}

.filter-actions {
  display: flex;
  gap: var(--space-sm);
}

/*Input*/
.input {
  padding: var(--space-sm) var(--space-md);
  border: 1px solid #ddd;
  border-radius: var(--radius-md);
  font-size: var(--font-base);
  width: 100%;
}

/*Section*/
.section {
  padding: var(--space-lg) 0;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

/*Search*/
.search {
  display: flex;
  gap: var(--space-sm);
  max-width: 500px;
  margin: 0 auto;
}

.search .input {
  flex: 1;
}

/*Navbar*/
.navbar {
  padding: var(--space-md) 0;
  border-bottom: 1px solid #eee;
}

.navbar-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-md);
}

.nav-brand {
  margin: 0;
}

.nav-center-links {
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
}

.nav-auth-links {
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-inline-form {
  margin: 0;
}

.nav-user-email {
  color: var(--color-muted);
  font-size: 0.92rem;
  word-break: break-all;
}

.auth-shell {
  max-width: 560px;
}

.auth-card {
  border: 1px solid #d8dee8;
  box-shadow: none;
}

.auth-form {
  display: block;
}

.btn-block {
  width: 100%;
  text-align: center;
}

.auth-link {
  color: var(--color-primary);
}

.auth-divider {
  border: 0;
  border-top: 1px solid #d8dee8;
}

.oauth-buttons {
  display: grid;
  gap: var(--space-sm);
}

.oauth-btn {
  width: 100%;
  text-align: center;
  background: white;
  border: 1px solid #d8dee8;
  color: var(--color-text);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.oauth-icon {
  position: absolute;
  left: var(--space-md);
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.oauth-icon svg {
  width: 22px;
  height: 22px;
}

/*Footer*/
.footer {
  padding: var(--space-lg) 0;
  background: var(--color-secondary);
  color: white;
}

.listings-grid {
  column-width: 300px;
  column-gap: var(--space-sm);
}

.listing-card {
  width: 100%;
  min-height: 320px;
  max-height: 520px;
  height: auto;
  display: inline-flex;
  flex-direction: column;
  padding: var(--space-sm);
  margin: 0 0 var(--space-sm);
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
}

.listing-card-media {
  height: 220px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #f2f3f5;
  border-radius: var(--radius-md);
}

.listing-card-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  border-radius: var(--radius-md);
  display: block;
}

.listing-card-image-placeholder {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-md);
  background: #f2f3f5;
}

.listing-card-details {
  flex: 1;
  overflow: auto;
  margin-top: 4px;
  display: flex;
  flex-direction: column;
}

.listing-card-description {
  overflow: visible;
}

.listing-card h3 {
  font-size: var(--font-base);
}

.listing-card p {
  font-size: 0.92rem;
  line-height: 1.35;
  margin-top: 4px;
}

.listing-card-footer {
  margin-top: auto;
  padding-top: var(--space-sm);
}

@media (max-width: 1024px) {
  .listings-grid {
    column-width: 250px;
  }
}

@media (max-width: 900px) {
  .card,
  .filter-panel {
    padding: var(--space-md);
  }

  .search {
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .navbar {
    padding: var(--space-sm) 0;
  }

  .navbar-inner {
    grid-template-columns: 1fr;
    gap: var(--space-sm);
  }

  .nav-center-links {
    justify-content: flex-start;
    gap: var(--space-md);
    flex-wrap: wrap;
  }

  .nav-auth-links {
    width: 100%;
    gap: var(--space-sm);
    justify-content: flex-start;
  }

  .search {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-actions {
    flex-wrap: wrap;
  }

  .listings-grid {
    column-width: 100%;
    column-gap: 0;
  }

  .listing-card {
    min-height: auto;
    max-height: none;
  }

  .listing-card-details {
    overflow: visible;
  }

  .listing-card-media {
    height: 210px;
  }

  .oauth-buttons {
    gap: var(--space-sm);
  }
}

@media (max-width: 480px) {
  .listing-card-media {
    height: 190px;
  }
}
